* fix(mfhob.py): read data set 4 when user provides it on multiple lines * Fix(modflowpy#675): hfb package load parameters when Factor not supplied * fix(modflowpy#675): add optional flag to OptionBlock context tree for optional nested arguments * update(autotest): added tests for modflowpy#675 * Updates for codacydevelop
parent
edb15b72a0
commit
38d96d31e8
|
@ -15,6 +15,9 @@ if not os.path.isdir(tpth):
|
|||
pth = os.path.join('..', 'examples', 'data', 'mf2005_test')
|
||||
namfiles = [namfile for namfile in os.listdir(pth) if namfile.endswith('.nam')]
|
||||
|
||||
ppth = os.path.join('..', 'examples', 'data', 'parameters')
|
||||
pnamfiles = ["Oahu_02.nam",]
|
||||
|
||||
test_nwt_pth = os.path.join("..", "examples", "data", "nwt_test")
|
||||
nwt_files = [os.path.join(test_nwt_pth, f) for f in os.listdir(test_nwt_pth)
|
||||
if f.endswith('.nwt')]
|
||||
|
@ -30,6 +33,13 @@ def load_model(namfile):
|
|||
assert m.load_fail is False
|
||||
|
||||
|
||||
def load_parameter_model(namfile):
|
||||
m = flopy.modflow.Modflow.load(namfile, model_ws=ppth,
|
||||
version='mf2005', verbose=True)
|
||||
assert m, 'Could not load namefile {}'.format(namfile)
|
||||
assert m.load_fail is False
|
||||
|
||||
|
||||
def load_only_bas6_model(namfile):
|
||||
m = flopy.modflow.Modflow.load(namfile, model_ws=pth,
|
||||
version='mf2005', verbose=True,
|
||||
|
@ -43,6 +53,11 @@ def test_modflow_load():
|
|||
yield load_model, namfile
|
||||
return
|
||||
|
||||
def test_parameter_load():
|
||||
for namfile in pnamfiles:
|
||||
yield load_parameter_model, namfile
|
||||
return
|
||||
|
||||
|
||||
def test_modflow_loadonly():
|
||||
for namfile in namfiles:
|
||||
|
|
|
@ -228,6 +228,7 @@ def test_read_write_nwt_options():
|
|||
from flopy.utils.optionblock import OptionBlock
|
||||
|
||||
welstr = "OPTIONS\nSPECIFY 0.5 10\nTABFILES 2 28\nEND\n"
|
||||
welstr2 = "OPTIONS\nSPECIFY 0.3\nTABFILES 2 28\nEND\n"
|
||||
uzfstr = "OPTIONS\nSPECIFYTHTR\nSPECIFYTHTI\nNOSURFLEAK\n" \
|
||||
"SPECIFYSURFK\nSEEPSURFK\nETSQUARE 0.7\nNETFLUX 10 20\n" \
|
||||
"SAVEFINF\nEND\n"
|
||||
|
@ -235,25 +236,31 @@ def test_read_write_nwt_options():
|
|||
"LOSSFACTOR 0.5\nSTRHC1KH 0.1\nSTRHC1KV 0.2\nEND\n"
|
||||
|
||||
welopt = OptionBlock.load_options(StringIO(welstr), ModflowWel)
|
||||
welopt2 = OptionBlock.load_options(StringIO(welstr2), ModflowWel)
|
||||
uzfopt = OptionBlock.load_options(StringIO(uzfstr), ModflowUzf1)
|
||||
sfropt = OptionBlock.load_options(StringIO(sfrstr), ModflowSfr2)
|
||||
|
||||
assert repr(welopt) == welstr
|
||||
assert repr(welopt2) == welstr2
|
||||
assert repr(uzfopt) == uzfstr
|
||||
assert repr(sfropt) == sfrstr
|
||||
|
||||
welopt.write_options(os.path.join(cpth, "welopt.txt"))
|
||||
welopt2.write_options(os.path.join(cpth, "welopt2.txt"))
|
||||
uzfopt.write_options(os.path.join(cpth, 'uzfopt.txt'))
|
||||
sfropt.write_options(os.path.join(cpth, 'sfropt.txt'))
|
||||
|
||||
welopt = OptionBlock.load_options(os.path.join(cpth, "welopt.txt"),
|
||||
ModflowWel)
|
||||
welopt2 = OptionBlock.load_options(os.path.join(cpth, "welopt2.txt"),
|
||||
ModflowWel)
|
||||
uzfopt = OptionBlock.load_options(os.path.join(cpth, 'uzfopt.txt'),
|
||||
ModflowUzf1)
|
||||
sfropt = OptionBlock.load_options(os.path.join(cpth, "sfropt.txt"),
|
||||
ModflowSfr2)
|
||||
|
||||
assert repr(welopt) == welstr
|
||||
assert repr(welopt2) == welstr2
|
||||
assert repr(uzfopt) == uzfstr
|
||||
assert repr(sfropt) == sfrstr
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Test the observation process load and write
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import numpy as np
|
||||
import flopy
|
||||
|
@ -274,6 +275,34 @@ def test_multilayerhob_prfail():
|
|||
return
|
||||
|
||||
|
||||
def test_multilayerhob_pr_multiline():
|
||||
if sys.version_info[0] > 2:
|
||||
from io import StringIO
|
||||
else:
|
||||
from cStringIO import StringIO
|
||||
|
||||
problem_hob = ["2 4 7",
|
||||
"1 1",
|
||||
"A19E1_1 -2 140 91 1 1 -0.28321 -0.05389"
|
||||
" 69 1 1 1 # A19E1 8/13/1975",
|
||||
"3 0.954",
|
||||
"4 0.046",
|
||||
"A19E1_2 -2 140 91 1 1 -0.28321 -0.05389"
|
||||
" 72 1 1 1 # A19E1 10/9/1975",
|
||||
"3 0.954",
|
||||
"4 0.046"]
|
||||
|
||||
problem_hob = "\n".join(problem_hob)
|
||||
ml = flopy.modflow.Modflow('hobtest')
|
||||
dis = flopy.modflow.ModflowDis(ml, nlay=4, nrow=200, ncol=200,
|
||||
nper=100, perlen=10, nstp=4, tsmult=1.,
|
||||
steady=False)
|
||||
hob = flopy.modflow.ModflowHob.load(StringIO(problem_hob), ml)
|
||||
|
||||
if len(hob.obs_data) != 2:
|
||||
raise AssertionError("pr, mlay... load error")
|
||||
|
||||
|
||||
def test_flwob_load():
|
||||
"""
|
||||
test041 create, write, and load ModflowFlwob package.
|
||||
|
@ -366,3 +395,4 @@ if __name__ == '__main__':
|
|||
test_obs_load_and_write()
|
||||
test_filenames()
|
||||
test_flwob_load()
|
||||
test_multilayerhob_pr_multiline()
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
# Basic package file for MODFLOW, generated by Flopy.
|
||||
FREE
|
||||
INTERNAL 1 (20I10) -1 #ibound Layer 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
-999.99
|
||||
INTERNAL 1 (20G15.6) -1 #strt Layer 1
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.500000E+01 1.500000E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
|
@ -0,0 +1,8 @@
|
|||
# Discretization file for MODFLOW, generated by Flopy.
|
||||
1 18 20 1 4 2
|
||||
0
|
||||
CONSTANT 1.600000E+04 #delr
|
||||
CONSTANT 1.600000E+04 #delc
|
||||
CONSTANT 3.000000E+01 #model_top
|
||||
CONSTANT -1.000000E+03 #botm Layer 1
|
||||
1000.000000 1000 1.000000 SS
|
|
@ -0,0 +1,268 @@
|
|||
# GHB for MODFLOW, generated by Flopy.
|
||||
PARAMETER 1 262
|
||||
262 0
|
||||
GHB_TEST GHB 15000 262
|
||||
1 1 1 0.000000
|
||||
1 1 2 0.000000
|
||||
1 1 3 0.000000
|
||||
1 1 4 0.000000
|
||||
1 1 5 0.000000
|
||||
1 1 6 0.000000
|
||||
1 1 7 0.000000
|
||||
1 1 8 0.000000
|
||||
1 1 9 0.000000
|
||||
1 1 10 0.000000
|
||||
1 1 11 0.000000
|
||||
1 1 12 0.000000
|
||||
1 1 13 0.000000
|
||||
1 1 14 0.000000
|
||||
1 1 15 0.000000
|
||||
1 1 16 0.000000
|
||||
1 1 17 0.000000
|
||||
1 1 18 0.000000
|
||||
1 1 19 0.000000
|
||||
1 1 20 0.000000
|
||||
1 2 1 0.000000
|
||||
1 2 2 0.000000
|
||||
1 2 3 0.000000
|
||||
1 2 4 0.000000
|
||||
1 2 5 0.000000
|
||||
1 2 6 0.000000
|
||||
1 2 7 0.000000
|
||||
1 2 8 0.000000
|
||||
1 2 9 0.000000
|
||||
1 2 10 0.000000
|
||||
1 2 11 0.000000
|
||||
1 2 12 0.000000
|
||||
1 2 13 0.000000
|
||||
1 2 14 0.000000
|
||||
1 2 15 0.000000
|
||||
1 2 16 0.000000
|
||||
1 2 17 0.000000
|
||||
1 2 18 0.000000
|
||||
1 2 19 0.000000
|
||||
1 2 20 0.000000
|
||||
1 3 1 0.000000
|
||||
1 3 2 0.000000
|
||||
1 3 3 0.000000
|
||||
1 3 4 0.000000
|
||||
1 3 5 0.000000
|
||||
1 3 6 0.000000
|
||||
1 3 7 0.000000
|
||||
1 3 8 0.000000
|
||||
1 3 9 0.000000
|
||||
1 3 10 0.000000
|
||||
1 3 11 0.000000
|
||||
1 3 12 0.000000
|
||||
1 3 13 0.000000
|
||||
1 3 14 0.000000
|
||||
1 3 15 0.000000
|
||||
1 3 16 0.000000
|
||||
1 3 17 0.000000
|
||||
1 3 18 0.000000
|
||||
1 3 19 0.000000
|
||||
1 3 20 0.000000
|
||||
1 4 1 0.000000
|
||||
1 4 2 0.000000
|
||||
1 4 3 0.000000
|
||||
1 4 4 0.000000
|
||||
1 4 5 0.000000
|
||||
1 4 6 0.000000
|
||||
1 4 7 0.000000
|
||||
1 4 8 0.000000
|
||||
1 4 11 0.000000
|
||||
1 4 12 0.000000
|
||||
1 4 13 0.000000
|
||||
1 4 14 0.000000
|
||||
1 4 15 0.000000
|
||||
1 4 16 0.000000
|
||||
1 4 17 0.000000
|
||||
1 4 18 0.000000
|
||||
1 4 19 0.000000
|
||||
1 4 20 0.000000
|
||||
1 5 1 0.000000
|
||||
1 5 2 0.000000
|
||||
1 5 3 0.000000
|
||||
1 5 4 0.000000
|
||||
1 5 5 0.000000
|
||||
1 5 6 0.000000
|
||||
1 5 7 0.000000
|
||||
1 5 12 0.000000
|
||||
1 5 13 0.000000
|
||||
1 5 14 0.000000
|
||||
1 5 15 0.000000
|
||||
1 5 16 0.000000
|
||||
1 5 17 0.000000
|
||||
1 5 18 0.000000
|
||||
1 5 19 0.000000
|
||||
1 5 20 0.000000
|
||||
1 6 1 0.000000
|
||||
1 6 2 0.000000
|
||||
1 6 3 0.000000
|
||||
1 6 4 0.000000
|
||||
1 6 5 0.000000
|
||||
1 6 6 0.000000
|
||||
1 6 13 0.000000
|
||||
1 6 14 0.000000
|
||||
1 6 15 0.000000
|
||||
1 6 16 0.000000
|
||||
1 6 17 0.000000
|
||||
1 6 18 0.000000
|
||||
1 6 19 0.000000
|
||||
1 6 20 0.000000
|
||||
1 7 1 0.000000
|
||||
1 7 2 0.000000
|
||||
1 7 3 0.000000
|
||||
1 7 13 0.000000
|
||||
1 7 14 0.000000
|
||||
1 7 15 0.000000
|
||||
1 7 16 0.000000
|
||||
1 7 17 0.000000
|
||||
1 7 18 0.000000
|
||||
1 7 19 0.000000
|
||||
1 7 20 0.000000
|
||||
1 8 1 0.000000
|
||||
1 8 2 0.000000
|
||||
1 8 3 0.000000
|
||||
1 8 14 0.000000
|
||||
1 8 15 0.000000
|
||||
1 8 16 0.000000
|
||||
1 8 17 0.000000
|
||||
1 8 18 0.000000
|
||||
1 8 19 0.000000
|
||||
1 8 20 0.000000
|
||||
1 9 1 0.000000
|
||||
1 9 2 0.000000
|
||||
1 9 3 0.000000
|
||||
1 9 4 0.000000
|
||||
1 9 15 0.000000
|
||||
1 9 16 0.000000
|
||||
1 9 17 0.000000
|
||||
1 9 18 0.000000
|
||||
1 9 19 0.000000
|
||||
1 9 20 0.000000
|
||||
1 10 1 0.000000
|
||||
1 10 2 0.000000
|
||||
1 10 3 0.000000
|
||||
1 10 4 0.000000
|
||||
1 10 16 0.000000
|
||||
1 10 17 0.000000
|
||||
1 10 18 0.000000
|
||||
1 10 19 0.000000
|
||||
1 10 20 0.000000
|
||||
1 11 1 0.000000
|
||||
1 11 2 0.000000
|
||||
1 11 3 0.000000
|
||||
1 11 4 0.000000
|
||||
1 11 5 0.000000
|
||||
1 11 17 0.000000
|
||||
1 11 18 0.000000
|
||||
1 11 19 0.000000
|
||||
1 11 20 0.000000
|
||||
1 12 1 0.000000
|
||||
1 12 2 0.000000
|
||||
1 12 3 0.000000
|
||||
1 12 4 0.000000
|
||||
1 12 5 0.000000
|
||||
1 12 17 0.000000
|
||||
1 12 18 0.000000
|
||||
1 12 19 0.000000
|
||||
1 12 20 0.000000
|
||||
1 13 1 0.000000
|
||||
1 13 2 0.000000
|
||||
1 13 3 0.000000
|
||||
1 13 4 0.000000
|
||||
1 13 5 0.000000
|
||||
1 13 6 0.000000
|
||||
1 13 18 0.000000
|
||||
1 13 19 0.000000
|
||||
1 13 20 0.000000
|
||||
1 14 1 0.000000
|
||||
1 14 2 0.000000
|
||||
1 14 3 0.000000
|
||||
1 14 4 0.000000
|
||||
1 14 5 0.000000
|
||||
1 14 6 0.000000
|
||||
1 14 18 0.000000
|
||||
1 14 19 0.000000
|
||||
1 14 20 0.000000
|
||||
1 15 1 0.000000
|
||||
1 15 2 0.000000
|
||||
1 15 3 0.000000
|
||||
1 15 4 0.000000
|
||||
1 15 5 0.000000
|
||||
1 15 6 0.000000
|
||||
1 15 7 0.000000
|
||||
1 15 8 0.000000
|
||||
1 15 9 0.000000
|
||||
1 15 10 0.000000
|
||||
1 15 11 0.000000
|
||||
1 15 12 0.000000
|
||||
1 15 13 0.000000
|
||||
1 15 16 0.000000
|
||||
1 15 17 0.000000
|
||||
1 15 18 0.000000
|
||||
1 15 19 0.000000
|
||||
1 15 20 0.000000
|
||||
1 16 1 0.000000
|
||||
1 16 2 0.000000
|
||||
1 16 3 0.000000
|
||||
1 16 4 0.000000
|
||||
1 16 5 0.000000
|
||||
1 16 6 0.000000
|
||||
1 16 7 0.000000
|
||||
1 16 8 0.000000
|
||||
1 16 9 0.000000
|
||||
1 16 10 0.000000
|
||||
1 16 11 0.000000
|
||||
1 16 12 0.000000
|
||||
1 16 13 0.000000
|
||||
1 16 14 0.000000
|
||||
1 16 15 0.000000
|
||||
1 16 16 0.000000
|
||||
1 16 17 0.000000
|
||||
1 16 18 0.000000
|
||||
1 16 19 0.000000
|
||||
1 16 20 0.000000
|
||||
1 17 1 0.000000
|
||||
1 17 2 0.000000
|
||||
1 17 3 0.000000
|
||||
1 17 4 0.000000
|
||||
1 17 5 0.000000
|
||||
1 17 6 0.000000
|
||||
1 17 7 0.000000
|
||||
1 17 8 0.000000
|
||||
1 17 9 0.000000
|
||||
1 17 10 0.000000
|
||||
1 17 11 0.000000
|
||||
1 17 12 0.000000
|
||||
1 17 13 0.000000
|
||||
1 17 14 0.000000
|
||||
1 17 15 0.000000
|
||||
1 17 16 0.000000
|
||||
1 17 17 0.000000
|
||||
1 17 18 0.000000
|
||||
1 17 19 0.000000
|
||||
1 17 20 0.000000
|
||||
1 18 1 0.000000
|
||||
1 18 2 0.000000
|
||||
1 18 3 0.000000
|
||||
1 18 4 0.000000
|
||||
1 18 5 0.000000
|
||||
1 18 6 0.000000
|
||||
1 18 7 0.000000
|
||||
1 18 8 0.000000
|
||||
1 18 9 0.000000
|
||||
1 18 10 0.000000
|
||||
1 18 11 0.000000
|
||||
1 18 12 0.000000
|
||||
1 18 13 0.000000
|
||||
1 18 14 0.000000
|
||||
1 18 15 0.000000
|
||||
1 18 16 0.000000
|
||||
1 18 17 0.000000
|
||||
1 18 18 0.000000
|
||||
1 18 19 0.000000
|
||||
1 18 20 0.000000
|
||||
0 1
|
||||
GHB_TEST
|
|
@ -0,0 +1,37 @@
|
|||
# HFB for MODFLOW, generated by Flopy.
|
||||
2 10 2
|
||||
HFB1 HFB 1.00e-06 5
|
||||
1 3 10 3 11
|
||||
1 4 10 4 11
|
||||
1 5 10 5 11
|
||||
1 6 10 6 11
|
||||
1 7 10 7 11
|
||||
HFB2 HFB 1.0e-06 5
|
||||
1 8 10 8 11 10.0
|
||||
1 9 10 9 11 10.0
|
||||
1 10 10 10 11 10.0
|
||||
1 11 10 11 11 10.0
|
||||
1 12 10 12 11 10.0
|
||||
1 13 10 13 11 1.000000e-06
|
||||
1 14 10 14 11 1.000000e-06
|
||||
2
|
||||
HFB2
|
||||
HFB1
|
||||
|
||||
|
||||
|
||||
|
||||
0 0 12
|
||||
1 3 10 3 11 1.000000e-06
|
||||
1 4 10 4 11 1.000000e-06
|
||||
1 5 10 5 11 1.000000e-06
|
||||
1 6 10 6 11 1.000000e-06
|
||||
1 7 10 7 11 1.000000e-06
|
||||
1 8 10 8 11 1.000000e-06
|
||||
1 9 10 9 11 1.000000e-06
|
||||
1 10 10 10 11 1.000000e-06
|
||||
1 11 10 11 11 1.000000e-06
|
||||
1 12 10 12 11 1.000000e-06
|
||||
1 13 10 13 11 1.000000e-06
|
||||
1 14 10 14 11 1.000000e-06
|
||||
0
|
|
@ -0,0 +1,11 @@
|
|||
# LPF for MODFLOW, generated by Flopy.
|
||||
53 -1E+30 2
|
||||
1
|
||||
0
|
||||
1
|
||||
0
|
||||
0
|
||||
LAY1_HK HK 1.0 1
|
||||
1 HKL1 ALL
|
||||
LAY1_VKA VK 1.0 1
|
||||
1 VKAL1 ALL
|
|
@ -0,0 +1,9 @@
|
|||
4
|
||||
prehk
|
||||
CONSTANT 1.5e+02
|
||||
k_f
|
||||
CONSTANT 10
|
||||
HKL1 FUNCTION
|
||||
prehk * k_f
|
||||
VKAL1
|
||||
CONSTANT 1.0
|
|
@ -0,0 +1,18 @@
|
|||
# Name file for mf2005, generated by Flopy.
|
||||
LIST 2 Oahu_02.list
|
||||
DIS 11 Oahu_02.dis
|
||||
LPF 15 Oahu_02.lpf
|
||||
BAS6 13 Oahu_02.bas
|
||||
GHB 23 Oahu_02.ghb
|
||||
WEL 20 Oahu_02.wel
|
||||
HFB6 17 Oahu_02.hfb
|
||||
SWI2 29 Oahu_02.swi2
|
||||
MULT 31 Oahu_02.mlt
|
||||
PVAL 101 Oahu_02.pval
|
||||
DATA(BINARY) 55 Oahu_02.zta REPLACE
|
||||
DATA(BINARY) 56 Oahu_02.swb REPLACE
|
||||
OC 14 Oahu_02.oc
|
||||
DATA(BINARY) 51 Oahu_02.hds REPLACE
|
||||
DATA(BINARY) 52 Oahu_02.ddn REPLACE
|
||||
DATA(BINARY) 53 Oahu_02.cbc REPLACE
|
||||
PCG 27 Oahu_02.pcg
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,3 @@
|
|||
# PCG for MODFLOW, generated by Flopy.
|
||||
50 30 1 0
|
||||
0.0001 5.0 1.0 0 0 3 1.0
|
|
@ -0,0 +1,4 @@
|
|||
# fake pval file
|
||||
2
|
||||
smallval 1.
|
||||
HFB2 1.0e-7
|
|
@ -0,0 +1,52 @@
|
|||
# Salt Water Intrusion (SWI2) package file for MODFLOW-2005, generated by Flopy.
|
||||
# Dataset 1
|
||||
1 1 0 55 56 0
|
||||
# Dataset 2a
|
||||
1 0 3
|
||||
# Dataset 3a
|
||||
4.000000e-02 4.000000e-02
|
||||
# Dataset 4
|
||||
INTERNAL 1 (2G15.6) -1 #nu
|
||||
0.000000E+00 2.500000E-02
|
||||
# Dataset 5
|
||||
INTERNAL 1 (20G15.6) -1 #zeta_1 Layer 1
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -6.000000E+02 -6.000000E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
|
||||
# Dataset 6
|
||||
CONSTANT 5.000000E-02 #ssz Layer 1
|
||||
# Dataset 7
|
||||
INTERNAL 1 (20I10) -1 #isource Layer 1
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 1 1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 1 1 1 1 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 1 1 1 1 1 1 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 1 1 1 1 1 1 1 1 1 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 1 1 1 1 1 1 1 1 1 1 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 1 1 1 1 1 1 1 1 1 1 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 1 1 1 1 1 1 1 1 1 1 1 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 1 1 1 1 1 1 1 1 1 1 1 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 1 1 1 1 1 1 1 1 1 1 1 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 1 1 1 1 1 1 1 1 1 1 1 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 1 1 1 1 1 1 1 1 1 1 1 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 1 1 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
||||
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
|
|
@ -0,0 +1,104 @@
|
|||
# Well file for MODFLOW, generated by Flopy.
|
||||
100 0
|
||||
100 0 # stress period 0
|
||||
1 4 9 818452.437500
|
||||
1 4 10 818452.437500
|
||||
1 5 8 818452.437500
|
||||
1 5 9 818452.437500
|
||||
1 5 10 818452.437500
|
||||
1 5 11 818452.437500
|
||||
1 6 7 818452.437500
|
||||
1 6 8 818452.437500
|
||||
1 6 9 818452.437500
|
||||
1 6 10 818452.437500
|
||||
1 6 11 818452.437500
|
||||
1 6 12 818452.437500
|
||||
1 7 4 818452.437500
|
||||
1 7 5 818452.437500
|
||||
1 7 6 818452.437500
|
||||
1 7 7 818452.437500
|
||||
1 7 8 818452.437500
|
||||
1 7 9 818452.437500
|
||||
1 7 10 818452.437500
|
||||
1 7 11 818452.437500
|
||||
1 7 12 818452.437500
|
||||
1 8 4 818452.437500
|
||||
1 8 5 818452.437500
|
||||
1 8 6 818452.437500
|
||||
1 8 7 818452.437500
|
||||
1 8 8 818452.437500
|
||||
1 8 9 818452.437500
|
||||
1 8 10 818452.437500
|
||||
1 8 11 818452.437500
|
||||
1 8 12 818452.437500
|
||||
1 8 13 818452.437500
|
||||
1 9 5 818452.437500
|
||||
1 9 6 818452.437500
|
||||
1 9 7 818452.437500
|
||||
1 9 8 818452.437500
|
||||
1 9 9 818452.437500
|
||||
1 9 10 818452.437500
|
||||
1 9 11 818452.437500
|
||||
1 9 12 818452.437500
|
||||
1 9 13 818452.437500
|
||||
1 9 14 818452.437500
|
||||
1 10 5 818452.437500
|
||||
1 10 6 818452.437500
|
||||
1 10 7 818452.437500
|
||||
1 10 8 818452.437500
|
||||
1 10 9 818452.437500
|
||||
1 10 10 818452.437500
|
||||
1 10 11 818452.437500
|
||||
1 10 12 818452.437500
|
||||
1 10 13 818452.437500
|
||||
1 10 14 818452.437500
|
||||
1 10 15 818452.437500
|
||||
1 11 6 818452.437500
|
||||
1 11 7 818452.437500
|
||||
1 11 8 818452.437500
|
||||
1 11 9 818452.437500
|
||||
1 11 10 818452.437500
|
||||
1 11 11 818452.437500
|
||||
1 11 12 818452.437500
|
||||
1 11 13 818452.437500
|
||||
1 11 14 818452.437500
|
||||
1 11 15 818452.437500
|
||||
1 11 16 818452.437500
|
||||
1 12 6 818452.437500
|
||||
1 12 7 818452.437500
|
||||
1 12 8 818452.437500
|
||||
1 12 9 818452.437500
|
||||
1 12 10 818452.437500
|
||||
1 12 11 818452.437500
|
||||
1 12 12 818452.437500
|
||||
1 12 13 818452.437500
|
||||
1 12 14 818452.437500
|
||||
1 12 15 818452.437500
|
||||
1 12 16 818452.437500
|
||||
1 13 7 818452.437500
|
||||
1 13 8 818452.437500
|
||||
1 13 9 818452.437500
|
||||
1 13 10 818452.437500
|
||||
1 13 11 818452.437500
|
||||
1 13 12 818452.437500
|
||||
1 13 13 818452.437500
|
||||
1 13 14 818452.437500
|
||||
1 13 15 818452.437500
|
||||
1 13 16 818452.437500
|
||||
1 13 17 818452.437500
|
||||
1 14 7 818452.437500
|
||||
1 14 8 818452.437500
|
||||
1 14 9 818452.437500
|
||||
1 14 10 818452.437500
|
||||
1 14 11 818452.437500
|
||||
1 14 12 818452.437500
|
||||
1 14 13 818452.437500
|
||||
1 14 14 818452.437500
|
||||
1 14 15 818452.437500
|
||||
1 14 16 818452.437500
|
||||
1 14 17 818452.437500
|
||||
1 15 14 818452.437500
|
||||
1 15 15 818452.437500
|
||||
1 9 8 -12031200.000000
|
||||
1 11 10 -10694400.000000
|
||||
-1 0 # stress period 1
|
|
@ -147,7 +147,6 @@ class ModflowHfb(Package):
|
|||
aux_names = []
|
||||
it = 0
|
||||
while it < len(options):
|
||||
print(it, options[it])
|
||||
if 'aux' in options[it].lower():
|
||||
aux_names.append(options[it + 1].lower())
|
||||
it += 1
|
||||
|
@ -285,7 +284,7 @@ class ModflowHfb(Package):
|
|||
while it < len(t):
|
||||
toption = t[it]
|
||||
# print it, t[it]
|
||||
if toption.lower() is 'noprint':
|
||||
if toption.lower() == 'noprint':
|
||||
options.append(toption)
|
||||
elif 'aux' in toption.lower():
|
||||
options.append(' '.join(t[it:it + 2]))
|
||||
|
|
|
@ -122,7 +122,8 @@ class ModflowHob(Package):
|
|||
# set package name
|
||||
fname = [filenames[0]]
|
||||
|
||||
# Call ancestor's init to set self.parent, extension, name and unit number
|
||||
# Call ancestor's init to set self.parent,
|
||||
# extension, name and unit number
|
||||
Package.__init__(self, model, extension=extension, name=name,
|
||||
unit_number=units, extra=extra, filenames=fname)
|
||||
|
||||
|
@ -137,7 +138,7 @@ class ModflowHob(Package):
|
|||
|
||||
# create default
|
||||
if obs_data is None:
|
||||
obs_data = HeadObservation()
|
||||
obs_data = HeadObservation(model)
|
||||
|
||||
# make sure obs_data is a list
|
||||
if isinstance(obs_data, HeadObservation):
|
||||
|
@ -333,8 +334,11 @@ class ModflowHob(Package):
|
|||
# read dataset 1
|
||||
t = line.strip().split()
|
||||
nh = int(t[0])
|
||||
iuhobsv = int(t[3])
|
||||
hobdry = float(t[4])
|
||||
iuhobsv = None
|
||||
hobdry = 0
|
||||
if len(t) > 3:
|
||||
iuhobsv = int(t[3])
|
||||
hobdry = float(t[4])
|
||||
|
||||
# read dataset 2
|
||||
line = f.readline()
|
||||
|
@ -368,15 +372,29 @@ class ModflowHob(Package):
|
|||
line = f.readline()
|
||||
t = line.strip().split()
|
||||
mlay = collections.OrderedDict()
|
||||
for j in range(0, abs(layer) * 2, 2):
|
||||
k = int(t[j]) - 1
|
||||
# catch case where the same layer is specified more than
|
||||
# once. In this case add previous value to the current value
|
||||
keys = list(mlay.keys())
|
||||
v = 0.
|
||||
if k in keys:
|
||||
v = mlay[k]
|
||||
mlay[k] = float(t[j + 1]) + v
|
||||
if len(t) >= abs(layer) * 2:
|
||||
for j in range(0, abs(layer) * 2, 2):
|
||||
k = int(t[j]) - 1
|
||||
# catch case where the same layer is specified
|
||||
# more than once. In this case add previous
|
||||
# value to the current value
|
||||
keys = list(mlay.keys())
|
||||
v = 0.
|
||||
if k in keys:
|
||||
v = mlay[k]
|
||||
mlay[k] = float(t[j + 1]) + v
|
||||
else:
|
||||
for j in range(abs(layer)):
|
||||
k = int(t[0]) - 1
|
||||
keys = list(mlay.keys())
|
||||
v = 0.
|
||||
if k in keys:
|
||||
v = mlay[k]
|
||||
mlay[k] = float(t[1]) + v
|
||||
|
||||
if j != abs(layer) - 1:
|
||||
line = f.readline()
|
||||
t = line.strip().split()
|
||||
# reset layer
|
||||
layer = -len(list(mlay.keys()))
|
||||
|
||||
|
@ -384,8 +402,9 @@ class ModflowHob(Package):
|
|||
if irefsp0 > 0:
|
||||
itt = 1
|
||||
irefsp0 -= 1
|
||||
totim = model.dis.get_totim_from_kper_toffset(irefsp0,
|
||||
toffset * tomulth)
|
||||
totim = model.dis.get_totim_from_kper_toffset(
|
||||
irefsp0,
|
||||
toffset * tomulth)
|
||||
names = [obsnam]
|
||||
tsd = [totim, hob]
|
||||
nobs += 1
|
||||
|
@ -403,8 +422,9 @@ class ModflowHob(Package):
|
|||
names.append(t[0])
|
||||
irefsp = int(t[1]) - 1
|
||||
toffset = float(t[2])
|
||||
totim = model.dis.get_totim_from_kper_toffset(irefsp,
|
||||
toffset * tomulth)
|
||||
totim = model.dis.get_totim_from_kper_toffset(
|
||||
irefsp,
|
||||
toffset * tomulth)
|
||||
hob = float(t[3])
|
||||
tsd.append([totim, hob])
|
||||
nobs += 1
|
||||
|
@ -429,10 +449,11 @@ class ModflowHob(Package):
|
|||
unitnumber, filenames[0] = \
|
||||
model.get_ext_dict_attr(ext_unit_dict,
|
||||
filetype=ModflowHob.ftype())
|
||||
if iuhobsv > 0:
|
||||
iu, filenames[1] = \
|
||||
model.get_ext_dict_attr(ext_unit_dict, unit=iuhobsv)
|
||||
model.add_pop_key_list(iuhobsv)
|
||||
if iuhobsv is not None:
|
||||
if iuhobsv > 0:
|
||||
iu, filenames[1] = \
|
||||
model.get_ext_dict_attr(ext_unit_dict, unit=iuhobsv)
|
||||
model.add_pop_key_list(iuhobsv)
|
||||
|
||||
# create hob object instance
|
||||
hob = ModflowHob(model, iuhobsv=iuhobsv, hobdry=hobdry,
|
||||
|
@ -459,7 +480,7 @@ class HeadObservation(object):
|
|||
----------
|
||||
tomulth : float
|
||||
Time-offset multiplier for head observations. Default is 1.
|
||||
obsnam : string
|
||||
obsname : string
|
||||
Observation name. Default is 'HOBS'
|
||||
layer : int
|
||||
The zero-based layer index of the cell in which the head observation
|
||||
|
@ -556,10 +577,11 @@ class HeadObservation(object):
|
|||
for key, value in self.mlay.items():
|
||||
tot += value
|
||||
if not (np.isclose(tot, 1.0, rtol=0)):
|
||||
msg = ('sum of dataset 4 proportions must equal 1.0 - ' + \
|
||||
msg = 'sum of dataset 4 proportions must equal 1.0 - ' + \
|
||||
'sum of dataset 4 proportions = {tot} for ' + \
|
||||
'observation name {obsname}.').format(tot=tot,
|
||||
obsname=self.obsname)
|
||||
'observation name {obsname}.'.format(
|
||||
tot=tot,
|
||||
obsname=self.obsname)
|
||||
raise ValueError(msg)
|
||||
|
||||
# convert passed time_series_data to a numpy array
|
||||
|
|
|
@ -228,7 +228,7 @@ class ModflowMlt(Package):
|
|||
|
||||
"""
|
||||
t = line.strip().split()
|
||||
basename = t.pop(0).lower()
|
||||
basename = t.pop(0).lower()[0:10]
|
||||
multarray = mult_dict[basename]
|
||||
try:
|
||||
multarray = multarray.array.copy()
|
||||
|
@ -239,7 +239,7 @@ class ModflowMlt(Package):
|
|||
if len(t) < 2:
|
||||
break
|
||||
op = t.pop(0)
|
||||
multname = t.pop(0)
|
||||
multname = t.pop(0)[0:10]
|
||||
try:
|
||||
atemp = mult_dict[multname.lower()].array
|
||||
except:
|
||||
|
|
|
@ -5,6 +5,7 @@ the ModflowParBc class as `flopy.modflow.ModflowParBc`.
|
|||
"""
|
||||
|
||||
import numpy as np
|
||||
from ..utils.flopy_io import line_strip
|
||||
|
||||
|
||||
class ModflowParBc(object):
|
||||
|
@ -74,7 +75,7 @@ class ModflowParBc(object):
|
|||
bc_parms = {}
|
||||
for idx in range(npar):
|
||||
line = f.readline()
|
||||
t = line.strip().split()
|
||||
t = line_strip(line).split()
|
||||
parnam = t[0].lower()
|
||||
if parnam.startswith("'"):
|
||||
parnam = parnam[1:]
|
||||
|
@ -96,14 +97,14 @@ class ModflowParBc(object):
|
|||
# read instance name
|
||||
if timeVarying:
|
||||
line = f.readline()
|
||||
t = line.strip().split()
|
||||
t = line_strip(line).split()
|
||||
instnam = t[0].lower()
|
||||
else:
|
||||
instnam = 'static'
|
||||
bcinst = []
|
||||
for nw in range(nlst):
|
||||
line = f.readline()
|
||||
t = line.strip().split()
|
||||
t = line_strip(line).split()
|
||||
bnd = []
|
||||
for jdx in range(nitems):
|
||||
# if jdx < 3:
|
||||
|
@ -111,7 +112,10 @@ class ModflowParBc(object):
|
|||
# conversion to zero-based occurs in package load method in mbase.
|
||||
bnd.append(int(t[jdx]))
|
||||
else:
|
||||
bnd.append(float(t[jdx]))
|
||||
try:
|
||||
bnd.append(float(t[jdx]))
|
||||
except IndexError:
|
||||
bnd.append(1.)
|
||||
bcinst.append(bnd)
|
||||
pinst[instnam] = bcinst
|
||||
bc_parms[parnam] = [{'partyp': partyp, 'parval': parval,
|
||||
|
|
|
@ -117,7 +117,11 @@ class ModflowWel(Package):
|
|||
[('phiramp',
|
||||
OptionBlock.simple_float),
|
||||
('iunitramp',
|
||||
OptionBlock.simple_int)])}),
|
||||
OrderedDict(
|
||||
[(OptionBlock.dtype, int),
|
||||
(OptionBlock.nested, False),
|
||||
(OptionBlock.optional, True)
|
||||
]))])}),
|
||||
('tabfiles', OptionBlock.simple_tabfile)])
|
||||
|
||||
def __init__(self, model, ipakcb=None, stress_period_data=None, dtype=None,
|
||||
|
|
|
@ -24,15 +24,20 @@ class OptionBlock(object):
|
|||
dtype = "dtype"
|
||||
n_nested = "nvars"
|
||||
vars = "vars"
|
||||
optional = "optional"
|
||||
|
||||
simple_flag = OrderedDict([(dtype, np.bool_),
|
||||
(nested, False)])
|
||||
(nested, False),
|
||||
(optional, False)])
|
||||
simple_str = OrderedDict([(dtype, str),
|
||||
(nested, False)])
|
||||
(nested, False),
|
||||
(optional, False)])
|
||||
simple_float = OrderedDict([(dtype, float),
|
||||
(nested, False)])
|
||||
(nested, False),
|
||||
(optional, False)])
|
||||
simple_int = OrderedDict([(dtype, int),
|
||||
(nested, False)])
|
||||
(nested, False),
|
||||
(optional, False)])
|
||||
|
||||
simple_tabfile = OrderedDict([(dtype, np.bool_),
|
||||
(nested, True),
|
||||
|
@ -114,7 +119,12 @@ class OptionBlock(object):
|
|||
else:
|
||||
val.append(str(k))
|
||||
else:
|
||||
val.append(str((object.__getattribute__(self, k))))
|
||||
v = str(object.__getattribute__(self, k))
|
||||
if v == "None" and d[OptionBlock.optional]:
|
||||
pass
|
||||
else:
|
||||
val.append(str((object.__getattribute__(self,
|
||||
k))))
|
||||
|
||||
if "None" in val:
|
||||
pass
|
||||
|
@ -277,6 +287,15 @@ class OptionBlock(object):
|
|||
for key, d in ctx[OptionBlock.vars].items():
|
||||
dtype = d[OptionBlock.dtype]
|
||||
|
||||
if d[OptionBlock.optional]:
|
||||
if ix >= len(t):
|
||||
continue
|
||||
else:
|
||||
try:
|
||||
OptionUtil.isvalid(dtype, t[ix])
|
||||
except TypeError:
|
||||
continue
|
||||
|
||||
OptionUtil.isvalid(dtype, t[ix])
|
||||
|
||||
if dtype == np.bool_:
|
||||
|
@ -363,6 +382,9 @@ class OptionBlock(object):
|
|||
ix = 1
|
||||
|
||||
for k, d in ctx[OptionBlock.vars].items():
|
||||
if ix >= len(t) and d[OptionBlock.optional]:
|
||||
continue
|
||||
|
||||
if d[OptionBlock.dtype] == float:
|
||||
valid = OptionUtil.isfloat(t[ix])
|
||||
elif d[OptionBlock.dtype] == int:
|
||||
|
|
Loading…
Reference in New Issue