MODFLOW 6  version 6.8.0.dev0
USGS Modular Hydrologic Model
swfcxsmodule Module Reference

Data Types

type  cxsoptionsfoundtype
 flags indicating which CXS options were found in the input More...
 
type  cxsdimensionsfoundtype
 flags indicating which CXS dimensions were found in the input More...
 
type  cxspackagedatafoundtype
 flags indicating which CXS packagedata were found in the input More...
 
type  cxscrosssectiondatafoundtype
 flags indicating which CXS crosssectiondata were found in the input More...
 
type  swfcxstype
 

Functions/Subroutines

subroutine, public cxs_cr (pobj, name_model, input_mempath, inunit, iout, dis)
 create package More...
 
subroutine allocate_scalars (this)
 @ brief Allocate scalars More...
 
subroutine source_options (this)
 Copy options from IDM into package. More...
 
subroutine log_options (this, found)
 Write user options to list file. More...
 
subroutine source_dimensions (this)
 Copy options from IDM into package. More...
 
subroutine log_dimensions (this, found)
 Write user options to list file. More...
 
subroutine allocate_arrays (this)
 allocate memory for arrays More...
 
subroutine source_packagedata (this)
 Copy options from IDM into package. More...
 
subroutine calc_iacross (nxspoints, iacross)
 Calculate index pointer array iacross from nxspoints. More...
 
subroutine check_packagedata (this)
 Check packagedata. More...
 
subroutine log_packagedata (this, found)
 Write user packagedata to list file. More...
 
subroutine source_crosssectiondata (this)
 Copy options from IDM into package. More...
 
subroutine check_crosssectiondata (this, ifno)
 Check crosssectiondata IFNO against PACKAGEDATA section groupings. More...
 
subroutine log_crosssectiondata (this, found)
 Write user packagedata to list file. More...
 
subroutine write_cxs_table (this, idcxs, width, slope, rough, unitconv)
 
subroutine cxs_da (this)
 deallocate memory More...
 
subroutine get_cross_section_info (this, idcxs, i0, i1, npts, icalcmeth)
 
real(dp) function get_area (this, idcxs, width, depth)
 
real(dp) function cxs_wetted_perimeter (this, idcxs, width, depth)
 
real(dp) function get_roughness (this, idcxs, width, depth, rough, slope)
 
real(dp) function cxs_conveyance (this, idcxs, width, depth, rough)
 Calculate and return conveyance. More...
 
real(dp) function get_hydraulic_radius (this, idcxs, width, depth, area)
 
real(dp) function get_wetted_top_width (this, idcxs, width, depth)
 
