The submitted files related to AVS module read_netcdf, in addition to this README file, are: filename contents -------- -------- Makefile standard Unix makefile read_netcdf.c C source code read_netcdf.txt module description in man page form small.cdf sample netCDF binary file It is assumed that prospective users have the netCDF library available on their system. The purpose of submitting this module to the International AVS Center is to provide a working example of a module that reads a netCDF data file to serve as a template for developing similar modules. The submitted module is currently used to read data generated by an ocean circulation modeling application. The module reads one data variable (i.e., salinity) at a particular time step and the necessary data for computing the 3-dimensional irregular coordinates used by the model. AVS Local Modules read netcdf(6) NAME read netcdf - read a netCDF file that follows specific conventions SUMMARY Name read netcdf Type data Inputs none Outputs field 3D scalar float 3-coord irregular Parameters Name Type Default Min Max Read netCDF File browser *.cdf time record typein 0 0 1000 DESCRIPTION The read netcdf module is a working example of a module that can read netCDF files. This version can only read netCDF files that contain specific dimension, variable, and attribute names. Also, the coordinate values for the irregular field output are computed in a way that is data specific. See LIMITATIONS below for details. PARAMETERS Read netCDF File A file browser that displays filenames with the .cdf extension. time record Integer typein that defines which time record of data to read. By default, time record 0 (i.e., first record) is read. Only one time record is read. The maximum time record number is currently set to 1000. EXAMPLE The following network converts netCDF data into an AVS field, displays the contents of the new field, and gives the person the option of writing the new AVS field permanently to disk. READ NETCDF | |--------------| | | PRINT FIELD WRITE FIELD LIMITATIONS The netCDF files to be read by this version of read netcdf must contain the following dimension names: xpos, ypos, zpos, and time, where the size of dimension time is declared as UNLIMITED. The following variables must be in the file: float variables sigma(zpos), x(ypos,xpos), y(ypos,xpos), and depth(ypos,xpos) and short variables elev(time,ypos,xpos) and salt(time,zpos,ypos,xpos). Variables elev and salt must have the following float attributes: scale_factor and add_offset, where the scale factor is to be multiplied first and then the offset added to the data. The data portion of the AVS field output is the data from variable salt. The X and Y coordinates are variables x and y scaled by a factor of 1/4000. The Z coordinates are calculated from variables sigma, depth and elev as follows: Z = sigma*(depth + elev) + elev SEE ALSO Unidata Program Center, 1991, NetCDF User's Guide: An Interface for Data Access, University Corporation for Atmospheric Research, Boulder, CO. Wright, E.L., 1992, An Example of Interfacing AVS and NetCDF: U.S. Geological Survey Open-File Report 92-332. Release 3.0 AVS read netcdf(6)