2128
2129 class(MawType), intent(inout) :: this
2130
2131 character(len=LINELENGTH) :: title
2132 character(len=LINELENGTH) :: text
2133 character(len=LINELENGTH) :: csteady
2134 character(len=LINELENGTH) :: str
2135 real(DP) :: auxvaldbl
2136 character(len=LENVARNAME) :: setting
2137 character(len=LINELENGTH) :: cstr
2138 character(len=LINELENGTH) :: errmsgr
2139 integer(I4B) :: node
2140 integer(I4B) :: n
2141 integer(I4B) :: ntabcols
2142 integer(I4B) :: ntabrows
2143 integer(I4B) :: imaw
2144 integer(I4B) :: ibnd
2145 integer(I4B) :: j
2146 integer(I4B) :: jpos
2147 integer(I4B) :: jj
2148 integer(I4B) :: nactive
2149 integer(I4B) :: icon
2150 integer(I4B), dimension(:), allocatable :: ibotset
2151 integer(I4B), dimension(:), allocatable :: iheadset
2152 integer(I4B), dimension(:), allocatable :: ilimset
2153 integer(I4B) :: istat
2154 integer(I4B) :: iheadlimit_warning
2155
2156 character(len=*), parameter :: fmtlsp = &
2157 &"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
2158 character(len=*), parameter :: fmthdbot = &
2159 &"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0, ').')"
2160
2161
2162 iheadlimit_warning = 0
2163
2164
2165 this%imawiss = this%gwfiss
2166
2167
2168 if (this%imawissopt == 1) then
2169 this%imawiss = 1
2170 end if
2171
2172
2173 this%nbound = this%maxbound
2174
2175
2176 if (this%iper ==
kper)
then
2177
2178
2179 if (this%iprpak /= 0) then
2180 title = trim(adjustl(this%text))//' PACKAGE ('// &
2181 trim(adjustl(this%packName))//') DATA FOR PERIOD'
2182 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2183 call table_cr(this%inputtab, this%packName, title)
2184 call this%inputtab%table_df(1, 5, this%iout, finalize=.false.)
2185 text = 'NUMBER'
2186 call this%inputtab%initialize_column(text, 10, alignment=
tabcenter)
2187 text = 'KEYWORD'
2188 call this%inputtab%initialize_column(text, 20, alignment=
tableft)
2189 do jj = 1, 3
2190 write (text, '(a,1x,i6)') 'VALUE', jj
2191 call this%inputtab%initialize_column(text, 15, alignment=
tabcenter)
2192 end do
2193 end if
2194
2195
2196 this%check_attr = 1
2197
2198
2199 allocate (ibotset(this%nmawwells))
2200 allocate (iheadset(this%nmawwells))
2201 allocate (ilimset(this%nmawwells))
2202 do imaw = 1, this%nmawwells
2203 ibotset(imaw) = 0
2204 iheadset(imaw) = 0
2205 ilimset(imaw) = 0
2206 end do
2207
2208 do n = 1, this%input%nbound
2209 imaw = this%input%ifno(n)
2210 if (imaw < 1 .or. imaw > this%nmawwells) then
2211 write (errmsg, '(2(a,1x),i0,a)') &
2212 'IMAW must be greater than 0 and', &
2213 'less than or equal to ', this%nmawwells, '.'
2215 cycle
2216 end if
2217
2218
2219 setting = this%input%setting(n)
2220
2221
2222 if (trim(setting) == 'STATUS') then
2223 str = this%input%status(n)
2224 this%status(imaw) = str(1:8)
2225 select case (trim(str))
2226 case ('CONSTANT')
2227 this%iboundpak(imaw) = -1
2228 case ('INACTIVE')
2229 this%iboundpak(imaw) = 0
2230 case ('ACTIVE')
2231 this%iboundpak(imaw) = 1
2232 case default
2233 write (errmsg, '(2a)') &
2234 'Unknown '//trim(this%text)//" maw status keyword: '", &
2235 trim(str)//"'."
2237 end select
2238 end if
2239
2240
2241 if (trim(setting) == 'CONN_STATUS') then
2242 icon = this%input%period_icon(n)
2243 str = this%input%connstatus(n)
2244 if (icon < 1 .or. icon > this%ngwfnodes(imaw)) then
2245 write (errmsg, '(2(a,1x),i0,1x,a,1x,i0,a)') &
2246 'ICON must be greater than 0 and', &
2247 'less than or equal to ', this%ngwfnodes(imaw), &
2248 'for maw well', imaw, '.'
2250 else
2251 jpos = this%get_jpos(imaw, icon)
2252 select case (trim(str))
2253 case ('INACTIVE')
2254 this%iboundconn(jpos) = 0
2255 case ('ACTIVE')
2256 this%iboundconn(jpos) = 1
2257 case default
2258 write (errmsg, '(2a)') &
2259 'Unknown '//trim(this%text)//" maw connection status "// &
2260 "keyword: '", trim(str)//"'."
2262 end select
2263 end if
2264 end if
2265
2266
2267 if (trim(setting) == 'PERIOD_BOTTOM') then
2268 this%bot(imaw) = this%input%period_bottom(n)
2269 ibotset(imaw) = 1
2270 end if
2271
2272
2273 call this%maw_set_period_value(n, imaw, setting)
2274
2275
2276 if (trim(setting) == 'WELL_HEAD') then
2277 iheadset(imaw) = 1
2278 end if
2279
2280
2281 if (trim(setting) == 'HEAD_LIMIT') then
2282 str = this%input%head_limit(n)
2283 if (trim(str) == 'OFF') then
2284 this%shutofflevel(imaw) =
dep20
2285 else
2286 read (str, *, iostat=istat, iomsg=errmsgr) &
2287 this%shutofflevel(imaw)
2288 if (istat /= 0) then
2289 errmsg = 'Could not read HEAD_LIMIT value. '//trim(errmsgr)
2291 end if
2292 end if
2293 ilimset(imaw) = 1
2294 end if
2295
2296
2297 if (trim(setting) == 'FLOWING_WELL') then
2298 this%fwelev(imaw) = this%input%fwelev(n)
2299 this%fwcond(imaw) = this%input%fwcond(n)
2300 this%fwrlen(imaw) = this%input%fwrlen(n)
2301 if (this%iflowingwells == 0) then
2302 this%iflowingwells = -1
2303 text = 'Flowing well data is specified in the '// &
2304 trim(this%packName)//' package but FLOWING_WELL was'// &
2305 ' not specified in the OPTIONS block.'
2307 end if
2308 end if
2309
2310
2311 if (trim(setting) == 'SHUT_OFF') then
2312 this%shutoffmin(imaw) = this%input%minrate(n)
2313 this%shutoffmax(imaw) = this%input%maxrate(n)
2314 end if
2315
2316
2317 if (trim(setting) == 'RATE_SCALING') then
2318 this%pumpelev(imaw) = this%input%pump_elevation(n)
2319 this%reduction_length(imaw) = this%input%scaling_length(n)
2320 if (this%reduction_length(imaw) <
dzero)
then
2321 call this%maw_set_attribute_error(imaw, 'RATE_SCALING', &
2322 &'must be greater than or equal to 0.')
2323 end if
2324 end if
2325
2326
2327
2328 if (this%naux > 0) then
2329 if (trim(setting) == 'PERIOD_AUXILIARY') then
2330 str = this%input%auxname(n)
2331 auxvaldbl = this%input%auxval(n)
2332 end if
2333 end if
2334
2335
2336 if (this%iprpak /= 0) then
2337 call this%inputtab%add_term(imaw)
2338 if (trim(setting) == 'PERIOD_AUXILIARY') then
2339 call this%inputtab%add_term('AUXILIARY')
2340 else
2341 call this%inputtab%add_term(trim(setting))
2342 end if
2343 select case (trim(setting))
2344 case ('STATUS')
2345 call this%inputtab%add_term(trim(str))
2346 call this%inputtab%add_term(' ')
2347 call this%inputtab%add_term(' ')
2348 case ('CONN_STATUS')
2349 call this%inputtab%add_term(icon)
2350 call this%inputtab%add_term(trim(str))
2351 call this%inputtab%add_term(' ')
2352 case ('PERIOD_BOTTOM')
2353 call this%inputtab%add_term(this%bot(imaw))
2354 call this%inputtab%add_term(' ')
2355 call this%inputtab%add_term(' ')
2356 case ('RATE')
2357 call this%inputtab%add_term(this%rate(imaw))
2358 call this%inputtab%add_term(' ')
2359 call this%inputtab%add_term(' ')
2360 case ('WELL_HEAD')
2361 call this%inputtab%add_term(this%well_head(imaw))
2362 call this%inputtab%add_term(' ')
2363 call this%inputtab%add_term(' ')
2364 case ('HEAD_LIMIT')
2365 call this%inputtab%add_term(trim(str))
2366 call this%inputtab%add_term(' ')
2367 call this%inputtab%add_term(' ')
2368 case ('FLOWING_WELL')
2369 call this%inputtab%add_term(this%fwelev(imaw))
2370 call this%inputtab%add_term(this%fwcond(imaw))
2371 call this%inputtab%add_term(this%fwrlen(imaw))
2372 case ('SHUT_OFF')
2373 call this%inputtab%add_term(this%shutoffmin(imaw))
2374 call this%inputtab%add_term(this%shutoffmax(imaw))
2375 call this%inputtab%add_term(' ')
2376 case ('RATE_SCALING')
2377 call this%inputtab%add_term(this%pumpelev(imaw))
2378 call this%inputtab%add_term(this%reduction_length(imaw))
2379 call this%inputtab%add_term(' ')
2380 case ('PERIOD_AUXILIARY')
2381 call this%inputtab%add_term(trim(str))
2382 call this%inputtab%add_term(auxvaldbl)
2383 call this%inputtab%add_term(' ')
2384 case default
2385 call this%inputtab%add_term(' ')
2386 call this%inputtab%add_term(' ')
2387 call this%inputtab%add_term(' ')
2388 end select
2389 end if
2390 end do
2391 if (this%iprpak /= 0) then
2392 call this%inputtab%finalize_table()
2393 end if
2394
2395
2396
2397
2398
2399 do imaw = 1, this%nmawwells
2400 if (ibotset(imaw) /= 0 .and. this%iboundpak(imaw) > 0) then
2401 if (this%bot(imaw) > this%xnewpak(imaw)) then
2402 write (cstr, fmthdbot) this%xnewpak(imaw), this%bot(imaw)
2403 call this%maw_set_attribute_error(imaw, 'BOTTOM', trim(cstr))
2404 end if
2405 end if
2406 do jj = 1, this%ngwfnodes(imaw)
2407 jpos = this%get_jpos(imaw, jj)
2408 if (this%iboundconn(jpos) == 0) cycle
2409 if (this%bot(imaw) > this%botscrn(jpos)) then
2410 write (errmsg, '(a,g0,a,1x,i0,1x,a,1x,i0,1x,a,g0,a)') &
2411 'BOTTOM (', this%bot(imaw), ') for maw well', imaw, &
2412 'is above the screen bottom of active connection', jj, '(', &
2413 this%botscrn(jpos), ').'
2415 exit
2416 end if
2417 end do
2418 if (iheadset(imaw) /= 0 .or. this%iboundpak(imaw) < 0) then
2419 if (this%well_head(imaw) < this%bot(imaw)) then
2420 write (cstr, fmthdbot) this%well_head(imaw), this%bot(imaw)
2421 call this%maw_set_attribute_error(imaw, 'WELL HEAD', trim(cstr))
2422 end if
2423 end if
2424 if (ibotset(imaw) /= 0 .or. ilimset(imaw) /= 0) then
2425 if (this%shutofflevel(imaw) <= this%bot(imaw)) then
2426 iheadlimit_warning = iheadlimit_warning + 1
2427 end if
2428 end if
2429 end do
2430 deallocate (ibotset)
2431 deallocate (iheadset)
2432 deallocate (ilimset)
2433
2434
2435
2436 do imaw = 1, this%nmawwells
2437 nactive = 0
2438 do jj = 1, this%ngwfnodes(imaw)
2439 jpos = this%get_jpos(imaw, jj)
2440 if (this%iboundconn(jpos) /= 0) nactive = nactive + 1
2441 end do
2442 if (nactive == 0) then
2443 write (errmsg, '(a,1x,i0,1x,a)') &
2444 'Every connection of maw well', imaw, 'is inactive. Use '// &
2445 'STATUS INACTIVE to deactivate all connections of a well.'
2447 end if
2448 end do
2449
2450
2451 else
2452 write (this%iout, fmtlsp) trim(this%filtyp)
2453 end if
2454
2455
2456 if (iheadlimit_warning > 0) then
2457 write (warnmsg, '(a,a,a,1x,a,1x,a)') &
2458 "HEAD_LIMIT in '", trim(this%packName), "' was below the well bottom", &
2459 "for one or more multi-aquifer well(s). This may result in", &
2460 "convergence failures for some models."
2462 end if
2463
2464
2467 end if
2468
2469
2470 if (this%check_attr /= 0) then
2471 call this%maw_check_attributes()
2472
2473
2474 if (this%iprpak == 1) then
2475 if (this%imawiss /= 0) then
2476 csteady = 'STEADY-STATE '
2477 else
2478 csteady = 'TRANSIENT '
2479 end if
2480
2481
2482 title = trim(adjustl(this%text))//' PACKAGE ('// &
2483 trim(adjustl(this%packName))//') '//trim(adjustl(csteady))// &
2484 ' RATE DATA FOR PERIOD'
2485 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2486 ntabcols = 6
2487 call table_cr(this%inputtab, this%packName, title)
2488 call this%inputtab%table_df(this%nmawwells, ntabcols, this%iout)
2489 text = 'NUMBER'
2490 call this%inputtab%initialize_column(text, 10, alignment=
tabcenter)
2491 text = 'STATUS'
2492 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2493 text = 'RATE'
2494 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2495 text = 'SPECIFIED HEAD'
2496 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2497 text = 'PUMP ELEVATION'
2498 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2499 text = 'REDUCTION LENGTH'
2500 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2501 do n = 1, this%nmawwells
2502 call this%inputtab%add_term(n)
2503 call this%inputtab%add_term(this%status(n))
2504 call this%inputtab%add_term(this%rate(n))
2505 if (this%iboundpak(n) < 0) then
2506 call this%inputtab%add_term(this%well_head(n))
2507 else
2508 call this%inputtab%add_term(' ')
2509 end if
2510 call this%inputtab%add_term(this%pumpelev(n))
2511 if (this%reduction_length(n) /=
dep20)
then
2512 call this%inputtab%add_term(this%reduction_length(n))
2513 else
2514 call this%inputtab%add_term(' ')
2515 end if
2516 end do
2517
2518
2519 if (this%iflowingwells > 0) then
2520
2521
2522 title = trim(adjustl(this%text))//' PACKAGE ('// &
2523 trim(adjustl(this%packName))//') '//trim(adjustl(csteady))// &
2524 ' FLOWING WELL DATA FOR PERIOD'
2525 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2526 ntabcols = 4
2527 ntabrows = 0
2528 do n = 1, this%nmawwells
2529 if (this%fwcond(n) >
dzero)
then
2530 ntabrows = ntabrows + 1
2531 end if
2532 end do
2533 if (ntabrows > 0) then
2534 call table_cr(this%inputtab, this%packName, title)
2535 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2536 text = 'NUMBER'
2537 call this%inputtab%initialize_column(text, 10, alignment=
tabcenter)
2538 text = 'ELEVATION'
2539 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2540 text = 'CONDUCT.'
2541 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2542 text = 'REDUCTION LENGTH'
2543 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2544 do n = 1, this%nmawwells
2545 if (this%fwcond(n) >
dzero)
then
2546 call this%inputtab%add_term(n)
2547 call this%inputtab%add_term(this%fwelev(n))
2548 call this%inputtab%add_term(this%fwcond(n))
2549 call this%inputtab%add_term(this%fwrlen(n))
2550 end if
2551 end do
2552 end if
2553 end if
2554
2555
2556 title = trim(adjustl(this%text))//' PACKAGE ('// &
2557 trim(adjustl(this%packName))//') '//trim(adjustl(csteady))// &
2558 ' WELL SHUTOFF DATA FOR PERIOD'
2559 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2560 ntabcols = 4
2561 ntabrows = 0
2562 do n = 1, this%nmawwells
2563 if (this%shutofflevel(n) /=
dep20)
then
2564 ntabrows = ntabrows + 1
2565 end if
2566 end do
2567 if (ntabrows > 0) then
2568 call table_cr(this%inputtab, this%packName, title)
2569 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2570 text = 'NUMBER'
2571 call this%inputtab%initialize_column(text, 10, alignment=
tabcenter)
2572 text = 'ELEVATION'
2573 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2574 text = 'MINIMUM. Q'
2575 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2576 text = 'MAXIMUM Q'
2577 call this%inputtab%initialize_column(text, 12, alignment=
tabcenter)
2578 do n = 1, this%nmawwells
2579 if (this%shutofflevel(n) /=
dep20)
then
2580 call this%inputtab%add_term(n)
2581 call this%inputtab%add_term(this%shutofflevel(n))
2582 call this%inputtab%add_term(this%shutoffmin(n))
2583 call this%inputtab%add_term(this%shutoffmax(n))
2584 end if
2585 end do
2586 end if
2587 end if
2588 end if
2589
2590
2591 ibnd = 1
2592 do n = 1, this%nmawwells
2593 do j = 1, this%ngwfnodes(n)
2594 jpos = this%get_jpos(n, j)
2595 node = this%get_gwfnode(n, j)
2596 this%nodelist(ibnd) = node
2597 this%bound(1, ibnd) = this%xnewpak(n)
2598 this%bound(2, ibnd) = this%satcond(jpos)
2599 this%bound(3, ibnd) = this%botscrn(jpos)
2600 if (this%iboundpak(n) > 0) then
2601 this%bound(4, ibnd) = this%rate(n)
2602 else
2603 this%bound(4, ibnd) =
dzero
2604 end if
2605 ibnd = ibnd + 1
2606 end do
2607 end do
real(dp), parameter dep20
real constant 1e20
subroutine, public store_warning(msg, substring)
Store warning message.
integer(i4b) function, public count_errors()
Return number of errors.
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 ...