Dear all,<br>I still cannot figure out what´s wrong with my dataset that will lead to missing value after using ut_calendar. The dataset I used is mldinfo_varDT.nc downloaded from <a href="http://mixedlayer.ucsd.edu/">http://mixedlayer.ucsd.edu/</a>. Could anyone help me with that? Thanks in advance for any help and suggestion.<br>
Shinn<br><br><div class="gmail_quote">2011/7/15 Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Prior to using cd_calendar you should use a print<br>
<br>
print(time)<div class="im"><br>
date = ut_calendar(time,0)<br>
<br></div>
It is possible that time does not contain some valis values<div class="im"><br>
<br>
<br>
On 07/15/2011 10:33 AM, shinn wong wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Dear Dennis,<br>
Thank you for your help. I am using version 5.5.1. But when I used date<br>
= ut_calendar(time,0), missing value was returned. The dataset is too<br>
large to be sent. I would be much appreciated for any help and suggestion.<br>
Shinn<br>
<br></div>
2011/7/11 Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a> <mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>>><div><div></div><div class="h5"><br>
<br>
I don't use Matlab but maybe ...<br>
<br>
time = (/730848.5, 730848.9/)<br>
time@units = "days since Jan-1-0000 00:00:00"<br>
<br>
date = cd_calendar(time,0) ; year,month,day,hour,minute,sec<br>
print(date)<br>
<br>
Due to the way 'cd_calendar' defines the initial day, you may<br>
need to subtract 1 day<br>
<br>
So ...<br>
<br>
time = (/730848.5, 730848.9/) - 1 ; ?? adjust for different start day<br>
date = cd_calendar(time,0)<br>
print(date)<br>
<br>
=====<br>
The inverse is true also<br>
<br>
t = cd_inv_calendar(2001,5,19,0,0,<u></u>__0,units,0) - 1 ; Matlab datenum<br>
print(t)<br>
========<br>
cd_calendar is in v6.0.0<br>
<br>
if you have an older version of NCL use<br>
<br>
date = ut_calendar(time,0)<br>
<br>
BUT in ut_calendar year 0 is treated like year 1 ...<br>
so test to get the correct day<br>
<br>
# Year 0 is not treated as year 1, like it is with the ut_calendar<br>
and ut_inv_calendar functions.<br>
<br>
=======<br>
<br>
<br>
<a href="http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_calendar.shtml" target="_blank">http://www.ncl.ucar.edu/__<u></u>Document/Functions/Built-in/__<u></u>cd_calendar.shtml</a><br>
<<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml" target="_blank">http://www.ncl.ucar.edu/<u></u>Document/Functions/Built-in/<u></u>cd_calendar.shtml</a>><br>
<br>
<a href="http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_inv_calendar.shtml" target="_blank">http://www.ncl.ucar.edu/__<u></u>Document/Functions/Built-in/__<u></u>cd_inv_calendar.shtml</a><br>
<<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml" target="_blank">http://www.ncl.ucar.edu/<u></u>Document/Functions/Built-in/<u></u>cd_inv_calendar.shtml</a>><br>
<br>
Good luck<br>
<br>
<br>
On 7/10/11 9:55 PM, shinn wong wrote:<br>
<br>
Dear all,<br>
I've got a netcdf file with time in the MATLAB datenum format (eg.<br>
730848.5, 730848.9, etc). How can I convert it into a<br>
UT-referenced date<br>
using ncl? Thanks in advance for any help and suggestions.<br>
Regards,<br>
Shinn<br>
<br>
<br>
</div></div></blockquote>
<br>
<br>
-- <br>
==============================<u></u>========================<br>
Dennis J. Shea tel: 303-497-1361 |<br>
P.O. Box 3000 fax: 303-497-1333 |<br>
Climate Analysis Section |<br>
Climate & Global Dynamics Div. |<br>
National Center for Atmospheric Research |<br>
Boulder, CO 80307 |<br>
USA email: shea 'at' <a href="http://ucar.edu" target="_blank">ucar.edu</a> |<br>
==============================<u></u>========================<br>
</blockquote></div><br>