[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: netCDF for W2K



>To: address@hidden
>From: "James K Lewis" <address@hidden>
>Subject: Re: 20040311: netCDF for W2K
>Organization: Scientific Solutions, Inc.
>Keywords: 200403110123.i2B1NgrV000584

Hi James,

> We're working on outputting our oceanographic results
> (www.hawaii.scisol.com) into a netCDF output format.  We've been on the
> Unidata web site to obtain the Win32 pre-built binaries, the Fortran 90
> User's Guide, and the test program netcdf_test.f90.  There are several
> questions that have come up in using information from these files.
> 
> 1) The test.f90 program and the User's Guide give the form of the netCDF
> functions as nf90_*.  But the netCDF.inc file in the zip package has all the
> functions defined as nf_*.  Which of these forms (with or without "90") does
> the pre-built libraries use?

The netcdf.inc file you are referring to is for the Fortran 77
interface, not the Fortran 90 interface.  You should be using the
nf90_* functions if you want to use the Fortran 90 interface.  The
netCDF module in the src/f90/netcdf.f90 file of the netCDF source
distribution declares the functions in the interface and serves an
analogous purpose for the Fortran 90 interface that the netcdf.inc
include file does for the Fortran 77 interface.

> 2) The test.f90 program and the User's Guide give forms for functions such
> as put_att and put_var without additional identifiers in the function name.
> The netCDF.inc file has the functions defined with additional
> specifications: e.g., nf_put_att_int, nf_put_att_real, etc.  Which of these
> forms does the pre-built libraries use?

The Fortran 90 interface defines nf90_put_att as an overloaded
function, determined from the types of the arguments rather than from
the function name.  This is an advantage of the Fortran 90 interface
over the Fortran 77 interface: far fewer functions.  If you want to
use the Fortran 90 interface on Win32, make sure you get the version
of the Windows binary that includes the f90 interface:

  ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-f90win32.tgz

> 3) The test.f90 program has the statements "use typeSizes" and "use netcdf".
> Where is the module "typesizes"?  Should "use netcdf" be "include
> netcdf.inc" since there is no netcdf.mod in the zip'ed file?

The typesizes module is in the src/f90/typeSizes.f90 file in the
source distribution.  The "use" should not be "include".  The
netcdf.mod file (or netcdf.MOD or netcdf.Mod file, depending on the
compiler) is generated from the source during compilation, so is not
included in the source distribution.  

I just noticed there doesn't seem to be a netcdf.mod file in the
binary distribution for win32 either, which seems to be an inadvertent
omission.  If you have a Fortran 90 compiler, you can probably
recreate it by compiling in the f90 src/ directory.  I'll have to
check to see if we can recreate it here and add it to the
netcdf-f90win32.tgz file.  Thanks for pointing out the problem.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden          http://www.unidata.ucar.edu/staff/russ