flopy icon indicating copy to clipboard operation
flopy copied to clipboard

little errors importing old MODFLOW models from visual modflow

Open vcantarella opened this issue 3 years ago • 6 comments

Hi,

I am working with a visual modflow nwt model and I encountered subtle differences in how visual modflow writes some packages that crash the import from flopy. Interestingly, these models run just fine with the standard executable. I am not sure if it is of interest to flopy to be able to read these, but they might be found in many more models out there.

First, in the UPW file, visual modflow has written the first line like this: 154 -1.00e+30 0 And flopy is expecting the input like this: [IUPWCB HDRY NPUPW IPHDRY] Otherwise, it is expecting the IPHDRY value, so it crashes. From the manual, I thought the parameter is mandatory, but the model runs just fine.

Second, in the ZON file from the zone-budget. It has written the last line with a 0 This crashes the loop in the flopy code as it is either expecting a layer definition line or the zone values. Again, when I run the zone-budget executable with this file it runs just fine.

In both cases, from reading the source code and identifying where it was crashing, I was able to edit the modflow files to import the model, however, I don't know if you find it interesting to be able to support those little changes or not. Visual MODFLOW has also their packages and if the user does not edit the .nam file it cannot be imported into flopy anyway.

vcantarella avatar Jun 21 '22 13:06 vcantarella

@jlarsen-usgs Is this something you could look at to see if it is an easy fix to support an empty iphdry entry? I am not sure about the zonebudget issue. I don't think we want to provide support for Visual MODFLOW files since then we might be obligated to support other GUI customizations but since the codes run with these files they must not be mandatory parameterss.

jdhughes-dev avatar Jul 19 '22 18:07 jdhughes-dev

@jdhughes-usgs I can look into the empty iphdry entry.

jlarsen-usgs avatar Jul 19 '22 18:07 jlarsen-usgs

@vcantarella

I'm not able to recreate with iphdry with modflow-nwt version 1.3.0. When I remove the iphdry entry from the UPW input file modflow-nwt crashes while attempting to load that line. What version of nwt are you working with?

jlarsen-usgs avatar Jul 19 '22 22:07 jlarsen-usgs

@jlarsen-usgs I am running Version 1.2.0 03/01/2020. I believe that is also the latest here: executables-repo

vcantarella avatar Jul 20 '22 11:07 vcantarella

@vcantarella I just tested this with Version 1.2.0 03/01/2020 and can't reproduce a run. On windows, UPW read crashes for me when iphdry is omitted from the UPW file, in addition, I don't see anywhere in the source code that would allow. What operating system are you using?

jlarsen-usgs avatar Jul 20 '22 17:07 jlarsen-usgs

@jlarsen-usgs So, I tested some models this morning, and at first, I could not reproduce a run. But then I tested removing the comments in the line and I was able to reproduce a run. Could this be a bug??

Original model UPW line: 9 -2.000000000000E+020 3 0 # Data Set 1, IUPWCB HDRY NPUPW IPHDRY

This doesn't run: 9 -2.000000000000E+020 3 # Data Set 1, IUPWCB HDRY NPUPW IPHDRY

This runs: 9 -2.000000000000E+020 3

vcantarella avatar Jul 21 '22 10:07 vcantarella