42 do n = 1, model_dynamic_pkgs%Count()
44 call model_dynamic_input%df()
58 do n = 1, model_dynamic_pkgs%Count()
60 call model_dynamic_input%rp()
74 do n = 1, model_dynamic_pkgs%Count()
76 call model_dynamic_input%ad()
91 integer(I4B),
intent(in) :: iout
94 character(len=LENCOMPONENTNAME) :: exg_comp, exg_subcomp
95 character(len=LENMEMPATH) :: input_mempath, mempath
103 call mem_setptr(mempaths,
'EXGMEMPATHS', input_mempath)
104 do n = 1,
size(mempaths)
105 mempath = mempaths(n)
106 if (mempath /=
'')
then
124 recursive subroutine input_load(component_type, subcomponent_type, modelname, &
125 pkgname, pkgtype, filename, modelfname, &
130 character(len=*),
intent(in) :: component_type
131 character(len=*),
intent(in) :: subcomponent_type
132 character(len=*),
intent(in) :: pkgname
133 character(len=*),
intent(in) :: pkgtype
134 character(len=*),
intent(in) :: filename
135 character(len=*),
intent(in) :: modelname
136 character(len=*),
intent(in) :: modelfname
138 integer(I4B),
intent(in) :: iout
147 pkgtype, filename, modelfname, nc_vars)
150 dynamic_loader => static_loader%load(iout)
152 if (
associated(dynamic_loader))
then
157 static_loader%component_input_name, nc_vars%nc_fname, &
161 call dynamic_pkgs%add(dynamic_loader)
166 call static_loader%create_subpkg_list()
169 do n = 1, static_loader%subpkg_list%pnum
172 call input_load(static_loader%subpkg_list%component_types(n), &
173 static_loader%subpkg_list%subcomponent_types(n), &
174 static_loader%mf6_input%component_name, &
175 static_loader%subpkg_list%subcomponent_types(n), &
176 static_loader%subpkg_list%pkgtypes(n), &
177 static_loader%subpkg_list%filenames(n), &
178 modelfname, nc_vars, iout)
182 call static_loader%destroy()
183 deallocate (static_loader)
197 integer(i4B),
intent(in) :: iout
199 integer(I4B) :: itype, ipkg
202 model_pkg_inputs%component_type, &
203 model_pkg_inputs%modelname, &
204 model_pkg_inputs%modelfname, iout)
207 do itype = 1,
size(model_pkg_inputs%pkglist)
210 do ipkg = 1, model_pkg_inputs%pkglist(itype)%pnum
213 model_pkg_inputs%pkglist(itype)%subcomponent_type)) &
217 call input_load(model_pkg_inputs%component_type, &
218 model_pkg_inputs%pkglist(itype)%subcomponent_type, &
219 model_pkg_inputs%modelname, &
220 model_pkg_inputs%pkglist(itype)%pkgnames(ipkg), &
221 model_pkg_inputs%pkglist(itype)%pkgtype, &
222 model_pkg_inputs%pkglist(itype)%filenames(ipkg), &
223 model_pkg_inputs%modelfname, nc_vars, iout)
227 model_pkg_inputs%pkglist(itype)%inunits(ipkg) = &
229 model_pkg_inputs%pkglist(itype)%filenames(ipkg), &
230 model_pkg_inputs%modelfname, iout)
236 call nc_vars%destroy()
257 integer(I4B),
intent(in) :: iout
260 integer(I4B),
dimension(:),
pointer :: model_loadmask
261 character(len=LENMEMPATH) :: input_mempath
268 character(len=LINELENGTH) :: mtype, mfname
269 character(len=LENMODELNAME) :: mname
275 model_loadmask => ds%get_load_mask()
281 call mem_setptr(mtypes,
'MTYPE', input_mempath)
282 call mem_setptr(mfnames,
'MFNAME', input_mempath)
283 call mem_setptr(mnames,
'MNAME', input_mempath)
285 do n = 1,
size(mtypes)
298 if (model_loadmask(n) > 0)
then
304 allocate (model_pkg_inputs)
305 call model_pkg_inputs%init(mtype, mfname, mname, iout)
311 call model_pkg_inputs%memload()
314 call model_pkg_inputs%destroy()
315 deallocate (model_pkg_inputs)
337 integer(I4B),
intent(in) :: iout
340 integer(I4B),
dimension(:),
pointer :: model_loadmask
357 character(len=LENMEMPATH) :: input_mempath, mempath
358 integer(I4B),
pointer :: exgid, ncelldim
359 character(len=LINELENGTH) :: exgtype, efname, mfname
360 character(len=LENMODELNAME) :: mname1, mname2, mname
361 character(len=LENCOMPONENTNAME) :: sc_type, sc_name, mtype
364 integer(I4B) :: n, m1_idx, m2_idx, irem, isize
368 model_loadmask => ds%get_load_mask()
374 call mem_setptr(etypes,
'EXGTYPE', input_mempath)
375 call mem_setptr(efiles,
'EXGFILE', input_mempath)
376 call mem_setptr(emnames_a,
'EXGMNAMEA', input_mempath)
377 call mem_setptr(emnames_b,
'EXGMNAMEB', input_mempath)
378 call mem_setptr(mtypes,
'MTYPE', input_mempath)
379 call mem_setptr(mfnames,
'MFNAME', input_mempath)
380 call mem_setptr(mnames,
'MNAME', input_mempath)
387 do n = 1,
size(etypes)
403 if (m1_idx <= 0 .or. m2_idx <= 0)
then
404 errmsg =
'Exchange has invalid (unrecognized) model name(s):'
405 if (m1_idx <= 0) errmsg = trim(errmsg)//
' '//trim(mname1)
406 if (m2_idx <= 0) errmsg = trim(errmsg)//
' '//trim(mname2)
416 if (model_loadmask(m1_idx) > 0 .or. model_loadmask(m2_idx) > 0)
then
419 if (model_loadmask(m1_idx) == 0)
then
421 else if (model_loadmask(m2_idx) == 0)
then
428 mfname = mfnames(irem)
431 call get_isize(
'NCELLDIM', mempath, isize)
436 call mem_setptr(ncelldim,
'NCELLDIM', mempath)
444 write (sc_name,
'(a,i0)') trim(sc_type)//
'_', n
448 emempaths(n) = mempath
458 dynamic_loader => static_loader%load(iout)
460 if (
associated(dynamic_loader))
then
461 errmsg =
'IDM unimplemented. Dynamic Exchanges not supported.'
465 call static_loader%destroy()
466 deallocate (static_loader)
474 do n = 1,
size(mnames)
475 if (model_loadmask(n) == 0)
then
478 call get_isize(
'NCELLDIM', mempath, isize)
480 call mem_setptr(ncelldim,
'NCELLDIM', mempath)
494 integer(I4B),
intent(inout) :: paramlog
527 ncid, iout)
result(model_dynamic_input)
529 character(len=*),
intent(in) :: modeltype
530 character(len=*),
intent(in) :: modelname
531 character(len=*),
intent(in) :: modelfname
532 character(len=*),
intent(in) :: nc_fname
533 integer(I4B),
intent(in) :: ncid
534 integer(I4B),
intent(in) :: iout
540 nullify (model_dynamic_input)
543 do id = 1, model_dynamic_pkgs%Count()
545 if (temp%modelname == modelname)
then
546 model_dynamic_input => temp
552 if (.not.
associated(model_dynamic_input))
then
553 allocate (model_dynamic_input)
554 call model_dynamic_input%init(modeltype, modelname, modelfname, &
555 nc_fname, ncid, iout)
568 integer(I4B),
intent(in) :: iout
572 do n = 1, model_dynamic_pkgs%Count()
574 call nc_close(model_dynamic_input%ncid, model_dynamic_input%nc_fname)
575 call model_dynamic_input%destroy()
576 deallocate (model_dynamic_input)
577 nullify (model_dynamic_input)
580 call model_dynamic_pkgs%Clear()
592 character(len=LENMEMPATH) :: simnam_mempath
593 integer(I4B) :: paramlog
594 integer(I4B),
pointer :: p
598 call mem_setptr(p,
'PRINT_INPUT', simnam_mempath)
612 character(len=LENMEMPATH) :: sim_mempath, simnam_mempath
617 integer(I4B),
pointer :: nummodels
618 integer(I4B),
pointer :: numexchanges
622 nullify (numexchanges)
629 call mem_setptr(mtypes,
'MTYPE', simnam_mempath)
630 call mem_setptr(etypes,
'EXGTYPE', simnam_mempath)
634 call mem_allocate(numexchanges,
'NUMEXCHANGES', sim_mempath)
637 nummodels =
size(mtypes)
638 numexchanges =
size(etypes)
649 character(len=LENMEMPATH),
intent(in) :: input_mempath
651 integer(I4B),
pointer :: intvar
654 call mem_allocate(intvar, idt%mf6varname, input_mempath)
656 select case (idt%mf6varname)
668 write (errmsg,
'(a,a)') &
669 'Idm SIMNAM Load default value setting '&
670 &
'is unhandled for this variable: ', &
687 character(len=LENMEMPATH),
intent(in) :: input_mempath
689 character(len=LINELENGTH),
pointer :: cstr
691 pointer,
contiguous :: acharstr1d
696 case (
'KEYWORD',
'INTEGER')
698 if (idt%in_record)
then
708 if (idt%in_record)
then
722 write (errmsg,
'(a,a)') &
723 'IdmLoad allocate simnam param unhandled datatype: ', &
740 character(len=LENMEMPATH) :: input_mempath
743 integer(I4B) :: iparam, isize
752 do iparam = 1,
size(mf6_input%param_dfns)
755 idt => mf6_input%param_dfns(iparam)
758 call get_isize(idt%mf6varname, input_mempath, isize)
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 lenexchangename
maximum length of the exchange name
integer(i4b), parameter lenmempath
maximum length of the memory path
This module contains the DefinitionSelectModule.
character(len=linelength) function, public idt_datatype(idt)
return input definition type datatype
class(distributedsimtype) function, pointer, public get_dsim()
Get pointer to the distributed simulation object.
logical function, public idm_integrated(component, subcomponent)
This module contains the IdmLoadModule.
subroutine, public simnam_load(paramlog)
MODFLOW 6 mfsim.nam input load routine.
integer(i4b) function input_param_log()
return sim input context PRINT_INPUT value
subroutine load_model_pkgs(model_pkg_inputs, iout)
load integrated model package files
subroutine, public idm_da(iout)
idm deallocate routine
subroutine, public idm_df()
advance package dynamic data for period steps
subroutine, public simtdis_load()
MODFLOW 6 tdis input load routine.
subroutine, public idm_rp()
load package dynamic data for period
subroutine, public idm_ad()
advance package dynamic data for period steps
recursive subroutine input_load(component_type, subcomponent_type, modelname, pkgname, pkgtype, filename, modelfname, nc_vars, iout)
load an integrated model package from supported source
subroutine simnam_load_dim()
load simulation summary info to input context
subroutine allocate_simnam_int(input_mempath, idt)
set sim nam input context default integer value
subroutine, public load_models(iout)
load model namfiles and model package files
subroutine dynamic_da(iout)
deallocate all model dynamic loader collections
subroutine, public load_exchanges(iout)
load exchange files
subroutine simnam_allocate()
MODFLOW 6 mfsim.nam input context parameter allocation.
class(modeldynamicpkgstype) function, pointer dynamic_model_pkgs(modeltype, modelname, modelfname, nc_fname, ncid, iout)
retrieve list of model dynamic loaders
subroutine allocate_simnam_param(input_mempath, idt)
MODFLOW 6 mfsim.nam parameter allocate and set.
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine split_mem_path(mem_path, component, subcomponent)
Split the memory path into component(s)
subroutine, public memorystore_remove(component, subcomponent, context)
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
This module contains the NCFileVarsModule.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
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
integer(i4b) isimcheck
simulation input check flag (1) to check input, (0) to ignore checks
integer(i4b) isimcontinue
simulation continue flag (1) to continue if isimcnvg = 0, (0) to terminate
character(len=linelength) simfile
simulation name file
This module contains the SourceCommonModule.
character(len=lencomponentname) function, public idm_subcomponent_type(component, subcomponent)
component from package or model type
subroutine, public inlen_check(input_name, mf6_name, maxlen, name_type)
store an error for input exceeding internal name length
character(len=lencomponentname) function, public idm_component_type(component)
component from package or model type
integer(i4b) function, public ifind_charstr(array, str)
This module contains the SourceLoadModule.
subroutine, public load_simnam()
integer(i4b) function, public open_source_file(pkgtype, filename, modelfname, iout)
subroutine, public load_simtdis()
type(ncfilevarstype) function, pointer, public netcdf_context(modeltype, component_type, modelname, modelfname, iout)
create model netcdf context
subroutine, public nc_close(ncid, nc_fname)
close an open netcdf file
integer(i4b) function, public remote_model_ndim(mtype, mfname)
class(staticpkgloadbasetype) function, pointer, public create_input_loader(component_type, subcomponent_type, component_name, subcomponent_name, input_type, input_fname, component_fname, nc_vars)
factory function to create and setup model package static loader
subroutine, public load_modelnam(mtype, mfname, mname, iout)
This class is used to store a single deferred-length character string. It was designed to work in an ...
A generic heterogeneous doubly-linked list.
Type describing modflow6 input variables in model NetCDF file.