This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Vic, > I have downloaded binaries and have installed the netcdf-4.0 for both > the x86-64 and x86 Linux systems running both Fedora and Centos. Looks > to work fine, until one user reports the following error when trying to > use our pgf90 > on a test file . Here is what the user did to demonstrate the problems > on the 32 bit LINUX system. > > The f90 code is below: > program test_nf90 > use netcdf > implicit none > integer :: stat,ncid > character(len=16) :: file > ! > file = "test_nf90.nc" > stat = nf90_create(ncid,NF90_CLOBBER,file) > write(6,"('Created file ',a,'ncid=',i3)") file,ncid > end program test_nf90 > > We set the the following which is location of the netcdf-4.0 files > set lib_netcdf = /opt/local/netcdf/linux86/lib > set inc_netcdf = /opt/local/netcdf/linux86/include > pgf90 -o test_nf90 -Mfixed -I${inc_netcdf} -L${lib_netcdf} -lnetcdf > test_nf90.F > > And here's the error message: > > PGF90-F-0004-Corrupt or Old Module file > /opt/local/netcdf/linux86/include/netcdf.mod > (test_nf90.F: 3) > PGF90/x86-64 Linux 7.2-4: compilation aborted > > I did look at the netcdf.mod file and others and did notice that > netcdf.mod was older that the other include files > -rw-r--r-- 1 tisone wheel 2655 Mar 4 14:04 hdf5.h > -rw-r--r-- 1 tisone wheel 587643 Mar 4 14:04 hdf5.mod > -rw-r--r-- 1 tisone wheel 1553 Mar 4 14:04 hdf5_hl.h > -rw-r--r-- 1 tisone wheel 10123 Jun 29 2008 ncvalues.h > -rw-r--r-- 1 tisone wheel 54013 Jun 29 2008 netcdf.h > -rw-r--r-- 1 tisone wheel 23 Jun 29 2008 netcdf.hh > -rw-r--r-- 1 tisone wheel 57616 Jun 29 2008 netcdf.inc > -rw-r--r-- 1 tisone wheel 287084 Jun 29 2008 netcdf.mod > -rw-r--r-- 1 tisone wheel 18916 Jun 29 2008 netcdfcpp.h > -rwxr-xr-x 1 tisone wheel 5352 Mar 4 13:53 rice.h > > I wasn't sure if I could a newer netcdf.mod files or if I would need to > install the 4.1 version instead. > Any help would be greatly appreciated. Fortran-90 .mod (module) files are not portable across compilers, architectures, or even different releases of the same compiler, as Thomas Orgis points out in this thread: http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2009/msg00210.html You are probably encountering that problem, if the binaries you downloaded weren't built with the same version of pgf90 your user is compiling with. We don't distribute any .mod files built with pgf90, so if you got the binary from us, that's the problem. One way around the problem is to build the library from source using the same compiler as your users. That won't work if multiple Fortran compilers are in use, as each would generate different and incompatible .mod files. Solutions for this latter case are discussed in the netcdfgroup thread referenced above, especially these postings: http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2009/msg00219.html http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2009/msg00222.html Hope this helps. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: JZI-995484 Department: Support netCDF Priority: Normal Status: Closed