MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
swficmodule Module Reference

Data Types

type  swfictype
 

Functions/Subroutines

subroutine, public ic_cr (ic, name_model, input_mempath, inunit, iout, dis)
 Create a new initial conditions object. More...
 
subroutine ic_load (this)
 Load data from IDM into package. More...
 
subroutine ic_ar (this, x)
 Allocate arrays, load from IDM, and assign head. More...
 
subroutine ic_da (this)
 Deallocate. More...
 
subroutine allocate_arrays (this, nodes)
 Allocate arrays. More...
 
subroutine source_griddata (this)
 Copy grid data from IDM into package. More...
 

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine swficmodule::allocate_arrays ( class(swfictype this,
integer(i4b), intent(in)  nodes 
)

Definition at line 122 of file swf-ic.f90.

123  ! -- modules
125  ! -- dummy
126  class(SwfIcType) :: this
127  integer(I4B), intent(in) :: nodes
128  !
129  ! -- Allocate
130  call mem_allocate(this%strt, nodes, 'STRT', this%memoryPath)

◆ ic_ar()

subroutine swficmodule::ic_ar ( class(swfictype this,
real(dp), dimension(:), intent(inout)  x 
)
private

Definition at line 81 of file swf-ic.f90.

82  ! -- dummy
83  class(SwfIcType) :: this
84  real(DP), dimension(:), intent(inout) :: x
85  ! -- local
86  integer(I4B) :: n
87  !
88  ! -- allocate arrays
89  call this%allocate_arrays(this%dis%nodes)
90  !
91  ! -- load from IDM
92  call this%ic_load()
93  !
94  ! -- assign starting head
95  do n = 1, this%dis%nodes
96  x(n) = this%strt(n)
97  end do

◆ ic_cr()

subroutine, public swficmodule::ic_cr ( type(swfictype), pointer  ic,
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(in), pointer  dis 
)

Definition at line 31 of file swf-ic.f90.

32  ! -- modules
34  ! -- dummy
35  type(SwfIcType), pointer :: ic
36  character(len=*), intent(in) :: name_model
37  character(len=*), intent(in) :: input_mempath
38  integer(I4B), intent(in) :: inunit
39  integer(I4B), intent(in) :: iout
40  class(DisBaseType), pointer, intent(in) :: dis
41  ! -- formats
42  character(len=*), parameter :: fmtic = &
43  "(1x, /1x, 'IC -- Initial Conditions Package, Version 8, 3/28/2015', &
44  &' input read from mempath: ', A, //)"
45  !
46  ! -- create IC object
47  allocate (ic)
48  !
49  ! -- create name and memory path
50  call ic%set_names(1, name_model, 'IC', 'IC', input_mempath)
51  !
52  ! -- allocate scalars
53  call ic%allocate_scalars()
54  !
55  ! -- set variables
56  ic%inunit = inunit
57  ic%iout = iout
58  !
59  ! -- set pointers
60  ic%dis => dis
61  !
62  ! -- check if pkg is enabled,
63  if (inunit > 0) then
64  ! print message identifying pkg
65  write (ic%iout, fmtic) input_mempath
66  end if
Here is the caller graph for this function:

◆ ic_da()

subroutine swficmodule::ic_da ( class(swfictype this)
private

Definition at line 102 of file swf-ic.f90.

103  ! -- modules
107  ! -- dummy
108  class(SwfIcType) :: this
109  !
110  ! -- deallocate IDM memory
111  call memorystore_remove(this%name_model, 'IC', idm_context)
112  !
113  ! -- deallocate arrays
114  call mem_deallocate(this%strt)
115  !
116  ! -- deallocate parent
117  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:

◆ ic_load()

subroutine swficmodule::ic_load ( class(swfictype this)

Definition at line 71 of file swf-ic.f90.

72  ! -- modules
73  ! -- dummy
74  class(SwfIcType) :: this
75  !
76  call this%source_griddata()

◆ source_griddata()

subroutine swficmodule::source_griddata ( class(swfictype this)

Definition at line 135 of file swf-ic.f90.

136  ! -- modules
140  ! -- dummy
141  class(SwfIcType) :: this
142  ! -- local
143  character(len=LINELENGTH) :: errmsg
144  type(SwfIcParamFoundType) :: found
145  integer(I4B), dimension(:), pointer, contiguous :: map
146  !
147  ! -- set map to convert user to reduced node data
148  map => null()
149  if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
150  !
151  ! -- set values
152  call mem_set_value(this%strt, 'STRT', this%input_mempath, map, found%strt)
153  !
154  ! -- ensure STRT was found
155  if (.not. found%strt) then
156  write (errmsg, '(a)') 'Error in GRIDDATA block: STRT not found.'
157  call store_error(errmsg, terminate=.false.)
158  call store_error_filename(this%input_fname)
159  else if (this%iout > 0) then
160  write (this%iout, '(4x,a)') 'STRT set from input file'
161  end if
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
Here is the call graph for this function: