NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
************************************************************************ THIS IS UNSUPPORTED SOFTWARE but documented bug reports and enhancements are very welcome. ************************************************************************ ncks -- netCDF Kitchen Sink version 3.3 Purpose: ncks combines a generic netCDF printer (like a formatted ncdump(1)), extractor (like ncextr), hyperslabber (the nccut specification), and combiner (partial ncpaste implementation) into one command. ncks and ncrename (available from the same FTP site) are intended to perform many common tasks for the rapid manipulation and analysis of netCDF data. New Features include: o hyperslabs may now be specified with Fortran indexing conventions o ncks output may be "glued" or "appended" to an existing netCDF file (rudimentary conformal dimension implementation of ncpaste). This allows you to add all or some of one file to another. o all major bugs in the hyperslabber from v3.1 are fixed o -h now means the same as in ncdump(1), while -H prints only the data Example: C-style printed output with units (-u option) looks like.... T: type = float, attributes = 3, dimensions = 4, id = 35 T attribute 0: name = units, type = char, length = 6, value = Kelvin T attribute 1: name = levels, type = char, length = 10, value = midpoints T attribute 2: name = time_rep, type = char, length = 14, value = instantaneous T dimension 0 is a coordinate: name = time, type = float, size = 1 T dimension 1 is a coordinate: name = lat, type = float, size = 64 T dimension 2 is a coordinate: name = lev, type = float, size = 18 T dimension 3 is a coordinate: name = lon, type = float, size = 128 T size is 1*64*18*128*sizeof(float) = 147456*4 = 589824 bytes time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[107]=300.938 T[0]=298.853 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[108]=303.75 T[1]=298.627 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[109]=306.562 T[2]=297.999 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[110]=309.375 T[3]=297.552 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[111]=312.188 T[4]=297.478 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[112]=315 T[5]=297.214 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[113]=317.812 T[6]=296.583 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[114]=320.625 T[7]=296.091 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[115]=323.438 T[8]=295.952 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[116]=326.25 T[9]=295.76 Kelvin time[0]=92 lat[42]=29.3013 lev[17]=992.528 lon[117]=329.062 T[10]=295.224 Kelvin Requirements: * netCDF (must be installed on your system) Obtaining the source: Anonymous FTP to ftp.cgd.ucar.edu. Look in the directory pub/zender and grab the compressed tar file ncks-3.3.tar.gz which contains the entire source tree. Files: ncks-3.3.tar.gz the entire source tree: ./ncks-3.3/README.ncks this file ./ncks-3.3/ncks.1 ncks man page ./ncks-3.3/ncks.c ncks source code ./ncks-3.3/ncks.h ncks include file ./ncks-3.3/ncks.nc sample input file to play around with Installation: The compressed tarfile ncks-3.3.tar.gz must be uncompressed (with GNU gunzip) and then untarred (tar -xvf ncks-3.3.tar). Install ncks.1 in your man/man1 directory (and view with "man ncks"), or view it directory with "nroff -man ncks.1 | less". To compile ncks.c, run the sample compile command below after editing it to suit your system. The root of your netCDF installation source tree should replace the $NETCDF_ROOT variable, e.g., "setenv NETCDF_ROOT /opt/netcdf2.3.2" ncks has been compiled and haphazardly tested for SunOS 4.1.3, Solaris 2.3 and 2.4, IRIX, AIX, and UNICOS. gcc -o ncks -I$NETCDF_ROOT/include ncks.c -L$NETCDF_ROOT/lib -lnetcdf acc -o ncks -I$NETCDF_ROOT/include ncks.c -L$NETCDF_ROOT/lib -lnetcdf cc -o ncks -I$NETCDF_ROOT/include ncks.c -L$NETCDF_ROOT/lib -lnetcdf Good luck, cz -- Charlie Zender NCAR/CGD/CMS Rm ML-320 P.O. Box 3000 zender@xxxxxxxxxxxxx Boulder CO 80307-3000 http://www.cgd.ucar.edu/cms/zender -- Charlie Zender Tel: (303) 497-1612 NCAR/CGD/CMS Rm ML-320 FAX: (303) 497-1324 P.O. Box 3000 zender@xxxxxxxxxxxxx Boulder CO 80307-3000 http://www.cgd.ucar.edu/cms/zender
netcdfgroup
archives: