[gradsusr] display problem while saving

Eric Altshuler ela at cola.iges.org
Fri May 7 13:33:13 EDT 2010


This can be done more elegantly, as follows:

mons='jan feb mar apr may jun jul aug sep oct nov dec'
n=1
while (n<=12)
mmm=subwrd(mons,n)
...
...
n=n+1
endwhile

thus eliminating the need for 12 different 'if/endif' structures.

----- Original Message -----
From: "gibies george" <gibiesgeorge at gmail.com>
To: "GrADS Users Forum" <gradsusr at gradsusr.org>
Sent: Friday, May 7, 2010 8:15:07 AM
Subject: Re: [gradsusr] display problem while saving

Jeevan,

The problem is with the time definision

There two way of defining time

set t 1

or

set time 01jan2010

Your variable mmm is now having integer value. You have to convert it
into three letter string. For that use the following code

n=m1
if(n=1) mmm='jan'
endif if(n=2)
mmm='feb' endif
if(n=3) mmm='mar'
endif if(n=4)
mmm='apr' endif
if(n=5) mmm='may'
endif if(n=6)
mmm='jun' endif
if(n=7) mmm='jul'
endif if(n=8)
mmm='aug' endif
if(n=9) mmm='sep'
endif if(n=10)
mmm='oct' endif
if(n=11) mmm='nov'
endif if(n=12)
mmm='dec' endif

then you can use format

'set time = 'dd''mmm''yyyy

Refine your code and try.

Regards


On 7 May 2010 11:16, RAJEEVAN k < rajeevancas at gmail.com > wrote:


Hai,
i want to plot precipitaion anomoly.i hv cmap data precip.mon.mean.nc.t
the gs file i used for this is.

the problem is that in the saved plot didplay did not came........please
help me
'reinit' yyyy=1979
while(yyyy<=1981) mmm=01
while(mmm<=12)

'sdfopen precip.mon.mean.nc '
'set time 'mmm''yyyy''
'set grid off'
'set grads off'
'set t 1 12'
'set gxout shaded'
*'set gxout contour'

'define monavg=ave(precip,t+1,t+36,12)'
'modify monavg seasonal'
'set t 1 last'
'define anom = precip-monavg'
*'set t 1 36'
'set lat 8 30'
'set lon 70 90'
'd anom'
'printim anomoly'mmm'.'yyyy'.jpg white'
'c' mmm=mmm+1
endwhile yyyy=yyyy+1
endwhile



error shows likes this

Syntax Error: Invalid Date/Time value.
Missing month abbreviation or 'z' delimiter
SET error: Missing or invalid arguments for TIME option
Defined variable is now climatological


_______________________________________________ gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr




-- Gibies George,CSIR-RF,
Climate and Global Modelling Division,
Indian Institute of Tropical Meteorology,
Dr. Homi Bhabha Road,
NCL (P. O.), Pashan,
Pune 411008

http://sites.google.com/site/gibiesge/


_______________________________________________ gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr



More information about the gradsusr mailing list