leap year

Karin Meier-Fleischer karin.meier-fleischer at ZMAW.DE
Tue Feb 6 04:31:38 EST 2007


Hallo Matthias,

schoen von Dir zu hoeren.


Here is my problem with the leap year:

the data file contains 12 monthly time steps (from 23:59Z31JAN1964 to
23:59Z31DEC1964)

     -1 :       Date  Time Code  Level    Size    Miss :     Minimum        Mean     Maximum
      1 : 1964-01-31 23:59  -1       0   42126       0 :      0.0000      25.063      557.66
      2 : 1964-02-29 23:59  -1       0   42126       0 :      0.0000      25.040      1086.3
      3 : 1964-03-31 23:59  -1       0   42126       0 :      0.0000      20.098      539.31
      4 : 1964-04-30 23:59  -1       0   42126       0 :      0.0000      20.345      265.12
      5 : 1964-05-31 23:59  -1       0   42126       0 :      0.0000      22.864      315.59
      6 : 1964-06-30 23:59  -1       0   42126       0 :      0.0000      29.650      388.09
      7 : 1964-07-31 23:59  -1       0   42126       0 :      0.0000      27.702      287.31
      8 : 1964-08-31 23:59  -1       0   42126       0 :      0.0000      26.029      243.57
      9 : 1964-09-30 23:59  -1       0   42126       0 :      0.0000      22.945      355.16
     10 : 1964-10-31 23:59  -1       0   42126       0 :      0.0000      24.714      359.15
     11 : 1964-11-30 23:59  -1       0   42126       0 :      0.0000      21.487      424.59
     12 : 1964-12-31 23:59  -1       0   42126       0 :      0.0000      17.004      294.62
cdo info: Processed 1 variable 12 timesteps. ( 0.02s )


The GrADS script leap_year.gs has the following output:
-------------------------------------------------------

Scanning self-describing file:
/pf/k/k204045/data/CLM/CLM_C20_1_D3_ms_RAIN_CON_49-60.nc
Found 1 data variables in SDF file.
Found displayable variable rain_con with 0 levels in SDF file.
dset /pf/k/k204045/data/CLM/CLM_C20_1_D3_ms_RAIN_CON_49-60.nc
title CLM simulation of the 20th century climate with anthropogenic
forcing (C20_1) for the SGA project (CLM_C20_1)
undef 9.96921e+36
xdef 238 linear -10.6 0.200001
ydef 177 linear 34.6 0.200001
zdef 1 linear 0 0
tdef 12 linear 23:59Z31JAN1964 1mo
vars 1
rain_con 0 -999 convective rainfall

-- t=1 --
Default file number is: 1
X is varying   Lon = -10.6 to 36.8002   X = 1 to 238
Y is varying   Lat = 34.6 to 69.8001   Y = 1 to 177
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 23:59Z31JAN1964  T = 1

-- t=2 --
Default file number is: 1
X is varying   Lon = -10.6 to 36.8002   X = 1 to 238
Y is varying   Lat = 34.6 to 69.8001   Y = 1 to 177
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 23:59Z02MAR1964  T = 3

-- t=3 --
Default file number is: 1
X is varying   Lon = -10.6 to 36.8002   X = 1 to 238
Y is varying   Lat = 34.6 to 69.8001   Y = 1 to 177
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 23:59Z31MAR1964  T = 3

-- t=12 --
Default file number is: 1
X is varying   Lon = -10.6 to 36.8002   X = 1 to 238
Y is varying   Lat = 34.6 to 69.8001   Y = 1 to 177
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 23:59Z31DEC1964  T = 12

-- time=23:59Z29FEB1964 --
Default file number is: 1
X is varying   Lon = -10.6 to 36.8002   X = 1 to 238
Y is varying   Lat = 34.6 to 69.8001   Y = 1 to 177
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 23:59Z02MAR1964  T = 3

