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

Re: Bugs(?) with ncgen



>To: address@hidden
>From: address@hidden
>Subject: Re: 20040527: Bugs(?) with ncgen
>Organization: Australian Bureau of Meteorology
>Keywords: 200405270236.i4R2aZtK025059 ncgen bugs

Hi Tim,

> I think I might have uncovered a couple of problems with ncgen. I have 
> attached a CDL at the end of this mail which causes two faults when I 
> issue the command:
> 
> ncgen -o test.nc test.cdl
> 
> 1) The global attribute called netCDF (see CDL fragment)  causes
> ncgen to crash:
> // global attributes:
>               :text = "PRELIMINARY DATA" ;
>               :title = "0.30 degree LBTM cloud products derived from GMS-5 
> for ARM TWP       " ;
>               :source = "NASA Langley Research Center" ;
>               :version = "LBTM TWP 3.0.0 PRELIM" ;
>               :netCDF = "netCDF 2.4.3" ;

Oops, that is a bug.  ncgen is implemented using a fairly simple
grammar with some reserved words: netcdf, dimensions, variables, data,
double, float, int, short, byte, char.  If you try to use any of these
reserved words for variable, dimension, or attribute names, parsing
problems result, but it shouldn't crash.  I'll add this bug to the
problems we're working to fix for the next release.  Thanks for
reporting it.

> 2) Once I remove the offending line from the CDL, I get another error from 
> ncgen:
> 
> ncgen -o test.nc test.cdl
> ncgen: test.cdl line 222: string too long, truncated
> 
> This problem is caused by the history attrbute being far too long. 
> However, even though ncgen says it is only going to truncate the 
> string, in fact it exits without creating the NetCDF file (I think I 
> can understand why it might do this ... maybe it truncates the string in 
> the CDL, and then ends up with an invalid CDL). This behaviour would be 
> bearable if it exited with a non-zero exit code which could be caught, but 
> it simply exits with a 0 exit code as though everything had worked 
> correctly.

Yes, this is another bug that we need to fix.  Thanks for reporting
it.  We'll try to get a fix into the next release.

--Russ

_____________________________________________________________________

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