[gradsusr] help Using Mathematical Function
Eric Altshuler
ela at cola.iges.org
Tue Apr 6 16:04:50 EDT 2010
There is a math function 'math_log' in the scripting language. Its usage is:
y = math_log(x)
where x is a positive real number and y is the natural logarithm of x. For base 10 logarithms, there is the math_log10 function. These functions are only available in the scripting language; i.e. they operate on script variables, not grads data variables.
----- Original Message -----
From: "Heiner Körnich" <heiner at misu.su.se>
To: "GrADS Users Forum" <gradsusr at gradsusr.org>
Sent: Tuesday, April 6, 2010 10:03:42 AM
Subject: Re: [gradsusr] help Using Mathematical Function
Hej Joao,
I think the problem is that the log-function is defined within the grads-commands, but not within the script-commands, ie. you can use it in a script within two apostrophes but not without.
Try this:
'd log('pres')'
logpp=subwrd(result,4)
result is a script variable which contains the output from the grads-command. it looks like:
Result value = 4.60517
The subwrd picks the 4th word of "result"
Regards till Johannes!
Cheers,
Heiner
2010/4/6 João Teixeira < a38978 at ua.pt >
Hi there
I've been trying to use the mathematical function, log( ), in one of my scripts, but GrADS always tells me that the function doesn't exist. Have any of you know how to use this mathematical function in the scripting language?
In attachment I send the script.
Cheers
João Teixeira
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
--
Heiner Körnich
Dept. of Meteorology Tel: +46 8 164333
Stockholms University, SE-106 91 Stockholm, Sweden
Email: heiner at misu.su.se www.misu.su.se/~heiner/
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
More information about the gradsusr
mailing list