23 character(len=LENMODELNAME) :: modelname
25 character(len=LINELENGTH),
pointer :: grid => null()
26 character(len=LINELENGTH),
pointer :: nc_fname => null()
27 integer(I4B),
pointer :: ncid => null()
37 character(LINELENGTH) :: pkgname
38 character(LINELENGTH) :: tagname
49 character(len=LINELENGTH),
pointer :: grid => null()
50 character(len=LINELENGTH),
pointer :: nc_fname => null()
51 integer(I4B),
pointer :: ncid => null()
65 character(len=*),
intent(in) :: modelname
67 this%modelname = modelname
74 character(len=*),
intent(in) :: tagname
75 integer(I4B),
optional :: layer
76 integer(I4B),
optional :: iaux
78 integer(I4B) :: n, l, p, a
88 if (
present(layer))
then
93 if (
present(iaux))
then
97 do n = 1, this%nc_vars%Count()
99 if (nc_var%tagname == tagname .and. &
100 nc_var%layer == l .and. &
101 nc_var%iaux == a)
then
107 if (varid == -1)
then
108 if (this%nc_fname /=
'')
then
110 'NetCDF variable not found, tagname="'//trim(tagname)//
'"'
111 if (
present(layer))
then
112 write (
errmsg,
'(a,i0)') trim(
errmsg)//
', layer=', layer
114 if (
present(iaux))
then
122 'NetCDF variable not found, tagname="'//trim(tagname)// &
123 '". NetCDF input not provided for model "'//trim(this%modelname)//
'".'
136 do n = 1, this%nc_vars%Count()
141 call this%nc_vars%Clear()
146 subroutine fv_init(this, modelname, nc_fname, ncid, grid)
152 character(len=*),
intent(in) :: modelname
153 character(len=*),
intent(in) :: nc_fname
154 integer(I4B),
intent(in) :: ncid
155 character(len=*),
intent(in) :: grid
156 character(len=LENMEMPATH) :: mempath
166 call mem_allocate(this%grid, ilen,
'NETCDF_GRID', mempath)
167 call mem_allocate(this%nc_fname, ilen,
'NETCDF_FNAME', mempath)
172 this%nc_fname = nc_fname
178 subroutine fv_add(this, pkgname, tagname, layer, iaux, varid)
181 character(len=*),
intent(in) :: pkgname
182 character(len=*),
intent(in) :: tagname
183 integer(I4B),
intent(in) :: layer
184 integer(I4B),
intent(in) :: iaux
185 integer(I4B),
intent(in) :: varid
187 class(*),
pointer :: obj
190 invar%pkgname = pkgname
191 invar%tagname = tagname
196 call this%mf6invar%Add(obj)
205 do n = 1, this%mf6invar%Count()
210 call this%mf6invar%Clear()
217 character(len=*),
intent(in) :: modelname
218 character(len=*),
intent(in) :: pkgname
222 class(*),
pointer :: obj
224 do n = 1, this%mf6invar%count()
226 if (invar%pkgname == pkgname)
then
229 nc_var%pkgname = invar%pkgname
230 nc_var%tagname = invar%tagname
231 nc_var%layer = invar%layer
232 nc_var%iaux = invar%iaux
233 nc_var%varid = invar%varid
235 call nc_vars%nc_vars%Add(obj)
240 nc_vars%modelname = modelname
243 nc_vars%ncid => this%ncid
244 nc_vars%nc_fname => this%nc_fname
245 nc_vars%grid => this%grid
252 integer(I4B),
intent(in) :: idx
254 class(*),
pointer :: obj
260 obj => nc_vars%GetItem(idx)
261 if (
associated(obj))
then
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 lenmempath
maximum length of the memory path
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the NCFileVarsModule.
subroutine create_varlists(this, modelname, pkgname, nc_vars)
create list of variables that correspond to a package
subroutine fv_init(this, modelname, nc_fname, ncid, grid)
initialize netcdf model variable description type
class(ncfilemf6vartype) function, pointer ncvar_get(nc_vars, idx)
get modflow6 input variable description at position idx
subroutine fv_destroy(this)
destroy netcdf model variable description type
subroutine ncvars_destroy(this)
destroy netcdf package variable lists
integer(i4b) function ncvars_varid(this, tagname, layer, iaux)
return a netcdf variable id for a package tagname
subroutine fv_add(this, pkgname, tagname, layer, iaux, varid)
add netcdf modflow6 input variable to list
subroutine ncvars_init(this, modelname)
create netcdf package variable lists
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
A generic heterogeneous doubly-linked list.
Type which describes a modflow input variable in a netcdf file.
Type describing modflow6 input variables in model NetCDF file.
Type describing input variables for a package in NetCDF file.