[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: netcdf file
- Subject: Re: netcdf file
- Date: Thu, 04 Dec 2008 14:48:47 -0700
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