This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Blanca, Here's a Fortran-90 program that adds 4.0 to each value of the variable "temp" in the netCDF file CopyOfData.nc: http://www.unidata.ucar.edu/staff/russ/public/inc_temp.f90 On my Unix system, I compiled and ran it like this. You will have to provide different compiler options and install locations for your netCDF installation. $ f90 -I/upc/netcdf/include -M/upc/netcdf/include inc_temp.f90 \ -L/upc/netcdf/lib -lnetcdf -o inc_temp $ ./inc_temp *** SUCCESS modifying file CopyOfData.nc! The -I option says where the netcdf.inc file is located. The -M option tells where to find the netcdf.mod modules file. The -L option says where to locate the netcdf library. The -l option says what the name of the library is. The -o option tells what to call the program after it is compiled and linked. Running the program took less than 1 second, and looking at the results in ncdump indicate that it changed the values of temp as desired. --Russ