2077 class(MawType),
intent(inout) :: this
2079 character(len=LINELENGTH) :: title
2080 character(len=LINELENGTH) :: text
2081 character(len=LINELENGTH) :: csteady
2082 character(len=LINELENGTH) :: str
2083 real(DP) :: auxvaldbl
2084 character(len=LENVARNAME) :: setting
2085 character(len=LINELENGTH) :: cstr
2086 character(len=LINELENGTH) :: errmsgr
2087 integer(I4B) :: node
2089 integer(I4B) :: ntabcols
2090 integer(I4B) :: ntabrows
2091 integer(I4B) :: imaw
2092 integer(I4B) :: ibnd
2094 integer(I4B) :: jpos
2096 integer(I4B) :: nactive
2097 integer(I4B) :: icon
2098 integer(I4B),
dimension(:),
allocatable :: ibotset
2099 integer(I4B),
dimension(:),
allocatable :: iheadset
2100 integer(I4B),
dimension(:),
allocatable :: ilimset
2101 integer(I4B) :: istat
2102 integer(I4B) :: iheadlimit_warning
2104 character(len=*),
parameter :: fmtlsp = &
2105 &
"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
2106 character(len=*),
parameter :: fmthdbot = &
2107 &
"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0, ').')"
2110 iheadlimit_warning = 0
2113 this%imawiss = this%gwfiss
2116 if (this%imawissopt == 1)
then
2121 this%nbound = this%maxbound
2124 if (this%iper ==
kper)
then
2127 if (this%iprpak /= 0)
then
2128 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2129 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
2130 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2131 call table_cr(this%inputtab, this%packName, title)
2132 call this%inputtab%table_df(1, 5, this%iout, finalize=.false.)
2134 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2136 call this%inputtab%initialize_column(text, 20, alignment=tableft)
2138 write (text,
'(a,1x,i6)')
'VALUE', jj
2139 call this%inputtab%initialize_column(text, 15, alignment=tabcenter)
2147 allocate (ibotset(this%nmawwells))
2148 allocate (iheadset(this%nmawwells))
2149 allocate (ilimset(this%nmawwells))
2150 do imaw = 1, this%nmawwells
2156 do n = 1, this%input%nbound
2157 imaw = this%input%ifno(n)
2158 if (imaw < 1 .or. imaw > this%nmawwells)
then
2159 write (errmsg,
'(2(a,1x),i0,a)') &
2160 'IMAW must be greater than 0 and', &
2161 'less than or equal to ', this%nmawwells,
'.'
2162 call store_error(errmsg)
2167 setting = this%input%setting(n)
2170 if (trim(setting) ==
'STATUS')
then
2171 str = this%input%status(n)
2172 this%status(imaw) = str(1:8)
2173 select case (trim(str))
2175 this%iboundpak(imaw) = -1
2177 this%iboundpak(imaw) = 0
2179 this%iboundpak(imaw) = 1
2181 write (errmsg,
'(2a)') &
2182 'Unknown '//trim(this%text)//
" maw status keyword: '", &
2184 call store_error(errmsg)
2189 if (trim(setting) ==
'CONN_STATUS')
then
2190 icon = this%input%period_icon(n)
2191 str = this%input%connstatus(n)
2192 if (icon < 1 .or. icon > this%ngwfnodes(imaw))
then
2193 write (errmsg,
'(2(a,1x),i0,1x,a,1x,i0,a)') &
2194 'ICON must be greater than 0 and', &
2195 'less than or equal to ', this%ngwfnodes(imaw), &
2196 'for maw well', imaw,
'.'
2197 call store_error(errmsg)
2199 jpos = this%get_jpos(imaw, icon)
2200 select case (trim(str))
2202 this%iboundconn(jpos) = 0
2204 this%iboundconn(jpos) = 1
2206 write (errmsg,
'(2a)') &
2207 'Unknown '//trim(this%text)//
" maw connection status "// &
2208 "keyword: '", trim(str)//
"'."
2209 call store_error(errmsg)
2215 if (trim(setting) ==
'PERIOD_BOTTOM')
then
2216 this%bot(imaw) = this%input%period_bottom(n)
2221 call this%maw_set_period_value(n, imaw, setting)
2224 if (trim(setting) ==
'WELL_HEAD')
then
2229 if (trim(setting) ==
'HEAD_LIMIT')
then
2230 str = this%input%head_limit(n)
2231 if (trim(str) ==
'OFF')
then
2232 this%shutofflevel(imaw) = dep20
2234 read (str, *, iostat=istat, iomsg=errmsgr) &
2235 this%shutofflevel(imaw)
2236 if (istat /= 0)
then
2237 errmsg =
'Could not read HEAD_LIMIT value. '//trim(errmsgr)
2238 call store_error(errmsg)
2245 if (trim(setting) ==
'FLOWING_WELL')
then
2246 this%fwelev(imaw) = this%input%fwelev(n)
2247 this%fwcond(imaw) = this%input%fwcond(n)
2248 this%fwrlen(imaw) = this%input%fwrlen(n)
2249 if (this%iflowingwells == 0)
then
2250 this%iflowingwells = -1
2251 text =
'Flowing well data is specified in the '// &
2252 trim(this%packName)//
' package but FLOWING_WELL was'// &
2253 ' not specified in the OPTIONS block.'
2254 call store_warning(text)
2259 if (trim(setting) ==
'SHUT_OFF')
then
2260 this%shutoffmin(imaw) = this%input%minrate(n)
2261 this%shutoffmax(imaw) = this%input%maxrate(n)
2265 if (trim(setting) ==
'RATE_SCALING')
then
2266 this%pumpelev(imaw) = this%input%pump_elevation(n)
2267 this%reduction_length(imaw) = this%input%scaling_length(n)
2268 if (this%reduction_length(imaw) < dzero)
then
2269 call this%maw_set_attribute_error(imaw,
'RATE_SCALING', &
2270 &
'must be greater than or equal to 0.')
2276 if (this%naux > 0)
then
2277 if (trim(setting) ==
'PERIOD_AUXILIARY')
then
2278 str = this%input%auxname(n)
2279 auxvaldbl = this%input%auxval(n)
2284 if (this%iprpak /= 0)
then
2285 call this%inputtab%add_term(imaw)
2286 if (trim(setting) ==
'PERIOD_AUXILIARY')
then
2287 call this%inputtab%add_term(
'AUXILIARY')
2289 call this%inputtab%add_term(trim(setting))
2291 select case (trim(setting))
2293 call this%inputtab%add_term(trim(str))
2294 call this%inputtab%add_term(
' ')
2295 call this%inputtab%add_term(
' ')
2296 case (
'CONN_STATUS')
2297 call this%inputtab%add_term(icon)
2298 call this%inputtab%add_term(trim(str))
2299 call this%inputtab%add_term(
' ')
2300 case (
'PERIOD_BOTTOM')
2301 call this%inputtab%add_term(this%bot(imaw))
2302 call this%inputtab%add_term(
' ')
2303 call this%inputtab%add_term(
' ')
2305 call this%inputtab%add_term(this%rate(imaw))
2306 call this%inputtab%add_term(
' ')
2307 call this%inputtab%add_term(
' ')
2309 call this%inputtab%add_term(this%well_head(imaw))
2310 call this%inputtab%add_term(
' ')
2311 call this%inputtab%add_term(
' ')
2313 call this%inputtab%add_term(trim(str))
2314 call this%inputtab%add_term(
' ')
2315 call this%inputtab%add_term(
' ')
2316 case (
'FLOWING_WELL')
2317 call this%inputtab%add_term(this%fwelev(imaw))
2318 call this%inputtab%add_term(this%fwcond(imaw))
2319 call this%inputtab%add_term(this%fwrlen(imaw))
2321 call this%inputtab%add_term(this%shutoffmin(imaw))
2322 call this%inputtab%add_term(this%shutoffmax(imaw))
2323 call this%inputtab%add_term(
' ')
2324 case (
'RATE_SCALING')
2325 call this%inputtab%add_term(this%pumpelev(imaw))
2326 call this%inputtab%add_term(this%reduction_length(imaw))
2327 call this%inputtab%add_term(
' ')
2328 case (
'PERIOD_AUXILIARY')
2329 call this%inputtab%add_term(trim(str))
2330 call this%inputtab%add_term(auxvaldbl)
2331 call this%inputtab%add_term(
' ')
2333 call this%inputtab%add_term(
' ')
2334 call this%inputtab%add_term(
' ')
2335 call this%inputtab%add_term(
' ')
2339 if (this%iprpak /= 0)
then
2340 call this%inputtab%finalize_table()
2346 do imaw = 1, this%nmawwells
2347 if (ibotset(imaw) /= 0 .and. this%iboundpak(imaw) >= 0)
then
2348 if (this%bot(imaw) > this%xnewpak(imaw))
then
2349 write (cstr, fmthdbot) this%xnewpak(imaw), this%bot(imaw)
2350 call this%maw_set_attribute_error(imaw,
'BOTTOM', trim(cstr))
2353 do jj = 1, this%ngwfnodes(imaw)
2354 jpos = this%get_jpos(imaw, jj)
2355 if (this%iboundconn(jpos) == 0) cycle
2356 if (this%bot(imaw) > this%botscrn(jpos))
then
2357 write (errmsg,
'(a,g0,a,1x,i0,1x,a,1x,i0,1x,a,g0,a)') &
2358 'BOTTOM (', this%bot(imaw),
') for maw well', imaw, &
2359 'is above the screen bottom of active connection', jj,
'(', &
2360 this%botscrn(jpos),
').'
2361 call store_error(errmsg)
2365 if (iheadset(imaw) /= 0 .or. this%iboundpak(imaw) < 0)
then
2366 if (this%well_head(imaw) < this%bot(imaw))
then
2367 write (cstr, fmthdbot) this%well_head(imaw), this%bot(imaw)
2368 call this%maw_set_attribute_error(imaw,
'WELL HEAD', trim(cstr))
2371 if (ibotset(imaw) /= 0 .or. ilimset(imaw) /= 0)
then
2372 if (this%shutofflevel(imaw) <= this%bot(imaw))
then
2373 iheadlimit_warning = iheadlimit_warning + 1
2377 deallocate (ibotset)
2378 deallocate (iheadset)
2379 deallocate (ilimset)
2383 do imaw = 1, this%nmawwells
2385 do jj = 1, this%ngwfnodes(imaw)
2386 jpos = this%get_jpos(imaw, jj)
2387 if (this%iboundconn(jpos) /= 0) nactive = nactive + 1
2389 if (nactive == 0)
then
2390 write (errmsg,
'(a,1x,i0,1x,a)') &
2391 'Every connection of maw well', imaw,
'is inactive. Use '// &
2392 'STATUS INACTIVE to deactivate all connections of a well.'
2393 call store_error(errmsg)
2399 write (this%iout, fmtlsp) trim(this%filtyp)
2403 if (iheadlimit_warning > 0)
then
2404 write (warnmsg,
'(a,a,a,1x,a,1x,a)') &
2405 "HEAD_LIMIT in '", trim(this%packName),
"' was below the well bottom", &
2406 "for one or more multi-aquifer well(s). This may result in", &
2407 "convergence failures for some models."
2408 call store_warning(warnmsg, substring=warnmsg(:50))
2412 if (count_errors() > 0)
then
2417 if (this%check_attr /= 0)
then
2418 call this%maw_check_attributes()
2421 if (this%iprpak == 1)
then
2422 if (this%imawiss /= 0)
then
2423 csteady =
'STEADY-STATE '
2425 csteady =
'TRANSIENT '
2429 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2430 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2431 ' RATE DATA FOR PERIOD'
2432 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2434 call table_cr(this%inputtab, this%packName, title)
2435 call this%inputtab%table_df(this%nmawwells, ntabcols, this%iout)
2437 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2439 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2441 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2442 text =
'SPECIFIED HEAD'
2443 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2444 text =
'PUMP ELEVATION'
2445 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2446 text =
'REDUCTION LENGTH'
2447 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2448 do n = 1, this%nmawwells
2449 call this%inputtab%add_term(n)
2450 call this%inputtab%add_term(this%status(n))
2451 call this%inputtab%add_term(this%rate(n))
2452 if (this%iboundpak(n) < 0)
then
2453 call this%inputtab%add_term(this%well_head(n))
2455 call this%inputtab%add_term(
' ')
2457 call this%inputtab%add_term(this%pumpelev(n))
2458 if (this%reduction_length(n) /= dep20)
then
2459 call this%inputtab%add_term(this%reduction_length(n))
2461 call this%inputtab%add_term(
' ')
2466 if (this%iflowingwells > 0)
then
2469 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2470 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2471 ' FLOWING WELL DATA FOR PERIOD'
2472 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2475 do n = 1, this%nmawwells
2476 if (this%fwcond(n) > dzero)
then
2477 ntabrows = ntabrows + 1
2480 if (ntabrows > 0)
then
2481 call table_cr(this%inputtab, this%packName, title)
2482 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2484 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2486 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2488 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2489 text =
'REDUCTION LENGTH'
2490 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2491 do n = 1, this%nmawwells
2492 if (this%fwcond(n) > dzero)
then
2493 call this%inputtab%add_term(n)
2494 call this%inputtab%add_term(this%fwelev(n))
2495 call this%inputtab%add_term(this%fwcond(n))
2496 call this%inputtab%add_term(this%fwrlen(n))
2503 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2504 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2505 ' WELL SHUTOFF DATA FOR PERIOD'
2506 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2509 do n = 1, this%nmawwells
2510 if (this%shutofflevel(n) /= dep20)
then
2511 ntabrows = ntabrows + 1
2514 if (ntabrows > 0)
then
2515 call table_cr(this%inputtab, this%packName, title)
2516 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2518 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2520 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2522 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2524 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2525 do n = 1, this%nmawwells
2526 if (this%shutofflevel(n) /= dep20)
then
2527 call this%inputtab%add_term(n)
2528 call this%inputtab%add_term(this%shutofflevel(n))
2529 call this%inputtab%add_term(this%shutoffmin(n))
2530 call this%inputtab%add_term(this%shutoffmax(n))
2539 do n = 1, this%nmawwells
2540 do j = 1, this%ngwfnodes(n)
2541 jpos = this%get_jpos(n, j)
2542 node = this%get_gwfnode(n, j)
2543 this%nodelist(ibnd) = node
2544 this%bound(1, ibnd) = this%xnewpak(n)
2545 this%bound(2, ibnd) = this%satcond(jpos)
2546 this%bound(3, ibnd) = this%botscrn(jpos)
2547 if (this%iboundpak(n) > 0)
then
2548 this%bound(4, ibnd) = this%rate(n)
2550 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 ...