<div dir="ltr">Thank you.<div><br></div><div>I will give it a try...</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 17, 2017 at 10:12 AM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Dear Mr.Barry<br><br></div>You just need to active or load to call file &#39;cd_string.ncl&#39; at the top of the code. The file &#39;cd_string&#39; itself  already exist inside folder &#39;/usr/share/ncarg/nclscripts/<wbr>contrib/&#39;. In this conversation, I attached a file call &#39;script.ncl&#39;. Like Mr. Rick and Mr.Dave said it is just need to specify ntimes(it) in the call to cd_string() because ntimes is loop for the time.<br><br></div>I hope this can help.<br><br></div>Regards,<br></div>Soares<br><div><div><div><div><br></div></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 17, 2017 at 1:13 PM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Soares:<div><br></div><div>Could you please summarize the code that allows you to convert wrf output times to local time.  </div><div><br></div><div>This is very useful.</div><div><br></div><div>Thansk</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-328133161516601911h5">On Fri, Feb 17, 2017 at 5:11 AM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-328133161516601911h5"><div dir="ltr"><div><div><div><div>Dear Mr.Dave and Mr.Rick<br><br></div>It&#39;s working. It&#39;s solved now.<br><br></div>Thank you very much.<br><br></div>Best regards,<br></div>Soares<br></div><div class="m_-328133161516601911m_-4829868297404112342HOEnZb"><div class="m_-328133161516601911m_-4829868297404112342h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 10, 2017 at 4:20 AM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Soares,<div><br></div><div>Never mind about those print statements.  This problem was already solved.  Please follow the instructions in this message:</div><div><br></div><div><a href="http://mailman.ucar.edu/pipermail/ncl-talk/2016-September/006863.html" target="_blank">http://mailman.ucar.edu/piperm<wbr>ail/ncl-talk/2016-September/00<wbr>6863.html</a><span class="m_-328133161516601911m_-4829868297404112342m_100128143003052256HOEnZb"><font color="#888888"><br></font></span></div><span class="m_-328133161516601911m_-4829868297404112342m_100128143003052256HOEnZb"><font color="#888888"><div><br></div><div>--Dave</div></font></span><div><div class="m_-328133161516601911m_-4829868297404112342m_100128143003052256h5"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 9, 2017 at 10:15 AM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Oops, my mistake.  Can you please tell me whether the input file contains numeric time coordinates, or only character time coordinates?  It is much easier to calculate offset times if the numeric time coordinates are already calculated.<div><br></div>Right after addfile, try printFileVarSummary (in, &quot;U&quot;).  If tjhat does not work, try printFileVarSummary (in, &quot;UU&quot;).  The first subscript in the variable gets you the name of the time dimension.<br><br>Then try printFileVarSummary (in, &quot;TIME&quot;) where you replace TIME with the actual name of the time dimension.  Then please show us the output from only that command.<div><br></div><div>If that does not work, you can try manually searching for a numeric time coordinate.  print (in) shows you a summary of all variables in the file.  Scroll through that list by pressing the space bar until you get to the end.  Look for a variable with &quot;time&quot; in the name; a numeric type such as double, float, or integer; and units attribute like &quot;days since&quot; or &quot;hours since&quot;.  Then show the complete printed description for that variable.</div><div><br></div><div>--Dave<div><br></div><div><br><div><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 8, 2017 at 8:47 PM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Dear Mr.Dave<br><br></div>By following your instruction I get complete output as in attachment (output.script.txt).<br><br></div>Best regards,<br></div>Soares<div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 9, 2017 at 10:42 AM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Also I see another problem.  In these two lines which I just sent, make sure you have ASCII straight double quotes (&quot;) in the script before you run it.  I think I sent you curly double quotes (UTF-8) by mistake.<div><br></div><div><span><div style="font-size:14px">    time_numeric = cd_inv_string (times, &quot;%Y%N%D%H%M&quot;)<br></div></span><div style="font-size:14px"><span><div>    offset_times = cd_string (time_numeric, &quot;%Y%N%D%H%M&quot; )<br></div><div><br></div></span><span class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213HOEnZb"><font color="#888888"><div>--Dave</div><div><br></div></font></span></div></div><div><div class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 8, 2017 at 6:29 PM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Soares,<div><br></div><div>Please insert this right below &quot;ntimes = dimsizes(times)&quot;:</div><div><br></div><div>    print (times(0:2))</div><div>    time_numeric = cd_inv_string (times, “%Y%N%D%H%M”)<br></div><div><div>    print (time_numeric(0:2))</div><div><br></div><div>    offset = -9    ; hours</div><div>    time_numeric = time_numeric - offset</div><div>    offset_times = cd_string (time_numeric, “%Y%N%D%H%M” )<br></div><div><div>    print (offset_times(0:2))</div></div><div>    exit</div><div><br></div><div>Then run it and show us the complete output, including all normal and error messages.</div><div><br></div><div>--Dave</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 8, 2017 at 5:18 PM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Dear Mr.Rick<br><br></div>That is I mean, I want to use the ntimes to call cd_string because of my wrfout file is in UTC but I want to get the output result in UTC+9.<br></div>I have active load above my script but it does not change anything.<br><br></div>Any help will appreciate,<br><br></div>Regards,<br></div>Soares<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 11:29 PM, Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br></div>I&#39;m not sure what you are trying to do, but this part does not seem right:<br><br>   do it = 0,ntimes-1                ;Loop for the time: it= starting time<br>      time = it<br>      time_numeric=cd_string(<span style="color:rgb(255,0,0)">time(0)</span><wbr>,&quot;%Y%N%D%H%M&quot;) <br><br></div>&quot;time&quot; would be an integer scalar (although in NCL, all scalars are arrays of dimension 1, so notation like time(0) is not a syntax/semantic error), but time certainly will not have the requisite &quot;units&quot; attribute.  Did you perhaps mean to specify &quot;ntimes(it)&quot; in the call to cd_string()?<br><br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213m_-8050920614596522142m_-6307986196561952526m_5588411576104163138gmail-m_-6817932020494648855h5">On Tue, Jan 24, 2017 at 11:28 PM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213m_-8050920614596522142m_-6307986196561952526m_5588411576104163138gmail-m_-6817932020494648855h5"><div dir="ltr"><div><div><div><div>Dear Mr.Dave<br><br></div>I am very for asking a lot, I have tried my best but I still face the error even I already have the line &#39;/usr/share/ncarg/nclscripts/c<wbr>ontrib/cd_string.ncl&#39; on my top script. I still use NCL version 6.1.2.<br><br></div>I face error say:<br><br>cd_string: The variable containing time values must have a &#39;units&#39; attribute.<br>fatal:Illegal right-hand side type for assignment<br>fatal:[&quot;Execute.c&quot;:8128]:Execu<wbr>te: Error occurred at or near line 33 in file script.ncl<br><br></div><div>My script file in attachment.<br></div><div>Thanks<br></div><div><br></div>regards,<br></div>Soares<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 5:46 AM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Soares,<div><br></div><div>Also show the output from print (time(0)) before you call cd_string.</div><span class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213m_-8050920614596522142m_-6307986196561952526m_5588411576104163138gmail-m_-6817932020494648855m_190083757131242295m_-5816446474713299693HOEnZb"><font color="#888888"><div><br></div><div>--Dave</div></font></span><div><div class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213m_-8050920614596522142m_-6307986196561952526m_5588411576104163138gmail-m_-6817932020494648855m_190083757131242295m_-5816446474713299693h5"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 1:29 PM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Soares,<div><br>The documentation for cd_string says that you must have this line at the top of your program:<br><br>   load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/contrib/cd_string.ncl&quot;<div><br></div><div>If that does not solve your problem, then please show:</div></div><div><br></div><div>1.  Complete console output up to the point of error.  This should include the command to run your program, and the NCL version number.</div><div><br></div><div>2.  A complete copy of your NCL script, or a reduced test script that just shows this error.</div><div><br></div><div>--Dave</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 9:28 PM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Dear Mr. Dave<br><br></div>I have modified the syntax to cd_string but I still face the error &#39;fatal:Undefined identifier: (cd_string) is undefined, can&#39;t continue&#39;<br><br>time_numeric=cd_string(time,&quot;%<wbr>Y%N%D%H%M&quot;)  ;; will return in hours since 1800-01-01 unless specified otherwise<br>offset=-9    ; hours<br>time_numeric =time_numeric-offset<br><br>time=cd_string(time_numeric,&quot;%<wbr>Y%N%D%H%M&quot;)<br><br></div><br>Soares<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 12:39 PM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Soares,<div><br></div><div>The function <span style="font-size:14px">cd_inv_string is in the next NCL release.  It is not available in the current release 6.3.0.  That is why you are getting a syntax error.</span></div><div><span style="font-size:14px"><br></span></div><div>If your data already has date/time in numeric format as hours since XXX, then you might be able to directly subtract the offset and use cd_string to print the times that you want.</div><span class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213m_-8050920614596522142m_-6307986196561952526m_5588411576104163138gmail-m_-6817932020494648855m_190083757131242295m_-5816446474713299693m_-1407716888093019742m_8713132754400176082m_-2943709031549377148HOEnZb"><font color="#888888"><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">--Dave</span></div></font></span><div><div class="m_-328133161516601911m_-4829868297404112342m_100128143003052256m_-4607828306384785800m_-159554481292913425gmail-m_3233914134851968213m_-8050920614596522142m_-6307986196561952526m_5588411576104163138gmail-m_-6817932020494648855m_190083757131242295m_-5816446474713299693m_-1407716888093019742m_8713132754400176082m_-2943709031549377148h5"><div><span style="font-size:14px"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 8:07 PM, isakhar sakhar isakhar <span dir="ltr">&lt;<a href="mailto:isakhar.inside13@gmail.com" target="_blank">isakhar.inside13@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Dear Mr.Dennis<br><br>I have a wrfout data and it is in UTC. I want to print in my local time (UTC+9). I already have the file cd_inv_string.ncl and already load it in my top of file. I also adjust as below to the my local time but I still face the error. <br><br>time_numeric=cd_inv_string(nti<wbr>mes,“%Y%N%D%H%M”)  ;; will return in hours since 1800-01-01 unless specified otherwise<br>offset=-9    ; hours<br>time_numeric =time_numeric-offset<br>time=cd_string(time_numeric,“%<wbr>Y%N%D%H%M” )<br><br></div>I got the error say: fatal:syntax error: line 34 in file script.ncl before or near � <br>time_numeric=cd_inv_string(tim<wbr>e,<br><br></div>My file in attachment. <br></div>Really appreciate for any help.<br><br></div>Big thanks<br></div>Soares</div></blockquote></div></div></div></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div><br></div></div><span>______________________________<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></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-328133161516601911m_-4829868297404112342gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>