[gradsusr] GrADS convert longitude west to east

Bill Bua - NOAA Affiliate bill.bua at noaa.gov
Thu Jul 12 07:39:31 EDT 2018


Hi Tracey --

There's a difference between a script variable and what I believe is called
an *intrinsic* variable, in GrADS. With script variables, you would indeed
use "define".  But for intrinsic variables (and this from my experience
needs to be in a script), I believe you'd have to pull the values from a
string of display-ed data.  That is:

"d lon"
lonw = subwrd(result,<leftmost character position>, <rightmost character
position>)

where leftmost and rightmost refer to the left and right position in the
line that includes the variable lonw.
If there are multiple lines in the display, you'll have to first choose the
line that contains the longitude. If it were the 2nd line, you'd have the
command

lonline=sublin(result, 2)
then do subwrd(lonline, <leftmost>,<rightmost>) as above.

Finally, you'd define your lone = 360 - lonw ("define lone = 360 - lonw").

I'm doing this from memory ... it's been awhile since I wrote a script.
I'll check it out once I'm where I can write a test script and see if this
works.

Bill



Dr. William R. (Bill) Bua
UCAR/COMET/NCEP/EMC
5830 University Research Court #2784
College Park, MD 20740


On Wed, Jul 11, 2018 at 6:49 PM, Tracey <tdorian10 at gmail.com> wrote:

> ​Hi Bill,
>
> Thanks, how would I use this arithmetic in the GrADS script with 'lonmax'
> and 'lonmin' arguments?  This is what I'm having trouble with.   Would I
> use "define"?
>
> Sincerely,
> Tracey
>
> On Wed, Jul 11, 2018 at 6:31 PM, Bill Reilly <bill_reilly at compuserve.com>
> wrote:
>
>> 360 - degW = degE
>>
>> --
>>
>> Bill Reilly
>>
>> (+34) 686-110-748
>> bill at passageweather.comwww.passageweather.com
>> bill at brwebworks.comwww.brwebworks.com
>>
>> On 12/07/2018 00:14, Tracey wrote:
>>
>> ​Hi GrADS users,
>>
>> Is there a GrADS function or script that converts degrees west longitude
>> into degrees east?  For example, if I input "lonmin" and "lonmax" arguments
>> into a GrADS script and I wanted to convert those longitudes from degrees
>> west to degrees east within the script by defining new "lonmin" and
>> "lonmax" variables?
>>
>> Thanks in advance for any help,
>> Tracey​
>>
>>
>> _______________________________________________
>> gradsusr mailing listgradsusr at gradsusr.orghttp://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180712/94764f22/attachment.html>


More information about the gradsusr mailing list