<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Forecast time in your file will be hours since simulation started.  e.g. 0,6,12,18.  Without any guidance the cd_ routines will think this is hours since 1979-01-01.  </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">I don't want to download a 300MB file just to see if there is another time variable inside, so working with what I can see in the email, you can grab the initialisation date from the file name using cd_inv_string() incldued in 6.4.0 <a href="http://www.ncl.ucar.edu/Document/Functions/User_contributed/cd_inv_string.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/User_contri<wbr>buted/cd_inv_string.shtml</a></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:monospace,monospace"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:monospace,monospace"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:monospace,monospace">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_inv_string.ncl"</span><br></div><div class="gmail_default"><font face="monospace, monospace"><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"</div><div><br></div></font></div><div class="gmail_default"><font face="monospace, monospace">fname="<a href="http://tmp2m.2002050100.time.nc">tmp2m.2002050100.time.nc</a>"<br></font></div><div class="gmail_default"><font face="monospace, monospace">a = addfile(fname, "r")</font></div><div class="gmail_default"><font face="monospace, monospace">init_time = cd_inv_string(fname, "tmp2m.%Y%N%D%<a href="http://H.time.nc">H.time.nc</a>" )<br></font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><span style="font-family:verdana,sans-serif">;  Then either add the forecast times to the initial_time, or set the calendar for the forecast times so that it is appropriate. </span><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">forecast_hours =  a->forecast_time0</font></div><div class="gmail_default"><font face="monospace, monospace">forecast_hours@units = cd_string(init_time, "hours since %Y-%N-%D %H:%M")</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">total_time = init_time + forecast_hours</font></div><div class="gmail_default"><font face="monospace, monospace">total_time@units = init_time@units</font></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_default" style="font-family:verdana,sans-serif">Good luck<br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Alan</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 8, 2017 at 3:48 PM, dale zuri <span dir="ltr"><<a href="mailto:dalezuri@gmail.com" target="_blank">dalezuri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi ,<br></div>This result is almost similar to cd_calendar result.<br>(0)    Forecast for 1 Jan. 1979 at 06:00 <br>(1)    Forecast for 1 Jan. 1979 at 12:00 <br>(2)    Forecast for 1 Jan. 1979 at 18:00 <br>(3)    Forecast for 2 Jan. 1979 at 00:00 <br>(4)    Forecast for 2 Jan. 1979 at 06:00 <br></div>I am confused with 1979 year . <br></div>But the initial_time :    05/31/1995 (00:00)<br></div><br></div>Thanks<span class="gmail-m_-6668886234285004292m_-5990196081112008516HOEnZb"><font color="#888888"><br><br></font></span></div><span class="gmail-m_-6668886234285004292m_-5990196081112008516HOEnZb"><font color="#888888">DZ<br></font></span></div><div class="gmail-m_-6668886234285004292m_-5990196081112008516HOEnZb"><div class="gmail-m_-6668886234285004292m_-5990196081112008516h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 8, 2017 at 11:24 AM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">You need this in your preamble:<div><span class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-variant-ligatures:normal;white-space:pre-wrap;background-color:rgb(255,255,255)">load</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-variant-ligatures:normal;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335pl-s" style="box-sizing:border-box;color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-variant-ligatures:normal;white-space:pre-wrap;background-color:rgb(255,255,255)">"<span class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">$NCARG_ROOT</span>/lib/ncarg/nclscri<wbr>pts/contrib/cd_string<span class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335pl-cce" style="box-sizing:border-box">.</span>ncl”</span></div><div><div class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197h5"><div><span class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335pl-s" style="box-sizing:border-box;color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-variant-ligatures:normal;white-space:pre-wrap;background-color:rgb(255,255,255)"><br></span></div><div><br></div><div><br><div><blockquote type="cite"><div>Il giorno 08 ott 2017, alle ore 21:23, dale zuri <<a href="mailto:dalezuri@gmail.com" target="_blank">dalezuri@gmail.com</a>> ha scritto:</div><br class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335Apple-interchange-newline"><div><div dir="ltr"><div>Hi ,<br></div><div>Thanks for your reply. I need to create a time array with the actual date associated with each forecast time. <br></div><div>fatal:Undefined identifier: (cd_string) is undefined, can't continue error<br>t=cd_string(time, "%H:%M")<br><br></div><div>DZ<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 8, 2017 at 9:32 AM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">You should really take a look at the starting guide of NCL and to the documentation of the individual functions before posting questions here.<div><br></div><div>I’ve just checked your file and it seems that the time variable has the right attributes. <br><div><br></div><div>Something like this should work (NOT TESTED)<br><div><br></div><div><font face="Menlo" size="1">a=addfile("tmp2m.1995053100.ti<wbr>me.grb2","r”)</font></div><div><font face="Menlo" size="1">time=a->forecast_time0</font></div><div><span style="font-family:Menlo;font-size:x-small"><br></span></div><div><span style="font-family:Menlo;font-size:x-small">date_title= </span><span style="font-family:Menlo;font-size:x-small">"Forecast for "</span><span style="font-family:Menlo;font-size:x-small">+</span><span style="font-family:Menlo;font-size:x-small">cd_string</span><span style="font-family:Menlo;font-size:x-small">(time, </span><span style="font-family:Menlo;font-size:x-small">"%d %c</span><span style="font-family:Menlo;font-size:x-small">.</span><span style="font-family:Menlo;font-size:x-small"> %Y"</span><span style="font-family:Menlo;font-size:x-small">)+</span><span style="font-family:Menlo;font-size:x-small">" at "</span><span style="font-family:Menlo;font-size:x-small">+</span><span style="font-family:Menlo;font-size:x-small">cd_string</span><span style="font-family:Menlo;font-size:x-small">(time, </span><span style="font-family:Menlo;font-size:x-small">"%H:%M"</span><span style="font-family:Menlo;font-size:x-small">)+" UTC</span><font face="Menlo" size="1">”</font></div><div><span style="font-family:Menlo;font-size:x-small"><br></span></div><div><span style="font-family:Menlo;font-size:x-small">Cheers </span></div><div><div><br><div><blockquote type="cite"><div>Il giorno 08 ott 2017, alle ore 11:40, dale zuri <<a href="mailto:dalezuri@gmail.com" target="_blank">dalezuri@gmail.com</a>> ha scritto:</div><br class="gmail-m_-6668886234285004292m_-5990196081112008516m_8909718647525004197m_938275100325876335m_5624277842751735818Apple-interchange-newline"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline">date = cd_calendar(r, -3)</span></div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>