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 Dessy, The gfortran error you are getting USE netcdf 1 Fatal Error: File 'netcdf.mod' opened at (1) is not a GNU Fortran module file make[1]: *** [cf90_routines.o] Error 1 make: *** [linux-gfort] Error 2 indicates that the netcdf.mod file find in /usr/local/include was not compiled with the gfortan compiler, or was compiled with a much older version of gfortran that had a different format for module files. Check the creation date on the netcdf.mod file and see to make sure it is more recent than your netCDF 4.2.1.1 library files in /usr/local/lib. If not, it's probably left over from an earlier install, possibly with a different compiler. The netCDF Fortran package is now separate from the netCDF C package, so you have to build and install it separately, *after* you have installed the netCDF C library. If you need to rebuild and install the netCDF 4.2 release from Unidata or the version 4.4.0-rc1 release candidate (either is compatible with your netCDF C library), follow these building and installation instructions: http://www.unidata.ucar.edu/netcdf/docs/netcdf-fortran-install.html --Russ > I would like to reporting problems as followings: > Currently I am trying to use netcdf-4.2.1.1 on my mac OS X 10.8.5 with > compiler gfortran-4.8.1 (gcc version 4.8.1) > We need netcdf to support us in ocean model of COHERENS V2.4.1, but it failed > in compiling, as followings: > > Dessys-MacBook-Pro:models dessy$ ln -s /Users/dessy/coherens/V2.4.1/ COHERENS2 > Dessys-MacBook-Pro:models dessy$ COHERENS2/install_test > Dessys-MacBook-Pro:models dessy$ make linux-gfort > make coherens "FC=gfortran" "FCOPTS= -O3" "FCDEFS=" "FCDEBUG=" \ > "CPP=" "CPPF=cpp" "CPPOPTS=-traditional-cpp" "CPPDEFS=-DCDF" > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/currents.f90 > -o currents.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/syspars.f90 -o > syspars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/datatypes.f90 > -o datatypes.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/density.f90 -o > density.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/depths.f90 -o > depths.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/diffusion.f90 > -o diffusion.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/fluxes.f90 -o > fluxes.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/grid.f90 -o > grid.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/gridpars.f90 > -o gridpars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/iopars.f90 -o > iopars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/meteo.f90 -o > meteo.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/modids.f90 -o > modids.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/nestgrids.f90 > -o nestgrids.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/obconds.f90 -o > obconds.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/optics.f90 -o > optics.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/paralpars.f90 > -o paralpars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/physpars.f90 > -o physpars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/relaxation.f90 > -o relaxation.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/switches.f90 > -o switches.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/tide.f90 -o > tide.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/timepars.f90 > -o timepars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/turbpars.f90 > -o turbpars.o > gfortran -I/usr/local/include -O3 -c COHERENS2/code/source/turbulence.f90 > -o turbulence.o > gfortran -I/usr/local/include -O3 -c > COHERENS2/code/source/utility_routines.f90 -o utility_routines.o > cpp -traditional-cpp -DCDF COHERENS2/code/source/error_routines.F90 > ./error_routines.f90 > COHERENS2/code/source/error_routines.F90:178:27: warning: missing terminating > ' character > [-Winvalid-pp-token] > WRITE (ioerr,'(A)') ' Interval must contain an integer number of& > ^ > COHERENS2/code/source/error_routines.F90:179:41: warning: missing terminating > ' character > [-Winvalid-pp-token] > & space steps' > ^ > COHERENS2/code/source/error_routines.F90:275:27: warning: missing terminating > ' character > [-Winvalid-pp-token] > WRITE (ioerr,'(A)') 'Interval must contain an integer number of& > ^ > COHERENS2/code/source/error_routines.F90:276:41: warning: missing terminating > ' character > [-Winvalid-pp-token] > & space steps' > ^ > COHERENS2/code/source/error_routines.F90:346:27: warning: missing terminating > ' character > [-Winvalid-pp-token] > WRITE (ioerr,'(A)') ' Interval must contain an integer number of time& > ^ > COHERENS2/code/source/error_routines.F90:347:34: warning: missing terminating > ' character > [-Winvalid-pp-token] > & steps' > ^ > COHERENS2/code/source/error_routines.F90:2410:67: warning: missing > terminating ' character > [-Winvalid-pp-token] > ! .TRUE. or lower than 'maxval if 'matchmax' is .FALSE. > ^ > 7 warnings generated. > gfortran -I/usr/local/include -O3 -c ./error_routines.f90 -o > error_routines.o > gfortran -I/usr/local/include -O3 -c > COHERENS2/code/source/datatypes_init.f90 -o datatypes_init.o > gfortran -I/usr/local/include -O3 -c > COHERENS2/code/biology/source/biovars_routines.f90 -o biovars_routines.o > gfortran -I/usr/local/include -O3 -c > COHERENS2/code/source/modvars_routines.f90 -o modvars_routines.o > gfortran -I/usr/local/include -O3 -c > COHERENS2/code/source/time_routines.f90 -o time_routines.o > gfortran -I/usr/local/include -O3 -c > COHERENS2/code/source/array_interp.f90 -o array_interp.o > cpp -traditional-cpp -DCDF COHERENS2/code/source/cf90_routines.F90 > ./cf90_routines.f90 > COHERENS2/code/source/cf90_routines.F90:2183:48: warning: missing terminating > ' character > [-Winvalid-pp-token] > !*dimids* INTEGER Returned IDs of the variable's dimensions > ^ > COHERENS2/code/source/cf90_routines.F90:3489:37: warning: missing terminating > ' character > [-Winvalid-pp-token] > !*curname* CHAR Current attribute's name > ^ > COHERENS2/code/source/cf90_routines.F90:3490:33: warning: missing terminating > ' character > [-Winvalid-pp-token] > !*newname* CHAR New attribute's name > ^ > 3 warnings generated. > gfortran -I/usr/local/include -O3 -c ./cf90_routines.f90 -o > cf90_routines.o > COHERENS2/code/source/cf90_routines.F90:37.7: > > USE netcdf > 1 > Fatal Error: File 'netcdf.mod' opened at (1) is not a GNU Fortran module file > make[1]: *** [cf90_routines.o] Error 1 > make: *** [linux-gfort] Error 2 > > Following I include the needed information: > 1. I have installed netcdf: v4.2.1 (netcdf library version 4.2.1.1 of Jan 20 > 2013 12:38:00 $) > 2. Also install hdf5-1.8.11 and zlib-1.2.8 > 3. File of configure and config.log > > I would be highly appreciate for any suggestion to solve my problem. > Thank you very much for your help. > > Best regards, > > dessy > > -- > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: KNN-483520 Department: Support netCDF Priority: Normal Status: Closed