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

Re: question/problem...



Hi Jose,

> 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.

It sounds like your program must have compiled and successfully linked
with the netCDF library for you to get the error messages above.

> i really have no idea where to look next.
> 
> the netCDF file are on my computer in the following path
> 
> /netcdf-3.5.1
> 
> is that the right place?

It doesn't much matter where things are installed.

> anyway, i'm totally clueless as to what to do next, and i apologize in 
> advance if this is a dumb question.

I suspect you have a problem with the nf_create() call but that you
aren't checking the return status to see what the error is.  We'll
need more information to diagnose the problem.  Please send the source
of a small self-contained program that fails to
"address@hidden", and we'll see if we can see what the
problem is.  The netcdfgroup mailing list you sent your original
question to is not the best place to get help, since it's intended for
announcements and discussion rather than support.

As a start, you might see if your nf_create() call is returning an
error, calling something like:

      subroutine check_err(iret)
      integer iret
      include 'netcdf.inc'
      if (iret .ne. NF_NOERR) then
      print *, nf_strerror(iret)
      stop
      endif
      return
      end

after your nf_create() call:

      Integer RCODE, FILE_ID
  ...
         RCODE = nf_create( 'filename.nc', nf_clobber, FILE_ID )
         call check_err(RCODE)
  
and similarly after all netCDF calls:

         RCODE  = nf_def_dim( FILE_ID, 'Latitude', N_Lat, Lat_ID )
         call check_err(RCODE)

...

--Russ

_____________________________________________________________________

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