R.K.'s NetCDF pages

This page documents some of the findings, recommendations, notes, and procedures regarding NERSC's involvement with NetCDF.

Currently, a major milestone has been reached. The netCDF library can now allow a subset of PEs to open a netCDF dataset when using the SGI/Cray ``global'' FFIO layer. Prior to this, either all the PEs had to open the file, or not use global FFIO.

The library performs without incident on the T3E and in all test cases so far. However, there are some practices that need to be followed as documented in the usage section.

Getting and Compiling Sources

I've got the local NERSC netCDF3.4x sources under CVS control. This is better, because each person can get their own sources and destroy them as much as possible without affecting anyone elses work. And if you destroy your own sources you can always get back the NERSC version.

The first time, you need to check-out the sources from CVS you need to do the following:

It's important to do the configure soon after the check-out, because the .cvsrc file defines the proper compiler environment variables to use. If you don't do this, then the configure script will find the minimum configuration (i.e. fort77, c89, and no C++ compiler). These minimal compilers are guarenteed by POSIX compliance, but do not have the full optimization capabilities as the standard Cray compilers. Hence, you need to define certain environment variables, which I've done for you in .cvsrc. The .cvsrc should look something like this for a T3E:

#
setenv CVSROOT /usr/local/pkg/usg/netcdf3.4x/cvs/
#
# set these environment variables prior to doing "configure"
#
# sn6602 t3e 2.0.2.15 unicosmk CRAY T3E (from INSTALL file)
# Cray Standard C Version 5.0.3.0        (d29p35m275a35) Mar  7 1998  00:42:04
# Cray CF90 Version 2.0.3.4 03/07/98 00:42:05
# Cray C++ Version 2.0.3 03/07/98 00:42:06

setenv CC       cc
setenv CFLAGS   -O3
setenv FC       f90
setenv FFLAGS   '-g -F -M1110'
setenv CXX      CC
setenv CXXFLAGS "-h char"               # needed with this version
setenv CXXFLAGS ""                      #RKO> the above cause warnings!?

#'C' compiler still chokes on libsrc/putget.c
#       c89 -c -O3 -I.  -DNDEBUG putget.c
#       cc-7951 c89: LIMIT File = putget.c, Line = 6617
#       Insufficient memory is available for compiler to continue.
#(56% of the way through the file. This is with a pragma to
#prevent inlining of odo1.)

The CVSROOT environment variable is only necessary if you're using the NERSC sources under CVS control. The key items are the other environment variables. If these are not set then configure will not intelligently find the optimal compilers, and will default to fort77 and c89.

Modification History

I'll generally send email out to the email list and with the details on how to update things.

I've applied a couple of patches and made several code modifications. The following list details some the changes from the base library.
cvs tag: unidata

If you find that things don't compile cleanly, just remove the src directory and start at the beginning of this section.

CVS Tips

Precompiled Libraries

To make it easier for those who just want to link with the latest update version of the library, do the following:
module load USG netcdf3.4x		# most up-to-date
module load USG netcdf3.4x_noffflush	# avoids ffflush()
module load USG netcdf3.4x_par		# uses PARIO library
This module will set up the necessary environment variables, most notably: $NETCDF and $NETCDF_DIR, which defines the libraries to link with and the ``root'' of the netcdf directory.

Then to link with this library:

linker options... $NETCDF

To find out further info regarding the modules do:

module help netcdf3.4x		# show message
module display netcdf3.4x	# display environment variables, etc.

Email addresses

Email list of those involved
R.K. Owen rkowen@nersc.gov
Chris Ding cding@nersc.gov
Steve Luzmoor luzmoor@cray.com
Harsh Anand harsh@nersc.gov
Mark Zeng markz@nersc.gov
Jonathan Carter jcarter@nersc.gov
Venkatramani Balaji vb@gfdl.gov
Glenn Davis davis@binnie.unidata.ucar.edu
Just the email addresses:
rkowen@nersc.gov, cding@nersc.gov, luzmoor@cray.com, harsh@nersc.gov, markz@nersc.gov, jcarter@nersc.gov, vb@gfdl.gov, davis@binnie.unidata.ucar.edu