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 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 275 of file swf-cxs.f90.

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

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

◆ calc_iacross()

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

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

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

◆ check_packagedata()

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

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

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

719  ! -- modules
721  ! -- dummy
722  class(SwfCxsType) :: this
723  integer(I4B), intent(in) :: idcxs !< cross section id
724  real(DP), intent(in) :: width !< width in reach
725  real(DP), intent(in) :: depth !< stage in reach
726  real(DP), intent(in) :: rough !< mannings value provided for the reach
727  ! -- return
728  real(DP) :: conveyance !< calculated composite roughness
729  ! -- local
730  real(DP) :: a
731  real(DP) :: rh
732  integer(I4B) :: i0
733  integer(I4B) :: i1
734  integer(I4B) :: npts
735  integer(I4B) :: icalcmeth
736  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
737  if (npts == 0) then
738  a = depth * width
739  rh = depth
740  conveyance = a * rh**dtwothirds / rough
741  else
742  conveyance = get_conveyance(npts, &
743  this%xfraction(i0:i1), &
744  this%height(i0:i1), &
745  this%manfraction(i0:i1), &
746  width, rough, depth)
747  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 88 of file swf-cxs.f90.

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

◆ cxs_da()

subroutine swfcxsmodule::cxs_da ( class(swfcxstype this)

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

564  ! -- modules
568  ! -- dummy
569  class(SwfCxsType) :: this
570  !
571  ! -- Deallocate input memory
572  call memorystore_remove(this%name_model, 'CXS', idm_context)
573  !
574  ! -- Scalars
575  call mem_deallocate(this%nsections)
576  call mem_deallocate(this%npoints)
577  !
578  ! -- Deallocate arrays if the package was created
579  ! from an input file
580  if (this%inunit > 0) then
581  call mem_deallocate(this%idcxs)
582  call mem_deallocate(this%nxspoints)
583  call mem_deallocate(this%xfraction)
584  call mem_deallocate(this%height)
585  call mem_deallocate(this%manfraction)
586  call mem_deallocate(this%iacross)
587  end if
588  !
589  ! -- deallocate parent
590  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 654 of file swf-cxs.f90.

655  ! -- modules
657  ! -- dummy
658  class(SwfCxsType) :: this
659  integer(I4B), intent(in) :: idcxs !< cross section id
660  real(DP), intent(in) :: width !< width in reach
661  real(DP), intent(in) :: depth !< stage in reach
662  ! -- local
663  real(DP) :: wp
664  integer(I4B) :: i0
665  integer(I4B) :: i1
666  integer(I4B) :: npts
667  integer(I4B) :: icalcmeth
668  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
669  if (npts == 0) then
670  wp = width
671  else
672  wp = get_wetted_perimeter(npts, &
673  this%xfraction(i0:i1), &
674  this%height(i0:i1), &
675  width, depth)
676  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 629 of file swf-cxs.f90.

630  ! -- modules
632  ! -- dummy
633  class(SwfCxsType) :: this
634  integer(I4B), intent(in) :: idcxs !< cross section id
635  real(DP), intent(in) :: width !< width in reach
636  real(DP), intent(in) :: depth !< stage in reach
637  ! -- local
638  real(DP) :: area
639  integer(I4B) :: i0
640  integer(I4B) :: i1
641  integer(I4B) :: npts
642  integer(I4B) :: icalcmeth
643  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
644  if (npts == 0) then
645  area = width * depth
646  else
647  area = get_cross_section_area(npts, &
648  this%xfraction(i0:i1), &
649  this%height(i0:i1), &
650  width, depth)
651  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 593 of file swf-cxs.f90.

594  ! -- dummy
595  class(SwfCxsType) :: this
596  integer(I4B), intent(in) :: idcxs !< cross section id number
597  integer(I4B), intent(inout) :: i0 !< starting cross section point number
598  integer(I4B), intent(inout) :: i1 !< ending cross section point number
599  integer(I4B), intent(inout) :: npts !< number of points in cross section
600  integer(I4B), intent(inout) :: icalcmeth !< calculation method for mannings roughness
601  ! -- local
602  !
603  ! -- Return npts = 0 if this package does not have input file
604  if (this%inunit == 0 .or. idcxs == 0) then
605  npts = 0
606  i0 = 1
607  i1 = 1
608  icalcmeth = 0
609  else
610  !
611  ! -- If the cross section id is 0, then it is a hydraulically wide channel,
612  ! and only width and rough are needed (not xfraction, height, and manfraction)
613  if (idcxs > 0) then
614  i0 = this%iacross(idcxs)
615  i1 = this%iacross(idcxs + 1) - 1
616  else
617  i0 = 1
618  i1 = 1
619  end if
620  ! set icalcmeth based on number of cross section points
621  npts = i1 - i0 + 1
622  icalcmeth = 0 ! linear composite mannings resistance
623  if (npts > 4) then
624  icalcmeth = 0 ! sum q by cross section segments
625  end if
626  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 750 of file swf-cxs.f90.

751  ! -- modules
753  ! -- dummy
754  class(SwfCxsType) :: this
755  integer(I4B), intent(in) :: idcxs !< cross section id
756  real(DP), intent(in) :: width !< width in reach
757  real(DP), intent(in) :: depth !< stage in reach
758  real(DP), intent(in), optional :: area !< area of the reach
759  ! -- local
760  real(DP) :: r !< calculated hydraulic radius
761  real(DP) :: a
762  integer(I4B) :: i0
763  integer(I4B) :: i1
764  integer(I4B) :: npts
765  integer(I4B) :: icalcmeth
766  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
767  if (present(area)) then
768  a = area
769  else
770  a = this%get_area(idcxs, width, depth)
771  end if
772  if (npts == 0) then
773  r = a / width
774  else
775  r = get_hydraulic_radius_xf(npts, &
776  this%xfraction(i0:i1), &
777  this%height(i0:i1), &
778  width, depth)
779  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 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  ! local
813  real(DP) :: r !< calculated hydraulic radius
814  integer(I4B) :: i0
815  integer(I4B) :: i1
816  integer(I4B) :: npts
817  integer(I4B) :: icalcmeth
818  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
819  if (npts == 0) then
820  r = width
821  else
822  r = get_saturated_topwidth(npts, this%xfraction(i0:i1), width)
823  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 679 of file swf-cxs.f90.

681  ! -- modules
683  ! -- dummy
684  class(SwfCxsType) :: this
685  integer(I4B), intent(in) :: idcxs !< cross section id
686  real(DP), intent(in) :: width !< width in reach
687  real(DP), intent(in) :: depth !< stage in reach
688  real(DP), intent(in) :: rough !< mannings value provided for the reach
689  real(DP), intent(in) :: slope !< slope value provided for the reach
690  ! -- local
691  real(DP) :: roughc !< calculated composite roughness
692  integer(I4B) :: i0
693  integer(I4B) :: i1
694  integer(I4B) :: npts
695  integer(I4B) :: icalcmeth
696  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
697  if (npts == 0) then
698  roughc = rough
699  else
700  roughc = calc_composite_roughness(npts, &
701  depth, &
702  width, &
703  rough, &
704  slope, &
705  this%xfraction(i0:i1), &
706  this%height(i0:i1), &
707  this%manfraction(i0:i1), &
708  icalcmeth)
709  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 782 of file swf-cxs.f90.

783  ! modules
785  ! dummy
786  class(SwfCxsType) :: this
787  integer(I4B), intent(in) :: idcxs !< cross section id
788  real(DP), intent(in) :: width !< width in reach
789  real(DP), intent(in) :: depth !< stage in reach
790  ! local
791  real(DP) :: r !< calculated hydraulic radius
792  integer(I4B) :: i0
793  integer(I4B) :: i1
794  integer(I4B) :: npts
795  integer(I4B) :: icalcmeth
796  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
797  if (npts == 0) then
798  r = width
799  else
800  r = get_wetted_topwidth(npts, this%xfraction(i0:i1), &
801  this%height(i0:i1), width, depth)
802  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 
)

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

