34 component_name, subcomponent_name, input_type, &
35 load_scope, input_fname, component_fname, &
40 character(len=*),
intent(in) :: component_type
41 character(len=*),
intent(in) :: subcomponent_type
42 character(len=*),
intent(in) :: component_name
43 character(len=*),
intent(in) :: subcomponent_name
44 character(len=*),
intent(in) :: input_type
45 character(len=*),
intent(in) :: load_scope
46 character(len=*),
intent(in) :: input_fname
47 character(len=*),
intent(in) :: component_fname
51 character(len=LENPACKAGENAME) :: source_type
52 character(len=LENPACKAGENAME) :: sc_name
58 mf6_input =
getmodflowinput(input_type, component_type, subcomponent_type, &
59 component_name, sc_name, load_scope, &
68 call loader%init(mf6_input, component_name, component_fname, input_fname)
71 if (
present(nc_vars))
then
72 call nc_vars%create_varlists(component_name, sc_name, loader%nc_vars)
74 call loader%nc_vars%init(component_name)
83 character(len=*),
intent(inout) :: source_type
91 select case (source_type)
93 allocate (mf6file_loader)
94 loader => mf6file_loader
95 allocate (loader%nc_vars)
98 'Simulation package input source type "'//trim(source_type)// &
99 '" not currently supported.'
107 character(len=*),
intent(in) :: pkgtype
108 character(len=*),
intent(in) :: filename
109 character(len=*),
intent(in) :: modelfname
110 integer(I4B),
intent(in) ::
iout
112 character(len=LENPACKAGENAME) :: source_type
120 select case (source_type)
131 character(len=*),
intent(in) :: mtype
132 character(len=*),
intent(in) :: mfname
133 character(len=*),
intent(in) :: mname
134 integer(I4B),
intent(in) :: iout
136 character(len=LENPACKAGENAME) :: source_type
143 mname,
'NAM',
'SIM', mfname)
144 select case (source_type)
158 character(len=LINELENGTH) :: hpc6_filename
159 character(len=LINELENGTH) :: line
160 logical(LGP) :: lexist
163 inquire (file=trim(adjustl(
simfile)), exist=lexist)
167 write (line,
'(2(1x,a))')
'Using Simulation name file:', &
171 mf6_input =
getmodflowinput(
'NAM6',
'SIM',
'NAM',
'SIM',
'NAM',
'ROOT', &
176 if (
filein_fname(hpc6_filename,
'HPC6_FILENAME', mf6_input%mempath, &
191 character(len=LENMEMPATH) :: input_mempath
193 character(len=LENPACKAGENAME) :: source_type
194 character(len=:),
pointer :: tdis6
195 logical(LGP) :: lexist
201 call mem_setptr(tdis6,
'TDIS6', input_mempath)
204 if (tdis6 /=
'')
then
207 select case (source_type)
209 inquire (file=trim(adjustl(tdis6)), exist=lexist)
213 'SIM',
'TDIS',
'SIM', simfile)
215 call input_load(tdis6, mf6_input, simfile, iout)
217 write (errmsg,
'(a)') &
218 'Simulation TIMING input file "'//trim(tdis6)// &
233 character(len=*),
intent(in) :: mtype
234 character(len=*),
intent(in) :: mfname
235 integer(I4B) :: ncelldim
236 character(len=LENPACKAGENAME) :: source_type
238 integer(I4B) :: ierr, inunit
239 logical(LGP) :: isfound, endofblock
240 character(len=LINELENGTH) :: ptype
247 select case (source_type)
251 call openfile(inunit, 0, trim(adjustl(mfname)), mtype, &
252 'FORMATTED',
'SEQUENTIAL',
'OLD')
254 call parser%Initialize(inunit, 0)
256 call parser%GetBlock(
'OPTIONS', isfound, ierr, &
257 supportopenclose=.true., blockrequired=.false.)
261 call parser%GetNextLine(endofblock)
266 call parser%GetBlock(
'PACKAGES', isfound, ierr, &
267 supportopenclose=.true., blockrequired=.true.)
271 call parser%GetNextLine(endofblock)
273 call parser%GetStringCaps(ptype)
290 'Unknown discretization type "'//trim(ptype)// &
291 '" not currently supported.'
306 #if defined(__WITH_NETCDF__)
312 #if defined(__WITH_NETCDF__)
316 'Model namefile NETCDF_STUCTURED or NETCDF_MESH2D option configured &
317 &but NetCDF libraries are not available.'
347 #if defined(__WITH_NETCDF__)
350 integer(I4B),
intent(in) :: ncid
351 character(len=*),
intent(in) :: nc_fname
353 #if defined(__WITH_NETCDF__)
362 modelfname, iout)
result(nc_vars)
366 #if defined(__WITH_NETCDF__)
369 character(len=*),
intent(in) :: modeltype
370 character(len=*),
intent(in) :: component_type
371 character(len=*),
intent(in) :: modelname
372 character(len=*),
intent(in) :: modelfname
373 integer(I4B),
intent(in) :: iout
375 character(len=LENMEMPATH) :: input_mempath
376 character(len=LINELENGTH) :: nc_fname
386 if (
filein_fname(nc_fname,
'NETCDF_FNAME', input_mempath, modelfname))
then
387 #if defined(__WITH_NETCDF__)
392 nc_vars, nc_fname, ncid, iout)
394 write (errmsg,
'(a)') &
395 'Cannot load model packages. NetCDF &
396 &keyword specified in input file but &
397 &NetCDF libraries are not available.'
403 call nc_vars%init(modelname,
'', ncid,
'')
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenmodelname
maximum length of the model name
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter lenpackagetype
maximum length of a package type (DIS6, SFR6, CSUB6, etc.)
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
integer(i4b), parameter lenmempath
maximum length of the memory path
This module contains the IdmMf6FileModule.
integer(i4b) function, public open_mf6file(filetype, filename, component_fname, iout)
open a model package files
subroutine, public input_load(filename, mf6_input, component_filename, iout, nc_vars)
input load for traditional mf6 simulation static input file
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
Store and issue logging messages to output units.
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
This module contains the ModelExportModule.
subroutine, public modelexports_post_prepare()
export model list post prepare step
subroutine, public modelexports_destroy()
destroy export model list
subroutine, public modelexports_post_step()
export model list post step
subroutine, public modelexports_create(iout)
create export container variable for all local models
logical(lgp) function, public nc_export_active()
is netcdf export configured for any model
This module contains the NCContextBuildModule.
integer(i4b) function, public open_ncfile(nc_fname, iout)
open netcdf file
subroutine, public create_netcdf_context(modeltype, modelname, input_name, nc_vars, nc_fname, ncid, iout)
create internal description of modflow6 input variables in netcdf file
This module contains the NCExportCreateModule.
subroutine, public nc_export_create()
initialize netcdf model export type
This module contains the NCFileVarsModule.
This module contains the NetCDFCommonModule.
subroutine, public nc_fclose(ncid, nc_fname)
Close netcdf file.
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
integer(i4b) iout
file unit number for simulation output
character(len=linelength) simfile
simulation name file
This module contains the SourceCommonModule.
character(len=lenpackagename) function, public package_source_type(sourcename)
source identifier from model namfile FNAME array
character(len=lencomponentname) function, public idm_component_type(component)
component from package or model type
character(len=lenpackagename) function, public idm_subcomponent_name(component_type, subcomponent_type, sc_name)
model package subcomponent name
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
This module contains the SourceLoadModule.
subroutine, public export_da()
deallocate model export objects and list
subroutine, public load_simnam()
integer(i4b) function, public open_source_file(pkgtype, filename, modelfname, iout)
class(staticpkgloadbasetype) function, pointer, public create_input_loader(component_type, subcomponent_type, component_name, subcomponent_name, input_type, load_scope, input_fname, component_fname, nc_vars)
factory function to create and setup model package static loader
subroutine, public load_simtdis()
class(staticpkgloadbasetype) function, pointer package_loader(source_type)
allocate source model package static loader
subroutine, public export_cr()
create model exports list
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
subroutine, public export_post_prepare()
model exports post prepare step actions
integer(i4b) function, public remote_model_ndim(mtype, mfname)
subroutine, public export_post_step()
model exports post step actions
subroutine, public load_modelnam(mtype, mfname, mname, iout)
MF6File static loader type.
Type describing modflow6 input variables in model NetCDF file.