simple script problem

Barry Barry.E.Schwartz at NOAA.GOV
Fri Oct 20 01:22:23 EDT 2006


Dave

Thanks! The bigger problem was not having the semicolon
between the if and the expression- it is no wonder I wasn't
getting the variable substitution I was looking for. And, of course,
having blanks in file names is a unix no no. Anyway, I just got
it to work; thanks alot.

barry

Dave Allured wrote:
> Barry,
>
> For one thing, your use of spaces in the printim command is
> incorrect.  Spaces are significant *inside* the quote marks, but not
> *outside*.  Look closely.  As written, each underscore will have
> spaces around it before the printim command is executed.  This does
> not construct a very nice filename, and I would expect Grads to gag
> here.  HTH.
>
> --Dave
>
> Barry wrote:
>> HI all
>>
>> I'm having another (what must be) simple problem;
>> I am attempting my first grads script (.gs) and I can't
>> seem to get the script to interpret my alphanumeric
>> assignments.
>>
>> What I am trying to do is run a plot 9 times- the binary
>> file has 9 times of day in it (ignore the commented out statements)...
>> I simply want to write a title for each one and create a postscript
>> output file with a unique name indicating what the plot is.
>>
>> Can someone tell me what is wrong- again, the documentation on scripts
>> has nothing like what I am trying to do.
>>
>> Thanks folks!
>>
>> barry
>>
>> 'open test.ctl'
>> 'set display grey white'
>> 'set lat 15 40'
>> 'set lon -180 -140'
>> 'set cint 5'
>> stat = "average"
>> season = "winter"
>> type = "full sky"
>> *s = 1
>> *while (s < 6)
>>
>> *if (s = 1) season = winter ; endif
>> *if (s = 2) season = spring ; endif
>> *if (s = 3) season = summer ; endif
>> *if (s = 4) season = fall   ; endif
>> *if (s = 5) season = year   ; endif
>>
>> hr = 1
>> while (hr < 10)
>>
>> if (hr = 1) hour = "00Z" ; endif
>> if (hr = 2) hour = "03Z" ; endif
>> if (hr = 3) hour = "06Z" ; endif
>> if (hr = 4) hour = "09Z" ; endif
>> if (hr = 5) hour = "12Z" ; endif
>> if (hr = 6) hour = "15z" ; endif
>> if (hr = 7) hour = "18z" ; endif
>> if (hr = 8) hour = "21z" ; endif
>> if (hr = 9) hour = "day" ; endif
>>
>> *'set t 's' '
>> 'set lev 'hr' '
>> 'display stat'
>> 'draw title 'stat'  'season'  'hour'  'type''
>> 'printim 'stat' _ 'season' _ 'hour' _ 'type' .ps'
>> 'clear'
>> *'close 1'
>>
>> hr = hr + 1
>> endwhile
>>
>> *s = s + 1
>> *endwhile



More information about the gradsusr mailing list