<div dir="ltr">Hi:<div><br></div><div>I am not sure if this made it to the list as I am no longer receiving the ncl-talk (sent) e-mails. At least part of the old problem has returned.<br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Barry Lynn</b> <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com">barry.h.lynn@gmail.com</a>></span><br>Date: Tue, Nov 1, 2016 at 12:33 PM<br>Subject: Creating Date String<br>To: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br><br><br><div dir="ltr">Good Morning:<div><br></div><div>I went to this page </div><div><br></div><div><a href="https://www.ncl.ucar.edu/Document/Functions/User_contributed/cd_string.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/User_<wbr>contributed/cd_string.shtml</a></div><div><br></div><div>and tried to do this:</div><div><br></div><div><p style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;line-height:12pt">For all the following examples, assume that <em style="margin:0px;padding:0px">time</em> is an array of time values.</p><p style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;line-height:12pt"><b style="margin:0px;padding:0px">Example 1</b></p><p style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;line-height:12pt">Using the default format string of "" will result in "HHMM UTC D Mon YYYY" (e.g., 1800 UTC 4 Jul 1776):</p><p style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px;line-height:12pt"></p><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"> format = ""
stime = cd_string(time,format)</pre><div>The goal is to plot the string "time_var" as shown below, as a single variable.</div><div><br></div><div>But I get an error; please see below.</div><div><br></div><div>(Note: I thought (as a try) to stick this information in the "unitlabel" parameter below, but I would really prefer to plot the date on the right hand side at</div><div>the top of the map).</div><div><br></div><div>Here's my code.</div><div><br></div><div><div>;HHMM UTC D Mon YYYY</div><div> time_array(0)=hour(1,1,1)</div><div> time_array(1)=minute(1,1,1)</div><div> time_array(2)=day(1,1,1)</div><div> time_array(3)=month(1,1,1)</div><div> time_array(4)=year(1,1,1)</div><div> time_array(5)=units</div><div>; format = "HHMM UTC D Mon YYYY"</div><div> format = ""</div><div> <b>time_var=cd_string(time_array,<wbr>format)</b></div><div> print("time_var = " + time_var)</div><div> opts_ic_cg@FieldTitle = "Lightning Rate"</div><div>; opts_ic_cg@UnitLabel = "/10-min"</div><div> <b> opts_ic_cg@UnitLabel = time_var</b></div></div><div><b><br></b></div><div><div style="font-weight:bold">(0)<span class="m_2574867095262707391gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>Working on time: 2016-10-30_00:00:00</div><div style="font-weight:bold">(0)<span class="m_2574867095262707391gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>cd_string: The variable containing time values must have a 'units' attribute.</div><div style="font-weight:bold">fatal:Illegal right-hand side type for assignment</div><div style="font-weight:bold"><br></div><div>After searching and finding:</div><div style="font-weight:bold"><br></div><div style="font-weight:bold"><a href="http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/User_<wbr>contributed/time_axis_labels.<wbr>shtml</a><br></div><div style="font-weight:bold"><br></div><div style="font-weight:bold"><em style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px;font-weight:normal">time</em><span style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px;font-weight:normal"></span><p class="m_2574867095262707391gmail-indent" style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-weight:normal;font-size:13.3333px;line-height:12pt">An array containing the values of time. This variable should have an attribute named "units". In other words, this variable holds the values of the coordinate axis 'time' along with the units.</p><div><br></div><em style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px;font-weight:normal"></em></div><div><br></div><div>I am not sure what this error means or how to address the error.</div><div><br></div><div>Thank you.</div><div style="font-weight:bold"><br></div></div><div><br></div>-- <br><div class="m_2574867095262707391gmail_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%203108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div></div>
</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></div>