MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
inputloadtypemodule Module Reference

This module contains the InputLoadTypeModule. More...

Data Types

type  staticpkgloadtype
 Static loader type. More...
 
type  staticpkgloadbasetype
 Base abstract type for static input loader. More...
 
type  dynamicpkgloadtype
 Dynamic loader type. More...
 
type  dynamicpkgloadbasetype
 Base abstract type for dynamic input loader. More...
 
interface  load_if
 load interfaces for source static and dynamic types More...
 
interface  period_load_if
 
type  modeldynamicpkgstype
 type for storing a dynamic package load list More...
 

Functions/Subroutines

subroutine static_init (this, mf6_input, component_name, component_input_name, input_name)
 initialize static package loader More...
 
subroutine static_destroy (this)
 
subroutine dynamic_init (this, mf6_input, component_name, component_input_name, input_name, iperblock, iout)
 initialize dynamic package loader More...
 
subroutine dynamic_df (this)
 dynamic package loader define More...
 
subroutine dynamic_ad (this)
 dynamic package loader advance More...
 
subroutine dynamic_destroy (this)
 dynamic package loader destroy More...
 
subroutine dynamicpkgs_init (this, modelname, modelfname, iout)
 model dynamic packages init More...
 
subroutine dynamicpkgs_add (this, dynamic_pkg)
 add package to model dynamic packages list More...
 
class(dynamicpkgloadbasetype) function, pointer dynamicpkgs_get (this, idx)
 retrieve package from model dynamic packages list More...
 
subroutine dynamicpkgs_rp (this)
 read and prepare model dynamic packages More...
 
subroutine dynamicpkgs_df (this)
 define model dynamic packages More...
 
subroutine dynamicpkgs_ad (this)
 advance model dynamic packages More...
 
integer(i4b) function dynamicpkgs_size (this)
 get size of model dynamic packages list More...
 
subroutine dynamicpkgs_destroy (this)
 destroy model dynamic packages object More...
 
subroutine, public adddynamicmodeltolist (list, model_dynamic)
 add model dynamic packages object to list More...
 
class(modeldynamicpkgstype) function, pointer, public getdynamicmodelfromlist (list, idx)
 get model dynamic packages object from list More...
 

Detailed Description

This module defines types that support generic IDM static and dynamic input loading.

Function/Subroutine Documentation

◆ adddynamicmodeltolist()

subroutine, public inputloadtypemodule::adddynamicmodeltolist ( type(listtype), intent(inout)  list,
class(modeldynamicpkgstype), intent(inout), pointer  model_dynamic 
)
Parameters
[in,out]listpackage list

Definition at line 383 of file InputLoadType.f90.

384  ! -- dummy variables
385  type(ListType), intent(inout) :: list !< package list
386  class(ModelDynamicPkgsType), pointer, intent(inout) :: model_dynamic
387  ! -- local variables
388  class(*), pointer :: obj
389  !
390  obj => model_dynamic
391  call list%Add(obj)
392  !
393  ! -- return
394  return
Here is the caller graph for this function:

◆ dynamic_ad()

subroutine inputloadtypemodule::dynamic_ad ( class(dynamicpkgloadtype), intent(inout)  this)
private

Definition at line 218 of file InputLoadType.f90.

219  class(DynamicPkgLoadType), intent(inout) :: this
220  !
221  ! override in derived type
222  !
223  return

◆ dynamic_destroy()

subroutine inputloadtypemodule::dynamic_destroy ( class(dynamicpkgloadtype), intent(inout)  this)
private

Definition at line 229 of file InputLoadType.f90.

233  class(DynamicPkgLoadType), intent(inout) :: this
234  !
235  ! -- deallocate package static and dynamic input context
236  call memorylist_remove(this%mf6_input%component_name, &
237  this%mf6_input%subcomponent_name, &
238  idm_context)
239  !
240  return
subroutine, public memorylist_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:

◆ dynamic_df()

subroutine inputloadtypemodule::dynamic_df ( class(dynamicpkgloadtype), intent(inout)  this)

Definition at line 207 of file InputLoadType.f90.

208  class(DynamicPkgLoadType), intent(inout) :: this
209  !
210  ! override in derived type
211  !
212  return

◆ dynamic_init()

subroutine inputloadtypemodule::dynamic_init ( class(dynamicpkgloadtype), intent(inout)  this,
type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in)  component_name,
character(len=*), intent(in)  component_input_name,
character(len=*), intent(in)  input_name,
integer(i4b), intent(in)  iperblock,
integer(i4b), intent(in)  iout 
)
private

Any managed memory pointed to from model/package context must be allocated when dynamic loader is initialized.

Definition at line 164 of file InputLoadType.f90.

166  use simvariablesmodule, only: errmsg
168  ! -- dummy
169  class(DynamicPkgLoadType), intent(inout) :: this
170  type(ModflowInputType), intent(in) :: mf6_input
171  character(len=*), intent(in) :: component_name
172  character(len=*), intent(in) :: component_input_name
173  character(len=*), intent(in) :: input_name
174  integer(I4B), intent(in) :: iperblock
175  integer(I4B), intent(in) :: iout
176  type(InputParamDefinitionType), pointer :: idt
177  !
178  this%mf6_input = mf6_input
179  this%component_name = component_name
180  this%component_input_name = component_input_name
181  this%input_name = input_name
182  this%iperblock = iperblock
183  this%nparam = 0
184  this%iout = iout
185  nullify (idt)
186  !
187  ! -- throw error and exit if not found
188  if (this%iperblock == 0) then
189  write (errmsg, '(a,a)') &
190  'Programming error. (IDM) PERIOD block not found in '&
191  &'dynamic package input block dfns: ', &
192  trim(mf6_input%subcomponent_name)
193  call store_error(errmsg)
194  call store_error_filename(this%input_name)
195  end if
196  !
197  ! -- set readasarrays
198  this%readasarrays = (.not. mf6_input%block_dfns(iperblock)%aggregate)
199  !
200  ! -- return
201  return
This module contains the InputDefinitionModule.
character(len=maxcharlen) errmsg
error message string
Here is the call graph for this function:

◆ dynamicpkgs_ad()

subroutine inputloadtypemodule::dynamicpkgs_ad ( class(modeldynamicpkgstype), intent(inout)  this)
private

Definition at line 335 of file InputLoadType.f90.

336  class(ModelDynamicPkgsType), intent(inout) :: this
337  class(DynamicPkgLoadBaseType), pointer :: dynamic_pkg
338  integer(I4B) :: n
339  !
340  do n = 1, this%pkglist%Count()
341  dynamic_pkg => this%get(n)
342  call dynamic_pkg%ad()
343  end do
344  !
345  return

◆ dynamicpkgs_add()

subroutine inputloadtypemodule::dynamicpkgs_add ( class(modeldynamicpkgstype), intent(inout)  this,
class(dynamicpkgloadbasetype), intent(inout), pointer  dynamic_pkg 
)
private

Definition at line 262 of file InputLoadType.f90.

263  class(ModelDynamicPkgsType), intent(inout) :: this
264  class(DynamicPkgLoadBaseType), pointer, intent(inout) :: dynamic_pkg
265  class(*), pointer :: obj
266  !
267  obj => dynamic_pkg
268  call this%pkglist%add(obj)
269  !
270  return

◆ dynamicpkgs_destroy()

subroutine inputloadtypemodule::dynamicpkgs_destroy ( class(modeldynamicpkgstype), intent(inout)  this)
private

Definition at line 363 of file InputLoadType.f90.

364  class(ModelDynamicPkgsType), intent(inout) :: this
365  class(DynamicPkgLoadBaseType), pointer :: dynamic_pkg
366  integer(I4B) :: n
367  !
368  do n = 1, this%pkglist%Count()
369  dynamic_pkg => this%get(n)
370  call dynamic_pkg%destroy()
371  deallocate (dynamic_pkg)
372  nullify (dynamic_pkg)
373  end do
374  !
375  call this%pkglist%Clear()
376  !
377  return

◆ dynamicpkgs_df()

subroutine inputloadtypemodule::dynamicpkgs_df ( class(modeldynamicpkgstype), intent(inout)  this)

Definition at line 319 of file InputLoadType.f90.

320  class(ModelDynamicPkgsType), intent(inout) :: this
321  class(DynamicPkgLoadBaseType), pointer :: dynamic_pkg
322  integer(I4B) :: n
323  !
324  do n = 1, this%pkglist%Count()
325  dynamic_pkg => this%get(n)
326  call dynamic_pkg%df()
327  end do
328  !
329  return

◆ dynamicpkgs_get()

class(dynamicpkgloadbasetype) function, pointer inputloadtypemodule::dynamicpkgs_get ( class(modeldynamicpkgstype), intent(inout)  this,
integer(i4b), intent(in)  idx 
)
private

Definition at line 276 of file InputLoadType.f90.

277  class(ModelDynamicPkgsType), intent(inout) :: this
278  integer(I4B), intent(in) :: idx
279  class(DynamicPkgLoadBaseType), pointer :: res
280  class(*), pointer :: obj
281  !
282  nullify (res)
283  obj => this%pkglist%GetItem(idx)
284  !
285  if (associated(obj)) then
286  select type (obj)
287  class is (dynamicpkgloadbasetype)
288  res => obj
289  end select
290  end if
291  !
292  return

◆ dynamicpkgs_init()

subroutine inputloadtypemodule::dynamicpkgs_init ( class(modeldynamicpkgstype), intent(inout)  this,
character(len=*), intent(in)  modelname,
character(len=*), intent(in)  modelfname,
integer(i4b), intent(in)  iout 
)

Definition at line 246 of file InputLoadType.f90.

247  class(ModelDynamicPkgsType), intent(inout) :: this
248  character(len=*), intent(in) :: modelname
249  character(len=*), intent(in) :: modelfname
250  integer(I4B), intent(in) :: iout
251  !
252  this%modelname = modelname
253  this%modelfname = modelfname
254  this%iout = iout
255  !
256  return

◆ dynamicpkgs_rp()

subroutine inputloadtypemodule::dynamicpkgs_rp ( class(modeldynamicpkgstype), intent(inout)  this)
private

Definition at line 298 of file InputLoadType.f90.

300  class(ModelDynamicPkgsType), intent(inout) :: this
301  class(DynamicPkgLoadBaseType), pointer :: dynamic_pkg
302  integer(I4B) :: n
303  !
304  call idm_log_period_header(this%modelname, this%iout)
305  !
306  do n = 1, this%pkglist%Count()
307  dynamic_pkg => this%get(n)
308  call dynamic_pkg%rp()
309  end do
310  !
311  call idm_log_period_close(this%iout)
312  !
313  return
This module contains the Input Data Model Logger Module.
Definition: IdmLogger.f90:7
subroutine, public idm_log_period_header(component, iout)
@ brief log a dynamic header message
Definition: IdmLogger.f90:69
subroutine, public idm_log_period_close(iout)
@ brief log the period closing message
Definition: IdmLogger.f90:82
Here is the call graph for this function:

◆ dynamicpkgs_size()

integer(i4b) function inputloadtypemodule::dynamicpkgs_size ( class(modeldynamicpkgstype), intent(inout)  this)
private

Definition at line 351 of file InputLoadType.f90.

352  class(ModelDynamicPkgsType), intent(inout) :: this
353  integer(I4B) :: size
354  !
355  size = this%pkglist%Count()
356  !
357  return

◆ getdynamicmodelfromlist()

class(modeldynamicpkgstype) function, pointer, public inputloadtypemodule::getdynamicmodelfromlist ( type(listtype), intent(inout)  list,
integer(i4b), intent(in)  idx 
)
Parameters
[in,out]listspd list
[in]idxpackage number

Definition at line 400 of file InputLoadType.f90.

401  ! -- dummy variables
402  type(ListType), intent(inout) :: list !< spd list
403  integer(I4B), intent(in) :: idx !< package number
404  class(ModelDynamicPkgsType), pointer :: res
405  ! -- local variables
406  class(*), pointer :: obj
407  !
408  ! -- initialize res
409  nullify (res)
410  !
411  ! -- get the object from the list
412  obj => list%GetItem(idx)
413  if (associated(obj)) then
414  select type (obj)
415  class is (modeldynamicpkgstype)
416  res => obj
417  end select
418  end if
419  !
420  ! -- return
421  return
Here is the caller graph for this function:

◆ static_destroy()

subroutine inputloadtypemodule::static_destroy ( class(staticpkgloadtype), intent(inout)  this)
private

Definition at line 152 of file InputLoadType.f90.

153  class(StaticPkgLoadType), intent(inout) :: this
154  !
155  return

◆ static_init()

subroutine inputloadtypemodule::static_init ( class(staticpkgloadtype), intent(inout)  this,
type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in)  component_name,
character(len=*), intent(in)  component_input_name,
character(len=*), intent(in)  input_name 
)
private

Definition at line 125 of file InputLoadType.f90.

127  class(StaticPkgLoadType), intent(inout) :: this
128  type(ModflowInputType), intent(in) :: mf6_input
129  character(len=*), intent(in) :: component_name
130  character(len=*), intent(in) :: component_input_name
131  character(len=*), intent(in) :: input_name
132  integer(I4B) :: iblock
133  !
134  this%mf6_input = mf6_input
135  this%component_name = component_name
136  this%component_input_name = component_input_name
137  this%input_name = input_name
138  this%iperblock = 0
139  !
140  ! -- identify period block definition
141  do iblock = 1, size(mf6_input%block_dfns)
142  !
143  if (mf6_input%block_dfns(iblock)%blockname == 'PERIOD') then
144  this%iperblock = iblock
145  exit
146  end if
147  end do
148  !
149  return