Installing NetCDF library in your computer

On Linux and Mac OS X machines typically you can install NetCDF from the main software repositories (with "yum" or similar package manage on Linux or MacPorts on Mac). You can try it, but we don't recommend this approach. The problem is that for a library to be compatible with your Fortran compiler it has to be compiled with the same compiler and with the same flags you will be using and that may be not the case when you get a precompiled library from a repository. If you install NetCDF with MacPorts, at least make sure that you have installed the Fortran compiler before you start the installation of NetCDF and that MacPorts recognizes it as a default compiler.

The safer way, though, is to install NetCDF from the source code. You can download the gzipped tar file with the source code from

http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
To install it do the following. Untar the downloaded file and enter the directory with downloaded code:
tar -xzf netcdf-3.6.3.tar.gz
cd netcdf-3.6.3
Choose a directory where you want to install NetCDF, say "/opt/netcdf/3.6.3" (make sure that directory above it exists and is writable to you). Make sure that Fortran compiler is installed and is functional. Now, start the installation process.

Inform the system which Fortran compiler you are going to use

export FC=gfortran
Configure the package giving it the desired location for installation
./configure --prefix=/opt/netcdf/3.6.3
Compile and install the package
make
make install
Netcdf library should now be functional on your system. To inform modelE about its location you need to add the following line to your ~/.modelErc file:
NETCDFHOME=/opt/netcdf/3.6.3