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
56 mf6_input =
getmodflowinput(input_type, component_type, subcomponent_type, &
57 component_name, sc_name, input_fname)
65 call loader%init(mf6_input, component_name, component_fname, input_fname)
68 if (
present(nc_vars))
then
69 call nc_vars%create_varlists(component_name, sc_name, loader%nc_vars)
71 call loader%nc_vars%init(component_name)
80 character(len=*),
intent(inout) :: source_type
88 select case (source_type)
90 allocate (mf6file_loader)
91 loader => mf6file_loader
92 allocate (loader%nc_vars)
95 'Simulation package input source type "'//trim(source_type)// &
96 '" not currently supported.'
104 character(len=*),
intent(in) :: pkgtype
105 character(len=*),
intent(in) :: filename
106 character(len=*),
intent(in) :: modelfname
107 integer(I4B),
intent(in) ::
iout
109 character(len=LENPACKAGENAME) :: source_type
117 select case (source_type)
128 character(len=*),
intent(in) :: mtype
129 character(len=*),
intent(in) :: mfname
130 character(len=*),
intent(in) :: mname
131 integer(I4B),
intent(in) :: iout
133 character(len=LENPACKAGENAME) :: source_type
140 mname,
'NAM', mfname)
141 select case (source_type)
155 character(len=LINELENGTH) :: hpc6_filename
156 character(len=LINELENGTH) :: line
157 logical(LGP) :: lexist
160 inquire (file=trim(adjustl(
simfile)), exist=lexist)
164 write (line,
'(2(1x,a))')
'Using Simulation name file:', &
172 if (
filein_fname(hpc6_filename,
'HPC6_FILENAME', mf6_input%mempath, &
187 character(len=LENMEMPATH) :: input_mempath
189 character(len=LENPACKAGENAME) :: source_type
190 character(len=:),
pointer :: tdis6
191 logical(LGP) :: lexist
197 call mem_setptr(tdis6,
'TDIS6', input_mempath)
200 if (tdis6 /=
'')
then
203 select case (source_type)
205 inquire (file=trim(adjustl(tdis6)), exist=lexist)
209 'SIM',
'TDIS', simfile)
211 call input_load(tdis6, mf6_input, simfile, iout)
213 write (errmsg,
'(a)') &
214 'Simulation TIMING input file "'//trim(tdis6)// &
229 character(len=*),
intent(in) :: mtype
230 character(len=*),
intent(in) :: mfname
231 integer(I4B) :: ncelldim
232 character(len=LENPACKAGENAME) :: source_type
234 integer(I4B) :: ierr, inunit
235 logical(LGP) :: isfound, endofblock
236 character(len=LINELENGTH) :: ptype
243 select case (source_type)
247 call openfile(inunit, 0, trim(adjustl(mfname)), mtype, &
248 'FORMATTED',
'SEQUENTIAL',
'OLD')
250 call parser%Initialize(inunit, 0)
252 call parser%GetBlock(
'OPTIONS', isfound, ierr, &
253 supportopenclose=.true., blockrequired=.false.)
257 call parser%GetNextLine(endofblock)
262 call parser%GetBlock(
'PACKAGES', isfound, ierr, &
263 supportopenclose=.true., blockrequired=.true.)
267 call parser%GetNextLine(endofblock)
269 call parser%GetStringCaps(ptype)
286 'Unknown discretization type "'//trim(ptype)// &
287 '" not currently supported.'
302 #if defined(__WITH_NETCDF__)
308 #if defined(__WITH_NETCDF__)
312 'Model namefile NETCDF_STUCTURED or NETCDF_MESH2D option configured &
313 &but NetCDF libraries are not available.'
343 #if defined(__WITH_NETCDF__)
346 integer(I4B),
intent(in) :: ncid
347 character(len=*),
intent(in) :: nc_fname
349 #if defined(__WITH_NETCDF__)
358 modelfname, iout)
result(nc_vars)
362 #if defined(__WITH_NETCDF__)
365 character(len=*),
intent(in) :: modeltype
366 character(len=*),
intent(in) :: component_type
367 character(len=*),
intent(in) :: modelname
368 character(len=*),
intent(in) :: modelfname
369 integer(I4B),
intent(in) :: iout
371 character(len=LENMEMPATH) :: input_mempath
372 character(len=LINELENGTH) :: nc_fname
382 if (
filein_fname(nc_fname,
'NETCDF_FNAME', input_mempath, modelfname))
then
383 #if defined(__WITH_NETCDF__)
388 nc_vars, nc_fname, ncid, iout)
390 write (errmsg,
'(a)') &
391 'Cannot load model packages. NetCDF &
392 &keyword specified in input file but &
393 &NetCDF libraries are not available.'
399 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.