netcdf with fortran-90

Lindsey, Daniel Lindsey at cira.colostate.edu
Fri Nov 3 11:24:31 MST 2006


All,



I'm attempting to compile netcdf-3.6.1 libraries on a Linux machine; my
ultimate goal is simply to use a Fortran-90 program to read a netcdf
file.  Following the install instructions, the following steps were
seemingly successful:



configure (I forced the F90 compiler to be pgf90)

make check 

make install



The libnetcdf.a file was put in /usr/lib/.  To test it, I wrote a 4 line
f90 program, and attempted to compile it like this:



pgf90 -o test.exe test.f90 -L/usr/lib -lnetcdf



The program is:



program test

integer :: ncid,status

status=NF90_OPEN("filesname.nc",0,ncid)

end program



The compile result is: undefined reference to nf90_open



Following some online examples, it appears that I need to add: 'use
netcdf' at the beginning of the program.  I assume it's looking for
netcdf.mod (which I found in /netcdf-3.6.1/src/f90), so I copied this
 to
my working directory.  But this gives the error:



Incompatable or old module file ./netcdf.mod



Any ideas?  I'm guessing the problem is related to this module file, but
I don't know what else to try.



Many thanks,



Dan



**********************************************

Dan Lindsey

Meteorologist, NOAA/NESDIS/Regional and Mesoscale Meteorology Branch

PH: (970) 491-8773  FAX:  (970) 491-8241

NOAA Email: Dan.Lindsey at noaa.gov <mailto:Dan.Lindsey at noaa.gov> 





More information about the netcdfgroup mailing list