real(dp) function get_maximum_top_width (this, idcxs, width)
 

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine swfcxsmodule::allocate_arrays ( class(swfcxstype this)
private

Definition at line 277 of file swf-cxs.f90.

278  ! -- dummy
279  class(SwfCxsType) :: this
280  ! -- locals
281  integer(I4B) :: n
282  !
283  ! -- arrays allocation
284  call mem_allocate(this%idcxs, this%nsections, &
285  'IDCXS', this%memoryPath)
286  call mem_allocate(this%nxspoints, this%nsections, &
287  'NXSPOINTS', this%memoryPath)
288  call mem_allocate(this%xfraction, this%npoints, &
289  'XFRACTION', this%memoryPath)
290  call mem_allocate(this%height, this%npoints, &
291  'HEIGHT', this%memoryPath)
292  call mem_allocate(this%manfraction, this%npoints, &
293  'MANFRACTION', this%memoryPath)
294  call mem_allocate(this%iacross, this%nsections + 1, &
295  'IACROSS', this%memoryPath)
296 
297  ! -- initialization
298  do n = 1, this%nsections
299  this%idcxs(n) = 0
300  this%nxspoints(n) = 0
301  end do
302  do n = 1, this%npoints
303  this%xfraction(n) = dzero
304  this%height(n) = dzero
305  this%manfraction(n) = dzero
306  end do
307  do n = 1, this%nsections + 1
308  this%iacross(n) = 0
309  end do

◆ allocate_scalars()

subroutine swfcxsmodule::allocate_scalars ( class(swfcxstype this)

Allocate and initialize scalars for the package. The base model allocate scalars method is also called.

Definition at line 156 of file swf-cxs.f90.

157  ! -- modules
158  ! -- dummy
159  class(SwfCxsType) :: this
160  !
161  ! -- allocate scalars in NumericalPackageType
162  call this%NumericalPackageType%allocate_scalars()
163  !
164  ! -- Allocate scalars
165  call mem_allocate(this%nsections, 'NSECTIONS', this%memoryPath)
166  call mem_allocate(this%npoints, 'NPOINTS', this%memoryPath)
167 
168  ! -- initialize
169  this%nsections = 0
170  this%npoints = 0

◆ calc_iacross()

subroutine swfcxsmodule::calc_iacross ( integer(i4b), dimension(:), intent(in)  nxspoints,
integer(i4b), dimension(:), intent(inout)  iacross 
)

Definition at line 360 of file swf-cxs.f90.

361  integer(I4B), dimension(:), intent(in) :: nxspoints
362  integer(I4B), dimension(:), intent(inout) :: iacross
363  integer(I4B) :: n
364  iacross(1) = 1
365  do n = 1, size(nxspoints)
366  iacross(n + 1) = iacross(n) + nxspoints(n)
367  end do
Here is the caller graph for this function:

◆ check_crosssectiondata()

subroutine swfcxsmodule::check_crosssectiondata ( class(swfcxstype this,
integer(i4b), dimension(:), intent(in)  ifno 
)
Parameters
thisthis instance
[in]ifnocross section number for each point

Definition at line 496 of file swf-cxs.f90.

497  ! -- dummy
498  class(SwfCxsType) :: this !< this instance
499  integer(I4B), dimension(:), intent(in) :: ifno !< cross section number for each point
500  ! -- local
501  integer(I4B) :: n
502  integer(I4B) :: i
503  integer(I4B) :: i0
504  integer(I4B) :: i1
505 
506  do n = 1, this%nsections
507  i0 = this%iacross(n)
508  i1 = this%iacross(n + 1) - 1
509  do i = i0, i1
510  if (ifno(i) /= this%idcxs(n)) then
511  write (errmsg, '(a, i0, a, i0, a, i0, a)') &
512  'IFNO value in CROSSSECTIONDATA does not match the cross &
513  &section implied by PACKAGEDATA. Found IFNO = ', ifno(i), &
514  ' at point ', i, ' but expected ', this%idcxs(n), '.'
515  call store_error(errmsg)
516  end if
517  end do
518  end do
519 
520  if (count_errors() > 0) then
521  call store_error_filename(this%input_fname)
522  end if
Here is the call graph for this function:

◆ check_packagedata()

subroutine swfcxsmodule::check_packagedata ( class(swfcxstype this)
private
Parameters
thisthis instance

Definition at line 372 of file swf-cxs.f90.

373  ! dummy arguments
374  class(SwfCxsType) :: this !< this instance
375  ! local variables
376  integer(I4B) :: i
377 
378  ! Check that all cross section IDs are in range
379  do i = 1, size(this%idcxs)
380  if (this%idcxs(i) <= 0 .or. this%idcxs(i) > this%nsections) then
381  write (errmsg, '(a, i0, a)') &
382  'IFNO values must be greater than 0 and less than NSECTIONS. &
383  &Found ', this%idcxs(i), '.'
384  call store_error(errmsg)
385  end if
386  end do
387 
388  ! Check that nxspoints are greater than one
389  do i = 1, size(this%nxspoints)
390  if (this%nxspoints(i) <= 1) then
391  write (errmsg, '(a, i0, a, i0, a)') &
392  'NXSPOINTS values must be greater than 1 for each cross section. &
393  &Found ', this%nxspoints(i), ' for cross section ', this%idcxs(i), '.'
394  call store_error(errmsg)
395  end if
396  end do
397 
398  ! write summary of package error messages
399  if (count_errors() > 0) then
400  call store_error_filename(this%input_fname)
401  end if
402 
Here is the call graph for this function:

◆ cxs_conveyance()

real(dp) function swfcxsmodule::cxs_conveyance ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  depth,
real(dp), intent(in)  rough 
)

Conveyance = area * hydraulic_radius ** (2/3) / mannings_roughness If idcxs = 0 (no cross section specified) then reach is

Parameters
[in]idcxscross section id
[in]widthwidth in reach
[in]depthstage in reach
[in]roughmannings value provided for the reach
Returns
calculated composite roughness

Definition at line 772 of file swf-cxs.f90.

774  ! -- modules
776  ! -- dummy
777  class(SwfCxsType) :: this
778  integer(I4B), intent(in) :: idcxs !< cross section id
779  real(DP), intent(in) :: width !< width in reach
780  real(DP), intent(in) :: depth !< stage in reach
781  real(DP), intent(in) :: rough !< mannings value provided for the reach
782  ! -- return
783  real(DP) :: conveyance !< calculated composite roughness
784  ! -- local
785  real(DP) :: a
786  real(DP) :: rh
787  integer(I4B) :: i0
788  integer(I4B) :: i1
789  integer(I4B) :: npts
790  integer(I4B) :: icalcmeth
791  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
792  if (npts == 0) then
793  a = depth * width
794  rh = depth
795  conveyance = a * rh**dtwothirds / rough
796  else
797  conveyance = get_conveyance(npts, &
798  this%xfraction(i0:i1), &
799  this%height(i0:i1), &
800  this%manfraction(i0:i1), &
801  width, rough, depth)
802  end if
This module contains stateless sfr subroutines and functions.
Definition: SwfCxsUtils.f90:11
real(dp) function, public get_conveyance(npts, xfraction, heights, cxs_rf, width, rough, d)
Calculate conveyance.
Here is the call graph for this function:

◆ cxs_cr()

subroutine, public swfcxsmodule::cxs_cr ( type(swfcxstype), pointer  pobj,
character(len=*), intent(in)  name_model,
character(len=*), intent(in)  input_mempath,
integer(i4b), intent(in)  inunit,
integer(i4b), intent(in)  iout,
class(disbasetype), intent(inout), pointer  dis 
)
Parameters
[in,out]disthe pointer to the discretization

Definition at line 90 of file swf-cxs.f90.

91  ! -- modules
93  ! -- dummy
94  type(SwfCxsType), pointer :: pobj
95  character(len=*), intent(in) :: name_model
96  character(len=*), intent(in) :: input_mempath
97  integer(I4B), intent(in) :: inunit
98  integer(I4B), intent(in) :: iout
99  class(DisBaseType), pointer, intent(inout) :: dis !< the pointer to the discretization
100  ! -- locals
101  logical(LGP) :: found_fname
102  ! -- formats
103  character(len=*), parameter :: fmtheader = &
104  "(1x, /1x, 'CXS -- CROSS SECTION PACKAGE, VERSION 1, 5/24/2023', &
105  &' INPUT READ FROM MEMPATH: ', A, /)"
106  !
107  ! -- Create the object
108  allocate (pobj)
109 
110  ! -- create name and memory path
111  call pobj%set_names(1, name_model, 'CXS', 'CXS')
112 
113  ! -- Allocate scalars
114  call pobj%allocate_scalars()
115 
116  ! -- Set variables
117  pobj%input_mempath = input_mempath
118  pobj%inunit = inunit
119  pobj%iout = iout
120  pobj%dis => dis
121 
122  ! -- set name of input file
123  call mem_set_value(pobj%input_fname, 'INPUT_FNAME', pobj%input_mempath, &
124  found_fname)
125 
126  ! -- check if package is enabled
127  if (inunit > 0) then
128 
129  ! -- Print a message identifying the package.
130  write (iout, fmtheader) input_mempath
131 
132  ! -- source options
133  call pobj%source_options()
134 
135  ! -- source dimensions
136  call pobj%source_dimensions()
137 
138  ! -- allocate arrays
139  call pobj%allocate_arrays()
140 
141  ! -- source dimensions
142  call pobj%source_packagedata()
143 
144  ! -- source dimensions
145  call pobj%source_crosssectiondata()
146 
147  end if
Here is the caller graph for this function:

◆ cxs_da()

subroutine swfcxsmodule::cxs_da ( class(swfcxstype this)

Definition at line 618 of file swf-cxs.f90.

619  ! -- modules
623  ! -- dummy
624  class(SwfCxsType) :: this
625  !
626  ! -- Deallocate input memory
627  call memorystore_remove(this%name_model, 'CXS', idm_context)
628  !
629  ! -- Scalars
630  call mem_deallocate(this%nsections)
631  call mem_deallocate(this%npoints)
632  !
633  ! -- Deallocate arrays if the package was created
634  ! from an input file
635  if (this%inunit > 0) then
636  call mem_deallocate(this%idcxs)
637  call mem_deallocate(this%nxspoints)
638  call mem_deallocate(this%xfraction)
639  call mem_deallocate(this%height)
640  call mem_deallocate(this%manfraction)
641  call mem_deallocate(this%iacross)
642  end if
643  !
644  ! -- deallocate parent
645  call this%NumericalPackageType%da()
subroutine, public memorystore_remove(component, subcomponent, context)
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=linelength) idm_context
Here is the call graph for this function:

◆ cxs_wetted_perimeter()

real(dp) function swfcxsmodule::cxs_wetted_perimeter ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  depth 
)
Parameters
[in]idcxscross section id
[in]widthwidth in reach
[in]depthstage in reach

Definition at line 709 of file swf-cxs.f90.

710  ! -- modules
712  ! -- dummy
713  class(SwfCxsType) :: this
714  integer(I4B), intent(in) :: idcxs !< cross section id
715  real(DP), intent(in) :: width !< width in reach
716  real(DP), intent(in) :: depth !< stage in reach
717  ! -- local
718  real(DP) :: wp
719  integer(I4B) :: i0
720  integer(I4B) :: i1
721  integer(I4B) :: npts
722  integer(I4B) :: icalcmeth
723  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
724  if (npts == 0) then
725  wp = width
726  else
727  wp = get_wetted_perimeter(npts, &
728  this%xfraction(i0:i1), &
729  this%height(i0:i1), &
730  width, depth)
731  end if
real(dp) function, public get_wetted_perimeter(npts, xfraction, heights, width, d)
Calculate the wetted perimeter for a reach.
Here is the call graph for this function:

◆ get_area()

real(dp) function swfcxsmodule::get_area ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  depth 
)
private
Parameters
[in]idcxscross section id
[in]widthwidth in reach
[in]depthstage in reach

