ROMS3 with gfortran and MPICH2

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
dsdarr
Posts: 6
Joined: Wed Jun 25, 2003 5:46 pm
Location: Univ. of Washington - School of Oceanography

ROMS3 with gfortran and MPICH2

#1 Unread post by dsdarr »

I can't seem to get ROMS3 to compile with gfortran and MPICH2. I have no trouble compiling the serial version. I have compiled (and recompiled) the MPICH2 package with gfortran (with no apparent problems) but when I attempt to compile ROMS I consistently get:

cd Build; gfortran -c -frepack-arrays -O3 -ffast-math -ffree-form mod_parallel.f90
Error: Can't open included file 'mpif.h'
In file mod_parallel.f90:76

integer, parameter :: MP_FLOAT = MPI_DOUBLE_PRECISION
1
Error: Symbol 'mpi_double_precision' at (1) has no IMPLICIT type
make: *** [Build/mod_parallel.o] Error 1


any suggestions? thanks, David

jcwarner
Posts: 1188
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

#2 Unread post by jcwarner »

check your environment and see if the location of mpif.h is in your INCLUDE list.

dsdarr
Posts: 6
Joined: Wed Jun 25, 2003 5:46 pm
Location: Univ. of Washington - School of Oceanography

ROMS3 with gfortran and MPICH2

#3 Unread post by dsdarr »

jcwarner wrote:check your environment and see if the location of mpif.h is in your INCLUDE list.
That's the bizarre thing. It is. I should have mentioned this. I had no problem, by the way, of getting the PGI version of this to compile with MPICH2.

David

dsdarr
Posts: 6
Joined: Wed Jun 25, 2003 5:46 pm
Location: Univ. of Washington - School of Oceanography

#4 Unread post by dsdarr »

Okay I figured out how to resolve this. If I copy mpiif.h directly to the Build directory manually it will compile. I still can't figure out why it doesn't see it in my mpich2/include directory though, especially in light of the fact that it works fine under PGI.

thanks, David

RubenDiez-Lazaro

#5 Unread post by RubenDiez-Lazaro »

I actually use gfortran and MPICH2 to get roms3 working...

My netcdf library path and MPICH2 installation path are in directories under my home one, so i must do some changes in the "Compilers/Linux-gfortran.mk" file...

Here is the output of the diff Linux-gfortran.mk Linux-gfortran.mk.original command:

Code: Select all

51,52c51,52
<     NETCDF_INCDIR ?= /home/roms/ROMS/lib/netcdf_gfortran/include
<     NETCDF_LIBDIR ?= /home/roms/ROMS/lib/netcdf_gfortran/lib
---
>     NETCDF_INCDIR ?= /usr/local/include
>     NETCDF_LIBDIR ?= /usr/local/lib
67c67
<                FC := /home/roms/ROMS/lib/mpich2-gfortran/bin/mpif90
---
>                FC := mpif90
As you can see, i installed the netcdf library under the "/home/roms/ROMS/lib/netcdf_gfortran/" directory, and the MPICH2 stuff under the "home/roms/ROMS/lib/mpich2-gfortran/" one...

With this changes it works for me....

Regards

Post Reply