Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: question/problem...

On Mon, 26 Jul 2004 21:17:38 -0700
JCB <jborrero@xxxxxxx> wrote:

> 
> hi,
> 
> i am trying to run a fortran code that writes the output in netCDF
> 
> format.
> 
> i have a Mac with OSX 10.3
> 
> when i run the code i get these errors:
> 
> "invalid Argument"
> "variable not found"
> "not a netCDF id"
> 
> depending on which routines i have switched on or off (i get one
> of the above each time, not all 3 each time)
> 
> i believe i have netCDF installed properly. all the scripts ran
> well during the install and the code compiles when calling the
> routines that invoke netCDF stuff.
> 
> i have my fortran compiler looking at the /netcdf-3.5.1/include
> and /netcdf-3.5.1/lib directories for the -I and -L flags in the
> g77 compile command.

In your Fortran code, you should have:

include 'netcdf.inc'

and use your compiler's linking and include switches.  The above
file, however, will not be built/installed unless the configure
program detects a working Fortran compiler.  Try rebuilding the
netcdf library and make sure you see the Fortran interface being
created (or else an error message).

I haven't used g77/netcdf for a while, and I've worked mostly with
the C interface anyway, but the netcdf configure *should* find g77
if everything is installed properly. If the Fortran stuff gets
built, then there should also be a separate man page for it:

/usr/share/man/man3f/netcdf.3f  (note the f)

If you don't have the above man page installed (or the netcdf.inc
file) then netcdf didn't build the Fortran interface.  The same
applies to f90 as well, but it only looks for f90 and xlf90.

Steve

-- 
Steve Arnold                           http://arnolds.dhs.org/
gnupg key:      http://arnolds.dhs.org/static/files/pubkey.txt
http://www.gentoo.org/                     http://caosity.org/
with Std.Disclaimer;                       use Std.Disclaimer;

Attachment: pgpb6mNROvQmb.pgp
Description: PGP signature

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690