MODFLOW-USGS / mt3d-usgs

MT3D-USGS Repository
23 stars 12 forks source link

LKNODE in LKT is not set properly with MODFLOW 6 models #70

Closed rbwinst-usgs closed 4 years ago

rbwinst-usgs commented 4 years ago

When running LKT in a MODFLOW 6 model, the value assigned to LKNODE is random which can cause MT3D-USGS to crash. The same model as in issue 69 illustrates the problem.

emorway-usgs commented 4 years ago

@langevin-usgs In fmi1mf6.f, there is a function called subroutine budgetdata_read(success, iout_opt). Within this function, the variable nlist is read which would ideally be used to set LKNODE (number of aquifer cells connected to a lake) in lkt1.f. In your experience, what would be the best way to return this variable to the calling code while maintaining fidelity with its twin function in MF6?

langevin-usgs commented 4 years ago

@emorway-usgs, all the variables at the top of the BudgetDataModule can be accessed with a use statement. So after you call budgetdata_read, everything you need will be available. You just need to "use" it.

These are the public variables from BudgetDataModule that you can use:

  public :: budtxt, ia, ja, flowja, nodesrc, nodedst, flowdata,                &
            dstpackagename, nbudterms, kstp, kper, delt, totim,                &
            srcmodelname, dstmodelname, hasimeth1flowja
emorway-usgs commented 4 years ago

Fixing this issue turned up some other issues. Will create a thread for those as it is a bit different than this issue