<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1450436634824_24074"><span id="yui_3_16_0_1_1450436634824_24096">Dear Dennis,</span></div><div id="yui_3_16_0_1_1450436634824_24197" dir="ltr"><br><span id="yui_3_16_0_1_1450436634824_24096"></span></div><div id="yui_3_16_0_1_1450436634824_24157" dir="ltr"><span id="yui_3_16_0_1_1450436634824_24096">I tried to use your suggested script, but got an error message as below (probablly because of, time = cd_convert( time0, "hours since 1987-04-13 18:00:00" )). Would you please kindly give more suggestion?</span></div><div id="yui_3_16_0_1_1450436634824_24312" dir="ltr"><br><span id="yui_3_16_0_1_1450436634824_24096"></span></div><div id="yui_3_16_0_1_1450436634824_24332" dir="ltr"><span id="yui_3_16_0_1_1450436634824_24096">Thanks so much!!!</span></div><div dir="ltr"><span id="yui_3_16_0_1_1450436634824_24096">Mark<br></span></div><div id="yui_3_16_0_1_1450436634824_24158" dir="ltr"><br><span id="yui_3_16_0_1_1450436634824_24096"></span></div><div id="yui_3_16_0_1_1450436634824_24347" dir="ltr"><span id="yui_3_16_0_1_1450436634824_24096">===ncl error message===<br></span></div><div id="yui_3_16_0_1_1450436634824_24102" dir="ltr"><span id="yui_3_16_0_1_1450436634824_24096">Variable: time0<br class="" id="yui_3_16_0_1_1450436634824_24077">Type: character<br class="" id="yui_3_16_0_1_1450436634824_24079">Total Size: 19 bytes<br class="" id="yui_3_16_0_1_1450436634824_24081">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19 values<br class="" id="yui_3_16_0_1_1450436634824_24083">Number of Dimensions: 2<br class="" id="yui_3_16_0_1_1450436634824_24085">Dimensions and sizes:&nbsp;&nbsp;&nbsp; [Time | 1] x [DateStrLen | 19]<br class="" id="yui_3_16_0_1_1450436634824_24087">Coordinates: <br class="" id="yui_3_16_0_1_1450436634824_24089">Number Of Attributes: 0<br class="" id="yui_3_16_0_1_1450436634824_24091">fatal:Could not coerce values for operation<br class="" id="yui_3_16_0_1_1450436634824_24093">fatal:["Execute.c":8128]:Execute: Error occurred at or near line 15 in file D1_Times.ncl<br class="" id="yui_3_16_0_1_1450436634824_24095"></span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> On Tuesday, December 15, 2015 9:04 PM, Dennis Shea &lt;shea@ucar.edu&gt; wrote:<br></font></div>  <br><br> <div class="y_msg_container">Perhaps two approaches....<br clear="none"><br clear="none"><br clear="none">[1] Add 6 to current values<br clear="none">[2] Use a function<br clear="none"><br clear="none">Initially,<br clear="none">&nbsp; f = addfile("...","r")&nbsp;  ;&nbsp; Use "r" for test and "w" to actually<br clear="none">overwrite the values<br clear="none">&nbsp; time0 = f-&gt;time<br clear="none"><br clear="none">&nbsp; time&nbsp;  = time0&nbsp; &nbsp; ; copy for print<br clear="none">&nbsp; printVarSummary(time0)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; before<br clear="none"><br clear="none">; method&nbsp; 1<br clear="none"><br clear="none">&nbsp; time = (/ time+6 /)&nbsp;  ; replace values<br clear="none">&nbsp; <a shape="rect" ymailto="mailto:time@units" href="mailto:time@units">time@units</a> = "hours since 1987-04-13 18:00:00"&nbsp; ; new units<br clear="none">&nbsp; printVarSummary(time)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; after<br clear="none"><br clear="none">or<br clear="none"><br clear="none">; method 2<br clear="none">; <a shape="rect" href="http://www.ncl.ucar.edu/Document/Functions/Contributed/cd_convert.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Contributed/cd_convert.shtml</a><br clear="none"><br clear="none">&nbsp; time = cd_convert( time0, "hours since 1987-04-13 18:00:00" )<br clear="none"><br clear="none">; print to make sure they are as you expect<br clear="none"><br clear="none">&nbsp; print("-----")<br clear="none">&nbsp; print(time0+"&nbsp;  "+time)&nbsp; ; examine before and after values<br clear="none"><br clear="none">====<br clear="none"> If all is ok the use the "w" on the addfile and then overwrite<br clear="none"><br clear="none">&nbsp;  f-&gt;time = time<br clear="none"><br clear="none">=================================<br clear="none"><br clear="none">I'd make a copy of the file before doing anything ... just in case<br clear="none">tehre are errors.<br clear="none"><br clear="none">Good Luck<br clear="none"><div class="yqt5130582994" id="yqtfd42555"><br clear="none">On Fri, Dec 11, 2015 at 4:35 AM, Mark Chan &lt;<a shape="rect" ymailto="mailto:cym263@yahoo.com" href="mailto:cym263@yahoo.com">cym263@yahoo.com</a>&gt; wrote:<br clear="none">&gt; Dear NCL group,<br clear="none">&gt;<br clear="none">&gt; I am wondering whether there is any easy method with NCL to modify "internal<br clear="none">&gt; Times" of the netcdf file: (the file name would be changed later)<br clear="none">&gt;<br clear="none">&gt; from: met_em_d01_1987-04-13_12:00:00<br clear="none">&gt;<br clear="none">&gt; To:&nbsp; &nbsp; met_em_d01_1987-04-13_18:00:00<br clear="none">&gt;<br clear="none">&gt; So the time could be shown as (with "ncdump -v Times")<br clear="none">&gt;&nbsp; Times =&nbsp;  "1978-04-13_18:00:00" ;<br clear="none">&gt;<br clear="none">&gt; Thanks very much in advance!!!<br clear="none">&gt; Mark</div><br clear="none">&gt;<br clear="none">&gt; _______________________________________________<br clear="none">&gt; ncl-talk mailing list<br clear="none">&gt; <a shape="rect" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">&gt; List instructions, subscriber options, unsubscribe:<br clear="none">&gt; <a shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><div class="yqt5130582994" id="yqtfd84390"><br clear="none">&gt;<br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>