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 124 of file swf-ic.f90.

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

◆ ic_ar()

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

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

84  ! -- dummy
85  class(SwfIcType) :: this
86  real(DP), dimension(:), intent(inout) :: x
87  ! -- local
88  integer(I4B) :: n
89  !
90  ! -- allocate arrays
91  call this%allocate_arrays(this%dis%nodes)
92  !
93  ! -- load from IDM
94  call this%ic_load()
95  !
96  ! -- assign starting head
97  do n = 1, this%dis%nodes
98  x(n) = this%strt(n)
99  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 32 of file swf-ic.f90.

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

◆ ic_da()

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

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

105  ! -- modules
109  ! -- dummy
110  class(SwfIcType) :: this
111  !
112  ! -- deallocate IDM memory
113  call memorystore_remove(this%name_model, 'IC', idm_context)
114  !
115  ! -- deallocate arrays
116  call mem_deallocate(this%strt)
117  !
118  ! -- deallocate parent
119  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 72 of file swf-ic.f90.

73  ! -- modules
74  use basedismodule, only: disbasetype
75  ! -- dummy
76  class(SwfIcType) :: this
77  !
78  call this%source_griddata()

◆ source_griddata()

subroutine swficmodule::source_griddata ( class(swfictype this)

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

138  ! -- modules
142  ! -- dummy
143  class(SwfIcType) :: this
144  ! -- local
145  character(len=LINELENGTH) :: errmsg
146  type(SwfIcParamFoundType) :: found
147  integer(I4B), dimension(:), pointer, contiguous :: map
148  !
149  ! -- set map to convert user to reduced node data
150  map => null()
151  if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
152  !
153  ! -- set values
154  call mem_set_value(this%strt, 'STRT', this%input_mempath, map, found%strt)
155  !
156  ! -- ensure STRT was found
157  if (.not. found%strt) then
158  write (errmsg, '(a)') 'Error in GRIDDATA block: STRT not found.'
159  call store_error(errmsg, terminate=.false.)
160  call store_error_filename(this%input_fname)
161  else if (this%iout > 0) then
162  write (this%iout, '(4x,a)') 'STRT set from input file'
163  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: