30 character(len=LENCOMPONENTNAME),
dimension(:),
allocatable :: pkgtypes
31 character(len=LENCOMPONENTNAME),
dimension(:),
allocatable :: component_types
32 character(len=LENCOMPONENTNAME),
dimension(:), &
33 allocatable :: subcomponent_types
34 character(len=LINELENGTH),
dimension(:),
allocatable :: filenames
35 character(len=LENMEMPATH) :: mempath
36 character(len=LENCOMPONENTNAME) :: component_name
52 character(len=LENCOMPONENTNAME) :: component_name
53 character(len=LINELENGTH) :: component_input_name
54 character(len=LINELENGTH) :: input_name
55 integer(I4B) :: iperblock
81 character(len=LENCOMPONENTNAME) :: component_name
82 character(len=LINELENGTH) :: component_input_name
83 character(len=LINELENGTH) :: input_name
84 character(len=LINELENGTH),
dimension(:),
allocatable :: param_names
85 logical(LGP) :: readasarrays
86 integer(I4B) :: iperblock
88 integer(I4B) :: nparam
109 function load_if(this, iout)
result(dynamic_loader)
112 integer(I4B),
intent(in) :: iout
128 character(len=LENCOMPONENTNAME) :: modeltype
129 character(len=LENMODELNAME) :: modelname
130 character(len=LINELENGTH) :: modelfname
132 character(len=LINELENGTH) :: nc_fname
156 character(len=*),
intent(in) :: mempath
157 character(len=*),
intent(in) :: component_name
162 this%mempath = mempath
163 this%component_name = component_name
166 allocate (this%pkgtypes(0))
167 allocate (this%component_types(0))
168 allocate (this%subcomponent_types(0))
169 allocate (this%filenames(0))
174 subroutine subpkg_add(this, pkgtype, component_type, subcomponent_type, &
183 character(len=*),
intent(in) :: pkgtype
184 character(len=*),
intent(in) :: component_type
185 character(len=*),
intent(in) :: subcomponent_type
186 character(len=*),
intent(in) :: tagname
187 character(len=*),
intent(in) :: filename
189 character(len=LENVARNAME) :: mempath_tag
190 character(len=LENMEMPATH),
pointer :: subpkg_mempath
191 character(len=LINELENGTH),
pointer :: input_fname
192 integer(I4B) :: idx, trimlen
201 this%pnum = this%pnum + 1
202 this%pkgtypes(this%pnum) = pkgtype
203 this%component_types(this%pnum) = component_type
204 this%subcomponent_types(this%pnum) = subcomponent_type
205 this%filenames(this%pnum) = filename
208 mempath_tag = tagname
209 trimlen = len_trim(tagname)
213 idx = index(tagname,
'_')
215 if (tagname(idx + 1:trimlen) ==
'FILENAME')
then
216 write (mempath_tag,
'(a)') tagname(1:idx)//
'MEMPATH'
231 input_fname = filename
243 deallocate (this%pkgtypes)
244 deallocate (this%component_types)
245 deallocate (this%subcomponent_types)
246 deallocate (this%filenames)
252 subroutine static_init(this, mf6_input, component_name, component_input_name, &
256 character(len=*),
intent(in) :: component_name
257 character(len=*),
intent(in) :: component_input_name
258 character(len=*),
intent(in) :: input_name
259 integer(I4B) :: iblock
261 this%mf6_input = mf6_input
262 this%component_name = component_name
263 this%component_input_name = component_input_name
264 this%input_name = input_name
268 call this%subpkg_list%create(this%mf6_input%mempath, &
269 this%mf6_input%component_name)
272 do iblock = 1,
size(mf6_input%block_dfns)
274 if (mf6_input%block_dfns(iblock)%blockname ==
'PERIOD')
then
275 this%iperblock = iblock
291 character(len=16),
dimension(:),
pointer :: subpkgs
292 character(len=LINELENGTH) :: tag, fname, pkgtype
293 character(len=LENFTYPE) :: c_type, sc_type
294 character(len=16) :: subpkg
295 integer(I4B) :: idx, n
299 this%mf6_input%subcomponent_type)
302 do n = 1,
size(subpkgs)
304 idx = index(subpkg,
'-')
308 c_type = subpkg(1:idx - 1)
309 sc_type = subpkg(idx + 1:len_trim(subpkg))
314 pkgtype = trim(sc_type)//
'6'
315 tag = trim(pkgtype)//
'_FILENAME'
319 errmsg =
'Multi-instance subpackages not supported. Remove dfn &
320 &subpackage tagline for package "'//trim(subpkg)//
'".'
325 this%input_name))
then
326 call this%subpkg_list%add(pkgtype, c_type, sc_type, &
327 trim(tag), trim(fname))
331 errmsg =
'Identified subpackage is not IDM integrated. Remove dfn &
332 &subpackage tagline for package "'//trim(subpkg)//
'".'
343 call this%subpkg_list%destroy()
345 if (
associated(this%nc_vars))
then
346 call this%nc_vars%destroy()
347 deallocate (this%nc_vars)
348 nullify (this%nc_vars)
360 subroutine dynamic_init(this, mf6_input, component_name, component_input_name, &
361 input_name, iperblock, iout)
367 character(len=*),
intent(in) :: component_name
368 character(len=*),
intent(in) :: component_input_name
369 character(len=*),
intent(in) :: input_name
370 integer(I4B),
intent(in) :: iperblock
371 integer(I4B),
intent(in) :: iout
374 this%mf6_input = mf6_input
375 this%component_name = component_name
376 this%component_input_name = component_input_name
377 this%input_name = input_name
378 this%iperblock = iperblock
384 if (this%iperblock == 0)
then
386 'Programming error. (IDM) PERIOD block not found in '&
387 &
'dynamic package input block dfns: ', &
388 trim(mf6_input%subcomponent_name)
394 this%readasarrays = (.not. mf6_input%block_dfns(iperblock)%aggregate)
429 if (
associated(this%nc_vars))
then
430 call this%nc_vars%destroy()
431 deallocate (this%nc_vars)
432 nullify (this%nc_vars)
437 this%mf6_input%subcomponent_name, &
449 character(len=*),
intent(in) :: modeltype
450 character(len=*),
intent(in) :: modelname
451 character(len=*),
intent(in) :: modelfname
452 character(len=*),
intent(in) :: nc_fname
453 integer(I4B),
intent(in) :: ncid
454 integer(I4B),
intent(in) :: iout
456 this%modeltype = modeltype
457 this%modelname = modelname
458 this%modelfname = modelfname
459 this%nc_fname = nc_fname
472 class(*),
pointer :: obj
475 call this%pkglist%add(obj)
485 integer(I4B),
intent(in) :: idx
487 class(*),
pointer :: obj
490 obj => this%pkglist%GetItem(idx)
492 if (
associated(obj))
then
513 do n = 1, this%pkglist%Count()
514 dynamic_pkg => this%get(n)
515 call dynamic_pkg%rp()
531 do n = 1, this%pkglist%Count()
532 dynamic_pkg => this%get(n)
533 call dynamic_pkg%df()
547 do n = 1, this%pkglist%Count()
548 dynamic_pkg => this%get(n)
549 call dynamic_pkg%ad()
562 size = this%pkglist%Count()
576 do n = 1, this%pkglist%Count()
577 dynamic_pkg => this%get(n)
578 call dynamic_pkg%destroy()
579 deallocate (dynamic_pkg)
580 nullify (dynamic_pkg)
583 call this%pkglist%Clear()
593 type(
listtype),
intent(inout) :: list
596 class(*),
pointer :: obj
607 type(
listtype),
intent(inout) :: list
608 integer(I4B),
intent(in) :: idx
611 class(*),
pointer :: obj
617 obj => list%GetItem(idx)
618 if (
associated(obj))
then
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
integer(i4b), parameter lenmodelname
maximum length of the model name
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
integer(i4b), parameter lenmempath
maximum length of the memory path
logical function, public idm_integrated(component, subcomponent)
logical function, public idm_multi_package(component, subcomponent)
character(len=16) function, dimension(:), pointer, public idm_subpackages(component, subcomponent)
This module contains the Input Data Model Logger Module.
subroutine, public idm_log_period_header(component, iout)
@ brief log a dynamic header message
subroutine, public idm_log_period_close(iout)
@ brief log the period closing message
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_remove(component, subcomponent, context)
This module contains the NCFileVarsModule.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=linelength) idm_context
This module contains the SourceCommonModule.
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
A generic heterogeneous doubly-linked list.
Type describing input variables for a package in NetCDF file.