thank your for your quick reply
dyjbean
From: Dennis Shea
Date: 2012-08-04 21:38
To: dyjbean
CC: ncl-talk@ucar.edu
Subject: Re: [ncl-talk] about improper time dimension value to extract
The only *variables* on the file are 'latitude', 'longitude',
'mask' and 'Incoming_Long_Wave_Radiation'.
'time_counter' is not a variable on the file.
It is a 'named dimension'. The size of the 'named dimension'
'time_counter' is 1460.
I speculate this is 6-hrly data for year 1901.
Attached is a script that will generate a time variable
with units YYYYMMDDHH.
A sample driver script is
load "./yyyymmddhh_time.ncl"
yrStrt = 1901
yrLast = 1901
hrStep = 6
time = yyyymmddhh_time(yrStrt, yrLast, hrStep, "integer")
print(time)
---
Variable: time
Type: integer
Total Size: 5840 bytes
1460 values
Number of Dimensions: 1
Dimensions and sizes: [time | 1460]
Coordinates:
time: [1901010100..1901123118]
Number Of Attributes: 2
long_name : time
units : YYYYMMDDHH
(0) 1901010100
(1) 1901010106
(2) 1901010112
(3) 1901010118
(4) 1901010200
(5) 1901010206
(6) 1901010212
(7) 1901010218
[snip]
(1452) 1901123000
(1453) 1901123006
(1454) 1901123012
(1455) 1901123018
(1456) 1901123100
(1457) 1901123106
(1458) 1901123112
(1459) 1901123118
==================================
You could do the following:
yrStrt = 1901
yrLast = 1901
hrStep = 6
time = yyyymmddhh_time(yrStrt, yrLast, hrStep, "integer")
x = f->Incoming_Long_Wave_Radiation
x!0 = "time" ; create new 'named dimension'
x&time = time
printVarSummary(x)
======
Date Category: http://www.ncl.ucar.edu/Document/Functions/date.shtml
On 8/4/12 3:04 AM, dyjbean wrote:
> hi,
> i met a strange problem, i have a nc file, whose information is as following with ncdump:
> *********************************************
> netcdf cruncep_lwdown_1901 {
> dimensions:
> time_counter = UNLIMITED ; // (1460 currently)
> latitude = 360 ;
> longitude = 720 ;
> variables:
> float Incoming_Long_Wave_Radiation(time_counter, latitude, longitude) ;
> Incoming_Long_Wave_Radiation:title = "Incoming_Long_Wave_Radiation" ;
> Incoming_Long_Wave_Radiation:units = "W/m2" ;
> float latitude(latitude) ;
> latitude:units = "Degrees" ;
> latitude:title = "Latitude" ;
> float longitude(longitude) ;
> longitude:units = "Degrees" ;
> longitude:title = "Longitude" ;
> long mask(latitude, longitude) ;
> // global attributes:
> :file_name = "cruncep_lwdown_1901_2008.nc" ;
> :model_name = "STOMATE-SECHIBA-LPJ" ;
> :history = "Tue Jan 19 15:10:21 2010: ncks -d time_counter,0,1459 cruncep_lwdown_1901_2008.nc cruncep_lwdown_1901.nc" ;
> }
> *********************************************
> from the above presentation, the "time" dimension is not defined with normal "time",then in NCL:
> ff=addfile("cruncep_lwdown_1901.nc","r")
> i can print(ff->latitude) and print(ff->longitude), but i can't print(ff->time_counter), which showed the follows error :
> ******************************************
> ncl 9> print(ff->time_counter)
> fatal:Either file (ff) isn't defined or variable (time_counter) is not a variable in the file
> fatal:Execute: Error occurred at or near line 9
> ******************************************
> anybody can give me some advice about how to show the time dimension value ?
> thanks
> ------------------------------------------------------------------------
> dyjbean
>
>
> _______________________________________________
> 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 Sat Aug 4 08:01:54 2012
This archive was generated by hypermail 2.1.8 : Wed Aug 15 2012 - 08:12:08 MDT