MODFLOW 6  version 6.7.0.dev2
USGS Modular Hydrologic Model
loadcontextmodule Module Reference

This module contains the LoadContextModule. More...

Data Types

type  readstatevartype
 Pointer type for read state variable. More...
 
interface  setptr
 
type  loadcontexttype
 derived type for boundary package input context More...
 

Enumerations

enum  { load_undef = 0 , list = 1 , layerarray = 2 , gridarray = 3 }
 
enum  {
  context_undef = 0 , root = 1 , sim = 2 , model = 3 ,
  modelpkg = 4 , stresspkg = 5 , exchange = 6
}
 

Functions/Subroutines

subroutine init (this, mf6_input, blockname, named_bound)
 init loader context object More...
 
subroutine allocate_scalars (this)
 allocate scalars More...
 
subroutine allocate_arrays (this)
 allocate arrays More...
 
subroutine allocate_param (this, idt)
 allocate a package dynamic input parameter More...
 
subroutine tags (this, params, nparam, input_name, create)
 get in scope package params More...
 
logical(lgp) function in_scope (this, mf6_input, blockname, tagname)
 establish if input parameter is in scope for package load More...
 
subroutine set_params (this)
 set set of in scope parameters for package More...
 
character(len=lenvarname) function rsv_alloc (this, mf6varname)
 allocate a read state variable More...
 
subroutine destroy (this)
 destroy input context object More...
 
character(len=lenvarname) function, public rsv_name (mf6varname)
 create read state variable name More...
 
subroutine allocate_charstr1d (strlen, nrow, varname, mempath)
 allocate character string type array More...
 
subroutine allocate_int1d (nrow, varname, mempath)
 allocate int1d More...
 
subroutine allocate_int2d (ncol, nrow, varname, mempath)
 allocate int2d More...
 
subroutine allocate_dbl1d (nrow, varname, mempath)
 allocate dbl1d More...
 
subroutine allocate_dbl2d (ncol, nrow, varname, mempath)
 allocate dbl2d More...
 
subroutine setval (intptr, varname, mempath)
 allocate intptr and update from input contextset intptr to varname More...
 
subroutine setptr_int (intptr, varname, mempath)
 set intptr to varname More...
 
subroutine setptr_charstr1d (charstr1d, varname, mempath, strlen)
 set charstr1d pointer to varname More...
 
subroutine setptr_auxvar (auxvar, mempath)
 set auxvar pointer More...
 

Detailed Description

This module creates a load context for IDM generic loaders (ListLoadType, LayerArrayLoadType, GridArrayLoadType) that supports consistent package side access. It also determines in scope parameters for the generic dynamic loaders and all structarray based static loads.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
load_undef 

undefined load type

list 

list (structarray) based load

layerarray 

readasarrays load

gridarray 

readarraygrid load

Definition at line 27 of file LoadContext.f90.

◆ anonymous enum

anonymous enum
private
Enumerator
context_undef 

undefined context type

root 

root context type

sim 

sim context type

model 

model context type

modelpkg 

model package context type

stresspkg 

model stress package context type

exchange 

exchange context type

