<div dir="ltr"><div class="gmail_default" style="font-size:small">You're almost there. You need to actually assign the values to "time" as well, and not just "time&time". I know this seems kind of strange, but a coordinate variable is one whose own values are the same as its coordinate values. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I would try this code; note there's no need to have a separate variable "yyyymmdd" and no need to use "new" to create "time":</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="color:rgb(0,0,0);font-size:14px;line-height:22.4px">time = yyyymmdd_time(2001,</span><span style="color:rgb(0,0,0);font-size:14px;line-height:22.4px"> 2050, "integer")<br></span><span style="color:rgb(0,0,0);font-size:14px;line-height:22.4px">time!0="time"<br></span><span style="color:rgb(0,0,0);font-size:14px;line-height:22.4px">time@units="days since 2001-1-</span><span style="color:rgb(0,0,0);font-size:14px;line-height:22.4px">1 0:0"<br></span><span style="color:rgb(0,0,0);font-size:14px;line-height:22.4px">time@long_name="time"</span></font><br></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:14px;line-height:22.4px">time&time=time</span><br style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:14px;line-height:22.4px"></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:14px;line-height:22.4px"><br></span></div><div class="gmail_default" style="font-size:small">If "time" has a _FillValue that you don't want, then add:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">delete(time@_FillValue)</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">--Mary</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 12:02 AM, <a href="mailto:dyjbean@163.com">dyjbean@163.com</a> <span dir="ltr"><<a href="mailto:dyjbean@163.com" target="_blank">dyjbean@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<table width="99.99%" height="100%" style="padding:10px;background-color:transparent" border="0" cellpadding="0" cellspacing="0" background="cid:_Foxmail.1@c01b2c53-45b3-2299-dbd8-056c8041c157">
<tbody><tr>
<td valign="top" style="width:100%;height:100%;line-height:160%;font-size:10.5pt">
<div>
<div><span></span>hi,</div><div> i have make a time variable, the patial code as follows:</div><div><br></div><div>***********************************************************</div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)">time=new((/18262/),"integer","No_FillValue")<br>yyyymmdd = yyyymmdd_time(2001, 2050, "integer")<br>time!0="time"<br>time&time=yyyymmdd <br>time@units="days since 2001-1-1 0:0"<br>time@long_name="time"<br>**********************************************<br><br>after inputing the above coding in ncl shell, then using the two following command:<br>print(time) and print(time&time)</span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)">but they gave different result.<br><br></span><span style="background-color:rgba(0,0,0,0)"><font color="#ff0000">ncl 16> print(time)</font></span><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br><br>Variable: time<br>Type: integer<br>Total Size: 73048 bytes<br> 18262 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [time | 18262]<br>Coordinates:<br> time: [20010101..20501231]<br>Number Of Attributes: 2<br> long_name : time<br> units : days since 2001-1-1 0:0<br>(0) 0<br>(1) 0<br>(2) 0<br>(3) 0<br>(4) 0<br>(5) 0<br>(6) 0<br>(7) 0<br>(8) 0<br>(9) 0<br>(10) 0<br>(11) 0<br>(12) 0<br><br>--------------------------------------------------------------<br><br></span><span style="background-color:rgba(0,0,0,0)"><font color="#ff0000">ncl 17> print(time&time)</font></span><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br><br>Variable: time (coordinate)<br>Type: integer<br>Total Size: 73048 bytes<br> 18262 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [time | 18262]<br>Coordinates:<br>Number Of Attributes: 2<br> units : days since 2001-1-1 0:0<br> long_name : time<br>(0) 20010101<br>(1) 20010102<br>(2) 20010103<br>(3) 20010104<br>(4) 20010105<br>(5) 20010106<br>(6) 20010107<br>(7) 20010108<br>(8) 20010109<br>(9) 20010110<br>(10) 20010111<br>(11) 20010112<br><br><br>++++++++++++++++++++++++++++++++++++++++++++++++++<br><br>but they showed different result, why they cannot give the same result like other NCEP files?</span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)">thanks for your advice! <br></span></div>
<div><br></div><div><br></div><div><br></div><div><br></div><hr style="width:210px;min-height:1px" color="#b5c4df" size="1" align="left"><span class="HOEnZb"><font color="#888888">
<div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><a href="mailto:dyjbean@163.com" target="_blank">dyjbean@163.com</a></div></div></span></div>
<div></div></font></span></div>
</td>
</tr>
</tbody></table>
</div><br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>