41 do n = 1, model_dynamic_pkgs%Count()
43 call model_dynamic_input%df()
53 do n = 1, model_dynamic_pkgs%Count()
55 call model_dynamic_input%rp()
65 do n = 1, model_dynamic_pkgs%Count()
67 call model_dynamic_input%ad()
79 integer(I4B),
intent(in) :: iout
82 character(len=LENCOMPONENTNAME) :: exg_comp, exg_subcomp
83 character(len=LENMEMPATH) :: input_mempath, mempath
91 call mem_setptr(mempaths,
'EXGMEMPATHS', input_mempath)
92 do n = 1,
size(mempaths)
94 if (mempath /=
'')
then
109 recursive subroutine input_load(component_type, subcomponent_type, modelname, &
110 pkgname, pkgtype, filename, modelfname, &
115 character(len=*),
intent(in) :: component_type
116 character(len=*),
intent(in) :: subcomponent_type
117 character(len=*),
intent(in) :: pkgname
118 character(len=*),
intent(in) :: pkgtype
119 character(len=*),
intent(in) :: filename
120 character(len=*),
intent(in) :: modelname
121 character(len=*),
intent(in) :: modelfname
123 integer(I4B),
intent(in) :: iout
132 pkgtype, filename, modelfname, nc_vars)
135 dynamic_loader => static_loader%load(iout)
137 if (
associated(dynamic_loader))
then
141 static_loader%component_input_name, nc_vars%nc_fname, &
144 call dynamic_pkgs%add(dynamic_loader)
148 call static_loader%create_subpkg_list()
151 do n = 1, static_loader%subpkg_list%pnum
153 call input_load(static_loader%subpkg_list%component_types(n), &
154 static_loader%subpkg_list%subcomponent_types(n), &
155 static_loader%mf6_input%component_name, &
156 static_loader%subpkg_list%subcomponent_types(n), &
157 static_loader%subpkg_list%pkgtypes(n), &
158 static_loader%subpkg_list%filenames(n), &
159 modelfname, nc_vars, iout)
163 call static_loader%destroy()
164 deallocate (static_loader)
175 integer(i4B),
intent(in) :: iout
177 integer(I4B) :: itype, ipkg
180 model_pkg_inputs%component_type, &
181 model_pkg_inputs%modelname, &
182 model_pkg_inputs%modelfname, iout)
184 do itype = 1,
size(model_pkg_inputs%pkglist)
186 do ipkg = 1, model_pkg_inputs%pkglist(itype)%pnum
188 model_pkg_inputs%pkglist(itype)%subcomponent_type)) &
191 call input_load(model_pkg_inputs%component_type, &
192 model_pkg_inputs%pkglist(itype)%subcomponent_type, &
193 model_pkg_inputs%modelname, &
194 model_pkg_inputs%pkglist(itype)%pkgnames(ipkg), &
195 model_pkg_inputs%pkglist(itype)%pkgtype, &
196 model_pkg_inputs%pkglist(itype)%filenames(ipkg), &
197 model_pkg_inputs%modelfname, nc_vars, iout)
200 model_pkg_inputs%pkglist(itype)%inunits(ipkg) = &
202 model_pkg_inputs%pkglist(itype)%filenames(ipkg), &
203 model_pkg_inputs%modelfname, iout)
209 call nc_vars%destroy()
225 integer(I4B),
intent(in) :: iout
227 integer(I4B),
dimension(:),
pointer :: model_loadmask
228 character(len=LENMEMPATH) :: input_mempath
235 character(len=LINELENGTH) :: mtype, mfname
236 character(len=LENMODELNAME) :: mname
242 model_loadmask => ds%get_load_mask()
248 call mem_setptr(mtypes,
'MTYPE', input_mempath)
249 call mem_setptr(mfnames,
'MFNAME', input_mempath)
250 call mem_setptr(mnames,
'MNAME', input_mempath)
252 do n = 1,
size(mtypes)
264 if (model_loadmask(n) > 0)
then
268 allocate (model_pkg_inputs)
269 call model_pkg_inputs%init(mtype, mfname, mname, iout)
273 call model_pkg_inputs%memload()
275 call model_pkg_inputs%destroy()
276 deallocate (model_pkg_inputs)
293 integer(I4B),
intent(in) :: iout
295 integer(I4B),
dimension(:),
pointer :: model_loadmask
312 character(len=LENMEMPATH) :: input_mempath, mempath
313 integer(I4B),
pointer :: exgid, ncelldim
314 character(len=LINELENGTH) :: exgtype, efname, mfname
315 character(len=LENMODELNAME) :: mname1, mname2, mname
316 character(len=LENCOMPONENTNAME) :: sc_type, sc_name, mtype
319 integer(I4B) :: n, m1_idx, m2_idx, irem, isize
323 model_loadmask => ds%get_load_mask()
329 call mem_setptr(etypes,
'EXGTYPE', input_mempath)
330 call mem_setptr(efiles,
'EXGFILE', input_mempath)
331 call mem_setptr(emnames_a,
'EXGMNAMEA', input_mempath)
332 call mem_setptr(emnames_b,
'EXGMNAMEB', input_mempath)
333 call mem_setptr(mtypes,
'MTYPE', input_mempath)
334 call mem_setptr(mfnames,
'MFNAME', input_mempath)
335 call mem_setptr(mnames,
'MNAME', input_mempath)
342 do n = 1,
size(etypes)
357 if (m1_idx <= 0 .or. m2_idx <= 0)
then
358 errmsg =
'Exchange has invalid (unrecognized) model name(s):'
359 if (m1_idx <= 0) errmsg = trim(errmsg)//
' '//trim(mname1)
360 if (m2_idx <= 0) errmsg = trim(errmsg)//
' '//trim(mname2)
370 if (model_loadmask(m1_idx) > 0 .or. model_loadmask(m2_idx) > 0)
then
372 if (model_loadmask(m1_idx) == 0)
then
374 else if (model_loadmask(m2_idx) == 0)
then
381 mfname = mfnames(irem)
384 call get_isize(
'NCELLDIM', mempath, isize)
389 call mem_setptr(ncelldim,
'NCELLDIM', mempath)
397 write (sc_name,
'(a,i0)') trim(sc_type)//
'_', n
401 emempaths(n) = mempath
411 dynamic_loader => static_loader%load(iout)
413 if (
associated(dynamic_loader))
then
414 errmsg =
'IDM unimplemented. Dynamic Exchanges not supported.'
418 call static_loader%destroy()
419 deallocate (static_loader)
425 do n = 1,
size(mnames)
426 if (model_loadmask(n) == 0)
then
429 call get_isize(
'NCELLDIM', mempath, isize)
431 call mem_setptr(ncelldim,
'NCELLDIM', mempath)
442 integer(I4B),
intent(inout) :: paramlog
464 ncid, iout)
result(model_dynamic_input)
466 character(len=*),
intent(in) :: modeltype
467 character(len=*),
intent(in) :: modelname
468 character(len=*),
intent(in) :: modelfname
469 character(len=*),
intent(in) :: nc_fname
470 integer(I4B),
intent(in) :: ncid
471 integer(I4B),
intent(in) :: iout
477 nullify (model_dynamic_input)
480 do id = 1, model_dynamic_pkgs%Count()
482 if (temp%modelname == modelname)
then
483 model_dynamic_input => temp
489 if (.not.
associated(model_dynamic_input))
then
490 allocate (model_dynamic_input)
491 call model_dynamic_input%init(modeltype, modelname, modelfname, &
492 nc_fname, ncid, iout)
502 integer(I4B),
intent(in) :: iout
505 do n = 1, model_dynamic_pkgs%Count()
507 call nc_close(model_dynamic_input%ncid, model_dynamic_input%nc_fname)
508 call model_dynamic_input%destroy()
509 deallocate (model_dynamic_input)
510 nullify (model_dynamic_input)
512 call model_dynamic_pkgs%Clear()
521 character(len=LENMEMPATH) :: simnam_mempath
522 integer(I4B) :: paramlog
523 integer(I4B),
pointer :: p
526 call mem_setptr(p,
'PRINT_INPUT', simnam_mempath)
537 character(len=LENMEMPATH) :: sim_mempath, simnam_mempath
542 integer(I4B),
pointer :: nummodels
543 integer(I4B),
pointer :: numexchanges
547 nullify (numexchanges)
554 call mem_setptr(mtypes,
'MTYPE', simnam_mempath)
555 call mem_setptr(etypes,
'EXGTYPE', simnam_mempath)
559 call mem_allocate(numexchanges,
'NUMEXCHANGES', sim_mempath)
562 nummodels =
size(mtypes)
563 numexchanges =
size(etypes)
571 character(len=LENMEMPATH),
intent(in) :: input_mempath
573 integer(I4B),
pointer :: intvar
576 call mem_allocate(intvar, idt%mf6varname, input_mempath)
578 select case (idt%mf6varname)
590 write (errmsg,
'(a,a)') &
591 'Idm SIMNAM Load default value setting '&
592 &
'is unhandled for this variable: ', &
606 character(len=LENMEMPATH),
intent(in) :: input_mempath
608 character(len=LINELENGTH),
pointer :: cstr
610 pointer,
contiguous :: acharstr1d
613 case (
'KEYWORD',
'INTEGER')
614 if (idt%in_record)
then
622 if (idt%in_record)
then
634 write (errmsg,
'(a,a)') &
635 'IdmLoad allocate simnam param unhandled datatype: ', &
649 character(len=LENMEMPATH) :: input_mempath
652 integer(I4B) :: iparam, isize
660 do iparam = 1,
size(mf6_input%param_dfns)
662 idt => mf6_input%param_dfns(iparam)
664 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.