Wednesday, July 21, 2010

Compiling netcdf4 for ROMS

ROMS likes static netCDF4 libraries. This is how to compile those:

export FC=gfortran
export F77=gfortran
export F90=gfortran
export FFLAGS='-O3'
./configure --prefix=/opt/netcdf4_static/gfortran --enable-netcdf-4 --with-hdf5=/opt/hdf5/gfortran --disable-shared --disable-dap

This configuration makes a set of static libraries that do not use opendap (otherwise, a libcurl needs to be linked to). Other programs prefer the shared libraries, so these go to the usual location /opt/netcdf4/gfortran.

No comments:

Post a Comment