[gradsusr] continue a line

Kevin Huyck klhuyck at meridian-enviro.com
Tue Sep 18 21:38:29 EDT 2012


I didn't realize that. Thank you, Jennifer. I've tested this technique 
and it works in both examples below...

dwind = 'pow(ugrd_isbl(z-1)-ugrd_isbl,2) + '
'define dwind = 'dwind % 'pow(vgrd_isbl(z-1)-ugrd_isbl,2)'

dwind = 'pow(ugrd_isbl(z-1)-ugrd_isbl,2) + '
dwind = dwind % 'pow(vgrd_isbl(z-1)-ugrd_isbl,2)'
'define dwind =' dwind

Kevin L. Huyck
Forecaster, Meridian Environmental Technology, Inc.
klhuyck at meridian-enviro.com <mailto:klhuyck at meridian-enviro.com>

Composed using Mozilla Thunderbird!

On 09/17/12 06:56, Jennifer Adams wrote:
> Kevin's technique can make your long expressions a little more 
> readable, but there is also this option:
>
> cmd='blah blah blah'
> cmd=cmd%'blah blah blah'
> cmd=cmd%'blah blah blah'
>
> --Jennifer
>
>
>
> On Sep 17, 2012, at 3:22 AM, Kevin Huyck wrote:
>
>> I have searched for an answer to this question, too. To my knowledge 
>> there is no line continuation syntax in GrADS. When I have a long 
>> calculation, I break it into parts across several lines, often 
>> including some extra variables.
>>
>> Example:
>> * One line
>> 'define 
>> esat=0.611*pow(10,(7.5*(tmp_isbl-273.15))/(237.3+(tmp_isbl-273.15)))'
>>
>> * Several lines. Note "undefines" when we are done with the temporary 
>> values.
>> 'define tmp=(tmp_isbl - 273.15)'
>> 'define a = pow(10, (7.5 * tmp) / (237.3 + tmp))'
>> 'define esat = 0.611 * a'
>> 'undefine tmp'
>> 'undefine a'
>>
>> Hope this helps. Good luck.
>>
>> Kevin L. Huyck
>> Forecaster, Meridian Environmental Technology, Inc.
>> klhuyck at meridian-enviro.com <mailto:klhuyck at meridian-enviro.com>
>>
>> Composed using Mozilla Thunderbird!
>>
>> On 09/12/12 10:38, Athanasios Karagiannidis wrote:
>>> hello to all.
>>>
>>> My question may be a little ...dumb, but i'm stuck!
>>> How can i continue a big expression (eg a sum) to the next line?
>>> And as a secondary question: is there a maximum character length for 
>>> GrADS scripts?
>>>
>>> Thank you all.
>>>
>>> A. Karagiannidis
>>>
>>> Athanasios F. Karagiannidis
>>> Physicist, PhD Meteorology and Climatology
>>> E-mail:thankar at live.com
>>>
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>> <klhuyck.vcf>_______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>> http://gradsusr.org/mailman/listinfo/gradsusr
>
> --
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705
> jma at cola.iges.org <mailto:jma at cola.iges.org>
>
>
>
>
> _______________________________________________
> 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/20120918/33105372/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: klhuyck.vcf
Type: text/x-vcard
Size: 307 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20120918/33105372/attachment-0003.vcf 


More information about the gradsusr mailing list