Skip to content

Commit

Permalink
added simulate_high_k_lakes condition to setup_array in sourcedata
Browse files Browse the repository at this point in the history
  • Loading branch information
apryet authored and aleaf committed Sep 23, 2024
1 parent a57b3a6 commit 1d02f71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mfsetup/sourcedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ def setup_array(model, package, var, data=None,
# special handling of some variables
# (for lakes)
simulate_high_k_lakes = model.cfg['high_k_lakes']['simulate_high_k_lakes']
if var == 'botm':
if var == 'botm' and simulate_high_k_lakes:
# only execute this code if building the model (not loading)
if not model._load:
bathy = model.lake_bathymetry
Expand Down Expand Up @@ -1605,7 +1605,9 @@ def setup_array(model, package, var, data=None,

# write the top array again, because top was filled
# with botm array above
if var == 'botm':
# NOTE: that tends to corrupt the top array,
# is that only applicable to simulate_high_k_lakes ?)
if var == 'botm' and simulate_high_k_lakes:
top_filepath = model.setup_external_filepaths(package, 'top',
model.cfg[package]['top_filename_fmt'])[0]
save_array(top_filepath, top,
Expand Down

0 comments on commit 1d02f71

Please sign in to comment.