Problem reading netcdf module in make stage

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
austinctodd

Problem reading netcdf module in make stage

#1 Unread post by austinctodd »

I have tried to follow fairly closely with some of the suggested methods of installing and configuring ROMS on my MacBook with OSX 10.4.11 (especially the wonderful post by Parker MacCready at UW). However, I am still having unresolved issues when typing "make" in the ROMS directory that do not look like the same issues others are having. First off, here are the options I am using:

OSX 10.4.11
gfortran
netcdf-4.0 (also tried w/ netcdf-3.6.3 but receive same error)
hdf5

The error I am receiving is:
cd Build; /usr/local/bin/gfortran -c -frepack-arrays -O3 -ffast-math -ffree-form -ffree-line-length-none mod_netcdf.f90
Fatal Error: Reading module netcdf at line 23 column 27: Expected string
make: *** [Build/mod_netcdf.o] Error 1
Any suggestions would be greatly appreciated.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problem reading netcdf module in make stage

#2 Unread post by kate »

The first thing to do is to actually look at Build/mod_netcdf.f90 and see what is on line 23. I get:

Code: Select all

      INTERFACE netcdf_get_fvar
as the start of this block:

Code: Select all

      INTERFACE netcdf_get_fvar
        MODULE PROCEDURE netcdf_get_fvar_0d
        MODULE PROCEDURE netcdf_get_fvar_1d
        MODULE PROCEDURE netcdf_get_fvar_2d
        MODULE PROCEDURE netcdf_get_fvar_3d
        MODULE PROCEDURE netcdf_get_fvar_4d
      END INTERFACE netcdf_get_fvar
Is this what you have?

austinctodd

Re: Problem reading netcdf module in make stage

#3 Unread post by austinctodd »

Hi Kate. This is exactly what I have in my Build/mod_netcdf.f90 starting at line 23.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problem reading netcdf module in make stage

#4 Unread post by kate »

The gfortran on my Mac has no problem with this code:
gfortran --version
GNU Fortran (GCC) 4.4.0 20081219 (experimental)

austinctodd

Re: Problem reading netcdf module in make stage

#5 Unread post by austinctodd »

OK, so I was running version 4.3. I updated to the newer version (4.4) and attempted to compile again.

I now receive a different error associated with the mod_netcdf.f90
cd Build; /usr/local/bin/gfortran -c -frepack-arrays -O3 -ffast-math -ffree-form -ffree-line-length-none mod_netcdf.f90
mod_netcdf.f90:18.19:

USE mod_kinds
1
Fatal Error: Parse error when checking module version for file 'mod_kinds.mod' opened at (1)
make: *** [Build/mod_netcdf.o] Error 1
I am not clear on how to solve a parse error.

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: Problem reading netcdf module in make stage

#6 Unread post by m.hadfield »

The first thing to do now is to delete all files created during the build process and try again. I doubt it will fix the problem, but it should make it easier to identify the cause.

Edit: From the original post I suspect that you have a compiler-version mismatch. Gfortran's mod-file format changed in the last year or so. I suggest you build netCDF from source, using the same compiler as the one you use to build ROMS.

Post Reply