34 component_name, subcomponent_name, input_type, &
35 input_fname, component_fname, nc_vars) &
39 character(len=*),
intent(in) :: component_type
40 character(len=*),
intent(in) :: subcomponent_type
41 character(len=*),
intent(in) :: component_name
42 character(len=*),
intent(in) :: subcomponent_name
43 character(len=*),
intent(in) :: input_type
44 character(len=*),
intent(in) :: input_fname
45 character(len=*),
intent(in) :: component_fname
49 character(len=LENPACKAGENAME) :: source_type
50 character(len=LENPACKAGENAME) :: sc_name
57 mf6_input =
getmodflowinput(input_type, component_type, subcomponent_type, &
58 component_name, sc_name, input_fname)
67 call loader%init(mf6_input, component_name, component_fname, input_fname)
70 if (
present(nc_vars))
then
71 call nc_vars%create_varlists(component_name, sc_name, loader%nc_vars)
73 call loader%nc_vars%init(component_name)
85 character(len=*),
intent(inout) :: source_type
93 select case (source_type)
95 allocate (mf6file_loader)
96 loader => mf6file_loader
97 allocate (loader%nc_vars)
100 'Simulation package input source type "'//trim(source_type)// &
101 '" not currently supported.'
112 character(len=*),
intent(in) :: pkgtype
113 character(len=*),
intent(in) :: filename
114 character(len=*),
intent(in) :: modelfname
115 integer(I4B),
intent(in) ::
iout
117 character(len=LENPACKAGENAME) :: source_type
125 select case (source_type)
139 character(len=*),
intent(in) :: mtype
140 character(len=*),
intent(in) :: mfname
141 character(len=*),
intent(in) :: mname
142 integer(I4B),
intent(in) :: iout
144 character(len=LENPACKAGENAME) :: source_type
151 mname,
'NAM', mfname)
153 select case (source_type)
170 character(len=LINELENGTH) :: hpc6_filename
171 character(len=LINELENGTH) :: line
175 inquire (file=trim(adjustl(
simfile)), exist=lexist)
180 write (line,
'(2(1x,a))')
'Using Simulation name file:', &
191 if (
filein_fname(hpc6_filename,
'HPC6_FILENAME', mf6_input%mempath, &
212 character(len=LENMEMPATH) :: input_mempath
214 character(len=LENPACKAGENAME) :: source_type
215 character(len=:),
pointer :: tdis6
222 call mem_setptr(tdis6,
'TDIS6', input_mempath)
225 if (tdis6 /=
'')
then
230 select case (source_type)
233 inquire (file=trim(adjustl(tdis6)), exist=lexist)
239 'SIM',
'TDIS', simfile)
242 call input_load(tdis6, mf6_input, simfile, iout)
245 write (errmsg,
'(a)') &
246 'Simulation TIMING input file "'//trim(tdis6)// &
264 character(len=*),
intent(in) :: mtype
265 character(len=*),
intent(in) :: mfname
266 integer(I4B) :: ncelldim
267 character(len=LENPACKAGENAME) :: source_type
269 integer(I4B) :: ierr, inunit
270 logical(LGP) :: isfound, endofblock
271 character(len=LINELENGTH) :: ptype
279 select case (source_type)
284 call openfile(inunit, 0, trim(adjustl(mfname)), mtype, &
285 'FORMATTED',
'SEQUENTIAL',
'OLD')
288 call parser%Initialize(inunit, 0)
291 call parser%GetBlock(
'OPTIONS', isfound, ierr, &
292 supportopenclose=.true., blockrequired=.false.)
296 call parser%GetNextLine(endofblock)
302 call parser%GetBlock(
'PACKAGES', isfound, ierr, &
303 supportopenclose=.true., blockrequired=.true.)
307 call parser%GetNextLine(endofblock)
310 call parser%GetStringCaps(ptype)
327 'Unknown discretization type "'//trim(ptype)// &
328 '" not currently supported.'
348 #if defined(__WITH_NETCDF__)
355 #if defined(__WITH_NETCDF__)
359 'Model namefile EXPORT_NETCDF option configured but NetCDF libraries are &
393 #if defined(__WITH_NETCDF__)
396 integer(I4B),
intent(in) :: ncid
397 character(len=*),
intent(in) :: nc_fname
400 #if defined(__WITH_NETCDF__)
411 modelfname, iout)
result(nc_vars)
415 #if defined(__WITH_NETCDF__)
419 character(len=*),
intent(in) :: modeltype
420 character(len=*),
intent(in) :: component_type
421 character(len=*),
intent(in) :: modelname
422 character(len=*),
intent(in) :: modelfname
423 integer(I4B),
intent(in) :: iout
427 character(len=LENMEMPATH) :: input_mempath
428 character(len=LINELENGTH) :: nc_fname
438 if (
filein_fname(nc_fname,
'NETCDF_FNAME', input_mempath, modelfname))
then
439 #if defined(__WITH_NETCDF__)
446 nc_vars, nc_fname, ncid, iout)
449 write (errmsg,
'(a)') &
450 'Cannot load model packages. NetCDF &
451 &keyword specified in input file but &
452 &NetCDF libraries are not available.'
458 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)
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
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)
MF6File static loader type.
Type describing modflow6 input variables in model NetCDF file.