Skip to content

Commit

Permalink
Fix(mfsfr2.py): dataset 6b and 6c write routine, remove blank lines (#…
Browse files Browse the repository at this point in the history
…1101)

* blank lines were previously written to file in the case of isfropt = 2 or 3 and icalc >= 2
  • Loading branch information
jlarsen-usgs committed Apr 26, 2021
1 parent df843e0 commit 870c577
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions autotest/t009_test.py
Expand Up @@ -429,6 +429,16 @@ def test_no_ds_6bc():
assert len(sfr.channel_geometry_data[0][1][i]) == 8
assert sum(sfr.channel_geometry_data[0][1][i]) > 0.

sfrfile2 = os.path.join("temp", "junk.sfr")
sfr.write_file()
sfr = fm.ModflowSfr2.load(sfrfile2, model=m)
assert len(sfr.segment_data[0]) == 2
assert len(sfr.channel_geometry_data[0]) == 2
assert len(sfr.channel_geometry_data[0][1]) == 2
for i in range(2):
assert len(sfr.channel_geometry_data[0][1][i]) == 8
assert sum(sfr.channel_geometry_data[0][1][i]) > 0.


def test_ds_6d_6e_disordered():
path = os.path.join("..", "examples", "data", "hydmod_test")
Expand Down
4 changes: 2 additions & 2 deletions flopy/modflow/mfsfr2.py
Expand Up @@ -2023,11 +2023,11 @@ def _write_6bc(self, i, j, f_sfr, cols=()):
f_sfr.write(fmts[4].format(depth) + " ")
elif icalc == 1:
if i > 0:
pass
return
else:
f_sfr.write(fmts[3].format(width) + " ")
else:
pass
return

else:
return
Expand Down

0 comments on commit 870c577

Please sign in to comment.