<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">https://www.ncl.ucar.edu/Document/Functions/User_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,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="gmail-Apple-tab-span" style="white-space:pre">        </span>Working on time: 2016-10-30_00:00:00</div><div style="font-weight:bold">(0)<span class="gmail-Apple-tab-span" style="white-space:pre">        </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">http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.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="gmail-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="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>