There are a few discussions involving netcdf installations so I though I’d ask for help here. My CAMx work is waiting on a successful install of netcdf, and I’ve gotten through all but the last step which is the netcdf-fortran-4.4.5 component. I’m following step by step instructions modeled on the docs.unidata.ucar.edu pages, and have successfully done (in sequence) zlib-1.2.11, hdf5-1.10.5, and netcdf-c-4.6.1 and have confirmed that libnetcdf.a has been built.
However, I’ve encountered errors after making netcdf-fortran that I don’t understand, but I’m hoping someone with more experience will recognize them and suggest a solution. I’ve defined gcc and gfortran as compilers, the prefixes as paths in my /home, and pasted the build scripts and error messages further down.
Thank you, I appreciate any assistance as I’m mostly on my own in this. It’s been suggested that./configure options will fix this, but I haven’t found which ones those are.
NETCDF INSTALL SCRIPTS
---- Build the zlib library (used for compression) ----
tar xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix={BLD_DIR}/zlib-1.2.11
make
make install
---- Build the HDF5 library (used for compression) ----
cd {SRC_DIR}
tar xvzf hdf5-1.10.5.tar.gz
cd hdf5-1.10.5
setenv LDFLAGS -L{BLD_DIR}/zlib-1.2.11
./configure --prefix={BLD_DIR}/hdf5-1.10.5 --enable-fortran
make
make install
---- Build the NetCDF C libraries ----
cd {SRC_DIR}
tar xvzf netcdf-c-4.6.1.tar.gz
cd netcdf-c-4.6.1
setenv CFLAGS -I{BLD_DIR}/hdf5-1.12.0/include
setenv LDFLAGS -L{BLD_DIR}/hdf5-1.12.0/lib
./configure --prefix=$CAMx_PKGS/netcdf-c-4.6.1 --disable-dap
make
make install
---- Build the NetCDF FORTRAN libraries ----
cd {SRC_DIR}
tar xvzf netcdf-fortran-4.4.5.tar.gz
cd netcdf-fortran-4.4.5
setenv CPPFLAGS -I{BLD_DIR}/netcdf-c-4.6.1/include
setenv LDFLAGS -L{BLD_DIR}/netcdf-c-4.6.1/lib
setenv LD_LIBRARY_PATH {BLD_DIR}/netcdf-c-4.6.1/lib
./configure --prefix={BLD_DIR}/netcdf-c-4.6.1
make
make install
NETCDF-FORTRAN MAKEFILE ERROR MESSAGES
Making install in fortran
make[1]: Entering directory ‘/home/enzo/NetCDF_Src/netcdf-fortran-4.4.5/fortran’
gfortran -g -O2 -c -o netcdf4.o netcdf4.f90
netcdf4_func.f90:730:75:
730 | inq_var_fill_FourByteReal = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 1
…
740 | inq_var_fill_EightByteReal = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/REAL(8)).
netcdf4_func.f90:720:75:
720 | inq_var_fill_EightByteInt = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 1
…
740 | inq_var_fill_EightByteReal = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/REAL(8)).
netcdf4_func.f90:710:74:
710 | _inq_var_fill_FourByteInt = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 1
…
740 | _inq_var_fill_EightByteReal = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
netcdf4_func.f90:700:73:
700 | 0_inq_var_fill_TwoByteInt = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 1
…
740 | 0_inq_var_fill_EightByteReal = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(2)/REAL(8)).
netcdf4_func.f90:690:73:
690 | 0_inq_var_fill_OneByteInt = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 1
…
740 | 0_inq_var_fill_EightByteReal = nf_inq_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(1)/REAL(8)).
netcdf4_func.f90:670:75:
670 | def_var_fill_FourByteReal = nf_def_var_fill(ncid, varid, no_fill, fill)
| 1
…
680 | def_var_fill_EightByteReal = nf_def_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/REAL(8)).
netcdf4_func.f90:660:75:
660 | def_var_fill_EightByteInt = nf_def_var_fill(ncid, varid, no_fill, fill)
| 1
…
680 | def_var_fill_EightByteReal = nf_def_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/REAL(8)).
netcdf4_func.f90:650:74:
650 | _def_var_fill_FourByteInt = nf_def_var_fill(ncid, varid, no_fill, fill)
| 1
…
680 | _def_var_fill_EightByteReal = nf_def_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
netcdf4_func.f90:640:73:
640 | 0_def_var_fill_TwoByteInt = nf_def_var_fill(ncid, varid, no_fill, fill)
| 1
680 | 0_def_var_fill_EightByteReal = nf_def_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(2)/REAL(8)).
netcdf4_func.f90:630:73:
630 | 0_def_var_fill_OneByteInt = nf_def_var_fill(ncid, varid, no_fill, fill)
| 1
…
680 | 0_def_var_fill_EightByteReal = nf_def_var_fill(ncid, varid, no_fill, fill)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(1)/REAL(8)).
make[1]: *** [Makefile:626: netcdf4.o] Error 1
make[1]: Leaving directory ‘/home/enzo/NetCDF_Src/netcdf-fortran-4.4.5/fortran’
make: *** [Makefile:544: install-recursive] Error 1