Modflow 2000 installation instructions for Linux

Modflow Installation: Linux    

This is a walk-through for installing Modflow 2000 GWT* on Linux operating systems, I have had success with this method on Linux mint and different flavors of Ubuntu. YMMV.

*MOC3D not functioning yet, the following instructions will install Modflow2000 only, not Modflow 2000 GWT

Check back for updates

Note: No need to type the dollar sign as seen in some of the terminal instructions, the $ is to delineate that we are typing the following line into a terminal window.

  1. Open an internet brower and go to:

Select the appropriate miniconda 3.6 installer for your system and install it

  1. Open your terminal, in Linux press ctrl+alt+t, in the terminal type the following line and press enter:

$ sudo apt-get install pip

now update with:

$ apt-get update

  1. Next type the following into the terminal and press enter:

$ conda install numpy

  1. Next type the following into the terminal and press enter:

$ pip install

  1. We will need gfortran, so in the terminal:

$ sudo apt-get install gfortran

  1. In an internet browser type into the address bar, press enter. This will take us to the Git Hub page  for pymake: a python package for compiling MODFLOW 2000
  2. Click on the examples folder -> click -> click “Raw” button -> right click anywhere on the page, save to a location you’ll remember and make sure the file saves with the “.py” extension, the Desktop works (This is the python script that will compile the executable file we will need.)
  1. Back to the terminal use cd (change directory command) to path to where you saved the file
    1. If you saved it to the Desktop, type this:  $ cd Desktop
    2. Alternatively find it in a file explorer and
      1. Right click anywhere in the window and select “open a terminal here”.
  1. If you put the file on the desktop you should see something like this in your terminal:   ~/Desktop $

Then type the following:   $ python

If everything works you should end up with folder on your desktop or wherever you are that is called temp. Inside is a shiny  new modflow2000 executable!

  1. Next, type this into your internet browser address bar:

Save the file wherever you’d like, extract it, open the /bin folder (it should be empty), copy the executable we built in the previous step (mf2000) into this folder and rename it to mf2k_gwt

  1. Open a terminal in this folder and type the following to tell your computer that this is an executable file:

$ chmod +x mf2k_gwt

  1. In your file explorer path to the /test folder in mf2k_gwt, then run, there are many ways to do this one way is open a terminal in the folder and type:

$ ./

Now, according to the Readme.txt (located in /mf2k_gwt) if everything worked well you should see discrepancies of 0 in the check.out file in the /test folder that was created when you ran the script. Go ahead and open the Readme.txt file, read it, and then inspect the check.out file.





Extra tips:

Atom is a flexible and approachable text editor that works well for writing and reading MODFLOW files and lots of other things, you can find it here:

Saving MODFLOW input files made in Atom as .prn seems to work fine

Now to create a model, you’ll want to create new folder, copy in the executable and create/save your MODFLOW files in the same folder.

if you have trouble with the executable, make sure it has been set as an executable by “chmod +x”, by typing “ls” into the terminal at your model folder you should see the executable be highlighted

To run the program open a terminal in that folder and type: $ ./mf2k_gwt

“$ ./” is a common command for running executables.

I’m working on an action file for Thunar so that you no longer need to put the MODFLOW executable in each model folder, I will update this when I have that figured out.

If you have any questions/suggestions, leave a comment


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s