-- t=1-12 --
Default file number is: 1
X is varying   Lon = -10.6 to 36.8002   X = 1 to 238
Y is varying   Lat = 34.6 to 69.8001   Y = 1 to 177
Z is fixed     Lev = 0  Z = 1
T is varying   Time = 23:59Z31JAN1964 to 23:59Z31DEC1964  T = 1 to 12
--------------------------------------------------------------------------

The plot shows a wrong value for february (it ist the same as march):
instead of value 1086.3 it plots 539.31.

Any idea what is going wrong?

Thanks in advance,
Karin
---------------------------------\\---------------------------------------
Karin Meier-Fleischer             \\ Max-Planck-Institut fuer Meteorologie
Phone: +49-40-41173-431            \\   Abteilung Modelle & Daten
FAX:   +49-40-41173-476             \\    Bundesstr. 53
Email: karin.meier-fleischer at zmaw.de \\   D-20146 Hamburg
http://www.mad.zmaw.de/               \\  Germany
---------------------------------------\\---------------------------------

On Mon, 5 Feb 2007, Matthias Munnich wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Karin,
>
> without a look at the descriptor file and a complete log of an example
> session
> it's hard to figure out what exactly is going on.  Can you use "set t"
> to set time
> to 29Feb?
>
> ... Matt
>
>
> Karin Meier-Fleischer wrote:
>> Hi,
>>
>> I've got a data file containing a leap year (1964). If I try to set the
>> time to 23:59Z29Feb1964 GrADS always
>> changes the time to 23:59Z02MAR1964.
>>
>> How could I prevent this?
>>
>> Thanks, Karin
>> ---------------------------------\\---------------------------------------
>>
>> Karin Meier-Fleischer             \\ Max-Planck-Institut fuer
>> Meteorologie
>> Phone: +49-40-41173-431            \\   Abteilung Modelle & Daten
>> FAX:   +49-40-41173-476             \\    Bundesstr. 53
>> Email: karin.meier-fleischer at zmaw.de \\   D-20146 Hamburg
>> http://www.mad.zmaw.de/               \\  Germany
>> ---------------------------------------\\---------------------------------
>>
>
>
> - --
> - --------------------------------
> Matthias Munnich
> Univ. of California, Los Angeles
> Dept. of Atmos. and Oceanic Sc. and
> Inst. of Geophysics and Planetary Physics
> 3845 Slichter Hall
> Los Angeles, CA 90095-1567
> Phone: +1-310-794 5899
> Fax: +1-310-206 3051
> Email: munnich at atmos.ucla.edu
> - --------------------------------
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFx6YPidaDTh/cfhYRAqmdAKCDrKfeM5v5YBdiS1DaNnQg2ceS4ACgtMgV
> ZDPrtiY2YUNsOTSCIhYh1nE=
> =uP3h
> -----END PGP SIGNATURE-----
>
-------------- next part --------------
function LeapYear(args)

_DATA='/pf/k/k204045/data/CLM/CLM_C20_1_D3_ms_RAIN_CON_49-60.nc'

'sdfopen '_DATA

'q ctlinfo'; say result

say '-- t=1 --'
'set t 1'
'q dims'; say result

say '-- t=2 --'
'set t 2'
'q dims'; say result

say '-- t=3 --'
'set t 3'
'q dims'; say result

say '-- t=12 --'
'set t 12'
'q dims'; say result

say '-- time=23:59Z29FEB1964 --'
'set time 23:59Z29FEB1964'
'q dims'; say result

say '-- t=1-12 --'
'set t 1 12'
'q dims'; say result

'set x 1'
'set y 1'
'd tloop(rain_con)'

'printim leap_year.gif gif white'

return
-------------- next part --------------
A non-text attachment was scrubbed...
Name: leap_year.gif
Type: image/gif
Size: 32041 bytes
Desc: GIF plot output file of leap_year.gs
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20070206/1e4c9039/attachment.gif 


More information about the gradsusr mailing list