Definition at line 684 of file swf-cxs.f90.

685  ! -- modules
687  ! -- dummy
688  class(SwfCxsType) :: this
689  integer(I4B), intent(in) :: idcxs !< cross section id
690  real(DP), intent(in) :: width !< width in reach
691  real(DP), intent(in) :: depth !< stage in reach
692  ! -- local
693  real(DP) :: area
694  integer(I4B) :: i0
695  integer(I4B) :: i1
696  integer(I4B) :: npts
697  integer(I4B) :: icalcmeth
698  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
699  if (npts == 0) then
700  area = width * depth
701  else
702  area = get_cross_section_area(npts, &
703  this%xfraction(i0:i1), &
704  this%height(i0:i1), &
705  width, depth)
706  end if
real(dp) function, public get_cross_section_area(npts, xfraction, heights, width, d)
Calculate the cross-sectional area for a reach.
Here is the call graph for this function:

◆ get_cross_section_info()

subroutine swfcxsmodule::get_cross_section_info ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
integer(i4b), intent(inout)  i0,
integer(i4b), intent(inout)  i1,
integer(i4b), intent(inout)  npts,
integer(i4b), intent(inout)  icalcmeth 
)
Parameters
[in]idcxscross section id number
[in,out]i0starting cross section point number
[in,out]i1ending cross section point number
[in,out]nptsnumber of points in cross section
[in,out]icalcmethcalculation method for mannings roughness

