NetCDF

NetCDF (Network Common Data Form) is an interface for array-oriented data access and a library that provides an implementation of the interface. The netCDF library also defines a machine-independent format for representing scientific data. Together, the interface, library, and format support the creation, access, and sharing of scientific data.

Availability and Restrictions

NetCDF is available on Glenn, Oakley and Ruby Clusters. The versions currently available at OSC are:

Version Glenn Oakley ruby notes
3.6.2 X*      
4.1.3 X X   Default version on Oakley prior to 09/15/2015
4.3.2     X  
4.3.3.1

 

X* X*  
* : Current Default Version

You can use module spider netcdf  to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

Access

NetCDF is available without restriction to all OSC users.

Usage

Usage on Glenn

Set-up on Glenn

Initalizing the system for use of the NetCDF is dependent on the system you are using and the compiler you are using. To load the default NetCDF on Glenn, run the following command: module load netcdf . To use the parallel implementation of NetCDF, run the following command instead: module load pnetcdf . To load a particular version, use  module load netcdf-version . For example, use  module load netcdf-3.6.2  to load NetCDF version 3.6.2 on Glenn. You can use module avail netcdf  to view available modules on Glenn.

Building With NetCDF

With the netcdf library loaded, the following environment variables will be available for use:

Variable Use
$NETCDF_CFLAGS Use during your compilation step for C or C++ programs.
$NETCDF_FFLAGS Use during your compilation step for Fortran programs.
$NETCDF_LIBS Use when linking your program to NetCDF.

Similarly, when the pnetcdf module is loaded, the following environment variables will be available:

VARIABLE USE
$PNETCDF_CFLAGS Use during your compilation step for C programs.
$PNETCDF_FFLAGS Use during your compilation step for Fortran programs.
$PNETCDF_LIBS Use when linking your program to NetCDF.
 

For example, to build the code myprog.c with the netcdf library you would use:

icc -c $NETCDF_CFLAGS myprog.c
icc -o myprog myprog.o $NETCDF_LIBS

Batch Usage on Glenn

When you log into glenn.osc.edu you are actually logged into a linux box referred to as the login node. To gain access to the mutiple processors in the computing environment, you must submit your job to the batch system for execution. Batch jobs can request mutiple nodes/cores and compute time up to the limits of the OSC systems. Refer to Queues and Reservations and Batch Limit Rules for more info.  Batch jobs run on the compute nodes of the system and not on the login node. It is desirable for big problems since more resources can be used.

Non-interactive Batch Job (Serial Run)
A batch script can be created and submitted for a serial or parallel run. You can create the batch script using any text editor you like in a working directory on the system of your choice. You must load the netcdf or pnetcdf module in your batch script before executing a program which is built with the netcdf library. Below is the example batch script that executes a program built with NetCDF:
#PBS -N AppNameJob
#PBS -l nodes=1:ppn=8
module load netcdf
cd $PBS_O_WORKDIR
cp foo.dat $TMPDIR
cd $TMPDIR
appname < foo.dat > foo.out
cp foo.out $PBS_O_WORKDIR

Usage on Oakley

Set-up on Oakley

Initalizing the system for use of the NetCDF is dependent on the system you are using and the compiler you are using. To load the default NetCDF on Oakley, run the following command: module load netcdf . To use the parallel implementation of NetCDF, run the following command instead: module load pnetcdf . To load a particular version, use  module load netcdf/version . For example, use  module load netcdf/4.3.3.1  to load NetCDF version 4.3.3.1 on Oakley. You can use module spider netcdf  to view available modules on Oakley.

Building With NetCDF

With the netcdf library loaded, the following environment variables will be available for use:

Variable Use
$NETCDF_CFLAGS Use during your compilation step for C or C++ programs.
$NETCDF_FFLAGS Use during your compilation step for Fortran programs.
$NETCDF_LIBS Use when linking your program to NetCDF.

