GithubHelp home page GithubHelp logo

modflowpy / flopy Goto Github PK

View Code? Open in Web Editor NEW
482.0 482.0 302.0 640.09 MB

A Python package to create, run, and post-process MODFLOW-based models.

Home Page: https://flopy.readthedocs.io

License: Other

Python 100.00%
modeling plotting python

flopy's People

Contributors

aleaf avatar brclark-usgs avatar briochh avatar cnicol-gwlogic avatar constablecatnip avatar dbrakenhoff avatar dependabot[bot] avatar emorway-usgs avatar etiennebresciani avatar github-actions[bot] avatar jbellino-usgs avatar jdhughes-usgs avatar jentjr avatar jjstarn-usgs avatar jlarsen-usgs avatar jtwhite79 avatar kwilcox avatar langevin-usgs avatar mbakker7 avatar mjknowling avatar mnfienen avatar mwtoews avatar ougx avatar rabbl avatar rodrperezi avatar rubencalje avatar scottrp avatar spaulins-usgs avatar wkitlasten avatar wpbonelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flopy's Issues

"normal termination" in mbase.py, line 379

MF2k stdout-compatibility requires shortening mbase.py line 379 from:

if 'normal termination of simulation' in line.lower():
-- to --
if 'normal termination' in line.lower():

mf.py::load() method

ext_unit_dict[].filetype is set to lowercase when the dict is populated, but then is compared to an uppercase filetype from load_only:

image

populating the load_only list with uppercase filetypes also causes this comparison to fail further down, so none of the packages specified in load_only actually get loaded:

image

I wasn't sure if you guys had a convention for whether the filetypes should be upper or lower case, so I wasn't sure what the right fix should be. I hacked something in there for myself to get it to work temporarily.

When writing datasets, some variables are not being forced into a 10 character width

The following code will show the problem. We are currently using formatter1 for many floats in Python. This can be a problem if the model code is reading fixed format. The problem shows up when using 1.e6 for DT0 for mt3d, for example. I'm working on a fix for this, but it is something to be aware of. formatter2 is better I think, but it is also problematic.

formatter1 = '{:10}'
formatter2 = '{:10f}'

numbers = [1.e6, 1000000000, 1.e30, 1.e-30]

for number in numbers:
n = float(number)
print 10 * '-'
print formatter1.format(n)
print formatter2.format(n)

output:


1000000.0

1000000.000000

1000000000.0

1000000000.000000

 1e+30

1000000000000000019884624838656.000000

 1e-30

0.000000

Mt3D compilation for Mac

I am trying to compile Mt3d using gfortran to run on mac.

The Terminal announces the following errors:
Undefined symbols for architecture x86_64:
"getcl", referenced from:
MAIN_ in mt3dms5.o
"hss5al", referenced from:
MAIN_ in mt3dms5.o
"hss5bd", referenced from:
MAIN_ in mt3dms5.o
"hss5fm", referenced from:
MAIN_ in mt3dms5.o
"hss5rp", referenced from:
MAIN_ in mt3dms5.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Can you please advise what I need to do to make the compilation successful?

Thanks!

Writing a text file with flopy.utils.util_array.util_2d

uzfbnd=fu.util_array.util_2d(mymodel,(nrow,ncol),np.int,iuzfbndT,ext_filename=uzfname)

From the available information, I expect the array (iuzfbndT) to be written to uzfname ('D:\MODFLOW\my_model-uzf-1505011656.txt'). But I don't an array file, or any errors. All other modflow files (bas, lpf,dis, etc) are written without a problem.

uzfbnd.write_txt((nrow,ncol),uzfname,iuzfbndT)

I get: TypeError: unsupported operand type(s) for %: 'int' and 'str' on line 873 of util_array.py. I am assuming the arg shape should be a tuple of integers. I cannot decipher how column_length in calculated in util_array.py, but for some reason ncol%column_length is producing errors.

Any suggestions on a better way to get this array file written?

binaryfile returns a nan array if totim not found

Email from Jeremy White identifying the problem and possible solutions:

Looks like the problem is that there are not entries in the hds file for totim == 1.0. If you use the binaryfile.HeadFile.list_records() method, you can see that the first (and only) totim is 10,000.0.

Now, the reason that mfbinaryfile works is that it searches through the listed totims in file until it finds a totim that is greater than or equal to the requested totim. binaryfile doesn't do that, it requires an exact match for the requested totim.

Chris - we should probably do something about this. To me, the options are:

