[ncl-talk] dim_sum_wgt problem with opt=0

Dennis Shea shea at ucar.edu
Mon Sep 8 14:33:51 MDT 2014


Hello Mattia,

You are correct. There does appear to be a bug in dim_sum_wgt  [*and*
dim_sum_wgt_n
and dim_avg_wgt_n]. Not sure what has happened.

Thx for the simple test to illustrate the problem.
A *slightly* more elaborate test is attached.

A JIRA ticket has been opened:  NCL-2065
<https://vets.development.ucar.edu/jira/browse/NCL-2065>

This will be fixed in the next release of NCL: 6.3.0

Vielen Dank

D



On Mon, Sep 8, 2014 at 2:01 AM, Mattia Righi <Mattia.Righi at dlr.de> wrote:

> Dear NCL users,
>
> I'm writing to report a problem with the built-in function dim_sum_wgt.
>
> According to the documentation
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_sum_wgt.shtml
>
> this function calculates the weighted sum of an input array only if all
> values are non-missing (opt=0) OR considering only the non-missing values
> (opt=1).
>
> This however seems not to be the case for opt=0.
> See the attached test script: the first print statement (opt=0) should
> return a missing, given that the input array contains 2 missing values.
>
> Note that the same calculation with the analogous dim_avg_wgt function
> provides the expected result, so this seems to be a problem only in
> dim_sum_wgt.
>
> NCL version: 6.2.0.
>
> Thanks for your help!
> Best regards,
> Mattia
>
> --
> --------------------------------------------------------------
> Dr. Mattia Righi
> Deutsches Zentrum fuer Luft- und Raumfahrt (DLR)
> Institut fuer Physik der Atmosphaere
> Muenchner Strasse 20
> D-82234 Wessling - Germany
>
>  Telephone +49 8153 28 1813
>  Telefax   +49 8153 28 1841
>  E-mail    Mattia.Righi at dlr.de
>  Internet  http://www.pa.op.dlr.de/~MattiaRighi/
> --------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140908/18ef2ff3/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst_dimsumwgt.Mattia.ncl
Type: application/octet-stream
Size: 1755 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140908/18ef2ff3/attachment.obj 


More information about the ncl-talk mailing list