Re: exp intrinsic function

From: Ethan Alpert (ethan AT unknown)
Date: Tue Dec 22 1998 - 10:48:51 MST


>
> Hello,
>
> I am trying to compute a simple exponential function in a NCL routine
> but I could not find the function exp or anything similar on the
> "Built-in NCL functions and procedures"
> http://ngwww.ucar.edu/ngdoc/ng4.1/ref/ncl/NclFuncAndProcRef.html.
> Other math functions like sin, cos, log and log10 are there. Could exp
> have been forgotten?

I'm not sure why exp is not supported because it appears to be a standard
C math library function. I'll look in to it. In the meantime you can use the
following NCL source as a replacement:

function exp(x:double)
local e
begin
;
; Solve for constant e
;
        e = 10.0^(1.0/log(10.0))

;
; compute e to the power of x for all elements of x
;
        return(e^x)
end

Keep in mind that it is possible to configure NCL to call you're own C and
FORTRAN utilities. I can provide you more information on this if you wish.
For C it can be complicated but for FORTRAN we have a wrapper generating
utility called "wrappit77"

        -ethan

>
> Thanks and Merry Christmas!
> Andrea
>
> /\
> /@@\ | Andrea N. Hahmann
> \__/ | Inst. of Atmospheric Phys.
> W AA W | PAS Bldg. 81
> |__AYA__/ | University of Arizona
> AXXV | Tucson, AZ 85721
> VXXV | Phone: (520) 621-6619
> W VUV W | (520) 621-8836 (msg.)
> |_/ V \_/ __ | Fax : (520) 621-6833
> \ [_ \ | www.atmo.arizona.edu/hahmann/hahmann.html
> \_____/
>
>



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:40:35 MDT