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 Frank, > Description of problem: We installed netcdf with g95 on a 64 bit computer > > mkdir /opt/netcdf-4.1.3-g95-64 > export CC="gcc" > export CXX="g++" > export CPPFLAGS="-DNDEBUG -DgFortran" > export CFLAGS="-O -m64" > export FC="g95" > export F77="g95" > export FFLAGS="-O -g -fno-second-underscore" > export FCFLAGS="-O -g -fno-second-underscore" > ./configure --prefix=/opt/netcdf-4.1.3-g95-64 > make > make test > make install > > Compiling the CHIMERE model we always get error messages like this: > > In file endchimere.F90:21 > > ncstat=nf90_close(meteo_ncid) > 1 > Error: Type mismatch in parameter 'ncid' at (1). Passing INTEGER(4) to > INTEGER(8) > > Changing the compiling options from -i4 to -i8 avoids this compiling > problem but produces a segmentation fault later somewhere else. > > So, my question: How can we compile NETCDF with g95 in a manner that > netdcf expects a 4 byte integer instead of a 8 byte integer? Try setting export CFLAGS="-O -m32" and also add "-m32" to your FFLAGS and FCFLAGS. You will get 32-bit libraries, but they will still be able to read and write netCDF files with 64-bit offsets, because netCDF was designed to work on 32-bit platforms as well as 64-bit platforms. If that doesn't work, you might try using gfortran instead of g95. We test with gfortran ... --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: LVC-614373 Department: Support netCDF Priority: Normal Status: Closed