Installing Modflow on Mac OS

1,402 views
Skip to first unread message

Nathan Barber

unread,
Dec 17, 2016, 10:42:45 PM12/17/16
to MODFLOW Users Group
I am attempting to install mf2005v1_11_00_unix.zip and am getting the following error when trying to compile the src via the make command...

gfortran -D_UF -O3 -c r_vector.c

In file included from r_vector.c:3:0:

r_vector.h:6:20: fatal error: stdlib.h: No such file or directory

 #include <stdlib.h>

                    ^

compilation terminated.

make: *** [r_vector.o] Error 1




Can anyone offer any advice on what to do?  I have exhausted Googling/trial and error...



Thanks.

Christian Langevin

unread,
Dec 18, 2016, 5:28:35 AM12/18/16
to MODFLOW Users Group
Nathan,

I suggest that you take a look at pymake (https://github.com/modflowpy/pymake).  Pymake is a python package for compiling MODFLOW.  The github site also has some scripts available for downloading and building different flavors of MODFLOW.  

-Chris Langevin

Giovanni Firmani

unread,
Dec 18, 2016, 8:41:25 AM12/18/16
to mod...@googlegroups.com
Hi Chris
the link is very interesting. I used it to compile mf2005. Executable works OK when I run a simulation. However I have a problem with flopy. I tried to run tutorial1.py I got from the flopy website but I get some error messages. mf2005 runs without any problem and produces the expected results, but the flopy command to read the binary files does not seem to work. See the errors below


giovanni@giovanni-HP-Compaq-6720s:~/Modflow_models$ python tutorial1.py
/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
warning: assuming SpatialReference units are meters
FloPy is using the following executable to run the model: /usr/bin/mf2005dbl

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

 Using NAME file: tutorial1.nam
 Run start date and time (yyyy/mm/dd hh:mm:ss): 2016/12/18 19:25:41

 Solving:  Stress period:     1    Time step:     1    Ground-Water Flow Eqn.
 Run end date and time (yyyy/mm/dd hh:mm:ss): 2016/12/18 19:25:41
 Elapsed run time:  0.003 Seconds

  Normal termination of simulation
/usr/local/lib/python2.7/dist-packages/flopy/utils/binaryfile.py:176: UserWarning: Possible error. ncol (538976288) or nrow (1145128264) > 10000
  warnings.warn(s)
Traceback (most recent call last):
  File "tutorial1.py", line 57, in <module>
    hds = bf.HeadFile(modelname + '.hds', text='head',precision='single')
  File "/usr/local/lib/python2.7/dist-packages/flopy/utils/binaryfile.py", line 334, in __init__
    super(HeadFile, self).__init__(filename, precision, verbose, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flopy/utils/binaryfile.py", line 161, in __init__
    super(BinaryLayerFile, self).__init__(filename, precision, verbose, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flopy/utils/datafile.py", line 118, in __init__
    self._build_index()
  File "/usr/local/lib/python2.7/dist-packages/flopy/utils/binaryfile.py", line 187, in _build_index
    header = self._get_header()
  File "/usr/local/lib/python2.7/dist-packages/flopy/utils/binaryfile.py", line 221, in _get_header
    return header[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

By the way I am using linux ubuntu 14.04
Thanks in advance and sorry for the off topic question.



 Sent with Mailtrack

--
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+unsubscribe@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modflow.
For more options, visit https://groups.google.com/d/optout.



--
Giovanni Firmani
2/58 McDonald St, Como WA 6152, Australia
Fax      +39 06 56562922
Skype gio.vanni.f

Christian Langevin

unread,
Dec 18, 2016, 10:13:00 AM12/18/16
to MODFLOW Users Group
Hi Giovanni,

Looks like you are using the double precision version of MODFLOW.  In that case, you need to tell the binary file reader that it is double:  

hds = bf.HeadFile(modelname + '.hds', text='head',precision='double')

Unfortunately, FloPy isn't smart enough yet to tell the precision of the binary file.


On 18 December 2016 at 18:20, Christian Langevin <clan...@gmail.com> wrote:
Nathan,

I suggest that you take a look at pymake (https://github.com/modflowpy/pymake).  Pymake is a python package for compiling MODFLOW.  The github site also has some scripts available for downloading and building different flavors of MODFLOW.  

-Chris Langevin


On Saturday, December 17, 2016 at 10:42:45 PM UTC-5, Nathan Barber wrote:
I am attempting to install mf2005v1_11_00_unix.zip and am getting the following error when trying to compile the src via the make command...

gfortran -D_UF -O3 -c r_vector.c

In file included from r_vector.c:3:0:

r_vector.h:6:20: fatal error: stdlib.h: No such file or directory

 #include <stdlib.h>

                    ^

compilation terminated.

make: *** [r_vector.o] Error 1




Can anyone offer any advice on what to do?  I have exhausted Googling/trial and error...



Thanks.

--
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.

Giovanni Firmani

unread,
Dec 19, 2016, 10:41:37 AM12/19/16
to mod...@googlegroups.com
thanks, it worked



To unsubscribe from this group and stop receiving emails from it, send an email to modflow+unsubscribe@googlegroups.com.

To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modflow.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages