[ncl-talk] dewtemp_trh function returns NaN values

Mary Haley haley at ucar.edu
Mon Dec 15 21:55:58 MST 2014


Hi Jon,

This bug has been fixed and will be in the 6.3.0 release.  Note that there
is no scheduled date for this release yet.

A work-around, if you need it, is to use isnan_ieee to check for NaNs, and
then set these to missing using replace_ieeenan:

tk = 18. + 273.15
rh = -1.
td = dewtemp_trh(tk,rh) - 273.15
print(td)

if(any(isnan_ieee(td))) then
  value = 1.e20
  replace_ieeenan (td, value, 0)
  td at _FillValue = value
end if
print(td)

Thanks again for reporting this.

--Mary



On Fri, Sep 5, 2014 at 12:13 PM, Mary Haley <haley at ucar.edu> wrote:
>
> Hi Jon,
>
> Thanks for letting us know about this issue.
>
> I'm not sure what the correct behavior should be (a missing value, or an
> outright error), but you're right that it shouldn't return NaN.
>
> I've filed a ticket on this (NCL-2060) and will be sure to update the
> documentation.
>
> --Mary
>
>
>
> On Fri, Sep 5, 2014 at 10:58 AM, Jon Meyer <
> jonathan.meyer at aggiemail.usu.edu> wrote:
>
>> Hello NCL developers,
>>
>> I wanted to bring a minor detail to your attention regarding the
>> dewtemp_trh function. I've been using this function to compute dewpoint
>> temperatures from WRF met_em files and have been seeing NaN values returned.
>>
>> Tracing this issue, I found that when RH values fall below 0%, the NaN
>> values are returned. When I use the 'where' function to constrain all
>> values to above 0%, the NaN values are not returned. Values above 100% do
>> not return NaN values.
>>
>> I know from pervious email exchanges that functions are not supposed to
>> return NaN values so I wanted to point this out.
>>
>> Since most met_em files have some values outside of the appropriate range
>> due to interpolation biases, I figured either a warning message or a
>> statement on the function's page would help others who are using this
>> function avoid the NaNs, which seem to choke any plotting interface.
>>
>> Have a good day,
>> Jon
>>
>>
>>
>> _______________________________________________
>> 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/20141215/48dab078/attachment.html 


More information about the ncl-talk mailing list