1.) replicate the user-friendly (but could-be-dangerous) way the mfbinaryfile does it. Maybe we could issue warning if an exact match isn't found

2.) raise an exception if the totim isn't found.

I'm leaning towards 1 because it seems to be the most friendly.

issue with use of TemporalReference and `SpatialReference`

UCN file does not have pertim in header (in temporalreference_from_binary_headers). Added hack to deal with issue in Henry notebook. Is tsmult needed for spatial reference? If not can we remove it. Should tsmult in instantiationation of TemporalReference be tsmults? Why is there a tsmult and tsmults??

In flopy3boundaries notebook a package cannot be created without a dis because of issue with mflist when there is no spatial reference (self.sr = self.model.dis.sr). Added try except hack to deal with issue but probably needs a closer look.

add reference parameters to get_node_coordinates()

Hi Guys, at this moment, the get_node_coordinates() doesn't allow you to specify xul and yul or some other reference parameters like these. I suggest to add xul and yul to this function to let it return the true coordinates. Also, it will be useful to have another function to let you find the coordinates for a number of nodes rather than the whole model cells. I can help to implement this task if you think it's a good idea.

AGU wishlist

I've started an AGU wishlist on the develop branch README.md. Please list enhancements/changes you think would be a best use of our effort

No module named 'version'

I get this error then I try to import the flopy utils in the ipython environment. I had a similar error message when trying to install flopy using the pip install command. I have tried modifying the init.py script to just bypass the version script (by assigning the version and build directly), but then I get an error that says "no module named 'modflow'", which is the next import item in the init.py script. What am I doing wrong?

A few typos in modflow\mfnwt

BACKFLAG parameter is 'backflag' in docstring but 'backflg' in object init.

Change 'levfil' to 'levfill' in the write_file call

File "C:\Anaconda\lib\site-packages\flopy\modflow\mfnwt.py", line 267, in write_file
f.write('{0:10d}'.format(self.levfil))
AttributeError: 'ModflowNwt' object has no attribute 'levfil'

Python 3.X support?

Would it be possible to port Flopy3 to Python 3.X? In particular the binary file and plotting utilities would be very useful to have in Python 3. Thanks.

BAS load method issue

Ran into an error trying to load a BAS file.

Error is on np.fromfile saying it needs to be passed a file pointer rather than a filename.

/Users/mnfienen/Documents/GIT/flopy/flopy/utils/util_array.pyc in load_bin(shape, file_in, dtype, bintype)
    937         else:
    938             header_data = None
--> 939         data = np.fromfile(file_in,dtype=dtype,count=nrow*ncol)
    940         data.resize(nrow, ncol)
    941         return [header_data, data]

IOError: first argument must be an open file

The doc for np.fromfile indicates it can accept either a file handle or a filename, so seems strange. We could change the static method load_bin in util_2d so that a file handle is opened prior to calling np.fromfile but I want to make sure that doesn't break other stuff prior to implementing the fix.

The extra strange thing is that it appears a file handle is already being passed, so the issue may be a little deeper....

Missing viscosity package

Currently I am modeling temperature and groundwater flow with SEAWAT. But the viscosity package wasn't there yet. With the code added below, the package can be added to the seawat model and the input files can be written. It still lacks those fancy feature those MODFLOW packages have. Lets call it a first step.

flopy\seawat__init__.py:

from .swt import Seawat
from .swtvdf import SeawatVdf
from .swtvsc import SeawatVsc

flopy\seawat\swtvsc.py:

import numpy as np
from flopy.mbase import Package
from flopy.utils import util_3d


class SeawatVsc(Package):

    def __init__(self, model, mt3dmuflg=-1, viscmin=0, viscmax=0,
                 viscref=8.904e-4, nsmueos=0, mutempopt=2, mtmuspec=1,
                 dmudc=1.923e-06, cmuref=0, mtmutempspec=1,
                 amucoeff=[0.001, 1, 0.015512, -20, -1.572], invisc=-1,
                 visc=-1, extension='vsc', **kwargs):

        if len(list(kwargs.keys())) > 0:
            raise Exception("VSC error: unrecognized kwargs: " +
                            ' '.join(list(kwargs.keys())))

        Package.__init__(self, model, extension, 'VSC', 38)
        nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
        self.mt3dmuflg = mt3dmuflg
        self.viscmin = viscmin
        self.viscmax = viscmax
        self.viscref = viscref
        self.nsmueos = nsmueos
        self.mutempopt = mutempopt
        self.mtmuspec = mtmuspec
        self.dmudc = dmudc
        self.cmuref = cmuref
        self.mtmutempspec = mtmutempspec
        self.amucoeff = amucoeff
        self.invisc = invisc
        self.visc = util_3d(model, (nlay, nrow, ncol), np.float32, visc,
                            name='visc')
        self.parent.add_package(self)
        return

    def write_file(self):
        nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
        f_vsc = open(self.fn_path, 'w')

        # item 1
        f_vsc.write('%10i\n' % self.mt3dmuflg)

        # item 2
        if isinstance(self.viscmin, int) and self.viscmin is 0:
            f_vsc.write('%10i' % self.viscmin)
        else:
            f_vsc.write('%10.3E' % self.viscmin)

        if isinstance(self.viscmax, int) and self.viscmax is 0:
            f_vsc.write('%10i\n' % self.viscmax)
        else:
            f_vsc.write('%10.3E\n' % self.viscmax)

        # item 3
        if self.mt3dmuflg >= 0:
            f_vsc.write('%10.3E%10.2E%10.2E\n' % (self.viscref, self.dmudc,
                                                  self.cmuref))
        if self.mt3dmuflg == -1:
            f_vsc.write('%10.3E\n' % self.viscref)
            f_vsc.write('%10i%10i\n' % (self.nsmueos, self.mutempopt))

            for iwr in range(self.nsmueos):
                f_vsc.write('%10i%10.2E%10.2E\n' % ([self.mtmuspec][iwr],
                                                    [self.dmudc][iwr],
                                                    [self.cmuref][iwr]))

        if self.mutempopt > 0:
            f_vsc.write('%10i' % self.mtmutempspec)

            if self.mutempopt == 1:
                string = '%10.3E%10f%10f%10f\n'
            elif self.mutempopt == 2:
                string = '%10.3E%10f%10f %9f %9f\n'
            elif self.mutempopt == 3:
                string = '%10f %9f\n'

            f_vsc.write(string % tuple(self.amucoeff))

        # item 4
        if self.mt3dmuflg == 0:
            f_vsc.write('%10i\n' % self.invisc)

        # item 5
        if self.mt3dmuflg == 0 and self.invisc > 0:
            f_vsc.write(self.visc.get_file_entry())

        f_vsc.close()
        return

Lake example is not creating hds file even after successful completion of modlfow

I am using ubuntu and modflow version 2005 and trying to execute the lake example .

name = 'lake_example'
h1 = 100
h2 = 90
Nlay = 10
N = 101
L = 400.0
H = 50.0
k = 1.0

ml = fmf.Modflow(modelname=name, exe_name='/home/kiruba/Downloads/Unix/src/mf2005', version='mf2005', model_ws='mf_files/')



bot = np.linspace(-H/Nlay,-H,Nlay)
delrow = delcol = L/(N-1)
dis = fmf.ModflowDis(ml,nlay=Nlay,nrow=N,ncol=N,delr=delrow,delc=delcol,top=0.0,botm=bot,laycbd=0)

