Installed location:
In your program include the appropriate netCDF header file
#include <netcdf.h>and call the appropriate netCDF functions.
To compile and link enter:
CC pgm.c -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf -lm -o pgmReplace CC with either gcc or icc depending on which compiler you want to use. Replace pgm.c with the name of the file containing your source code and pgm with the name of the executable to be created.
Set NETCDF_HOME to be: /u/local/apps/netcdf/current. You can either set an environment variable or replace $NETCDF_HOME in the command shown above.
In your program include the appropriate netCDF header file
#include <netcdfcpp.h>and call the appropriate netCDF functions.
To compile and link enter:
CC pgm.cpp -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf_c++ -lnetcdf -lm -o pgmReplace CC with either g++ or icpc depending on which compiler you want to use. Replace pgm.cpp with the name of the file containing your source code and pgm with the name of the executable to be created.
Set NETCDF_HOME to be: /u/local/apps/netcdf/current. You can either set an environment variable or replace $NETCDF_HOME in the command shown above.
In your program include the appropriate netCDF header file
include 'netcdf.inc'and call the appropriate netCDF functions.
To compile and link enter:
ifort pgm.f -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf -o pgmReplace pgm.f with the name of the file containing your source code and pgm with the name of the executable to be created.
Set NETCDF_HOME to be: /u/local/apps/netcdf/current. You can either set an environment variable or replace $NETCDF_HOME in the command shown above.
In your program include the appropriate netCDF module
use netcdfand call the appropriate netCDF functions.
To compile and link enter:
ifort pgm.f90 -I$NETCDF_HOME/include -L$NETCDF_HOME/lib -lnetcdf -o pgmReplace pgm.f90 with the name of the file containing your source code and pgm with the name of the executable to be created.
Set NETCDF_HOME to be: /u/local/apps/netcdf/current. You can either set an environment variable or replace $NETCDF_HOME in the command shown above.