41 integer(I4B),
pointer :: iper => null()
42 integer(I4B),
pointer :: ionper => null()
58 subroutine input_load(filename, mf6_input, component_filename, iout, nc_vars)
60 character(len=*),
intent(in) :: filename
62 character(len=*),
intent(in) :: component_filename
63 integer(I4B),
intent(in) :: iout
68 integer(I4B) :: inunit
70 if (
present(nc_vars))
then
71 netcdf_vars => nc_vars
77 inunit =
open_mf6file(mf6_input%pkgtype, filename, component_filename, iout)
81 call parser%Initialize(inunit, iout)
84 call loader%load(parser, mf6_input, netcdf_vars, filename, iout)
95 subroutine static_init(this, mf6_input, component_name, component_input_name, &
99 character(len=*),
intent(in) :: component_name
100 character(len=*),
intent(in) :: component_input_name
101 character(len=*),
intent(in) :: input_name
103 call this%StaticPkgLoadType%init(mf6_input, component_name, &
104 component_input_name, input_name)
111 integer(I4B),
intent(in) :: iout
119 if (this%iperblock > 0)
then
121 allocate (mf6_loader)
123 mf6_loader%nc_vars => this%nc_vars
125 nullify (this%nc_vars)
127 call mf6_loader%init(this%mf6_input, this%component_name, &
128 this%component_input_name, this%input_name, &
129 this%iperblock, iout)
131 rp_loader => mf6_loader
134 call input_load(this%input_name, this%mf6_input, &
135 this%component_input_name, iout, this%nc_vars)
144 call this%StaticPkgLoadType%destroy()
149 subroutine dynamic_init(this, mf6_input, component_name, component_input_name, &
150 input_name, iperblock, iout)
156 character(len=*),
intent(in) :: component_name
157 character(len=*),
intent(in) :: component_input_name
158 character(len=*),
intent(in) :: input_name
159 integer(I4B),
intent(in) :: iperblock
160 integer(I4B),
intent(in) :: iout
161 integer(I4B) :: inunit
164 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
165 component_input_name, input_name, &
169 call mem_allocate(this%ionper,
'IONPER', mf6_input%mempath)
177 component_input_name, iout)
180 allocate (this%parser)
181 call this%parser%Initialize(inunit, iout)
184 call this%create_loader()
192 call this%rp_loader%df()
194 call this%read_ionper()
202 call this%rp_loader%ad()
212 if (this%ionper /=
kper)
return
215 call this%rp_loader%rp(this%parser)
222 call this%read_ionper()
224 this%ionper =
nper + 1
233 character(len=LINELENGTH) :: line
234 logical(LGP) :: isblockfound
236 character(len=*),
parameter :: fmtblkerr = &
237 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
239 call this%parser%GetBlock(
'PERIOD', isblockfound, ierr, &
240 supportopenclose=.true., &
241 blockrequired=.false.)
243 if (isblockfound)
then
244 this%ionper = this%parser%GetInteger()
245 if (this%ionper <= this%iper)
then
246 write (
errmsg,
'(a, i0, a, i0, a, i0, a)') &
247 'Error in stress period ',
kper, &
248 '. Period numbers not increasing. Found ', this%ionper, &
249 ' but last period block was assigned ', this%iper,
'.'
251 call this%parser%StoreErrorUnit()
257 this%ionper =
nper + 1
260 call this%parser%GetCurrentLine(line)
261 write (
errmsg, fmtblkerr) adjustl(trim(line))
263 call this%parser%StoreErrorUnit()
280 if (this%mf6_input%subcomponent_type ==
'STO')
then
281 allocate (sto_loader)
282 this%rp_loader => sto_loader
283 else if (this%readasarrays)
then
284 allocate (bndgrid_loader)
285 this%rp_loader => bndgrid_loader
287 allocate (bndlist_loader)
288 this%rp_loader => bndlist_loader
292 this%rp_loader%nc_vars => this%nc_vars
295 call this%rp_loader%ainit(this%mf6_input, &
296 this%component_name, &
297 this%component_input_name, &
315 nullify (this%rp_loader%nc_vars)
316 call this%rp_loader%destroy()
317 deallocate (this%rp_loader)
320 call this%parser%clear()
321 deallocate (this%parser)
324 call this%DynamicPkgLoadType%destroy()
329 function open_mf6file(filetype, filename, component_fname, iout)
result(inunit)
331 character(len=*),
intent(in) :: filetype
332 character(len=*),
intent(in) :: filename
333 character(len=*),
intent(in) :: component_fname
334 integer(I4B),
intent(in) :: iout
335 integer(I4B) :: inunit
340 if (filename /=
'')
then
343 call openfile(inunit, iout, trim(adjustl(filename)), filetype, &
344 'FORMATTED',
'SEQUENTIAL',
'OLD')
346 write (
errmsg,
'(a,a,a)') &
347 'File unspecified, cannot load model or package &
348 &type "', trim(filetype),
'".'
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename)
Return parameter definition.
This module contains the IdmMf6FileModule.
subroutine dynamic_df(this)
define routine for dynamic loader
integer(i4b) function, public open_mf6file(filetype, filename, component_fname, iout)
open a model package files
subroutine dynamic_create_loader(this)
allocate a dynamic loader based on load context
subroutine dynamic_destroy(this)
dynamic loader destroy
subroutine dynamic_init(this, mf6_input, component_name, component_input_name, input_name, iperblock, iout)
dynamic loader init
subroutine, public input_load(filename, mf6_input, component_filename, iout, nc_vars)
input load for traditional mf6 simulation static input file
subroutine dynamic_ad(this)
advance routine for dynamic loader
subroutine static_destroy(this)
static loader destroy
subroutine dynamic_rp(this)
read and prepare routine for dynamic loader
subroutine static_init(this, mf6_input, component_name, component_input_name, input_name)
static loader init
subroutine dynamic_read_ionper(this)
dynamic loader read ionper of next period block
class(dynamicpkgloadbasetype) function, pointer static_load(this, iout)
load routine for static loader
This module defines variable data types.
This module contains the LoadMf6FileModule.
This module contains the NCFileVarsModule.
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
integer(i4b), pointer, public kper
current stress period number
integer(i4b), pointer, public nper
number of stress period
MF6File dynamic loader type.
MF6File static loader type.
Static parser based input loader.
Type describing input variables for a package in NetCDF file.