Definition at line 648 of file swf-cxs.f90.

649  ! -- dummy
650  class(SwfCxsType) :: this
651  integer(I4B), intent(in) :: idcxs !< cross section id number
652  integer(I4B), intent(inout) :: i0 !< starting cross section point number
653  integer(I4B), intent(inout) :: i1 !< ending cross section point number
654  integer(I4B), intent(inout) :: npts !< number of points in cross section
655  integer(I4B), intent(inout) :: icalcmeth !< calculation method for mannings roughness
656  ! -- local
657  !
658  ! -- Return npts = 0 if this package does not have input file
659  if (this%inunit == 0 .or. idcxs == 0) then
660  npts = 0
661  i0 = 1
662  i1 = 1
663  icalcmeth = 0
664  else
665  !
666  ! -- If the cross section id is 0, then it is a hydraulically wide channel,
667  ! and only width and rough are needed (not xfraction, height, and manfraction)
668  if (idcxs > 0) then
669  i0 = this%iacross(idcxs)
670  i1 = this%iacross(idcxs + 1) - 1
671  else
672  i0 = 1
673  i1 = 1
674  end if
675  ! set icalcmeth based on number of cross section points
676  npts = i1 - i0 + 1
677  icalcmeth = 0 ! linear composite mannings resistance
678  if (npts > 4) then
679  icalcmeth = 0 ! sum q by cross section segments
680  end if
681  end if

◆ get_hydraulic_radius()

