missing values in the gamma function

From: Nick Guy <nick.guy_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 05 2013 - 08:55:37 MST

Hello all,

I am passing an array of values to the gamma function as below. Note the -999 causes an error:

ncl 5> a=(/5,2,-999/)
ncl 6> print(gamma(a))
 ==>SLATEC/NCL: DGAMMA: X SO SMALL GAMMA UNDERFLOWS: NERR= 2 : LEVEL= 1
(0) 24
(1) 1
(2) 0

Now I set the -999 as a missing values and try again, but the error is still returned:
ncl 7> a@_FillValue=-999
ncl 8> print(gamma(a))
 ==>SLATEC/NCL: DGAMMA: X SO SMALL GAMMA UNDERFLOWS: NERR= 2 : LEVEL= 1
(0) 24
(1) 1
(2) 0

So I also try using the where command to only process the "good" values:
ncl 10> b=where(ismissing(a),a@_FillValue,gamma(a))
 ==>SLATEC/NCL: DGAMMA: X SO SMALL GAMMA UNDERFLOWS: NERR= 2 : LEVEL= 1
ncl 11> print(b)

Variable: b
Type: float
Total Size: 12 bytes
            3 values
Number of Dimensions: 1
Dimensions and sizes: [3]
Coordinates:
(0) 24
(1) 1
(2) -999

So the missing value is always processed (if the default missing float value is used, a big gamma underflow occurs). I assume this may be part of the DCDFLIB library and that all array numbers must be passed? In the end NCL does what the command tells it to do, but the resulting output is annoying more than anything.

Is there any way to cut the error by not processing the missing values?
Thanks,

Nick Guy, Ph.D.
NOAA National Severe Storms Laboratory
NOAA/NSSL/WRDD
120 David L. Boren Blvd.
Norman, OK 73072
(405)325-6287
nick.guy@noaa.gov

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 5 08:56:19 2013

This archive was generated by hypermail 2.1.8 : Wed Feb 06 2013 - 16:37:00 MST