Nhalf = (N-1)/2
ibound = np.ones((Nlay,N,N), 'int32')
ibound[:,0,:] = -1; ibound[:,-1,:] = -1; ibound[:,:,0] = -1; ibound[:,:,-1] = -1
ibound[0,Nhalf,Nhalf] = -1
start = h1 * np.ones((N,N))
start[Nhalf,Nhalf] = h2
bas = fmf.ModflowBas(ml,ibound=ibound,strt=start)
print "o"
lpf = fmf.ModflowLpf(ml, hk=k)
pcg = fmf.ModflowPcg(ml)
oc = fmf.ModflowOc(ml)
ml.write_input()
ml.run_model3()```

My output is : 
                               MODFLOW-2005     
    U.S. GEOLOGICAL SURVEY MODULAR FINITE-DIFFERENCE GROUND-WATER FLOW MODEL
                             Version 1.11.00 8/8/2013                        

 Using NAME file: lake_example.nam 
 Run start date and time (yyyy/mm/dd hh:mm:ss): 2015/02/11 13:51:00

 Solving:  Stress period:     1    Time step:     1    Ground-Water Flow Eqn.
 Run end date and time (yyyy/mm/dd hh:mm:ss): 2015/02/11 13:51:00
 Elapsed run time:  0.005 Seconds

  Normal termination of simulation
Process finished with exit code 0

The hds file is not created in the directory.

Rotation in ModelMap

Should we consider the x- and y-offsets to be relative to the lower left corner (rather than the upper left) and embrace a cartesian coordinate system??

budget of external stresses (river package, etc)

What are the options to get budget data from external stress packages ? I would like to get the leakage data from the river package. A unit number can be defined through the ipakcb variable of the river package, but I cannot find a way to add a new line for this additional binary file in the name file. Thanks !
alex

Reference branch

Hey guys - I've worked up a feature branch that splits off the spatial reference info from ModelMap into new SpatialReference class. I also created a TemporalReference class for time handling. It took some refactoring of ModelMap to try to separate it from the requirement of a complete flopy.mbase object. I updated the ModelMap notebook and added a new py.test file.

I've already added a plot() and to_shapefile() method to util_2d util_3d transient_2d array so that any array object can be plotted or saved and also added datetime info to mflist so that model input files now have datetime info in the comments. I anticipate this will open up some really cool functionality such as observation pre- and post-processing with pandas, a spatially and temporally referenced binaryfile with plot() methods for both maps and time series, etc...

check it out and let me know what you think. Want to merge soon...

flopy.utils.binaryfile.HeadFile will not read Henry.hds binary

When I run the Henry Saltwater Intrusion Problem script, I can't seem to read the .hds file using flopy.utils.binaryfile.HeadFile. Everything else works just like in the example, I can get the concentrations and cell budgets and make the plot as shown in the example.

When reading a different .hds file, e.g. the lake example or tutorial 2, it works fine.

Running the following snippet

import flopy.utils.binaryfile as bf
bf.HeadFile('lake_example.hds')

gives, as expected

Out[55]:
<flopy.utils.binaryfile.HeadFile at 0x15eba8d0>

But from

import flopy.utils.binaryfile as bf
bf.HeadFile('henry.hds')

I get the following error:

Traceback (most recent call last):

  File "<ipython-input-48-7d116619a952>", line 1, in <module>
    bf.HeadFile('henry.hds')

  File "C:\Anaconda\lib\site-packages\flopy\utils\binaryfile.py", line 562, in __init__
    super(HeadFile, self).__init__(filename, precision, verbose)

  File "C:\Anaconda\lib\site-packages\flopy\utils\binaryfile.py", line 218, in __init__
    self._build_index()

  File "C:\Anaconda\lib\site-packages\flopy\utils\binaryfile.py", line 253, in _build_index
    self.file.seek(self.databytes, 1)

IOError: [Errno 22] Invalid argument

Maybe it has something to do with SEAWAT, since bf.HeadFile works for steady state and transient MODFLOW. Incidentally, none of the examples seem to feature getting the heads from SEAWAT (I'm just starting out though, so my intuitions probably aren't worth much).

It this error reproducible, or is it something on my side?

Observations

Any interest in developing observation packages for MODFLOW? Steffen Mehl indicated he might be inclined to use them if they were available.

May be low hanging fruit.

Import issue

Iā€™m having trouble importing flopy when it is installed (see example below from trying to run the tests). I tried deleting any install directories and eggs in the site-packages folder, as well as deleting the build folder, and then reinstalling, but via setup.py install and using pip with the link to the develop branch.

When I have flopy uninstalled and manually point to the flopy folder (in the github repo), everything works fine. So somehow Iā€™m not installing correctly. Any ideas what the problem might be? I get the same results with 2.7 and 3.4.

Do you guys run the tests with flopy installed, or do you have some other way of pointing pytest to the working flopy folder?

________________________________ ERROR collecting py.test/t003_test.py _________________________________
py.test/t003_test.py:1: in
import flopy
//anaconda/envs/python3/lib/python3.4/site-packages/flopy/init.py:34: in
from . import export
E ImportError: cannot import name 'export'
________________________________ ERROR collecting py.test/t004_test.py _________________________________
py.test/t004_test.py:3: in
import flopy
//anaconda/envs/python3/lib/python3.4/site-packages/flopy/init.py:28: in
from . import modflow
E ImportError: cannot import name 'modflow'

mt3d.BTN: starting concentrations

The following script:
import flopy

Create the basic MODFLOW model structure

mf = flopy.modflow.Modflow('steven')

Create the basic MT3DMS model structure and default BTN package

mt = flopy.mt3d.Mt3dms('steven', 'nam_mt3dms', mf)
btn = flopy.mt3d.Mt3dBtn(mt)

Gives an error:
Traceback (most recent call last):
File "btn_problem.py", line 8, in btn = flopy.mt3d.Mt3dBtn(mt)
File "C:\Anaconda\lib\site-packages\flopy\mt3d\mtbtn.py", line 186, in init
self.sconc = [u3d]
File "C:\Anaconda\lib\site-packages\flopy\mbase.py", line 584, in setattr
if isinstance(old_value[0], utils.util_3d):
IndexError: list index out of range

The error is eliminated when line 186 of the file ...\Lib\site-packages\flopy\mt3d\mtbtn.py:
self.sconc = [u3d]
is replaced by:
self.sconc.append(u3d)

Willem Zaadnoordijk

Package replace not working when adding another package of the same type

The following code demonstrates the problem:

import flopy

mf = flopy.modflow.Modflow('test')
dis = flopy.modflow.ModflowDis(mf)

stress_period_data = {0: [[0, 0, 0, -1.]]}
wel = flopy.modflow.ModflowWel(mf, stress_period_data=stress_period_data)

stress_period_data = {0: [[0, 0, 0, -2.]]}
wel = flopy.modflow.ModflowWel(mf, stress_period_data=stress_period_data)

stress_period_data = {0: [[0, 0, 0, -3.]]}
wel = flopy.modflow.ModflowWel(mf, stress_period_data=stress_period_data)

mf.write_input()

The fix is to modify the mbase module and explicitly assign the package to the packagelist position. Will commit this fix after more testing.

def add_package(self, p):
    """
    Add a package.

    Parameters
    ----------
    p : Package object

    """
    for i, pp in enumerate(self.packagelist):
        if pp.allowDuplicates:
            continue
        elif (isinstance(p, type(pp))):
            print '****Warning -- two packages of the same type: ',type(p),type(pp)                 
            print 'replacing existing Package...'                
            # pp = p
            self.packagelist[i] = p
            return        
    if self.verbose:
        print 'adding Package: ', p.name[0]
    self.packagelist.append(p)

Setters and getters

It might be time to consider including set and get methods to redefine variables now that the load methods are working.

MF96 capability

Hi, is there a way to make FloPy load an old MF96 model? Apologies if this is the wrong place to post a question like this. Leads to my second question. Is this the place to post user questions or should they also be posted on the MODFLOW users group?

Relocate shapefile writer?

Jeremy, I like the new shapefile writer. It looks great. The ability to add attributes is really slick. I'm wondering, though, if we shouldn't create a new 'export' submodule, and put it in there instead. That way we can plan for "to VTK", "to_NetCDF", and anything else we want to support. I know the map object has those rotated and offset coordinates, but maybe we need to generalize that somehow?

ModFlowEvt load

Hi,
Using version 3.1.1r I had to insert npar = 0 at line 174 in the load method for the EVT. Without it, npar would only be defined if "parameter" appeared in the evt package input file. Prior to this I could not load any existing evt input files. Chances are this may be fixed already.

Regards,

Tariq

to_shapefile() / reference.py::get_vertices() speed issue

Love the "to_shapefile" functionality. Would like to suggest a fix that improved write time for me on a 362, 368 grid from 26m:31s to 1m:50s . My fix is probably a dumb approach, but I think the issue is real.

For large grids it appears to spend a lot of time in flopy_io.py::write_grid_shapefile() in the loop just prior to wr.save(filename), which I traced to the reference.py::get_vertices() call:

image

It appears to me (I am a python novice so forgive any stupidity that follows) that the reference.py::get_vertices() call that occurs over nrow by ncol is triggering an unnecessary recreation of the xgrid/ygrid properties every time it gets called:

image

I verified that this line (line 296) is the slow part of the method call. My ignorant way of fixing this was just to check whether xgrid/ygrid had been created during the property call, and to skip their recreation:

image

SEAWAT; Itype==-1 and itype==-15 not counted as sink/sources

The cells with itype==-1 and itype==15 are counted by the SEAWAT routine as sink/sources. Not by flopy.

in flopy\mt3d\mtssm.py lines: 50 - 59, to:

self.stress_period_data = mflist(self, model=self.parent.mf,
                                         data=stress_period_data)

self.__maxssm = np.sum(self.stress_period_data.data[0].itype == -1)
self.__maxssm += np.sum(self.stress_period_data.data[0].itype == -15)

#        self.__maxssm = 0
#if (self.parent.btn.icbund != None):

if isinstance(self.parent.btn.icbund, np.ndarray):
    self.maxssm += (self.parent.btn.icbund < 0).sum()
for p in self.__SsmPackages:
    print 'label', p.label
    print 'instance', p.instance
    if ((p.label == 'BAS6') and (p.instance != None)):
        self.__maxssm += (p.instance.ibound < 0).sum()
    elif p.instance != None:
        self.__maxssm += p.instance.ncells()

Also moved the function call that assigns the stress_period_data variable upwards. That garantees that the stress_period_data is in mflist format.

Syntax error in BTN file

First of all, thanks creating and updating this python package! I upgraded my Flopy version yesterday from version 2.2.353 to the most recent version (3.2.3). SEAWAT gives a format syntax error, when trying to read the BTN-file. I have figured out that the error occurs due to an extra spacing in the control record. The self.format.fortran has shifted one space to the right in comparison with the previous version. When I delete this space in all control records of the BTN-file the error is gone.

I have fixed this problem now in my FloPy version in the def get_control_record (in util_array), by changing {2:>20s} in to {2:>19s}. However in the previous version of FloPy the value was also 20s. I could not figure out the true cause of this error, perhaps this is caused by my shift from Python 2.7 to Python 3.4.3?

format syntax error flopy 2 3 2

STRT option from GLO HDS file

I see the global process is not fully supported yet, which is likely a load of work, but it sure would be nice if someone could squeeze in support for loading STRT heads from a HDS file (e.g. using the DATAGLO option in the NAM file). Maybe adding external STRT support could be a first step toward supporting the GLO process?

External file formats

Consider implementing a method for accommodating user defined formats for external files.

external file support

Default behavior for external files is they should not be loaded and written to input MODFLOW input files. external_path kwarg should be used to control output of internal array data to external files.

.array method

FYI - I just changed the .array method in util_2d to return a COPY of the array as the model sees it - with the control record multiplier applied. This is new, but I think it is what probably expected. If you still need access to an array pointer that goes into the input file, use ._array

HUF package support

I like to have a HUF package support in flopy3, so I downloaded your code and added it. Now, my flopy reads and writes the HUF package file, but then I realized that I am missing zone and mlt files, which are of course not written as you fill up all parameter defined variables to native arrays for all packages. However, this approach is not possible for HUF as there is no way to write a HUF file without the use of parameters. What do you think would the best way to solve this issue:

  1. Change HUF to LPF package upon reading the HUF input file. This would require the smallest change of the flopy code, but one would use all the hydrogeologic model definition which is not very practical for some applications, like parameter estimation;
  2. Add parameter definition support. The user could decide if he wants to write the input files using parameters or native arrays. This would make flopy flexible, but maybe complicated;
  3. Add parameter support only for the HUF package. So pval is not written, but mlt and zone files are written when HUF is present.

docstrings about parameters

Suggested language to handle parameters in the docstrings:

Notes
-----
Parameters are supported in Flopy only when reading in existing models.
Parameter values are converted to native values in Flopy and the
connection to "parameters" is thus nonexistent.

Hubbertville problem w/ MF-NWT

Hello,

I'm trying to run the Hubbertville problem (with MF-NWT) from the new book by Anderson, Woessner and Hunt. I use a Mac, and therefore need to recompile MF-NWT. The problem is that the makefile is not included in the USGS program files (!). I tried with a compiled version available from Theo Olsthoorn's mflab project, but flopy cannot read the output files (although it runs OK). The problem seems to be that Theo's compiled mfnwt file is based on MF2005 v.1.9 whereas the example model in the book was run with v.1.11.

Could you please point me towards the makefile for MF-NWT, or the Mac-compiled version of mfnwt?

I am sure many Mac users are coming across this problem :)

Thanks!

The program mf2005 does not exist or is not executable.

run example of lake and all of folder flopy master, but model not run, install flopy in anaconda with pip, the version install is 3.2.1, , it is installed in enviroment Mac OS X.
Sorry for my bad English.

Thanks

Exception Traceback (most recent call last)
in ()
2 oc = mf.ModflowOc(ml)
3 ml.write_input()
----> 4 ml.run_model()

/Users/Oscar/anaconda/lib/python2.7/site-packages/flopy/mbase.pyc in run_model(self, silent, pause, report)
375 if exe is None:
376 s = 'The program {} does not exist or is not executable.'.format(self.exe_name)
--> 377 raise Exception(s)
378 else:
379 if not silent:

Exception: The program mf2005 does not exist or is not executable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.