real(dp) function swfcxsmodule::get_hydraulic_radius ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  depth,
real(dp), intent(in), optional  area 
)
Parameters
[in]idcxscross section id
[in]widthwidth in reach
[in]depthstage in reach
[in]areaarea of the reach
Returns
calculated hydraulic radius

Definition at line 805 of file swf-cxs.f90.

806  ! -- modules
808  ! -- dummy
809  class(SwfCxsType) :: this
810  integer(I4B), intent(in) :: idcxs !< cross section id
811  real(DP), intent(in) :: width !< width in reach
812  real(DP), intent(in) :: depth !< stage in reach
813  real(DP), intent(in), optional :: area !< area of the reach
814  ! -- local
815  real(DP) :: r !< calculated hydraulic radius
816  real(DP) :: a
817  integer(I4B) :: i0
818  integer(I4B) :: i1
819  integer(I4B) :: npts
820  integer(I4B) :: icalcmeth
821  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
822  if (present(area)) then
823  a = area
824  else
825  a = this%get_area(idcxs, width, depth)
826  end if
827  if (npts == 0) then
828  r = a / width
829  else
830  r = get_hydraulic_radius_xf(npts, &
831  this%xfraction(i0:i1), &
832  this%height(i0:i1), &
833  width, depth)
834  end if
real(dp) function, public get_hydraulic_radius_xf(npts, xfraction, heights, width, d)
Calculate the hydraulic radius for a reach.
Here is the call graph for this function:

◆ get_maximum_top_width()

real(dp) function swfcxsmodule::get_maximum_top_width ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width 
)
Parameters
[in]idcxscross section id
[in]widthwidth in reach
Returns
calculated hydraulic radius

Definition at line 860 of file swf-cxs.f90.

861  ! modules
863  ! dummy
864  class(SwfCxsType) :: this
865  integer(I4B), intent(in) :: idcxs !< cross section id
866  real(DP), intent(in) :: width !< width in reach
867  ! local
868  real(DP) :: r !< calculated hydraulic radius
869  integer(I4B) :: i0
870  integer(I4B) :: i1
871  integer(I4B) :: npts
872  integer(I4B) :: icalcmeth
873  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
874  if (npts == 0) then
875  r = width
876  else
877  r = get_saturated_topwidth(npts, this%xfraction(i0:i1), width)
878  end if
real(dp) function, public get_saturated_topwidth(npts, xfraction, width)
Calculate the saturated top width for a reach.
Here is the call graph for this function:

◆ get_roughness()

real(dp) function swfcxsmodule::get_roughness ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  depth,
real(dp), intent(in)  rough,
real(dp), intent(in)  slope 
)
Parameters
[in]idcxscross section id
[in]widthwidth in reach
[in]depthstage in reach
[in]roughmannings value provided for the reach
[in]slopeslope value provided for the reach
Returns
calculated composite roughness

Definition at line 734 of file swf-cxs.f90.

736  ! -- modules
738  ! -- dummy
739  class(SwfCxsType) :: this
740  integer(I4B), intent(in) :: idcxs !< cross section id
741  real(DP), intent(in) :: width !< width in reach
742  real(DP), intent(in) :: depth !< stage in reach
743  real(DP), intent(in) :: rough !< mannings value provided for the reach
744  real(DP), intent(in) :: slope !< slope value provided for the reach
745  ! -- local
746  real(DP) :: roughc !< calculated composite roughness
747  integer(I4B) :: i0
748  integer(I4B) :: i1
749  integer(I4B) :: npts
750  integer(I4B) :: icalcmeth
751  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
752  if (npts == 0) then
753  roughc = rough
754  else
755  roughc = calc_composite_roughness(npts, &
756  depth, &
757  width, &
758  rough, &
759  slope, &
760  this%xfraction(i0:i1), &
761  this%height(i0:i1), &
762  this%manfraction(i0:i1), &
763  icalcmeth)
764  end if
real(dp) function, public calc_composite_roughness(npts, depth, width, rough, slope, cxs_xf, cxs_h, cxs_rf, linmeth)
Here is the call graph for this function:

◆ get_wetted_top_width()

real(dp) function swfcxsmodule::get_wetted_top_width ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  depth 
)
Parameters
[in]idcxscross section id
[in]widthwidth in reach
[in]depthstage in reach
Returns
calculated hydraulic radius

Definition at line 837 of file swf-cxs.f90.