Definition at line 34 of file LoadContext.f90.

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine loadcontextmodule::allocate_arrays ( class(loadcontexttype this)

call this routine after input parameters have been allocated, e.g. after load_params() with create has been called for array based loaders or after all mem_create_vector() calls have been made for list based load.

Definition at line 238 of file LoadContext.f90.

240  class(LoadContextType) :: this
241  integer(I4B), dimension(:, :), pointer, contiguous :: cellid
242  integer(I4B), dimension(:), pointer, contiguous :: nodeulist
243 
244  if (this%ctxtype == stresspkg .and. &
245  this%blockname == 'PERIOD') then
246  ! allocate cellid if this is not list input
247  if (this%readarray) then
248  call mem_allocate(cellid, 0, 0, 'CELLID', this%mf6_input%mempath)
249  end if
250 
251  ! allocate nodeulist
252  if (this%loadtype /= gridarray) then
253  call mem_allocate(nodeulist, 0, 'NODEULIST', this%mf6_input%mempath)
254  end if
255 
256  ! set pointers to arrays
257  call setptr(this%auxname_cst, 'AUXILIARY', &
258  this%mf6_input%mempath, lenauxname)
259  call setptr(this%boundname_cst, 'BOUNDNAME', &
260  this%mf6_input%mempath, lenboundname)
261  call setptr(this%auxvar, this%mf6_input%mempath)
262 
263  else if (this%ctxtype == exchange) then
264  ! set pointers to arrays
265  call setptr(this%auxname_cst, 'AUXILIARY', &
266  this%mf6_input%mempath, lenauxname)
267  call setptr(this%boundname_cst, 'BOUNDNAME', &
268  this%mf6_input%mempath, lenboundname)
269  call setptr(this%auxvar, this%mf6_input%mempath)
270  end if
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
Here is the call graph for this function:

◆ allocate_charstr1d()

subroutine loadcontextmodule::allocate_charstr1d ( integer(i4b), intent(in)  strlen,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]strlenstring number of characters
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 601 of file LoadContext.f90.

603  integer(I4B), intent(in) :: strlen !< string number of characters
604  integer(I4B), intent(in) :: nrow !< integer array number of rows
605  character(len=*), intent(in) :: varname !< variable name
606  character(len=*), intent(in) :: mempath !< variable mempath
607  type(CharacterStringType), dimension(:), pointer, &
608  contiguous :: charstr1d
609  integer(I4B) :: n
610  call mem_allocate(charstr1d, strlen, nrow, varname, mempath)
611  do n = 1, nrow
612  charstr1d(n) = ''
613  end do
Here is the caller graph for this function:

◆ allocate_dbl1d()

subroutine loadcontextmodule::allocate_dbl1d ( integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 651 of file LoadContext.f90.

653  integer(I4B), intent(in) :: nrow !< integer array number of rows
654  character(len=*), intent(in) :: varname !< variable name
655  character(len=*), intent(in) :: mempath !< variable mempath
656  real(DP), dimension(:), pointer, contiguous :: dbl1d
657  integer(I4B) :: n
658  call mem_allocate(dbl1d, nrow, varname, mempath)
659  do n = 1, nrow
660  dbl1d(n) = dzero
661  end do
Here is the caller graph for this function:

◆ allocate_dbl2d()

subroutine loadcontextmodule::allocate_dbl2d ( integer(i4b), intent(in)  ncol,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]ncolinteger array number of cols
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 666 of file LoadContext.f90.

668  integer(I4B), intent(in) :: ncol !< integer array number of cols
669  integer(I4B), intent(in) :: nrow !< integer array number of rows
670  character(len=*), intent(in) :: varname !< variable name
671  character(len=*), intent(in) :: mempath !< variable mempath
672  real(DP), dimension(:, :), pointer, contiguous :: dbl2d
673  integer(I4B) :: n, m
674  call mem_allocate(dbl2d, ncol, nrow, varname, mempath)
675  do m = 1, nrow
676  do n = 1, ncol
677  dbl2d(n, m) = dzero
678  end do
679  end do
Here is the caller graph for this function:

◆ allocate_int1d()

subroutine loadcontextmodule::allocate_int1d ( integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 618 of file LoadContext.f90.

620  integer(I4B), intent(in) :: nrow !< integer array number of rows
621  character(len=*), intent(in) :: varname !< variable name
622  character(len=*), intent(in) :: mempath !< variable mempath
623  integer(I4B), dimension(:), pointer, contiguous :: int1d
624  integer(I4B) :: n
625  call mem_allocate(int1d, nrow, varname, mempath)
626  do n = 1, nrow
627  int1d(n) = izero
628  end do
Here is the caller graph for this function:

◆ allocate_int2d()

subroutine loadcontextmodule::allocate_int2d ( integer(i4b), intent(in)  ncol,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]ncolinteger array number of cols
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 633 of file LoadContext.f90.

635  integer(I4B), intent(in) :: ncol !< integer array number of cols
636  integer(I4B), intent(in) :: nrow !< integer array number of rows
637  character(len=*), intent(in) :: varname !< variable name
638  character(len=*), intent(in) :: mempath !< variable mempath
639  integer(I4B), dimension(:, :), pointer, contiguous :: int2d
640  integer(I4B) :: n, m
641  call mem_allocate(int2d, ncol, nrow, varname, mempath)
642  do m = 1, nrow
643  do n = 1, ncol
644  int2d(n, m) = izero
645  end do
646  end do
Here is the caller graph for this function:

◆ allocate_param()

subroutine loadcontextmodule::allocate_param ( class(loadcontexttype this,
type(inputparamdefinitiontype), pointer  idt 
)

Definition at line 275 of file LoadContext.f90.

277  class(LoadContextType) :: this
278  type(InputParamDefinitionType), pointer :: idt
279  integer(I4B) :: dimsize
280 
281  ! initialize
282  dimsize = 0
283 
284  if (this%readarray) then
285  select case (idt%shape)
286  case ('NCPL', 'NAUX NCPL')
287  dimsize = this%ncpl
288  case ('NODES', 'NAUX NODES')
289  dimsize = this%maxbound
290  case default
291  end select
292  end if
293 
294  select case (idt%datatype)
295  case ('INTEGER')
296  if (this%loadtype == list) then
297  call allocate_int1d(this%maxbound, idt%mf6varname, &
298  this%mf6_input%mempath)
299  end if
300  case ('DOUBLE')
301  if (this%loadtype == list) then
302  call allocate_dbl1d(this%maxbound, idt%mf6varname, &
303  this%mf6_input%mempath)
304  end if
305  case ('STRING')
306  if (this%loadtype == list) then
307  call allocate_charstr1d(lenboundname, this%maxbound, idt%mf6varname, &
308  this%mf6_input%mempath)
309  end if
310  case ('INTEGER1D')
311  if (this%loadtype == list) then
312  if (idt%shape == 'NCELLDIM') then
313  call allocate_int2d(size(this%mshape), this%maxbound, &
314  idt%mf6varname, this%mf6_input%mempath)
315  end if
316  else if (this%readarray) then
317  call allocate_int1d(dimsize, idt%mf6varname, &
318  this%mf6_input%mempath)
319  end if
320  case ('DOUBLE1D')
321  if (idt%shape == 'NAUX') then
322  call allocate_dbl2d(this%naux, this%maxbound, &
323  idt%mf6varname, this%mf6_input%mempath)
324  else if (this%readarray) then
325  call allocate_dbl1d(dimsize, idt%mf6varname, &
326  this%mf6_input%mempath)
327  end if
328  case ('DOUBLE2D')
329  if (this%readarray) then
330  call allocate_dbl2d(this%naux, dimsize, idt%mf6varname, &
331  this%mf6_input%mempath)
332  end if
333  case default
334  end select
This module contains the InputDefinitionModule.
Here is the call graph for this function:

◆ allocate_scalars()

subroutine loadcontextmodule::allocate_scalars ( class(loadcontexttype this)

Definition at line 193 of file LoadContext.f90.

195  class(LoadContextType) :: this
196 
197  if (this%ctxtype == exchange .or. &
198  this%ctxtype == modelpkg .or. &
199  this%ctxtype == stresspkg) then
200 
201  call setptr(this%nbound, 'NBOUND', this%mf6_input%mempath)
202  call setval(this%naux, 'NAUX', this%mf6_input%mempath)
203  call setval(this%ncpl, 'NCPL', this%mf6_input%mempath)
204  call setval(this%nodes, 'NODES', this%mf6_input%mempath)
205  call setval(this%maxbound, this%named_bound, this%mf6_input%mempath)
206  call setval(this%boundnames, 'BOUNDNAMES', this%mf6_input%mempath)
207  call setval(this%iprpak, 'IPRPAK', this%mf6_input%mempath)
208 
209  ! reset nbound
210  this%nbound = 0
211  end if
212 
213  if (this%ctxtype == stresspkg .and. &
214  this%blockname == 'PERIOD') then
215  call mem_setptr(this%mshape, 'MODEL_SHAPE', &
216  this%mf6_input%component_mempath)
217 
218  if (this%ncpl == 0) then
219  if (size(this%mshape) == 2) then
220  this%ncpl = this%mshape(2)
221  else if (size(this%mshape) == 3) then
222  this%ncpl = this%mshape(2) * this%mshape(3)
223  end if
224  end if
225 
226  if (this%nodes == 0) this%nodes = product(this%mshape)
227  end if
Here is the call graph for this function:

◆ destroy()

subroutine loadcontextmodule::destroy ( class(loadcontexttype this)

Definition at line 555 of file LoadContext.f90.

556  class(LoadContextType) :: this
557 
558  if (this%ctxtype == exchange .or. &
559  this%ctxtype == stresspkg) then
560  ! deallocate local
561  deallocate (this%naux)
562  deallocate (this%ncpl)
563  deallocate (this%nodes)
564  deallocate (this%maxbound)
565  deallocate (this%boundnames)
566  deallocate (this%iprpak)
567  end if
568 
569  ! nullify
570  nullify (this%naux)
571  nullify (this%nbound)
572  nullify (this%ncpl)
573  nullify (this%nodes)
574  nullify (this%maxbound)
575  nullify (this%boundnames)
576  nullify (this%iprpak)
577  nullify (this%auxname_cst)
578  nullify (this%boundname_cst)
579  nullify (this%auxvar)
580  nullify (this%mshape)

◆ in_scope()

logical(lgp) function loadcontextmodule::in_scope ( class(loadcontexttype this,
type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in)  blockname,
character(len=*), intent(in)  tagname 
)

Definition at line 385 of file LoadContext.f90.

388  class(LoadContextType) :: this
389  type(ModflowInputType), intent(in) :: mf6_input
390  character(len=*), intent(in) :: blockname
391  character(len=*), intent(in) :: tagname
392  logical(LGP) :: in_scope
393  type(InputParamDefinitionType), pointer :: idt
394  character(len=LENVARNAME) :: checkname
395  character(len=LINELENGTH) :: datatype
396  integer(I4B) :: isize, checksize
397  integer(I4B), pointer :: intptr
398 
399  idt => &
400  get_param_definition_type(mf6_input%param_dfns, &
401  mf6_input%component_type, &
402  mf6_input%subcomponent_type, &
403  blockname, tagname, '')
404  if (idt%required) then
405  in_scope = .true.
406  return
407  else
408  in_scope = .false.
409  datatype = idt_datatype(idt)
410  if (datatype == 'KEYSTRING' .or. &
411  datatype == 'RECARRAY' .or. &
412  datatype == 'RECORD') return
413  end if
414 
415  ! initialize
416  checkname = ''
417  checksize = 0
418 
419  if (tagname == 'AUXVAR' .or. &
420  tagname == 'AUX') then
421  checkname = 'NAUX'
422  else if (tagname == 'BOUNDNAME') then
423  checkname = 'BOUNDNAMES'
424  else if (tagname == 'I'//trim(mf6_input%subcomponent_type(1:3))) then
425  if (this%loadtype == layerarray) in_scope = .true.
426  else
427  select case (mf6_input%subcomponent_type)
428  case ('EVT')
429  if (tagname == 'PXDP' .or. tagname == 'PETM') then
430  checkname = 'NSEG'
431  checksize = 1
432  else if (tagname == 'PETM0') then
433  checkname = 'SURFRATESPEC'
434  end if
435  case ('MVR', 'MVT', 'MVE')
436  if (tagname == 'MNAME' .or. &
437  tagname == 'MNAME1' .or. &
438  tagname == 'MNAME2') then
439  checkname = 'MODELNAMES'
440  end if
441  case ('NAM')
442  in_scope = .true.
443  case ('SSM')
444  if (tagname == 'MIXED') in_scope = .true.
445  case default
446  errmsg = 'LoadContext in_scope needs new check for: '// &
447  trim(idt%tagname)
448  call store_error(errmsg, .true.)
449  end select
450  end if
451 
452  ! apply checks
453  if (.not. in_scope) then
454  call get_isize(checkname, mf6_input%mempath, isize)
455  if (isize > 0) then
456  call mem_setptr(intptr, checkname, mf6_input%mempath)
457  if (intptr > checksize) in_scope = .true.
458  end if
459  end if
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename)
Return parameter definition.
character(len=linelength) function, public idt_datatype(idt)
return input definition type datatype
Here is the call graph for this function:

◆ init()

subroutine loadcontextmodule::init ( class(loadcontexttype this,
type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in), optional  blockname,
character(len=*), intent(in), optional  named_bound 
)
private

Definition at line 99 of file LoadContext.f90.

100  use inputoutputmodule, only: upcase
102  class(LoadContextType) :: this
103  type(ModflowInputType), intent(in) :: mf6_input
104  character(len=*), optional, intent(in) :: blockname
105  character(len=*), optional, intent(in) :: named_bound
106  type(InputParamDefinitionType), pointer :: idt
107  integer(I4B) :: n
108 
109  this%mf6_input = mf6_input
110  this%readarray = .false.
111  this%loadtype = load_undef
112  this%ctxtype = context_undef
113 
114  select case (mf6_input%load_scope)
115  case ('ROOT')
116  this%ctxtype = root
117  case ('SIM')
118  if (mf6_input%subcomponent_type == 'NAM') then
119  this%ctxtype = model
120  else if (mf6_input%subcomponent_type == 'TDIS' .or. &
121  mf6_input%subcomponent_type == 'HPC') then
122  this%ctxtype = sim
123  else if (mf6_input%component_type == 'EXG') then
124  this%ctxtype = exchange
125  end if
126  case ('MODEL')
127  if (mf6_input%subcomponent_type == 'OC' .or. &
128  mf6_input%subcomponent_type == 'STO') then
129  this%ctxtype = modelpkg
130  else
131  this%ctxtype = stresspkg
132  end if
133  case default
134  end select
135 
136  if (this%ctxtype == context_undef) then
137  errmsg = 'LoadContext unidentified context for mempath: '// &
138  trim(mf6_input%mempath)
139  call store_error(errmsg, .true.)
140  end if
141 
142  if (present(blockname)) then
143  this%blockname = blockname
144  call upcase(this%blockname)
145  else
146  this%blockname = 'PERIOD'
147  end if
148 
149  if (present(named_bound)) then
150  this%named_bound = named_bound
151  call upcase(this%named_bound)
152  else
153  this%named_bound = 'MAXBOUND'
154  end if
155 
156  ! determine if list based load
157  do n = 1, size(mf6_input%block_dfns)
158  if (mf6_input%block_dfns(n)%blockname == this%blockname) then
159  if (mf6_input%block_dfns(n)%aggregate) then
160  this%loadtype = list
161  end if
162  end if
163  end do
164 
165  ! determine if array based load
166  if (this%loadtype == load_undef) then
167  do n = 1, size(mf6_input%param_dfns)
168  idt => mf6_input%param_dfns(n)
169  if (idt%blockname == 'OPTIONS') then
170  select case (idt%tagname)
171  case ('READASARRAYS')
172  this%loadtype = layerarray
173  this%readarray = .true.
174  case ('READARRAYGRID')
175  this%loadtype = gridarray
176  this%readarray = .true.
177  case default
178  ! no-op
179  end select
180  end if
181  end do
182  end if
183 
184  ! set in scope params for load
185  call this%set_params()
186 
187  ! allocate load context scalars
188  call this%allocate_scalars()
subroutine, public upcase(word)
Convert to upper case.
This module contains the ModelPackageInputsModule.
logical(lgp) function, public supported_model(ctype)
is this a supported MODFLOW 6 model type
Here is the call graph for this function:

◆ rsv_alloc()

character(len=lenvarname) function loadcontextmodule::rsv_alloc ( class(loadcontexttype this,
character(len=*), intent(in)  mf6varname 
)

Create and set a read state variable, e.g. 'INRECHARGE', which are updated per iper load as follows: -1: unset, not in use 0: not read in most recent period block 1: numeric input read in most recent period block 2: time series input read in most recent period block

Definition at line 541 of file LoadContext.f90.

542  use constantsmodule, only: lenvarname
544  class(LoadContextType) :: this
545  character(len=*), intent(in) :: mf6varname
546  character(len=LENVARNAME) :: varname
547  integer(I4B), pointer :: intvar
548  varname = rsv_name(mf6varname)
549  call mem_allocate(intvar, varname, this%mf6_input%mempath)
550  intvar = -1
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenvarname
maximum length of a variable name
Definition: Constants.f90:17
Here is the call graph for this function:

◆ rsv_name()

character(len=lenvarname) function, public loadcontextmodule::rsv_name ( character(len=*), intent(in)  mf6varname)

Definition at line 585 of file LoadContext.f90.

586  use constantsmodule, only: lenvarname
587  character(len=*), intent(in) :: mf6varname
588  character(len=LENVARNAME) :: varname
589  integer(I4B) :: ilen
590  character(len=2) :: prefix = 'IN'
591  ilen = len_trim(mf6varname)
592  if (ilen > (lenvarname - len(prefix))) then
593  varname = prefix//mf6varname(1:(lenvarname - len(prefix)))
594  else
595  varname = prefix//trim(mf6varname)
596  end if
Here is the caller graph for this function:

◆ set_params()

subroutine loadcontextmodule::set_params ( class(loadcontexttype this)

Definition at line 464 of file LoadContext.f90.

469  class(LoadContextType) :: this
470  type(InputParamDefinitionType), pointer :: idt, aidt
471  character(len=LINELENGTH), dimension(:), allocatable :: tags
472  character(len=LINELENGTH), dimension(:), allocatable :: cols
473  integer(I4B) :: keepcnt, iparam, nparam
474  logical(LGP) :: keep
475 
476  ! initialize
477  keepcnt = 0
478 
479  if (this%loadtype == list) then
480  ! get aggregate param definition for period block
481  aidt => &
482  get_aggregate_definition_type(this%mf6_input%aggregate_dfns, &
483  this%mf6_input%component_type, &
484  this%mf6_input%subcomponent_type, &
485  this%blockname)
486  ! split recarray definition
487  call idt_parse_rectype(aidt, cols, nparam)
488  else
489  nparam = size(this%mf6_input%param_dfns)
490  end if
491 
492  ! allocate dfn input params
493  do iparam = 1, nparam
494  if (this%loadtype == list) then
495  idt => get_param_definition_type(this%mf6_input%param_dfns, &
496  this%mf6_input%component_type, &
497  this%mf6_input%subcomponent_type, &
498  this%blockname, cols(iparam), '')
499  else
500  idt => this%mf6_input%param_dfns(iparam)
501  end if
502 
503  if (idt%blockname /= this%blockname) then
504  keep = .false.
505  else
506  keep = this%in_scope(this%mf6_input, this%blockname, idt%tagname)
507  end if
508 
509  if (keep) then
510  keepcnt = keepcnt + 1
511  call expandarray(tags)
512  tags(keepcnt) = trim(idt%tagname)
513  end if
514  end do
515 
516  ! update nparam
517  nparam = keepcnt
518 
519  ! allocate filtcols
520  allocate (this%params(nparam))
521 
522  ! set filtcols
523  do iparam = 1, nparam
524  this%params(iparam) = trim(tags(iparam))
525  end do
526 
527  ! cleanup
528  if (allocated(tags)) deallocate (tags)
type(inputparamdefinitiontype) function, pointer, public get_aggregate_definition_type(input_definition_types, component_type, subcomponent_type, blockname)
Return aggregate definition.
subroutine, public idt_parse_rectype(idt, cols, ncol)
allocate and set RECARRAY, KEYSTRING or RECORD param list
Here is the call graph for this function:

◆ setptr_auxvar()

subroutine loadcontextmodule::setptr_auxvar ( real(dp), dimension(:, :), intent(inout), pointer, contiguous  auxvar,
character(len=*), intent(in)  mempath 
)

Definition at line 735 of file LoadContext.f90.

737  real(DP), dimension(:, :), pointer, &
738  contiguous, intent(inout) :: auxvar
739  character(len=*), intent(in) :: mempath
740  integer(I4B) :: isize
741  call get_isize('AUXVAR', mempath, isize)
742  if (isize > -1) then
743  call mem_setptr(auxvar, 'AUXVAR', mempath)
744  else
745  call mem_allocate(auxvar, 0, 0, 'AUXVAR', mempath)
746  end if

◆ setptr_charstr1d()

subroutine loadcontextmodule::setptr_charstr1d ( type(characterstringtype), dimension(:), intent(inout), pointer, contiguous  charstr1d,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  strlen 
)

Definition at line 716 of file LoadContext.f90.

718  type(CharacterStringType), dimension(:), pointer, &
719  contiguous, intent(inout) :: charstr1d
720  character(len=*), intent(in) :: varname
721  character(len=*), intent(in) :: mempath
722  integer(I4B), intent(in) :: strlen
723  integer(I4B) :: isize
724  call get_isize(varname, mempath, isize)
725  if (isize > -1) then
726  call mem_setptr(charstr1d, varname, mempath)
727  else
728  call mem_allocate(charstr1d, strlen, 0, varname, mempath)
729  end if

◆ setptr_int()

subroutine loadcontextmodule::setptr_int ( integer(i4b), intent(inout), pointer  intptr,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)

Definition at line 699 of file LoadContext.f90.

701  integer(I4B), pointer, intent(inout) :: intptr
702  character(len=*), intent(in) :: varname
703  character(len=*), intent(in) :: mempath
704  integer(I4B) :: isize
705  call get_isize(varname, mempath, isize)
706  if (isize > -1) then
707  call mem_setptr(intptr, varname, mempath)
708  else
709  call mem_allocate(intptr, varname, mempath)
710  intptr = 0
711  end if

◆ setval()

subroutine loadcontextmodule::setval ( integer(i4b), intent(inout), pointer  intptr,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)

Definition at line 685 of file LoadContext.f90.

687  integer(I4B), pointer, intent(inout) :: intptr
688  character(len=*), intent(in) :: varname
689  character(len=*), intent(in) :: mempath
690  logical(LGP) :: found
691  allocate (intptr)
692  intptr = 0
693  call mem_set_value(intptr, varname, mempath, found)
Here is the caller graph for this function:

◆ tags()

subroutine loadcontextmodule::tags ( class(loadcontexttype this,
character(len=linelength), dimension(:), intent(inout), allocatable  params,
integer(i4b), intent(inout)  nparam,
character(len=*), intent(in)  input_name,
logical(lgp), intent(in), optional  create 
)

set input array to tagnames of in scope params, optionally allocate the parameters based on datatype.

Definition at line 343 of file LoadContext.f90.

345  class(LoadContextType) :: this
346  character(len=LINELENGTH), dimension(:), allocatable, &
347  intent(inout) :: params
348  integer(I4B), intent(inout) :: nparam
349  character(len=*), intent(in) :: input_name
350  logical(LGP), optional, intent(in) :: create
351  type(InputParamDefinitionType), pointer :: idt
352  logical(LGP) :: allocate_params
353  integer(I4B) :: n
354 
355  ! initialize allocate_params
356  allocate_params = .false.
357 
358  ! override default if provided
359  if (present(create)) then
360  allocate_params = create
361  end if
362 
363  if (allocated(params)) deallocate (params)
364  nparam = size(this%params)
365  allocate (params(nparam))
366  do n = 1, nparam
367  params(n) = this%params(n)
368  end do
369 
370  if (allocate_params) then
371  ! allocate dfn input params
372  do n = 1, nparam
373  idt => &
374  get_param_definition_type(this%mf6_input%param_dfns, &
375  this%mf6_input%component_type, &
376  this%mf6_input%subcomponent_type, &
377  this%blockname, params(n), '')
378  call this%allocate_param(idt)
379  end do
380  end if
Here is the call graph for this function: