Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(run_model): trying to fix "cannot allocate memory" error #621

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions autotest/t032_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ def test_polygon_from_ij():
nlay=2, delr=100, delc=100,
top=3, botm=botm, model=m)

ncdf = NetCdf('toy.model.nc', m)
fname = os.path.join(mpth, 'toy.model.nc')
ncdf = NetCdf(fname, m)
ncdf.write()

m.export('toy_model_two.nc')
dis.export('toy_model_dis.nc')
fname = os.path.join(mpth, 'toy_model_two.nc')
m.export(fname)

fname = os.path.join(mpth, 'toy_model_dis.nc')
dis.export(fname)

mg = m.modelgrid
mg.set_coord_info(xoff=mg._xul_to_xll(600000.0, -45.0),
Expand Down
11 changes: 6 additions & 5 deletions flopy/mbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ def to_shapefile(self, filename, package_names=None, **kwargs):

def run_model(exe_name, namefile, model_ws='./',
silent=False, pause=False, report=False,
normal_msg='normal termination', use_async=False,
normal_msg='normal termination', use_async=True,
cargs=None):
"""
This function will run the model using subprocess.Popen. It
Expand Down Expand Up @@ -1629,10 +1629,11 @@ def q_output(output, q):
proc.stdout.close()

for line in buff:
if normal_msg in line:
print("success")
success = True
break
for msg in normal_msg:
if msg in line.lower():
print("success")
success = True
break

if pause:
input('Press Enter to continue...')
Expand Down