838  ! modules
840  ! dummy
841  class(SwfCxsType) :: this
842  integer(I4B), intent(in) :: idcxs !< cross section id
843  real(DP), intent(in) :: width !< width in reach
844  real(DP), intent(in) :: depth !< stage in reach
845  ! local
846  real(DP) :: r !< calculated hydraulic radius
847  integer(I4B) :: i0
848  integer(I4B) :: i1
849  integer(I4B) :: npts
850  integer(I4B) :: icalcmeth
851  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
852  if (npts == 0) then
853  r = width
854  else
855  r = get_wetted_topwidth(npts, this%xfraction(i0:i1), &
856  this%height(i0:i1), width, depth)
857  end if
real(dp) function, public get_wetted_topwidth(npts, xfraction, heights, width, d)
Calculate the wetted top width for a reach.
Here is the call graph for this function:

◆ log_crosssectiondata()

subroutine swfcxsmodule::log_crosssectiondata ( class(swfcxstype this,
type(cxscrosssectiondatafoundtype), intent(in)  found 
)
private

Definition at line 527 of file swf-cxs.f90.

528  class(SwfCxsType) :: this
529  type(CxsCrosssectiondataFoundType), intent(in) :: found
530 
531  write (this%iout, '(1x,a)') 'Setting CXS Cross Section Data'
532 
533  if (found%ifno) then
534  write (this%iout, '(4x,a)') 'IFNO set from input file.'
535  end if
536 
537  if (found%xfraction) then
538  write (this%iout, '(4x,a)') 'XFRACTION set from input file.'
539  end if
540 
541  if (found%height) then
542  write (this%iout, '(4x,a)') 'HEIGHT set from input file.'
543  end if
544 
545  if (found%manfraction) then
546  write (this%iout, '(4x,a)') 'MANFRACTION set from input file.'
547  end if
548 
549  write (this%iout, '(1x,a,/)') 'End Setting CXS Cross Section Data'
550 

◆ log_dimensions()

subroutine swfcxsmodule::log_dimensions ( class(swfcxstype this,
type(cxsdimensionsfoundtype), intent(in)  found 
)

Definition at line 257 of file swf-cxs.f90.

258  class(SwfCxsType) :: this
259  type(CxsDimensionsFoundType), intent(in) :: found
260 
261  write (this%iout, '(1x,a)') 'Setting CXS Dimensions'
262 
263  if (found%nsections) then
264  write (this%iout, '(4x,a)') 'NSECTIONS set from input file.'
265  end if
266 
267  if (found%npoints) then
268  write (this%iout, '(4x,a)') 'NPOINTS set from input file.'
269  end if
270 
271  write (this%iout, '(1x,a,/)') 'End Setting CXS Dimensions'
272 

◆ log_options()

subroutine swfcxsmodule::log_options ( class(swfcxstype this,
type(cxsoptionsfoundtype), intent(in)  found 
)

Definition at line 201 of file swf-cxs.f90.

202  class(SwfCxsType) :: this
203  type(CxsOptionsFoundType), intent(in) :: found
204 
205  write (this%iout, '(1x,a)') 'Setting CXS Options'
206 
207  if (found%iprpak) then
208  write (this%iout, '(4x,a)') 'Package information will be printed.'
209  end if
210 
211  write (this%iout, '(1x,a,/)') 'End Setting CXS Options'
212 

◆ log_packagedata()

subroutine swfcxsmodule::log_packagedata ( class(swfcxstype this,
type(cxspackagedatafoundtype), intent(in)  found 
)
private

Definition at line 407 of file swf-cxs.f90.

408  class(SwfCxsType) :: this
409  type(CxsPackagedataFoundType), intent(in) :: found
410 
411  write (this%iout, '(1x,a)') 'Setting CXS Package Data'
412 
413  if (found%idcxs) then
414  write (this%iout, '(4x,a)') 'IFNO set from input file.'
415  end if
416 
417  if (found%nxspoints) then
418  write (this%iout, '(4x,a)') 'NXSPOINTS set from input file.'
419  end if
420 
421  write (this%iout, '(1x,a,/)') 'End Setting CXS Package Data'
422 

◆ source_crosssectiondata()

subroutine swfcxsmodule::source_crosssectiondata ( class(swfcxstype this)
private

Definition at line 427 of file swf-cxs.f90.

428  ! -- modules
429  use kindmodule, only: lgp
432  ! -- dummy
433  class(SwfCxsType) :: this
434  ! -- locals
435  character(len=LENMEMPATH) :: idmMemoryPath
436  type(CxsCrosssectiondataFoundType) :: found
437  integer(I4B), dimension(:), pointer, contiguous :: ifno => null()
438  !
439  ! -- set memory path
440  idmmemorypath = create_mem_path(this%name_model, 'CXS', idm_context)
441  !
442  ! -- update defaults with idm sourced values
443  allocate (ifno(this%npoints))
444  call mem_set_value(ifno, 'IFNO', idmmemorypath, &
445  found%ifno)
446  call mem_set_value(this%xfraction, 'XFRACTION', idmmemorypath, &
447  found%xfraction)
448  call mem_set_value(this%height, 'HEIGHT', idmmemorypath, &
449  found%height)
450  call mem_set_value(this%manfraction, 'MANFRACTION', idmmemorypath, &
451  found%manfraction)
452  !
453  ! -- ensure ifno was found
454  if (.not. found%ifno) then
455  write (errmsg, '(a)') &
456  'Error in CROSSSECTIONDATA block: IFNO not found.'
457  call store_error(errmsg)
458  end if
459  !
460  ! -- ensure xfraction was found
461  if (.not. found%xfraction) then
462  write (errmsg, '(a)') &
463  'Error in CROSSSECTIONDATA block: xfraction not found.'
464  call store_error(errmsg)
465  end if
466  !
467  ! -- ensure height was found
468  if (.not. found%height) then
469  write (errmsg, '(a)') &
470  'Error in CROSSSECTIONDATA block: HEIGHT not found.'
471  call store_error(errmsg)
472  end if
473  !
474  ! -- ensure manfraction was found
475  if (.not. found%manfraction) then
476  write (errmsg, '(a)') &
477  'Error in CROSSSECTIONDATA block: MANFRACTION not found.'
478  call store_error(errmsg)
479  end if
480  !
481  ! -- check that ifno is consistent with the section groupings
482  ! implied by PACKAGEDATA's NXSPOINTS
483  if (found%ifno) then
484  call this%check_crosssectiondata(ifno)
485  end if
486  deallocate (ifno)
487  !
488  ! -- log values to list file
489  if (this%iout > 0) then
490  call this%log_crosssectiondata(found)
491  end if
This module defines variable data types.
Definition: kind.f90:8
Here is the call graph for this function:

◆ source_dimensions()

subroutine swfcxsmodule::source_dimensions ( class(swfcxstype this)
private

Definition at line 217 of file swf-cxs.f90.

218  ! -- modules
219  use kindmodule, only: lgp
222  ! -- dummy
223  class(SwfCxsType) :: this
224  ! -- locals
225  character(len=LENMEMPATH) :: idmMemoryPath
226  type(CxsDimensionsFoundType) :: found
227  !
228  ! -- set memory path
229  idmmemorypath = create_mem_path(this%name_model, 'CXS', idm_context)
230  !
231  ! -- update defaults with idm sourced values
232  call mem_set_value(this%nsections, 'NSECTIONS', idmmemorypath, &
233  found%nsections)
234  call mem_set_value(this%npoints, 'NPOINTS', idmmemorypath, &
235  found%npoints)
236  !
237  ! -- ensure nsections was found
238  if (.not. found%nsections) then
239  write (errmsg, '(a)') 'Error in DIMENSIONS block: NSECTIONS not found.'
240  call store_error(errmsg)
241  end if
242  !
243  ! -- ensure npoints was found
244  if (.not. found%npoints) then
245  write (errmsg, '(a)') 'Error in DIMENSIONS block: NPOINTS not found.'
246  call store_error(errmsg)
247  end if
248  !
249  ! -- log values to list file
250  if (this%iout > 0) then
251  call this%log_dimensions(found)
252  end if
Here is the call graph for this function:

◆ source_options()

subroutine swfcxsmodule::source_options ( class(swfcxstype this)
private

Definition at line 175 of file swf-cxs.f90.

176  ! -- modules
177  use kindmodule, only: lgp
180  ! -- dummy
181  class(SwfCxsType) :: this
182  ! -- locals
183  character(len=LENMEMPATH) :: idmMemoryPath
184  type(CxsOptionsFoundType) :: found
185  !
186  ! -- set memory path
187  idmmemorypath = create_mem_path(this%name_model, 'CXS', idm_context)
188  !
189  ! -- update defaults with idm sourced values
190  call mem_set_value(this%iprpak, 'PRINT_INPUT', idmmemorypath, &
191  found%iprpak)
192  !
193  ! -- log values to list file
194  if (this%iout > 0) then
195  call this%log_options(found)
196  end if
Here is the call graph for this function:

◆ source_packagedata()

subroutine swfcxsmodule::source_packagedata ( class(swfcxstype this)
private

Definition at line 314 of file swf-cxs.f90.

315  ! modules
316  use kindmodule, only: lgp
319  ! dummy
320  class(SwfCxsType) :: this
321  ! locals
322  character(len=LENMEMPATH) :: idmMemoryPath
323  type(CxsPackagedataFoundType) :: found
324 
325  ! set memory path
326  idmmemorypath = create_mem_path(this%name_model, 'CXS', idm_context)
327 
328  ! update defaults with idm sourced values
329  call mem_set_value(this%idcxs, 'IFNO_PKGDATA', idmmemorypath, &
330  found%idcxs)
331  call mem_set_value(this%nxspoints, 'NXSPOINTS', idmmemorypath, &
332  found%nxspoints)
333 
334  ! ensure idcxs was found
335  if (.not. found%idcxs) then
336  write (errmsg, '(a)') 'Error in PACKAGEDATA block: IFNO not found.'
337  call store_error(errmsg)
338  end if
339 
340  ! ensure nxspoints was found
341  if (.not. found%nxspoints) then
342  write (errmsg, '(a)') 'Error in PACKAGEDATA block: NXSPOINTS not found.'
343  call store_error(errmsg)
344  end if
345 
346  ! log values to list file
347  if (this%iout > 0) then
348  call this%log_packagedata(found)
349  end if
350 
351  ! Check to make sure package data is valid
352  call this%check_packagedata()
353 
354  ! Calculate the iacross index array using nxspoints
355  call calc_iacross(this%nxspoints, this%iacross)
Here is the call graph for this function:

◆ write_cxs_table()

subroutine swfcxsmodule::write_cxs_table ( class(swfcxstype this,
integer(i4b), intent(in)  idcxs,
real(dp), intent(in)  width,
real(dp), intent(in)  slope,
real(dp), intent(in)  rough,
real(dp), intent(in)  unitconv 
)
private

Definition at line 553 of file swf-cxs.f90.

554  ! -- module
555  use sortmodule, only: qsort, unique_values
556  ! -- dummy
557  class(SwfCxsType) :: this
558  integer(I4B), intent(in) :: idcxs
559  real(DP), intent(in) :: width
560  real(DP), intent(in) :: slope
561  real(DP), intent(in) :: rough
562  real(DP), intent(in) :: unitconv
563  ! -- local
564  integer(I4B) :: ipt
565  real(DP) :: d
566  real(DP) :: a
567  real(DP) :: rh
568  real(DP) :: wp
569  real(DP) :: r
570  real(DP) :: c
571  real(DP) :: q
572  integer(I4B) :: i0
573  integer(I4B) :: i1
574  integer(I4B) :: npts
575  integer(I4B) :: icalcmeth
576  real(DP), dimension(:), allocatable :: depths
577  real(DP), dimension(:), allocatable :: depths_unique
578  integer(I4B), dimension(:), allocatable :: indx
579 
580  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
581 
582  if (npts > 0) then
583 
584  write (this%iout, *) 'Processing information for cross section ', idcxs
585  write (this%iout, *) 'Depth Area WettedP HydRad Rough Conveyance Q'
586 
587  allocate (depths(npts))
588  allocate (indx(size(depths)))
589 
590  depths(:) = this%height(:)
591  call qsort(indx, depths)
592  call unique_values(depths, depths_unique)
593 
594  do ipt = 1, size(depths_unique)
595  d = depths_unique(ipt)
596  a = this%get_area(idcxs, width, d)
597  wp = this%get_wetted_perimeter(idcxs, width, d)
598  rh = this%get_hydraulic_radius(idcxs, width, d, a)
599  r = this%get_roughness(idcxs, width, d, rough, slope)
600  c = this%get_conveyance(idcxs, width, d, rough)
601  if (slope > dzero) then
602  q = unitconv * c * sqrt(slope)
603  else
604  q = dzero
605  end if
606  write (this%iout, *) d, a, wp, rh, r, c, q
607  end do
608 
609  deallocate (depths)
610  deallocate (depths_unique)
611  write (this%iout, *) 'Done processing information for cross section ', idcxs
612 
613  end if