[gradsusr] help - NetCDF file

Charles Seman - NOAA Federal charles.seman at noaa.gov
Thu Jul 11 17:52:36 EDT 2013


Celso,

DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc
...
tdef time 4 linear 01jan2002 1dy

the time units defined in "DSET" for the time templating are "months" 
while the "tdef" increment is "1dy" (1 day)... try reconciling these and 
see what happens... see also 
http://grads.iges.org/grads/gadoc/templates.html

Hope this helps,
Chuck

On 07/11/2013 03:59 PM, James T. Potemra wrote:
> Celso:
>
> Can you check with ncdump or something similar to see the
> dimensions on your input files?  In your descriptor file you
> have variables listed as f(t,z,y,x), and this needs to be the
> same layout in the netCDF file.  Another possibility is the
> first variable has four dimensions (t,z,y,x) while the rest have
> only three (t,y,x).  Again check the netCDF file and see if these
> variables have a z dimension constant at 1?  I don't know if
> you can have a single file with different number of z-levels
> in the variables.
>
> Jim
>
> On 7/11/13 9:26 AM, Celso Bandeira de Melo Ribeiro wrote:
>> Hi James,
>> Thank you for attention and help again.
>> I included the line "OPTIONS template", in amazonia.ctl, as you sugest,
>> show below:
>>
>> DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc
>> OPTIONS template
>> OPTIONS 365_day_calendar
>> tdef time 4 linear 01jan2002 1dy
>>
>> The file open perfectily now, see the message below:
>>
>> ga-> xdfopen amazonia.ctl
>> Scanning Descriptor File:  amazonia.ctl
>> SDF file amazonia.clm2.h0.2002-01-%m2-00000.nc is open as file 1
>> LON set to 279.062 311.875
>> LAT set to -20.2999 6.45372
>> LEV set to 0.00710064 0.00710064
>> Time values set: 2002:1:1:0 2002:1:1:0
>> E set to 1 1
>> ga->
>>
>> But I still could not see the time values ​​of four, the following message
>> appears below:
>>
>> ga-> set t 1 4
>> Time values set: 2002:1:1:0 2002:1:4:0
>> ga-> d wind
>> Contouring: 0.5 to 5.5 interval 0.5
>> NetCDF Error (gancrow, nc_get_vara_double): NetCDF: Index exceeds
>> dimension bound
>> Data Request Error:  Error for variable 'wind'
>>     Error ocurred at column 1
>> DISPLAY error:  Invalid expression
>>     Expression = wind
>> ga->
>>
>> Do you know how solve this problem?
>>
>> Tank you very much!
>> Celso
>>
>>
>> On Thu, 11 Jul 2013 07:33:38 -1000, "James T. Potemra" <jimp at hawaii.edu>
>> wrote:
>>> Hi Celso:
>>>
>>> You also have to add the option "template":
>>> OPTIONS template
>>>
>>> Jim
>>> On 7/11/13 6:57 AM, Celso Bandeira de Melo Ribeiro wrote:
>>>> Hi James,
>>>> Thank you for attention and help.
>>>> I modified the file data to diaries as show below:
>>>>
>>>> DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc
>>>> OPTIONS 365_day_calendar
>>>> tdef time 4 linear 01jan2000 1dy
>>>>
>>>> But it did not work, appeared the following error message:
>>>>
>>>> ga-> xdfopen amazonia.ctl
>>>> Scanning Descriptor File:  amazonia.ctl
>>>> Error: nc_open failed to open file
>> amazonia.clm2.h0.2002-01-%m2-00000.nc
>>>> No such file or directory
>>>> gadsdf: Couldn't ingest SDF metadata.
>>>> SDF Descriptor file amazonia.ctl was not successfully opened & parsed.
>>>> ga->
>>>>
>>>> All the best!
>>>>
>>>> Celso
>>>>
>>>>
>>>>
>>>> On Wed, 10 Jul 2013 17:06:21 -1000, "James T. Potemra"
>> <jimp at hawaii.edu>
>>>> wrote:
>>>>> Celso:
>>>>>
>>>>> Your descriptor file lists four times (months), but it is specifically
>>>>> reading only one file (amazonia.clm2.h0.2002-01-01-00000.nc).  You
>>>>> likely want to read all four, so you'll have to add an option
>>>>> "template".  Also, it's not clear from the file names if they
>> reference
>>>>> month-day or day-month, e.g., is amazonia.clm2.h0.2002-01-04-00000.nc
>>>>> for January 4, 2002 or April 1, 2002?  In your descriptor file you
>>>>> specify the time increment as monthly (1mo).  If the files have single
>>>>> time values (one monthly value), and the format of the file name is
>>>>> day-month, your DSET line should be something like:
>>>>>
>>>>> DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc
>>>>>
>>>>> The %m2 indicating a substitution template of 2-digit month.
>>>>>
>>>>> Jim
>>>>>
>>>>> On 7/10/13 3:58 PM, Celso Bandeira de Melo Ribeiro wrote:
>>>>>> Hi Matt,
>>>>>>
>>>>>> Thank you very much for your attention and help.
>>>>>> Worked perfectly I created the following file:
>>>>>>
>>>>>> DSET ^amazonia.clm2.h0.2002-01-01-00000.nc
>>>>>> OPTIONS 365_day_calendar
>>>>>> tdef time 4 linear 01jan2000 1mo
>>>>>>
>>>>>> I am working with 4 files (Daily), whose names are:
>>>>>>
>>>>>> amazonia.clm2.h0.2002-01-01-00000.nc
>>>>>> amazonia.clm2.h0.2002-01-02-00000.nc
>>>>>> amazonia.clm2.h0.2002-01-03-00000.nc
>>>>>> amazonia.clm2.h0.2002-01-04-00000.nc
>>>>>>
>>>>>> The file opens perfectly in GrADS:
>>>>>>
>>>>>> ga-> xdfopen amazonia.ctl
>>>>>> Scanning Descriptor File:  amazonia.ctl
>>>>>> SDF file amazonia.clm2.h0.2002-01-01-00000.nc is open as file 1
>>>>>> LON set to 279.062 311.875
>>>>>> LAT set to -20.2999 6.45372
>>>>>> LEV set to 0.00710064 0.00710064
>>>>>> Time values set: 2000:1:1:0 2000:1:1:0
>>>>>> E set to 1 1
>>>>>> ga-> q file
>>>>>> File 1 : CLM History file information
>>>>>>       Descriptor: amazonia.ctl
>>>>>>       Binary: amazonia.clm2.h0.2002-01-01-00000.nc
>>>>>>       Type = Gridded
>>>>>>       Xsize = 106  Ysize = 115  Zsize = 15  Tsize = 4  Esize = 1
>>>>>>       Number of Variables = 175
>>>>>>         ...
>>>>>>          tsoi  15  t,z,y,x  soil temperature
>>>>>>          tsoi_10cm  0  t,y,x  soil temperature in top 10cm of soil
>>>>>>          tv  0  t,y,x  vegetation temperature
>>>>>>          u10  0  t,y,x  10-m wind
>>>>>>          urban_ac  0  t,y,x  urban air conditioning flux
>>>>>>      ...
>>>>>>
>>>>>> But when I try to open in GrADS putting time as a variable (set 1 t
>> 4)
>>>>>> appears the following error message:
>>>>>>
>>>>>> ga-> set t 1 4
>>>>>> Time values set: 2000:1:1:0 2000:4:1:0
>>>>>> ga-> d tsoi
>>>>>> Contouring: 273 to 279 interval 0.5
>>>>>> gancgrid error: nc_get_vara_double failed; NetCDF: Index exceeds
>>>>>> dimension
>>>>>> bound
>>>>>> Data Request Error:  Error for variable 'tsoi'
>>>>>>       Error ocurred at column 1
>>>>>> DISPLAY error:  Invalid expression
>>>>>>       Expression = tsoi
>>>>>> ga->
>>>>>>
>>>>>> You know how to help me change the time?
>>>>>>
>>>>>> All the best!
>>>>>>
>>>>>> Celso
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, 10 Jul 2013 12:43:38 -0700, Matt Masarik
>>>>>> <mmasarik at atmos.ucla.edu>
>>>>>> wrote:
>>>>>>> Hi Celso,
>>>>>>>
>>>>>>> you can solve this by using a small (3 line) control file
>>>>>>> that has the 365_day_calendar option specified.  Copy
>>>>>>> the following text into a file, say, amazonia.ctl
>>>>>>>
>>>>>>> DSET ^amazonia.clm2.h0.2002-01-04-00000.nc
>>>>>>> OPTIONS 365_day_calendar
>>>>>>> tdef time 3084 linear 16jan1850 1mo
>>>>>>>
>>>>>>> I put your file name in the DSET line already.  You will
>>>>>>> need to change the 3084 to the total number of time
>>>>>>> records in the file.  You can find this out by issuing
>>>>>>> the following at a command prompt:
>>>>>>>
>>>>>>> ncdump -c amazonia.clm2.h0.2002-01-04-00000.nc
>>>>>>>
>>>>>>> you will also need to change 16jan1850 to the start
>>>>>>> date of your data set, again use ncdump.
>>>>>>>
>>>>>>> Once you make those changes you should be able to open
>>>>>>> the file by using
>>>>>>>
>>>>>>> xdfopen amazonia.ctl
>>>>>>>
>>>>>>>
>>>>>>> Matt
>>>>>>>
>>>>>>>
>>>>>>> On 07/10/2013 11:50 AM, Celso Bandeira de Melo Ribeiro wrote:
>>>>>>>> Hello,
>>>>>>>> I'm working with GrADS Version 2.0.a9 in Linux Ubuntu 64-bit and I
>> am
>>>>>> not
>>>>>>>> able to open NetCDF file.
>>>>>>>> I am using the function "sdfopen" but an error message appears as
>>>>>> sending
>>>>>>>> the attachment.
>>>>>>>> The message, as follows:
>>>>>>>>
>>>>>>>> ga-> sdfopen amazonia.clm2.h0.2002-01-04-00000.nc
>>>>>>>> Scanning self-describing file:
>> amazonia.clm2.h0.2002-01-04-00000.nc
>>>>>>>> SDF Error: 365 day calendars are no longer supported by sdfopen.
>>>>>>>>        To open this file with GrADS, use a descriptor file with
>>>>>>>>        a complete TDEF entry and OPTIONS 365_day_calendar.
>>>>>>>>        Documentation is at
>>>>>> http://iges.org/grads/gadoc/SDFdescriptorfile.html
>>>>>>>> ga->
>>>>>>>>
>>>>>>>> I would like to know how solve this problem.
>>>>>>>> Thank you!
>>>>>>>> Celso
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> gradsusr mailing list
>>>>>>> gradsusr at gradsusr.org
>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>> _______________________________________________
>>>>> gradsusr mailing list
>>>>> gradsusr at gradsusr.org
>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
  Charles Seman                                Charles.Seman at noaa.gov
  U.S. Department of Commerce / NOAA / OAR
  Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
  201 Forrestal Road                              fax: (609) 987-5063
  Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."



More information about the gradsusr mailing list