477  class(SwfCxsType) :: this
478  type(CxsCrosssectiondataFoundType), intent(in) :: found
479 
480  write (this%iout, '(1x,a)') 'Setting CXS Cross Section Data'
481 
482  if (found%xfraction) then
483  write (this%iout, '(4x,a)') 'XFRACTION set from input file.'
484  end if
485 
486  if (found%height) then
487  write (this%iout, '(4x,a)') 'HEIGHT set from input file.'
488  end if
489 
490  if (found%manfraction) then
491  write (this%iout, '(4x,a)') 'MANFRACTION set from input file.'
492  end if
493 
494  write (this%iout, '(1x,a,/)') 'End Setting CXS Cross Section Data'
495 

◆ log_dimensions()

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

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

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

◆ log_options()

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

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

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

◆ log_packagedata()

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

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

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

◆ source_crosssectiondata()

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

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

426  ! -- modules
427  use kindmodule, only: lgp
430  ! -- dummy
431  class(SwfCxsType) :: this
432  ! -- locals
433  character(len=LENMEMPATH) :: idmMemoryPath
434  type(CxsCrosssectiondataFoundType) :: found
435  !
436  ! -- set memory path
437  idmmemorypath = create_mem_path(this%name_model, 'CXS', idm_context)
438  !
439  ! -- update defaults with idm sourced values
440  call mem_set_value(this%xfraction, 'XFRACTION', idmmemorypath, &
441  found%xfraction)
442  call mem_set_value(this%height, 'HEIGHT', idmmemorypath, &
443  found%height)
444  call mem_set_value(this%manfraction, 'MANFRACTION', idmmemorypath, &
445  found%manfraction)
446  !
447  ! -- ensure xfraction was found
448  if (.not. found%xfraction) then
449  write (errmsg, '(a)') &
450  'Error in CROSSSECTIONDATA block: xfraction not found.'
451  call store_error(errmsg)
452  end if
453  !
454  ! -- ensure height was found
455  if (.not. found%height) then
456  write (errmsg, '(a)') &
457  'Error in CROSSSECTIONDATA block: HEIGHT not found.'
458  call store_error(errmsg)
459  end if
460  !
461  ! -- ensure manfraction was found
462  if (.not. found%manfraction) then
463  write (errmsg, '(a)') &
464  'Error in CROSSSECTIONDATA block: MANFRACTION not found.'
465  call store_error(errmsg)
466  end if
467  !
468  ! -- log values to list file
469  if (this%iout > 0) then
470  call this%log_crosssectiondata(found)
471  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 215 of file swf-cxs.f90.

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

◆ source_options()

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

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

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

◆ source_packagedata()

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

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

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

499  ! -- module
500  use sortmodule, only: qsort, unique_values
501  ! -- dummy
502  class(SwfCxsType) :: this
503  integer(I4B), intent(in) :: idcxs
504  real(DP), intent(in) :: width
505  real(DP), intent(in) :: slope
506  real(DP), intent(in) :: rough
507  real(DP), intent(in) :: unitconv
508  ! -- local
509  integer(I4B) :: ipt
510  real(DP) :: d
511  real(DP) :: a
512  real(DP) :: rh
513  real(DP) :: wp
514  real(DP) :: r
515  real(DP) :: c
516  real(DP) :: q
517  integer(I4B) :: i0
518  integer(I4B) :: i1
519  integer(I4B) :: npts
520  integer(I4B) :: icalcmeth
521  real(DP), dimension(:), allocatable :: depths
522  real(DP), dimension(:), allocatable :: depths_unique
523  integer(I4B), dimension(:), allocatable :: indx
524 
525  call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth)
526 
527  if (npts > 0) then
528 
529  write (this%iout, *) 'Processing information for cross section ', idcxs
530  write (this%iout, *) 'Depth Area WettedP HydRad Rough Conveyance Q'
531 
532  allocate (depths(npts))
533  allocate (indx(size(depths)))
534 
535  depths(:) = this%height(:)
536  call qsort(indx, depths)
537  call unique_values(depths, depths_unique)
538 
539  do ipt = 1, size(depths_unique)
540  d = depths_unique(ipt)
541  a = this%get_area(idcxs, width, d)
542  wp = this%get_wetted_perimeter(idcxs, width, d)
543  rh = this%get_hydraulic_radius(idcxs, width, d, a)
544  r = this%get_roughness(idcxs, width, d, rough, slope)
545  c = this%get_conveyance(idcxs, width, d, rough)
546  if (slope > dzero) then
547  q = unitconv * c * sqrt(slope)
548  else
549  q = dzero
550  end if
551  write (this%iout, *) d, a, wp, rh, r, c, q
552  end do
553 
554  deallocate (depths)
555  deallocate (depths_unique)
556  write (this%iout, *) 'Done processing information for cross section ', idcxs
557 
558  end if