Steps to instal Modflow in Windows

856 views
Skip to first unread message

halla rezgui

unread,
May 7, 2021, 2:44:46 AM5/7/21
to mod...@googlegroups.com
Dear all,


Could you please guide me through the installation process of Modflow in my laptop, because I tried to download it from USGS website, unfortunately I was not able to run the program.

Best,
Halla 

Mak.Gurukul

unread,
May 7, 2021, 4:21:39 AM5/7/21
to MODFLOW Users Group
Go through the 

Scott Elliott Boyce

unread,
May 8, 2021, 12:25:46 AM5/8/21
to MODFLOW Users Group
Most versions of MODFLOW all a standalone windows executable (it ends with .exe, such as mf-owhm.exe), so you have to either double click it, run it from the command prompt (cmd.exe), or have a GUI, such as 
ModelMuse ( https://www.usgs.gov/software/modelmuse-a-graphical-user-interface-groundwater-models
or the EU's QGIS-FreeWat ( http://www.freewat.eu/
to run it (which behind the scene just opens a command prompt and runes the executable.

I develop code for MODFLOW-OWHM, so I will use that as an example, but the same procedure works for MODFLOW-2005 or MODFLOW-6. MODFLOW-OWHM info is at:

If you run from the command prompt, then it is easiest to place a copy of the executable in the same folder as the input files (this makes relative paths easy). 
If you use a GUI you can always generate the input files and move the exe into that folder and follow the same set of instructions.

What is important to note is that everything is relative to the directory the command prompt has open.
For example, this is cmd.exe opened at C:\modflow_example  (The default location is C:\Users\YourWindowsUserName).

command_window.PNG

An easy method to open the console at a specific windows folder is to just type into the windows explorer url bar cmd as show below. To illustrate running a modflow example I copied into the folder the input files for the MODFLOW-NWT Seawater Intrusion (swi2ex4sww) example problem.

(this image has the current directory path in the url bar which is C:\modflow_example)
cmd_explorer0.png

(now I have typed cmd and hit enter as show in the window below)

cmd_explorer.png

When you run the MODFLOW program it will ask you for the location of the MODFLOW name file (swi2ex4sww.nam). 
This file specifies the packages in use and the location of their input files.
In this case, I am running the exe in the same folder as the input files so there is no need to specify the path for each file nor the name file. 
Otherwise everything would have to be relative to where the command prompt is currently positioned or specify an absolute path (absolute paths should never be used since they are not portable. One windows an absolute path always includes a drive letter, such as C:\)

If you run mf-owhm without any command arguments, then it will ask for the name file or it can be specified directly when running.

So by typing 
mf-owhm.exe  swi2ex4sww.nam
will run the program with that specific name file (this has swi2ex4sww.nam as the name file as a command argument).

The following shows the command prompt opened and I ran the mf-owhm.exe without any arguments, so I had to answer the request for a name file (the red circle is what I typed in):

run_mf-owhm.png

Then either you will get an error message if something does not work or if it runs will see something like this:
(Note that that calendar date will only appear if you specify a starting date for the model, in this case I modified the input to specify a starting date of January 2010)

run_mf-owhm_run.png

and then when the model completes you should see the following:

run_mf-owhm_end.png


Hope that helps out,

Scott

--Side note that the input structure for MODFLOW-2005, MODFLOW-NWT, and MODFLOW-LGR work without modification in MODFLOW-OWHM, 
but MODFLOW-6 is a different arc of MODFLOW so it has a unique input structure for it.  MODFLOW-6 does provide a translation program that converts MODFLOW-2005 to the MODFLOW6 input structure, but not the reverse direction. 

--Second Note, FreeWat is a GUI front end that uses QGIS on the backend to build MODFLOW-OWHM models, which implicitly sorts any MODFLOW-2005 variants, but requires the MODFLOW6 translator program if you want to use that MODFLOW arc with  FreeWat .
Reply all
Reply to author
Forward
0 new messages