41 do n = 1, model_inputs%Count()
43 call model_dynamic_input%df()
53 do n = 1, model_inputs%Count()
55 call model_dynamic_input%rp()
65 do n = 1, model_inputs%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)
139 dynamic_models(static_loader%mf6_input%component_type, modelname, &
140 static_loader%component_input_name, nc_vars%nc_fname, &
143 if (
associated(dynamic_loader))
then
145 call dynamic_model%add(dynamic_loader)
149 call static_loader%create_subpkg_list()
152 do n = 1, static_loader%subpkg_list%pnum
154 call input_load(static_loader%subpkg_list%component_types(n), &
155 static_loader%subpkg_list%subcomponent_types(n), &
156 static_loader%mf6_input%component_name, &
157 static_loader%subpkg_list%subcomponent_types(n), &
158 static_loader%subpkg_list%pkgtypes(n), &
159 static_loader%subpkg_list%filenames(n), &
160 modelfname, nc_vars, iout)
164 call static_loader%destroy()
165 deallocate (static_loader)
176 integer(i4B),
intent(in) :: iout
178 integer(I4B) :: itype, ipkg
181 model_pkg_inputs%component_type, &
182 model_pkg_inputs%modelname, &
183 model_pkg_inputs%modelfname, iout)
185 do itype = 1,
size(model_pkg_inputs%pkglist)
187 do ipkg = 1, model_pkg_inputs%pkglist(itype)%pnum
189 model_pkg_inputs%pkglist(itype)%subcomponent_type)) &
192 call input_load(model_pkg_inputs%component_type, &
193 model_pkg_inputs%pkglist(itype)%subcomponent_type, &
194 model_pkg_inputs%modelname, &
195 model_pkg_inputs%pkglist(itype)%pkgnames(ipkg), &
196 model_pkg_inputs%pkglist(itype)%pkgtype, &
197 model_pkg_inputs%pkglist(itype)%filenames(ipkg), &
198 model_pkg_inputs%modelfname, nc_vars, iout)
201 model_pkg_inputs%pkglist(itype)%inunits(ipkg) = &
203 model_pkg_inputs%pkglist(itype)%filenames(ipkg), &
204 model_pkg_inputs%modelfname, iout)
210 call nc_vars%destroy()
226 integer(I4B),
intent(in) :: iout
228 integer(I4B),
dimension(:),
pointer :: model_loadmask
229 character(len=LENMEMPATH) :: input_mempath
236 character(len=LINELENGTH) :: mtype, mfname
237 character(len=LENMODELNAME) :: mname
243 model_loadmask => ds%get_load_mask()
249 call mem_setptr(mtypes,
'MTYPE', input_mempath)
250 call mem_setptr(mfnames,
'MFNAME', input_mempath)
251 call mem_setptr(mnames,
'MNAME', input_mempath)
253 do n = 1,
size(mtypes)
265 if (model_loadmask(n) > 0)
then
269 allocate (model_pkg_inputs)
270 call model_pkg_inputs%init(mtype, mfname, mname, iout)
274 call model_pkg_inputs%memload()
276 call model_pkg_inputs%destroy()
277 deallocate (model_pkg_inputs)
294 integer(I4B),
intent(in) :: iout
296 integer(I4B),
dimension(:),
pointer :: model_loadmask
313 character(len=LENMEMPATH) :: input_mempath, mempath
314 integer(I4B),
pointer :: exgid, ncelldim
315 character(len=LINELENGTH) :: exgtype, efname, mfname
316 character(len=LENMODELNAME) :: mname1, mname2, mname
317 character(len=LENCOMPONENTNAME) :: sc_type, sc_name, mtype
320 integer(I4B) :: n, m1_idx, m2_idx, irem, isize
324 model_loadmask => ds%get_load_mask()
330 call mem_setptr(etypes,
'EXGTYPE', input_mempath)
331 call mem_setptr(efiles,
'EXGFILE', input_mempath)
332 call mem_setptr(emnames_a,
'EXGMNAMEA', input_mempath)
333 call mem_setptr(emnames_b,
'EXGMNAMEB', input_mempath)
334 call mem_setptr(mtypes,
'MTYPE', input_mempath)
335 call mem_setptr(mfnames,
'MFNAME', input_mempath)
336 call mem_setptr(mnames,
'MNAME', input_mempath)
343 do n = 1,
size(etypes)
358 if (m1_idx <= 0 .or. m2_idx <= 0)
then
359 errmsg =
'Exchange has invalid (unrecognized) model name(s):'
360 if (m1_idx <= 0) errmsg = trim(errmsg)//
' '//trim(mname1)
361 if (m2_idx <= 0) errmsg = trim(errmsg)//
' '//trim(mname2)
371 if (model_loadmask(m1_idx) > 0 .or. model_loadmask(m2_idx) > 0)
then
373 if (model_loadmask(m1_idx) == 0)
then
375 else if (model_loadmask(m2_idx) == 0)
then
382 mfname = mfnames(irem)
385 call get_isize(
'NCELLDIM', mempath, isize)
390 call mem_setptr(ncelldim,
'NCELLDIM', mempath)
398 write (sc_name,
'(a,i0)') trim(sc_type)//
'_', n
402 emempaths(n) = mempath
412 dynamic_loader => static_loader%load(iout)
414 if (
associated(dynamic_loader))
then
415 errmsg =
'IDM unimplemented. Dynamic Exchanges not supported.'
419 call static_loader%destroy()
420 deallocate (static_loader)
426 do n = 1,
size(mnames)
427 if (model_loadmask(n) == 0)
then
430 call get_isize(
'NCELLDIM', mempath, isize)
432 call mem_setptr(ncelldim,
'NCELLDIM', mempath)
443 integer(I4B),
intent(inout) :: paramlog
465 ncid, iout)
result(model_dynamic_input)
467 character(len=*),
intent(in) :: modeltype
468 character(len=*),
intent(in) :: modelname
469 character(len=*),
intent(in) :: modelfname
470 character(len=*),
intent(in) :: nc_fname
471 integer(I4B),
intent(in) :: ncid
472 integer(I4B),
intent(in) :: iout
478 nullify (model_dynamic_input)
481 do id = 1, model_inputs%Count()
483 if (temp%modelname == modelname)
then
484 model_dynamic_input => temp
490 if (.not.
associated(model_dynamic_input))
then
491 allocate (model_dynamic_input)
492 call model_dynamic_input%init(modeltype, modelname, modelfname, &
493 nc_fname, ncid, iout)
503 integer(I4B),
intent(in) :: iout
506 do n = 1, model_inputs%Count()
508 call nc_close(model_dynamic_input%ncid, model_dynamic_input%nc_fname)
509 call model_dynamic_input%destroy()
510 deallocate (model_dynamic_input)
511 nullify (model_dynamic_input)
513 call model_inputs%Clear()
522 character(len=LENMEMPATH) :: simnam_mempath
523 integer(I4B) :: paramlog
524 integer(I4B),
pointer :: p
527 call mem_setptr(p,
'PRINT_INPUT', simnam_mempath)
538 character(len=LENMEMPATH) :: sim_mempath, simnam_mempath
543 integer(I4B),
pointer :: nummodels
544 integer(I4B),
pointer :: numexchanges
548 nullify (numexchanges)
555 call mem_setptr(mtypes,
'MTYPE', simnam_mempath)
556 call mem_setptr(etypes,
'EXGTYPE', simnam_mempath)
560 call mem_allocate(numexchanges,
'NUMEXCHANGES', sim_mempath)
563 nummodels =
size(mtypes)
564 numexchanges =
size(etypes)
572 character(len=LENMEMPATH),
intent(in) :: input_mempath
574 integer(I4B),
pointer :: intvar
577 call mem_allocate(intvar, idt%mf6varname, input_mempath)
579 select case (idt%mf6varname)
591 write (errmsg,
'(a,a)') &
592 'Idm SIMNAM Load default value setting '&
593 &
'is unhandled for this variable: ', &
607 character(len=LENMEMPATH),
intent(in) :: input_mempath
609 character(len=LINELENGTH),
pointer :: cstr
611 pointer,
contiguous :: acharstr1d
614 case (
'KEYWORD',
'INTEGER')
615 if (idt%in_record)
then
623 if (idt%in_record)
then
635 write (errmsg,
'(a,a)') &
636 'IdmLoad allocate simnam param unhandled datatype: ', &
650 character(len=LENMEMPATH) :: input_mempath
653 integer(I4B) :: iparam, isize
661 do iparam = 1,
size(mf6_input%param_dfns)
663 idt => mf6_input%param_dfns(iparam)
665 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
class(modeldynamicpkgstype) function, pointer dynamic_models(modeltype, modelname, modelfname, nc_fname, ncid, iout)
retrieve list of model dynamic loaders
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.
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.