[gradsusr] Grads Bash scripting
Don Van Dyke
Don.VanDyke at noaa.gov
Tue Aug 31 22:53:56 EDT 2010
Although, on second thought, that shouldn't even matter as long as
you're consistent within your GrADS script calling it "Lat" and not "lat".
-Don
Don Van Dyke wrote:
> Hi Meredith,
>
> Yeah, that should work. What error did you get? The only thing I see
> potentially wrong there is to check and make sure you have
> lat=subwrd(data,3) and not Lat=subwrd(data,3) in your GrADS script. :-)
>
> Don Van Dyke
> NWS Tallahassee, FL
>
> Meredith Croke wrote:
>> Thank you very much for your suggestion, this did work. Now if I want
>> to pass multipe varibale(ie lat/lon, name) can I do it the same way
>> listing them before the export? Ie:
>> echo ${yyyy} ${name} ${lat} | /export/grads/bin/gradsc -blc "run
>> gs.sf.surface.wind_mps"
>>
>> yyyy=subwrd(data,1)
>> name=subwrd(data,2)
>> Lat=subwrd(data,3)
>>
>> I am getting an error when I do it this way.
>>
>> Thanks.
>>
>> Meredith
>>
>> -----Original Message-----
>> From: gradsusr-bounces at gradsusr.org
>> [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Don.VanDyke at noaa.gov
>> Sent: Tuesday, August 31, 2010 5:02 PM
>> To: GrADS Users Forum
>> Subject: Re: [gradsusr] Grads Bash scripting
>>
>> Hi Meredith,
>>
>> To go from bash to GrADS, try doing something like this. In your bash
>> script, add a line like this....
>>
>> echo ${yyyy} | /export/grads/bin/gradsc -blc "run
>> gs.sf.surface.wind_mps"
>>
>> In your gs.sf.surface.wind_mps script, at the very top, add these
>> lines....
>>
>> pull data
>> yyyy=subwrd(data,1)
>>
>> Then you can reference the yyyy in the rest of the GrADS script like
>> this....
>> 'draw title Testing 'yyyy' year'
>>
>> Hope this helps some.
>>
>> Don Van Dyke
>> NWS Tallahassee, FL
>>
>> ----- Original Message -----
>> From: Meredith Croke <mcroke at airdat.com>
>> Date: Tuesday, August 31, 2010 4:39 pm
>> Subject: [gradsusr] Grads Bash scripting
>> To: gradsusr at gradsusr.org
>>
>>
>>
>>> Hi,
>>>
>>> I am trying to write a bash script that will read values from a
>>> tc-vitals file and feed it into my grads script. Can anyone give me
>>> tips on how to do this? I'm not sure how to feed the varibales from
>>> bash into grads. I have tried doing this in a bunch of different
>>>
>> ways
>>
>>> and searched the users forum but I can't find any good examples.
>>> Here's one example, trying to have the date read in grads:
>>> in bash:
>>>
>>> yyyy=$(date +%Y%m%d$hh)
>>> /export/grads/bin/gradsc -blc 'run gs.sf.surface.wind_mps'
>>>
>>> in grads
>>> date= yyyy
>>> (i've tried 'yyyy' and $yyyy)
>>>
>>> what else do I need to put in bash or in my grads script to
>>> recognize that yyyy= 2010083112 ?
>>>
>>> Any help is greatly appreciated.
>>>
>>> Meredith
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>>
>>>
>> _______________________________________________
>> 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 --------------
A non-text attachment was scrubbed...
Name: don_vandyke.vcf
Type: text/x-vcard
Size: 356 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20100831/6da47987/attachment-0001.vcf
More information about the gradsusr
mailing list