Please enable JavaScript to view this site.

Online Guide to MODFLOW

Navigation: » No topics above this level «

Suggestions on Compiling MODFLOW-2000

Scroll Prev Top Next More

Most users will not need to compile MODFLOW-2000 because you can download a compiled version of MODFLOW-2000 from the USGS web site.  However, if you wish to make changes to the source code, you will need to compile it yourself.

Nearly all the Fortran code in MODFLOW is standard Fortran that will compile the same way with any compiler.  However, a small portion of the code uses compiler-dependent code.  This compiler dependent code is included in the file "openspec.inc".  Be sure to modify this file to the correct form for your compiler.  There are extensive comments in openspec.inc that can help you.

Prior to version 1.15.00, MODFLOW-2000 was written entirely in Fortran.  However, the GMG package added in version 1.15.00 is written primarily in C (with a small amount of Fortran code to link to the C code).  This makes compiling MODFLOW-2000 a bit more challenging than previously. Now, instead of just a Fortran compiler, a C compiler is also required. If one is not aware that the C language is case-sensitive and  the Fortran language is case insensitive, some error messages returned by compilers may be difficult to understand. Often the C compiler will "decorate" the name of the C function and the linker can't figure out how to link Fortran object code with an undecorated name with C object code with a decorated name. Users should try to find the switches in the compilers and linkers that control how names are decorated so that the object code generated by the C and Fortran compilers use consistent names.

This web page gives advice on compiling MODFLOW-2000 with some compilers.  However, no attempt has been made to test all Fortran compilers.  If you have information on how to compile it with another compiler, please send to rbwinst@usgs.gov so it can be included on this web page.

If you wish to compile a parallel version of MODFLOW-2000, you will need to get a copy of mpif.h.  

To enable the parallel-processing capabilities of MODFLOW-2000, an implementation of MPI must first be installed on your computer(s).  MPI software is not distributed by the USGS and must be obtained and installed separately.  The mpif.h file and MPI subroutines referenced in the para-mpi.f file and other locations in the MODFLOW source code will be provided as part of the MPI installation.  After MPI has been installed, use mpif.h and other source-code files provided with the MPI implementation that is installed on your computer(s) when MODFLOW-2000 is compiled with para-mpi.f.  Some implementations of MPI support only certain compilers, so ensure that the MPI implementation you install supports the compiler you will be using to compile MODFLOW-2000.  Please refer to page 203 of USGS Open-File Report 00-184 for additional information.

There is more info in the FAQ about compiling a parallel version of MODFLOW-2000.

You should check that the variables specified in openspec.inc are specified correctly for your compiler. There is more information about this in the FAQ.

References to commercial vendors of software products or services are provided solely for the convenience of users when obtaining or using USGS software. Such references do not imply any endorsement by the U.S. Government.

The information on this web page was provided with the assistance of Edward Banta, Steffan Mehl, Henk den Adel, William R. Hutchison, and Richard Winston.  The instructions may be outdated or incorrect.  If you find that the instructions are in error, please send corrections to rbwinst@usgs.gov.

 

Created with Help & Manual 8 and styled with Premium Pack Version 4 © by EC Software