Similarly, when the pnetcdf module is loaded, the following environment variables will be available:

VARIABLE USE
$PNETCDF_CFLAGS Use during your compilation step for C programs.
$PNETCDF_FFLAGS Use during your compilation step for Fortran programs.
$PNETCDF_LIBS Use when linking your program to NetCDF.
 

For example, to build the code myprog.c with the netcdf library you would use:

icc -c $NETCDF_CFLAGS myprog.c
icc -o myprog myprog.o $NETCDF_LIBS

Batch Usage on Oakley

When you log into oakley.osc.edu you are actually logged into a linux box referred to as the login node. To gain access to the mutiple processors in the computing environment, you must submit your job to the batch system for execution. Batch jobs can request mutiple nodes/cores and compute time up to the limits of the OSC systems. Refer to Queues and Reservations and Batch Limit Rules for more info.  Batch jobs run on the compute nodes of the system and not on the login node. It is desirable for big problems since more resources can be used.

Non-interactive Batch Job (Serial Run)
A batch script can be created and submitted for a serial or parallel run. You can create the batch script using any text editor you like in a working directory on the system of your choice. You must load the netcdf or pnetcdf module in your batch script before executing a program which is built with the netcdf library. Below is the example batch script that executes a program built with NetCDF:
#PBS -N AppNameJob
#PBS -l nodes=1:ppn=12
module load netcdf
cd $PBS_O_WORKDIR
cp foo.dat $TMPDIR
cd $TMPDIR
appname < foo.dat > foo.out
cp foo.out $PBS_O_WORKDIR

Usage on Ruby

Set-up on Ruby

Initalizing the system for use of the NetCDF is dependent on the system you are using and the compiler you are using. To load the default NetCDF on Ruby, run the following command: module load netcdf . To use the parallel implementation of NetCDF, run the following command instead: module load pnetcdf . To load a particular version, use  module load netcdf/version . For example, use  module load netcdf/4.3.3.1  to load NetCDF version 4.3.3.1 on Ruby. You can use module spider netcdf  to view available modules on Ruby.

Building With NetCDF

With the netcdf library loaded, the following environment variables will be available for use:

Variable Use
$NETCDF_CFLAGS Use during your compilation step for C or C++ programs.
$NETCDF_FFLAGS Use during your compilation step for Fortran programs.
$NETCDF_LIBS Use when linking your program to NetCDF.

Similarly, when the pnetcdf module is loaded, the following environment variables will be available:

VARIABLE USE
$PNETCDF_CFLAGS Use during your compilation step for C programs.
$PNETCDF_FFLAGS Use during your compilation step for Fortran programs.
$PNETCDF_LIBS Use when linking your program to NetCDF.
 

For example, to build the code myprog.c with the netcdf library you would use:

icc -c $NETCDF_CFLAGS myprog.c
icc -o myprog myprog.o $NETCDF_LIBS

Batch Usage on Ruby

When you log into ruby.osc.edu you are actually logged into a linux box referred to as the login node. To gain access to the mutiple processors in the computing environment, you must submit your job to the batch system for execution. Batch jobs can request mutiple nodes/cores and compute time up to the limits of the OSC systems. Refer to Queues and Reservations and Batch Limit Rules for more info. 

Non-interactive Batch Job (Serial Run)
A batch script can be created and submitted for a serial or parallel run. You can create the batch script using any text editor you like in a working directory on the system of your choice. You must load the netcdf or pnetcdf module in your batch script before executing a program which is built with the netcdf library. Below is the example batch script that executes a program built with NetCDF:
#PBS -N AppNameJob
#PBS -l nodes=1:ppn=20
module load netcdf
cd $PBS_O_WORKDIR
cp foo.dat $TMPDIR
cd $TMPDIR
appname < foo.dat > foo.out
cp foo.out $PBS_O_WORKDIR

Further Reading

See Also

Supercomputer: 
Service: