problem with opening multiple NetCDF files

Pavel Kishcha pavel at CYCLONE.TAU.AC.IL
Wed Jun 11 02:22:33 EDT 2008


Hi Jennifer,



It seems to me that GrADS-1.9 can convert double precision to single
precision (floating-point values) automatically only for a single NetCDF
file open by sdfopen. This function does not work, however, for multiple
NetCDF files opened with a template. At least, it does not work
automatically and maybe something (?) should be done for that.

For example, when I am trying to display variables from the opened multiple
NetCDF files I got the following output:



ga-> d aot

Contouring: nan to nan interval inf



Pavel

On Tue, Jun 10, 2008 Jennifer Adams wrote:

Grads 1.9 will read the double precision data and convert to floats
internally. You don't need to do anything special, and it should be fine. If
you are concerned about losing precision, then you should use v2, but if you
don't care, then 1.9 is good. I hope that you can get a descriptor working
to your satisfaction.

On Jun 10, 2008, at 5:52 PM, Pavel Kishcha wrote:
<Thank you Jennifer.
<If single precision (floating-point values) is enough, is it possible to
convert correctly double-precision data to floating-point values by <using
CrADS-1.9?

Thanks!
Jennifer

On Tue, Jun 10, 2008 at 9:51 PM, Pavel Kishcha <pavel at cyclone.tau.ac.il>
wrote:

> Hi Jennifer,
>
>
>
> Thank you very much for your message.
>
> The ctl file has been updated in accordance with your comments, and I was
> able to open the multiple NetCDF files in Grads.
>
>
>
> However, another problem comes about when I am trying to display variables
> from the opened multiple NetCDF files. I got the following output:
>
>
>
> ga-> d aot
>
> Contouring: nan to nan interval inf
>
>
>
> A possible reason is that NetCDF data are all generated on a 64-bit
> machine, and now they are opened by the 32-bit GRADS 1.9.
>
> When I am trying to use "option template big_endian" or "option template
> byteswapped", the displaying data are incorrect. The incorrect data vary
> from -4e+37 to 1.6e+38 while the correct data should vary from 0 to 2.7.
>
>
>
> ***Here is output for incorrect data from the opened multiple NetCDF files
> with "option template byteswapped" included:
>
>
>
> ga-> open data.ctl
>
> Scanning description file:  data.ctl
>
> Data file %y4-%m2.nc is open as file 1
>
> LON set to 0 360
>
> LAT set to -89.5 90.5
>
> LEV set to 0 0
>
> Time values set: 2000:4:1:0 2000:4:1:0
>
>
>
> ga-> d aot
>
> Contouring: -4e+37 to 1.6e+38 interval 2e+37
>
>
>
> *** Here is output for correct data from a single NetCDF file:
>
>
>
> ga-> sdfopen 2000-04.nc
>
> Scanning self-describing file:  2000-04.nc
>
> udunits(3): syntax error:
>
> seconds since ??
>
>                ^
>
> udunits(3): syntax error:
>
> seconds since ??
>
>                ^
>
> SDF file has no discernable time coordinate.
>
> udunits(3): syntax error:
>
> seconds since ??
>
>                ^
>
> SDF:  The double precision values of the variable aot
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable aot_land
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable aot_water
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable aot_dust
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable angst
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable small
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable medium
>
> will be automatically converted to single precision.
>
> SDF:  The double precision values of the variable large
>
> will be automatically converted to single precision.
>
> SDF file 2000-04.nc is open as file 1
>
> LON set to 0 360
>
> LAT set to -89.5 90.5
>
> LEV set to 0 0
>
> Time values set: 1:1:1:0 1:1:1:0
>
> ga-> d aot
>
> Contouring: 0 to 2.7 interval 0.3
>
>
>
> What am I doing wrong with multiple NetCDF descriptor file this time?
>
>
>
> Pavel
>
>
> On Tue, Jun 10, 2008 at 2:39 PM, Jennifer Adams <jma at cola.iges.org> wrote:
>
>> Hi, Pavel --  Templating netcdf files with GrADS 1.9 is best done with a
>> dtype netcdf descriptor file, so you should stick with the 'open' command
>> and not try to use 'xdfopen'. What you have below is a good start, but the
>> error message you got "invalid variable record" does tell you where the
>> problem lies. Your variable declarations have two problems: you need a long
>> name for each variable, and you need to change the "1" in the levels field
>> to "0" since your variables do not vary in Z.
>>
>>    aot 0 t,y,x  total aerosol optical thickness
>>
>> and don't forget to add 'dtype netcdf' to your descriptor and also 'undef
>> -9.99e36' . The number you use for undef is irrelevant, since it appears
>> your data do not have and missing values, but GrADS requires something in
>> the undef record. Make sure there are only spaces and no tabs in the
>> whitespace between fields in your variable declarations.
>>
>> Jennifer
>>
>>
>>
>>  On Jun 9, 2008, at 11:27 AM, Pavel Kishcha wrote:
>>
>>  Dear All,
>>
>> The problem comes about when I am trying to open multiple NetCDF files in
>> GRADS.
>> Here is my descriptor file  (data.ctl):
>>
>> dset ^%y4-%2m.nc
>> options template
>> XDEF 360 linear -179.500000 1.00000
>> YDEF 181  linear -89.5000000 1.000000
>> ZDEF 1 levels 1000
>> TDEF 24 linear 01apr2000  1mo
>> vars 8
>> aot       1 t,y,x
>> aot_land  1 t,y,x
>> aot_water 1 t,y,x
>> aot_dust  1 t,y,x
>> angst     1 t,y,x
>> small     1 t,y,x
>> medium    1 t,y,x
>> large     1 t,y,x
>> endvars
>>
>>
>> ***When I run it in GrADS Version 1.9b4 by using the command xdfopen I see
>> the message:
>>
>> ga-> xdfopen data.ctl
>> Scanning Descriptor File:  data.ctl
>> XDFopen Error:  Missing or invalid dimension size.
>>   --> The invalid description file record is:
>>   --> xdef 360 linear -179.500000 1.00000
>>   The data file was not opened.
>>
>> ***When I run it by using the command open I see the message:
>>
>> ga-> open data.ctl
>> Scanning description file:  MISR_L3.ctl
>> Open Error:  Invalid variable record
>>   --> The invalid description file record is:
>>   --> aot       1 t,y,x
>>
>> What am I doing wrong?
>> Thank you for all of your help.
>>
>> Cheers,
>> Pavel
>>
>> P.S. Here are my files:
>>
>> 2000-04.nc
>> 2000-05.nc
>> 2000-06.nc
>>>> 2002-03.nc
>>
>> ***Here is the output from "ncdump -h" of 2000-04.nc
>>
>> [pavel at wind ~]$ /usr/local/bin/ncdump -h 2000-04.nc
>> netcdf 2000-04 {
>> dimensions:
>>         longitude = 360 ;
>>         latitude = 181 ;
>>         ftime = 1 ;
>> variables:
>>         double longitude(longitude) ;
>>                 longitude:units = "degree_east" ;
>>                 longitude:standard_name = "longitude" ;
>>         double latitude(latitude) ;
>>                 latitude:units = "degree_north" ;
>>                 latitude:standard_name = "latitude" ;
>>         double ftime(ftime) ;
>>                 ftime:units = "seconds since ??" ;
>>                 ftime:standard_name = "ftime" ;
>>         double aot(ftime, latitude, longitude) ;
>>                 aot:units = "kg m-2" ;
>>                 aot:standard_name = "total_aerosol_optical_thickness" ;
>>                 aot:coordinates = "ftime latitude longitude" ;
>>         double aot_land(ftime, latitude, longitude) ;
>>                 aot_land:units = "kg m-2" ;
>>                 aot_land:standard_name
>> = "total_aerosol_optical_thickness" ;
>>                 aot_land:coordinates = "ftime latitude longitude" ;
>>         double aot_water(ftime, latitude, longitude) ;
>>                 aot_water:units = "kg m-2" ;
>>                 aot_water:standard_name
>> = "total_aerosol_optical_thickness" ;
>>                 aot_water:coordinates = "ftime latitude longitude" ;
>>         double aot_dust(ftime, latitude, longitude) ;
>>                 aot_dust:units = "kg m-2" ;
>>                 aot_dust:standard_name
>> = "atmosphere_content_of_dust_aerosol" ;
>>                 aot_dust:coordinates = "ftime latitude longitude" ;
>>         double angst(ftime, latitude, longitude) ;
>>                 angst:units = "None" ;
>>                 angst:standard_name = "angstrom_exponent" ;
>>                 angst:coordinates = "ftime latitude longitude" ;
>>         double small(ftime, latitude, longitude) ;
>>                 small:units = "kg m-2" ;
>>                 small:standard_name
>> = "aerosol_optical_thickness_due_to_small_particles" ;
>>                 small:coordinates = "ftime latitude longitude" ;
>>         double medium(ftime, latitude, longitude) ;
>>                 medium:units = "kg m-2" ;
>>                 medium:standard_name
>> = "aerosol_optical_thickness_due_to_medium_particles" ;
>>                 medium:coordinates = "ftime latitude longitude" ;
>>         double large(ftime, latitude, longitude) ;
>>                 large:units = "kg m-2" ;
>>                 large:standard_name
>> = "aerosol_optical_thickness_due_to_large_particles" ;
>>                 large:coordinates = "ftime latitude longitude" ;
>>
>> // global attributes:
>>                 :Conventions = "CF-1.0" ;
>>                 :history = "Created Mon May  5 15:55:49 2008 by mikeb" ;
>>                 :comment = "??" ;
>>                 :source = "IMPACT model v??" ;
>>                 :references = "??" ;
>>                 :institution = "Los Alamos" ;
>>                 :title = "AOT global grid for total, dust, angst, small,
>> medium, large" ;
>> }
>>
>>
>>  --
>> Jennifer M. Adams
>> IGES/COLA
>> 4041 Powder Mill Road, Suite 302
>> Calverton, MD 20705
>> jma at cola.iges.org
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080611/1aced79a/attachment.html 


More information about the gradsusr mailing list