Re: Problem with ut_inv_calendar

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 19 2010 - 07:56:27 MDT

Hi Mateus,

I'll take a look at this. We did move from Udunits-1 to Udunits-2 when we went from NCL 5.1.1 to 5.2.0, but I don't
know of anything offhand that would cause this kind of problem.

--Mary

On Jul 17, 2010, at 6:55 PM, Mateus Teixeira wrote:

> Dear NCL users,
>
> I noted a difference in the functioning of the ut_inv_calendar function between 5.1.1 and 5.2.0 NCL versions. Please see the example below:
>
> 1) for 5.1.1 version:
>
> ncl 0> dataStorm = (/2004,02,27,23/)
> ncl 1> idxStorm = ut_inv_calendar( dataStorm(0), dataStorm(1), dataStorm(2), dataStorm(3), 0, 0,"hours since 2004-02-25 00:00:0.0",0)
> ncl 2> print(idxStorm)
>
> Variable: idxStorm
> Type: double
> Total Size: 8 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 2
> calendar : standard
> units : hours since 2004-02-25 00:00:0.0
> (0) 71
>
>
> 2) for 5.2.0 version, the same result from print(idxStorm):
>
> Variable: idxStorm
> Type: double
> Total Size: 8 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 2
> calendar : standard
> units : hours since 2004-02-25 00:00:0.0
> (0) 70.99999999999997
>
>
> Why there is this difference? Is it caused by UDUNITS 2 in NCL 5.2.0?
> I don't understand this difference since I'm not dealing with minutes and seconds which will give me a non integer result.
>
> With 5.1.1 NCL version, I could apply doubletoint directly to the result of the ut_inv_calendar and use it to obtain an element of an array.
> Now, with 5.2.0 I have to add more instructions to convert it correctly to integer type, since doubletoint truncates it giving me a wrong result.
>
>
> Best regards,
>
>
> --
> Mateus da Silva Teixeira
>
> Registered Linux User #466740 (http://counter.li.org/)
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 19 07:56:33 2010

This archive was generated by hypermail 2.1.8 : Mon Jul 19 2010 - 09:39:01 MDT