Setting the netCDF Environment Variable


Before compiling WRF, you will need to set the netCDF environment variable. Typically, the netCDF libraries are located in /usr/local/netcdf (however, you will need to verify this, and make sure you point to the correct location when you set your environment variable - you may wish to discuss this with your systems administrator at your institute).

setenv NETCDF /usr/local/netcdf


Add this environment variable to your .cshrc (or .login or .profile) file. This will ensure that it is always set correctly, and that you do not have to reset it every time that you log–in.


Ensure that your netCDF libraries were compiled with the same compiler that you are going to use to compile WRF.
e.g., If you are compiling WRF with a PGI compiler, your netCDF libraries must also be compiled with that same version of PGI.



NCAR – Cheyenne Users

On NCAR's Cheyenne supercomputer, netCDF is installed in:

/glade/u/apps/ch/opt/netcdf/version/compiler/version_of_compiler

above, 'version' is the version of netcdf you currently have loaded, the 'compiler' is the compiler you currently have loaded, and the 'version of compiler' is the version of the currently loaded compiler (ex. /4.4.1.1/intel/17.0.1).