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

Re: programming problems



Hi Gabor,

> I am Gabor Papp from the Geodetic and Geophysical Res. Inst.,
> Sopron, Hungary. I have used GMT program package since 1993
> which runs with your netCDF type files. Now I have decided
> to change the source code of my own Fortran programs in order
> to make them capable to read and write netCDF files directly,
> without the use of converting programs provided in the GMT
> package. At the moment my programs are able to read the netCDF
> files but the creation of a netCDF file does not work.
> 
> At runtime, when the program reaches the following line
> (and have already read a netCDF file successfully):
> 
> NCID=NCCRE(FNAME,NCNOCLOB,RCODE) 
> 
> ,where
> 
> INTEGER NCID,RCODE,....
> CHARACTER FNAME*50
> 
> an error message occurs.
> 
> nccreate: Bad Flag

Perhaps you haven't included the "netcdf.inc" file that contains the
PARAMETER statement defining NCNOCLOB and other netCDF Fortran symbols.  In
the netcdf.inc file, NCNOCLOB is defined by:

      parameter(NCNOCLOB = 15)

If you have included netcdf.inc with a statement such as

      include 'netcdf.inc'

then, something  before the call to NCCRE must have caused the value of
NCNOCLOB to be overwritten, even though PARAMETER values are supposed to be
constant.  You could tell if this is the case by printing the value of
NCNOCLOB before the call.

--Russ

______________________________________________________________________________

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