2115 class(MawType),
intent(inout) :: this
2117 character(len=LINELENGTH) :: title
2118 character(len=LINELENGTH) :: text
2119 character(len=LINELENGTH) :: csteady
2120 character(len=LINELENGTH) :: str
2121 real(DP) :: auxvaldbl
2122 character(len=LENVARNAME) :: setting
2123 character(len=LINELENGTH) :: cstr
2124 character(len=LINELENGTH) :: errmsgr
2125 integer(I4B) :: node
2127 integer(I4B) :: ntabcols
2128 integer(I4B) :: ntabrows
2129 integer(I4B) :: imaw
2130 integer(I4B) :: ibnd
2132 integer(I4B) :: jpos
2134 integer(I4B) :: istat
2135 integer(I4B) :: iheadlimit_warning
2137 character(len=*),
parameter :: fmtlsp = &
2138 &
"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
2139 character(len=*),
parameter :: fmthdbot = &
2140 &
"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0, ').')"
2143 iheadlimit_warning = 0
2146 this%imawiss = this%gwfiss
2149 if (this%imawissopt == 1)
then
2154 this%nbound = this%maxbound
2157 if (this%iper ==
kper)
then
2160 if (this%iprpak /= 0)
then
2161 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2162 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
2163 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2164 call table_cr(this%inputtab, this%packName, title)
2165 call this%inputtab%table_df(1, 5, this%iout, finalize=.false.)
2167 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2169 call this%inputtab%initialize_column(text, 20, alignment=tableft)
2171 write (text,
'(a,1x,i6)')
'VALUE', jj
2172 call this%inputtab%initialize_column(text, 15, alignment=tabcenter)
2178 do n = 1, this%input%nbound
2179 imaw = this%input%ifno(n)
2180 if (imaw < 1 .or. imaw > this%nmawwells)
then
2181 write (errmsg,
'(2(a,1x),i0,a)') &
2182 'IMAW must be greater than 0 and', &
2183 'less than or equal to ', this%nmawwells,
'.'
2184 call store_error(errmsg)
2189 setting = this%input%setting(n)
2192 if (trim(setting) ==
'STATUS')
then
2193 str = this%input%status(n)
2194 this%status(imaw) = str(1:8)
2195 select case (trim(str))
2197 this%iboundpak(imaw) = -1
2199 this%iboundpak(imaw) = 0
2201 this%iboundpak(imaw) = 1
2203 write (errmsg,
'(2a)') &
2204 'Unknown '//trim(this%text)//
" maw status keyword: '", &
2206 call store_error(errmsg)
2211 call this%maw_set_period_value(n, imaw, setting)
2212 if (trim(setting) ==
'WELL_HEAD')
then
2213 if (this%well_head(imaw) < this%bot(imaw))
then
2214 write (cstr, fmthdbot) this%well_head(imaw), this%bot(imaw)
2215 call this%maw_set_attribute_error(imaw,
'WELL HEAD', trim(cstr))
2220 if (trim(setting) ==
'HEAD_LIMIT')
then
2221 str = this%input%head_limit(n)
2222 if (trim(str) ==
'OFF')
then
2223 this%shutofflevel(imaw) = dep20
2225 read (str, *, iostat=istat, iomsg=errmsgr) &
2226 this%shutofflevel(imaw)
2227 if (istat /= 0)
then
2228 errmsg =
'Could not read HEAD_LIMIT value. '//trim(errmsgr)
2229 call store_error(errmsg)
2231 if (this%shutofflevel(imaw) <= this%bot(imaw))
then
2232 iheadlimit_warning = iheadlimit_warning + 1
2238 if (trim(setting) ==
'FLOWING_WELL')
then
2239 this%fwelev(imaw) = this%input%fwelev(n)
2240 this%fwcond(imaw) = this%input%fwcond(n)
2241 this%fwrlen(imaw) = this%input%fwrlen(n)
2242 if (this%iflowingwells == 0)
then
2243 this%iflowingwells = -1
2244 text =
'Flowing well data is specified in the '// &
2245 trim(this%packName)//
' package but FLOWING_WELL was'// &
2246 ' not specified in the OPTIONS block.'
2247 call store_warning(text)
2252 if (trim(setting) ==
'SHUT_OFF')
then
2253 this%shutoffmin(imaw) = this%input%minrate(n)
2254 this%shutoffmax(imaw) = this%input%maxrate(n)
2258 if (trim(setting) ==
'RATE_SCALING')
then
2259 this%pumpelev(imaw) = this%input%pump_elevation(n)
2260 this%reduction_length(imaw) = this%input%scaling_length(n)
2261 if (this%reduction_length(imaw) < dzero)
then
2262 call this%maw_set_attribute_error(imaw,
'RATE_SCALING', &
2263 &
'must be greater than or equal to 0.')
2269 if (this%naux > 0)
then
2270 if (trim(setting) ==
'PERIOD_AUXILIARY')
then
2271 str = this%input%auxname(n)
2272 auxvaldbl = this%input%auxval(n)
2277 if (this%iprpak /= 0)
then
2278 call this%inputtab%add_term(imaw)
2279 if (trim(setting) ==
'PERIOD_AUXILIARY')
then
2280 call this%inputtab%add_term(
'AUXILIARY')
2282 call this%inputtab%add_term(trim(setting))
2284 select case (trim(setting))
2286 call this%inputtab%add_term(trim(str))
2287 call this%inputtab%add_term(
' ')
2288 call this%inputtab%add_term(
' ')
2290 call this%inputtab%add_term(this%rate(imaw))
2291 call this%inputtab%add_term(
' ')
2292 call this%inputtab%add_term(
' ')
2294 call this%inputtab%add_term(this%well_head(imaw))
2295 call this%inputtab%add_term(
' ')
2296 call this%inputtab%add_term(
' ')
2298 call this%inputtab%add_term(trim(str))
2299 call this%inputtab%add_term(
' ')
2300 call this%inputtab%add_term(
' ')
2301 case (
'FLOWING_WELL')
2302 call this%inputtab%add_term(this%fwelev(imaw))
2303 call this%inputtab%add_term(this%fwcond(imaw))
2304 call this%inputtab%add_term(this%fwrlen(imaw))
2306 call this%inputtab%add_term(this%shutoffmin(imaw))
2307 call this%inputtab%add_term(this%shutoffmax(imaw))
2308 call this%inputtab%add_term(
' ')
2309 case (
'RATE_SCALING')
2310 call this%inputtab%add_term(this%pumpelev(imaw))
2311 call this%inputtab%add_term(this%reduction_length(imaw))
2312 call this%inputtab%add_term(
' ')
2313 case (
'PERIOD_AUXILIARY')
2314 call this%inputtab%add_term(trim(str))
2315 call this%inputtab%add_term(auxvaldbl)
2316 call this%inputtab%add_term(
' ')
2318 call this%inputtab%add_term(
' ')
2319 call this%inputtab%add_term(
' ')
2320 call this%inputtab%add_term(
' ')
2324 if (this%iprpak /= 0)
then
2325 call this%inputtab%finalize_table()
2330 write (this%iout, fmtlsp) trim(this%filtyp)
2334 if (iheadlimit_warning > 0)
then
2335 write (warnmsg,
'(a,a,a,1x,a,1x,a)') &
2336 "HEAD_LIMIT in '", trim(this%packName),
"' was below the well bottom", &
2337 "for one or more multi-aquifer well(s). This may result in", &
2338 "convergence failures for some models."
2339 call store_warning(warnmsg, substring=warnmsg(:50))
2343 if (count_errors() > 0)
then
2348 if (this%check_attr /= 0)
then
2349 call this%maw_check_attributes()
2352 if (this%iprpak == 1)
then
2353 if (this%imawiss /= 0)
then
2354 csteady =
'STEADY-STATE '
2356 csteady =
'TRANSIENT '
2360 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2361 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2362 ' RATE DATA FOR PERIOD'
2363 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2365 call table_cr(this%inputtab, this%packName, title)
2366 call this%inputtab%table_df(this%nmawwells, ntabcols, this%iout)
2368 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2370 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2372 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2373 text =
'SPECIFIED HEAD'
2374 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2375 text =
'PUMP ELEVATION'
2376 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2377 text =
'REDUCTION LENGTH'
2378 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2379 do n = 1, this%nmawwells
2380 call this%inputtab%add_term(n)
2381 call this%inputtab%add_term(this%status(n))
2382 call this%inputtab%add_term(this%rate(n))
2383 if (this%iboundpak(n) < 0)
then
2384 call this%inputtab%add_term(this%well_head(n))
2386 call this%inputtab%add_term(
' ')
2388 call this%inputtab%add_term(this%pumpelev(n))
2389 if (this%reduction_length(n) /= dep20)
then
2390 call this%inputtab%add_term(this%reduction_length(n))
2392 call this%inputtab%add_term(
' ')
2397 if (this%iflowingwells > 0)
then
2400 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2401 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2402 ' FLOWING WELL DATA FOR PERIOD'
2403 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2406 do n = 1, this%nmawwells
2407 if (this%fwcond(n) > dzero)
then
2408 ntabrows = ntabrows + 1
2411 if (ntabrows > 0)
then
2412 call table_cr(this%inputtab, this%packName, title)
2413 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2415 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2417 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2419 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2420 text =
'REDUCTION LENGTH'
2421 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2422 do n = 1, this%nmawwells
2423 if (this%fwcond(n) > dzero)
then
2424 call this%inputtab%add_term(n)
2425 call this%inputtab%add_term(this%fwelev(n))
2426 call this%inputtab%add_term(this%fwcond(n))
2427 call this%inputtab%add_term(this%fwrlen(n))
2434 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2435 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2436 ' WELL SHUTOFF DATA FOR PERIOD'
2437 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2440 do n = 1, this%nmawwells
2441 if (this%shutofflevel(n) /= dep20)
then
2442 ntabrows = ntabrows + 1
2445 if (ntabrows > 0)
then
2446 call table_cr(this%inputtab, this%packName, title)
2447 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2449 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2451 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2453 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2455 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2456 do n = 1, this%nmawwells
2457 if (this%shutofflevel(n) /= dep20)
then
2458 call this%inputtab%add_term(n)
2459 call this%inputtab%add_term(this%shutofflevel(n))
2460 call this%inputtab%add_term(this%shutoffmin(n))
2461 call this%inputtab%add_term(this%shutoffmax(n))
2470 do n = 1, this%nmawwells
2471 do j = 1, this%ngwfnodes(n)
2472 jpos = this%get_jpos(n, j)
2473 node = this%get_gwfnode(n, j)
2474 this%nodelist(ibnd) = node
2475 this%bound(1, ibnd) = this%xnewpak(n)
2476 this%bound(2, ibnd) = this%satcond(jpos)
2477 this%bound(3, ibnd) = this%botscrn(jpos)
2478 if (this%iboundpak(n) > 0)
then
2479 this%bound(4, ibnd) = this%rate(n)
2481 this%bound(4, ibnd) = dzero
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This class is used to store a single deferred-length character string. It was designed to work in an ...