Re: possible bug in reading variable

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 23 2011 - 12:33:04 MDT

Hi Ufuk,

The problem here is that in order to support the 'group' concept in NetCDF4 and HDF5,
we have made the '/' character into a legal part of a file variable name. We should have
anticipated this possible backwards incompatibility but I have to admit that we didn't think
of it. The solution for your code is simply to put a space before the '/':

lev = grb[0]->lv_ISBL0 /100

should work. We will document this at least. I am not sure whether we can or should
change this behavior though.
 -dave

On Mar 23, 2011, at 3:28 AM, u.utku.turuncoglu@be.itu.edu.tr wrote:

> Hi,
>
> I have just installed the NCL 6.0.0 beta (Mac OS 10.6, 64 bit and gcc
> 4.21) and i try to run a NCL script that works in NCL 5.2.1 without any
> error but in the newer version it gives the following error,
>
> fatal:No valid instance of variable lv_ISBL0/100 found in file list
> fatal:Execute: Error occurred at or near line 102 in file track_gfs.ncl
>
> The code is,
>
> ;--- read input files ---
> files = systemfunc("ls -tr dsets/gfs/"+dstr+"/gfs.t"+darr(3)+"z.*")
> nfile = dimsizes(files)
> grb = addfiles(files, "r")
>
> ;--- concantrate files ---
> ListSetType(grb, "cat")
>
> ;--- get coordinate variables ---
> lat = grb[0]->lat_0
> lon = grb[0]->lon_0
> lev = grb[0]->lv_ISBL0/100
> time = nfile
> ntimes = nfile
>
> I fix the problem when i change the calculation of lev variable in script,
>
> lev = grb[0]->lv_ISBL0
> lev = lev/100
>
> I think that the arithmetic operation trigers the error when the variable
> is read. The data format is GRIB that is retrieved from NOMADS server
> (nomads.ncep.noaa.gov) and directory /pub/data/nccf/com/gfs/prod/. I am
> not sure this is a bug or not but i send this mail just in case.
>
> Best regards,
>
> --ufuk
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 23 12:33:12 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT