26 character(len=LENMODELNAME) :: name_model =
''
27 character(len=LENPACKAGENAME) :: packname =
''
28 character(len=LENMEMPATH) :: memorypath =
''
29 character(len=LENMEMPATH) :: memorypathmodel =
''
31 character(len=LENMEMPATH) :: input_mempath =
''
32 character(len=LINELENGTH),
pointer :: input_fname => null()
33 character(len=LENFTYPE) :: filtyp =
''
34 character(len=LENFTYPE),
pointer :: package_type => null()
37 integer(I4B),
pointer :: id => null()
38 integer(I4B),
pointer :: inunit => null()
39 integer(I4B),
pointer :: iout => null()
40 integer(I4B),
pointer :: inewton => null()
41 integer(I4B),
pointer :: iasym => null()
42 integer(I4B),
pointer :: iprpak => null()
43 integer(I4B),
pointer :: iprflow => null()
44 integer(I4B),
pointer :: ipakcb => null()
45 integer(I4B),
pointer :: ionper => null()
46 integer(I4B),
pointer :: lastonper => null()
69 subroutine set_names(this, ibcnum, name_model, pakname, ftype, input_mempath)
72 integer(I4B),
intent(in) :: ibcnum
73 character(len=*),
intent(in) :: name_model
74 character(len=*),
intent(in) :: pakname
75 character(len=*),
intent(in) :: ftype
76 character(len=*),
optional,
intent(in) :: input_mempath
80 this%name_model = name_model
81 if (
present(input_mempath)) this%input_mempath = input_mempath
82 if (pakname ==
'')
then
83 write (this%packName,
'(a, i0)') trim(ftype)//
'-', ibcnum
87 if (index(trim(pakname),
' ') > 0)
then
88 errmsg =
'Package name contains spaces: '//trim(pakname)
90 errmsg =
'Remove spaces from name.'
94 this%packName = pakname
112 integer(I4B),
pointer :: imodelnewton => null()
113 integer(I4B),
pointer :: imodelprpak => null()
114 integer(I4B),
pointer :: imodelprflow => null()
115 integer(I4B),
pointer :: imodelpakcb => null()
116 logical(LGP) :: found
124 call mem_allocate(this%inunit,
'INUNIT', this%memoryPath)
126 call mem_allocate(this%inewton,
'INEWTON', this%memoryPath)
128 call mem_allocate(this%iprpak,
'IPRPAK', this%memoryPath)
129 call mem_allocate(this%iprflow,
'IPRFLOW', this%memoryPath)
130 call mem_allocate(this%ipakcb,
'IPAKCB', this%memoryPath)
132 call mem_allocate(this%ionper,
'IONPER', this%memoryPath)
133 call mem_allocate(this%lastonper,
'LASTONPER', this%memoryPath)
136 call mem_setptr(imodelnewton,
'INEWTON', this%memoryPathModel)
137 call mem_setptr(imodelprpak,
'IPRPAK', this%memoryPathModel)
138 call mem_setptr(imodelprflow,
'IPRFLOW', this%memoryPathModel)
139 call mem_setptr(imodelpakcb,
'IPAKCB', this%memoryPathModel)
142 this%input_fname =
''
143 this%package_type = this%filtyp
147 this%inewton = imodelnewton
149 this%iprpak = imodelprpak
150 this%iprflow = imodelprflow
151 this%ipakcb = imodelpakcb
156 imodelnewton => null()
157 imodelprpak => null()
158 imodelprflow => null()
159 imodelpakcb => null()
162 if (this%input_mempath /=
'')
then
164 this%input_mempath, found)
180 call mem_deallocate(this%input_fname,
'INPUT_FNAME', this%memoryPath)
181 call mem_deallocate(this%package_type,
'PACKAGE_TYPE', this%memoryPath)
209 this%lastonper = this%ionper
210 this%ionper = this%parser%GetInteger()
213 if (this%ionper <= this%lastonper)
then
214 write (
errmsg,
'(a, i0, a, i0, a, i0, a)') &
215 'Error in stress period ',
kper, &
216 '. Period numbers not increasing. Found ', this%ionper, &
217 ' but last period block was assigned ', this%lastonper,
'.'
219 call this%parser%StoreErrorUnit()
233 character(len=24),
dimension(:),
intent(in) :: tags
234 logical,
dimension(:),
intent(inout) :: lfound
235 character(len=24),
dimension(:),
intent(in),
optional :: varinames
238 logical :: endOfBlock
239 integer(I4B) :: nsize
241 character(len=24) :: tmpvar
242 character(len=LENVARNAME) :: varname
243 character(len=LINELENGTH) :: keyword
244 character(len=:),
allocatable :: line
245 integer(I4B) :: istart, istop, lloc
246 integer(I4B),
dimension(:),
pointer,
contiguous :: aint
247 real(DP),
dimension(:),
pointer,
contiguous :: adbl
252 call this%parser%GetNextLine(endofblock)
254 call this%parser%GetStringCaps(keyword)
255 call this%parser%GetRemainingLine(line)
258 tag_iter:
do j = 1, nsize
259 if (trim(adjustl(keyword)) == trim(adjustl(tags(j))))
then
262 if (
present(varinames))
then
263 tmpvar = adjustl(varinames(j))
265 tmpvar = adjustl(tags(j))
268 if (keyword(1:1) ==
'I')
then
269 call mem_setptr(aint, trim(varname), trim(this%memoryPath))
270 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
271 this%parser%iuactive, aint, tags(j))
273 call mem_setptr(adbl, trim(varname), trim(this%memoryPath))
274 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
275 this%parser%iuactive, adbl, tags(j))
280 if (.not. lkeyword)
then
281 write (
errmsg,
'(a,a)')
'Unknown GRIDDATA tag: ', &
284 call this%parser%StoreErrorUnit()
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 lenvarname
maximum length of a variable name
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 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 base numerical package type.
subroutine get_block_data(this, tags, lfound, varinames)
@ brief Read griddata block for a package
subroutine read_check_ionper(this)
@ brief Check ionper
subroutine set_names(this, ibcnum, name_model, pakname, ftype, input_mempath)
@ brief Set package names
subroutine allocate_scalars(this)
@ brief Allocate package scalars
subroutine da(this)
@ brief Deallocate package scalars
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b), pointer, public kper
current stress period number