[gradsusr] Making a Nested While Loop

Muhammad Rahiz muhammad.rahiz at ouce.ox.ac.uk
Fri Dec 31 12:36:55 EST 2010


FYI, the script has been tested and it works fine. Can you include your 
script in an attachment and describe exactly how you run it?

Also, go easy on the exclamation mark (!) - not necessary I would think...

-- 
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford

On Fri, 31 Dec 2010, saiguranloi at yahoo.com wrote:

> I followed your procedure accurately;
>
> Everything else worked except for the vpage options!
>
> SET error: Missing or invalid arguments for VPAGE option
>
> All the four images are overlaid on each other on the full page!
> Sent from my BlackBerry® smartphone from Zain Tanzania
>
> -----Original Message-----
> From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
> Date: Fri, 31 Dec 2010 15:30:58
> To: saiguran loisulie<saiguranloi at yahoo.com>
> Cc: GrADS Users<gradsusr at gradsusr.org>
> Subject: Re: Making a Nested While Loop
>
> Saiguran,
>
> The following script does as you require.
>
> 'sdfopen ifile.nc'
>
> mtot = 4
> m = 1
> while ( m < mtot +1 )
>
> * labels for title
> s0 = ''DJF' 'MAM' 'JJA' 'SON''
> s1 = subwrd(s0,m)
>
> * dimensions for 2x2 plot
> x1 = 11/2
> x2 = x1 + x1
> oo = 0.00
> y1 = 8.5/2
> y2 = y1 + y1
>
> p1 = ''oo' 'x1' 'oo' 'x1''
> p2 = ''x1' 'x2' 'x1' 'x2''
> p3 = ''y1' 'y1' 'oo' 'oo''
> p4 = ''y2' 'y2' 'y1' 'y1''
>
> a1 = subwrd(p1,m)
> a2 = subwrd(p2,m)
> a3 = subwrd(p3,m)
> a4 = subwrd(p4,m)
>
> 'set t 'm''
> 'set vpage 'a1' 'a2' 'a3' 'a4''
> 'set lat -20 20'
> 'set lon 20 60'
> 'set grads off'
> 'set mpdset mres'
> 'set gxout shaded'
> 'set clevs 288 290 292 294 296 298 300 304 306 308 310'
>
> 'd tmax'
> 'd u10;v10'
> 'draw title 's1''
> 'run cbarn'
>
> m = m +1
> endwhile
>
> 'printim image.png white'
> 'quit'
>
>


More information about the gradsusr mailing list