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">&lt;<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>&gt;</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 &lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a> &lt;mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;&gt;<div><div></div><div class="h5"><br>
<br>
    I don&#39;t use Matlab but maybe ...<br>
<br>
    time  = (/730848.5, 730848.9/)<br>
    time@units = &quot;days since Jan-1-0000 00:00:00&quot;<br>
<br>
    date  = cd_calendar(time,0)   ; year,month,day,hour,minute,sec<br>
    print(date)<br>
<br>
    Due to the way &#39;cd_calendar&#39; 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>
    &lt;<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>&gt;<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>
    &lt;<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>&gt;<br>
<br>
    Good luck<br>
<br>
<br>
    On 7/10/11 9:55 PM, shinn wong wrote:<br>
<br>
        Dear all,<br>
        I&#39;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 &amp; Global Dynamics Div.                       |<br>
National Center for Atmospheric Research             |<br>
Boulder, CO  80307                                   |<br>
USA                        email: shea &#39;at&#39; <a href="http://ucar.edu" target="_blank">ucar.edu</a> |<br>
==============================<u></u>========================<br>
</blockquote></div><br>