Page header: USGS banner

Software

MODFLOW

If you have not already done so, download the latest release of the desired version of MODFLOW source code from the Suvey's Water Resources Ground Water Software webpage:

MODFLOW-2000 .

MODFLOW-2005 .

Place the tar file containing the MODFLOW release in a directory of your choice and uncompress the tar file. For MODFLOW-2000, the source directory for the MODFLOW source files is mf2k and, relative to the location where the tar file is uncompressed, is located at mf2k.1_xx/src/mf2k (currently xx=18). For MODFLOW-2005 the source directory is src and, relative to the location where the tar file is uncompressed, is located at v1.x/src (currently x=5). Rename the file containing the MODFLOW main in the source directory, as it will be replaced. For MODFLOW-2000 and MODFLOW-2005 the replacements mf2k.f => mf2k_save.f and mf2005.f => mf2005_save.f, respectively, are suggested. Also rename the makefile that comes with the MODFLOW release: makefile => makefile_save. It is advisable to difference the saved main with the PCGN-release main; only differences related to PCGN subroutine calls should be present. If differences in subroutine calls other than PCGN are present, then a version conflict is likely; in this event, please contact the author, and he will provide you with the requisite version of the MODFLOW main.

PCGN

If you have not already done so, download the latest release of the PCGN source code compatible with the selected MODFLOW release:

PCGN-2000 Download.

PCGN-2005 Download.

Place this tar file in the MODFLOW source directory, as described previously, and uncompress the tar file. This action will create a new directory structure in the MODFLOW source directory, the top-most directory of which will be PCGN. The directories below PCGN are doc, solver and test. Directory solver contains the source files for the PCGN solver, directory test contains a test problem and directory doc contains the PCGN documentation.

Installation

  1. Load and install MODFLOW with PCGN

    Having downloaded and uncompressed tar files for the MODFLOW and PCGN releases, files containing the PCGN source code should be found in the directory PCGN/solver within the MODFLOW source directory. Copy all files contained in the PCGN/solver directory into the MODFLOW source directory. The PCGN source files include a makefile for compiling and installing MODFLOW with PCGN. The makefile is preset to use the gfortran compiler and Gnu C compiler; if the user wishes other compiler alternatives, the makefile must be modified. Before making the makefile, the user should determine the nature of the format specification for binary files (in the event that binary files are needed). Generally speaking, for gfortran, one should use the "unformatted" option as gfortran does not recognize the "binary" option. In MODFLOW, this option is set in the openspec.inc file. A openspec_unform.inc file, in which the "unformatted" option has been selected, has been included with the PCGN release; replacing openspec.inc with openspec_unform.inc before compiling the source code with the makefile will cause the "unformatted" option to be in effect. On the other hand, most commercial compilers allow that "binary" be used as an alternate to the "unformatted" specification; if the user is using a commercial compiler and has appropriately altered the makefile, then a "binary" format specification is feasible. This option is set in the file openspec_binary.inc, and is part of the PCGN release. MODFLOW releases can come with either option set; it is the user's responsibility to select the correct option for reading and writing binary data. Please note: "unformatted" binary files are not compatible with "binary" binary files. When the user is satisfied that compiler and binary format options are properly set, then MODFLOW with PCGN should be installed using the makefile.

  2. Test the installation

    After the installation process has finished, MODFLOW with PCGN can be tested using the example data set located in the PCGN/test directory. To generate a listing file for the for this example with MODFLOW2000 or MODFLOW2005, simply run the MODFLOW executable (MF2000.ex or MF2005.ex); when MODFLOW asks for the name of a NAME FILE, insert PCGN/test/twri.nam on the command line and press the return key. The listing file will be generated in the MODFLOW source directory. Compare the listing file generated (twri.lst) with the test listing file PCGN/test/twripcgn.lst to ascertain that the solver is working correctly. Remove the listing file twri.lst from the MODFLOW source file after verifying that it is substantially identically to PCGN/test/twripcgn.nam. If so desired, the object files (*.o) can also be removed from the source directory.


[Home]
[Previous]


URL: http://wwwbrr.cr.usgs.gov/projects/GW_stoch/pcgn/pages/mf200x_LU_install.shtml
Contact:rlnaff@usgs.gov

Last modified: 12 Dec 2008