Closed aleaf closed 4 years ago
@aleaf, confirmed that this is a problem. You can find a quick fix that is working for me on this fork:
https://github.com/spaulins-usgs/flopy
I will revisit this problem next week and see if I can come up with a more elegant solution.
thanks @spaulins-usgs
@spaulins-usgs, thanks, I can supply None now for sfr reaches without connections, but flopy is still writing these reaches as empty lines in packagedata (except for the reach number). For example, if I add a reach 3 at the end of the package data input in the above example with the same values as reach 2, except with None
for the cellid, I get this:
BEGIN packagedata
1 1 1 10 35.50000000 1.76000000 0.44800000 293.20000000 1.00000000 1.00000000 0.037 1 1.00000000 0
2 1 1 9 35.50000000 1.76000000 0.44800000 293.20000000 1.00000000 1.00000000 0.037 1 1.00000000 0
3
END packagedata
@aleaf-usgs Sorry I forgot to mention that in addition to the problem I fixed with the flopy code there is also a problem with your example. Your example passes in the python value None for a cellid. Flopy is expecting the text 'none', not the python value none ('none' is just text that happens to be the same name as the python value).
When I address your next issue (#835) I will add some additional cellid validation code to flopy so that the python value None returns an 'invalid cellid' error.
@spaulins-usgs can we close this?
@jdhughes-usgs yes closing this issue.
tl;dr: flopy won't load or (correctly) write an SFR package like this one (can provide full working example if needed):
In the MODFLOW-6 SFR package input, 'NONE' must be specified for SFR reaches that don't have a connection to the groundwater system (for example, those located in cells with IDOMAIN < 1). If I make this model:
it writes ok, but the SFR package looks like this:
I'm not sure if empty reaches like 2 and 3 above are valid MODFLOW-6 input, but I can't load the above file with
mf6.MFSimulation.load('testsim', sim_ws='tmp')
Changing reaches 2 and 3 to
is valid for MODFLOW6, but when I try loading with
mf6.MFSimulation.load('testsim', sim_ws='tmp')
, I get this error