Problem with use of cbarn and user defined functions

mmacleod mmacleod at SCOTIAWEATHER.COM
Thu Oct 18 11:14:18 EDT 2007


Hi Dan.

I tried 'run cbarn.gs 1 0 6.0 0.65'

It made no difference  - the draw still shifted tot he left margin.

Thanks


Mac


Dan Leins wrote:
> Mac,
>
> I think the proper syntax in the script would be something along the lines
> of
>
> 'run cbarn 1 0 6.0 0.65 '
>
> I don't know if it makes a difference, but is the cbarn skip called "cbarn"
> or "cbarn.gs"? If it's called cbarn.gs, then you'll likely need to include
> the ".gs" when you call the script.
>
> HTH,
> Dan
>
> On 10/18/07, mmacleod <mmacleod at scotiaweather.com> wrote:
>
>> Good morning All.
>>
>> I have a recurring problem with both GrADS version 1.8.11 on Windows XP
>> and on 1.9.4b on Red Hat E4.1 Linux version.
>>
>> When I plot a 2-D map and use the cbarn.gs or the user function hilo the
>> draw instructions seems to loose the x position on the page and shifts
>> even line to the left margin.  See attached maps
>> "NAM_NovaS_LowLvlMoistConv-WindsH03-Cor.png" which contains the plot
>> without cbarn being executed within the script script section below:
>>
>> ------ Script lines ----------
>> 'set font 0'
>> 'set strsiz 0.20 0.20'
>> 'draw string 3.5 8.20 Scotia Weather Services Inc'
>> 'set strsiz 0.12 0.12'
>> 'draw string 0.35 7.95 NWS NAM Model 0-30 mb Horizontal Moisture
>> Divergence and 0-30 mb AGL WInd Direction and Speed'
>> 'set strsiz 0.15 0.15'
>> 'set strsiz 0.12 0.12'
>>
>>
>> if(xx > 9)
>>
>> *  This inserts the valid model output date and time for the current time
>>   'draw string 2.5 0.15 ' xx ' Hr Prog valid at ' time1 ' - ' time3 ' -
>> ' time2 ' - ' time4
>>   'set strsiz 0.1 0.1'
>>   'draw string 1.95 0.5 ___ 0-30 mb Horizontal Moisture Divergence (E
>> -06 kg/kg/s) amd 0-30 mb wind barbs  '
>>
>> *  This displays the valid date and time of the model run so one does
>> not get confused when several model runs are available.
>>
>>   'set strsiz 0.09 0.09'
>>     'draw string 0.25 0.40 Model run from '
>>   'draw string 0.25 0.25 ' timea '-' timeb '-' timec '-' timed ' '
>>   'draw rec .20 .20 1.75 0.55 '
>>
>> 'set gxout contour'
>> 'cbarn 1 0 6.0 0.75 '
>>
>>
>> 'printim ' fileset  xx '.png x1000 y800 '
>>
>> else
>>
>>
>> *  This inserts the valid model output date and time for the current time
>>   'draw string 2.5 0.15 0' xx ' Hr Prog valid at ' time1 ' - ' time3 '
>> - ' time2 ' - ' time4
>>   'set strsiz 0.1 0.1'
>>    'draw string 1.95 0.4 ___ 0-30 mb Horizontal Moisture Divergence (E
>> -06 kg/kg/s) amd 0-30 mb wind barbs  '
>>
>> *  This displays the valid date and time of the model run so one does
>> not get confused when several model runs are available.
>>
>>   'set strsiz 0.09 0.09'
>>   'draw string 0.25 0.40 Model run from '
>>   'draw string 0.25 0.25 ' timea '-' timeb '-' timec '-' timed ' '
>>   'draw rec .20 .20 1.75 0.55 '
>> 'set gxout contour'
>> 'cbarn 1 0 6.0 0.65 '
>>
>> 'printim ' fileset '0' xx '.png x1000 y800 '
>> endif
>>
>> ----- End of Script Lines ------
>>
>> Once cbarn is run and until I reinitialize GrADS, all script runs will
>> then move the draw lines tight to the left margin as shown in the
>> attached map "NAM_NovaS_LowLvlMoistConv-WindsH03.png"
>>
>> Even if I run a scrip that does not have the "run cbarn  " line in it,
>> the draw statements place the margins tight to the left margin.
>>
>> The same thing occurs with the use of the hilo user function for the
>> placement of high and low centres on the  MSL maps.
>>
>> It appears to be a memory location has a setting changed by cbarn or
>> hilo that then overrides the x  setting  of draw.
>>
>> You help to correct this problem is  much appreciated.
>>
>> Sincerely
>>
>> Mac MacLeod
>>
>> --
>> M.A. (Mac) MacLeod
>> President and General Manager
>> Scotia Weather Services Inc
>> 192 Wyse Road, Suite 8,
>> Dartmouth, N.S. B3A 1M9
>>
>> Tele: 902-468-3866
>> Fax:  902-461-1768
>> E-mail: mmacleod at scotiaweather.com
>> Visit us: www.scotiaweather.com
>>
>>
>>
>>
>
>

--
M.A. (Mac) MacLeod
President and General Manager
Scotia Weather Services Inc
192 Wyse Road, Suite 8,
Dartmouth, N.S. B3A 1M9

Tele: 902-468-3866
Fax:  902-461-1768
E-mail: mmacleod at scotiaweather.com
Visit us: www.scotiaweather.com



More information about the gradsusr mailing list