modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

Issue loading mt3d model #244

Closed paulinema closed 7 years ago

paulinema commented 7 years ago

Hi,

I am new to Flopy and I am especially interested in post-processing results. I managed to load a flow model correctly but now I am trying to load a mt3d model (after a flow model) and I keep having these error messages: "error loading name file entries from file:\n" + str(e)) Exception: error loading name file entries from file: list index out of range

My code is simply: import flopy ws = r'T:\R230000\Python\K' f1 = 'K_model_v6' f2 = 'K_model_v9' mf = flopy.modflow.Modflow.load(f1+'.mfn', exe_name='mf2005.exe', model_ws=ws) mt = flopy.mt3d.mt.Mt3dms.load(f2+'.mts', version='mt3d-usgs',exe_name='mt3d-usgs.exe', modflowmodel=mf) flopy.mt3d.mt.ftlfilename = f1+'.ftl'

I am using the native files which I have download from Modflow.

Anyone has an idea? Thank you.

langevin-usgs commented 7 years ago

So just to clarify, the name of your mt3d name file is:

T:\R230000\Python\K\K_model_v9.mts

It would be helpful if you could show us the contents of that file.

And this line doesn't look right:

flopy.mt3d.mt.ftlfilename = f1+'.ftl'

Instead you should add it to the mt constructor:

mt = flopy.mt3d.mt.Mt3dms.load(f2+'.mts', version='mt3d-usgs',exe_name='mt3d-usgs.exe', 
modflowmodel=mf, ftlfilename=f1+'.ftl')

Looks like it is something simple.

paulinema commented 7 years ago

Yes this is the right name of my file.

But when changing to your line mt = flopy.mt3d.mt.Mt3dms.load(f2+'.mts', version='mt3d-usgs',exe_name='mt3d-usgs.exe', modflowmodel=mf, ftlfilename=f1+'.ftl'), I get an error message saying: load() got an unexpected keyword argument 'ftlfilename'.

I tried an example where I created a flow and a mt3d models from scratch, then I tried to load them using the same syntax as in my first post, and it worked.

I have attached my mts file: K_model_v9.txt

Thank you

langevin-usgs commented 7 years ago

The problem is that it looks like you are using a specialized version of MT3D. That MT3D name file cannot be read by MT3D-USGS or the MT3D distributed by the Univ of Alabama.

paulinema commented 7 years ago

Thank you for your answer, indeed it looks like GMS modified the version of MT3DMS. I'll need more reasearch to find out how it's possible to use my files with Flopy.