<div dir="ltr"><div class="gmail_default" style="font-size:small">Thomas,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think you want to parse your array to get the individual years, months, days, hours, and seconds, and then use cd_inv_calendar to generate an array of time numeric values with units of something like "hours since 1850-01-01"</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See example #2 at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml</a><br></div><div class="gmail_default" style><br></div><div class="gmail_default" style>which is similar to your situation.</div><div class="gmail_default" style><br></div><div class="gmail_default" style>--Mary</div><div class="gmail_default" style><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 9:30 AM, Thomas Tobian <span dir="ltr"><<a href="mailto:thomastobian@gmail.com" target="_blank">thomastobian@gmail.com</a>></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>Hallo,<br><br>Anyone know how to solve the problem with my historical model data, 1850 to 1875:<br>'<br> institution : Max-Planck-Institute for Meteorology<br> CDO : Climate Data Operators version 1.5.9 (<a href="http://code.zmaw.de/projects/cdo" target="_blank">http://code.zmaw.de/projects/cdo</a>)<br> dimensions:<br> lon = 192<br> lat = 96<br> lev = 1<br> time = 9496 // unlimited<br> variables:<br> double lon ( lon )<br> standard_name : longitude<br> long_name : longitude<br> units : degrees_east<br> axis : X<br><br> double lat ( lat )<br> standard_name : latitude<br> long_name : latitude<br> units : degrees_north<br> axis : Y<br><br> double lev ( lev )<br> standard_name : air_pressure<br> long_name : pressure<br> units : Pa<br> positive : down<br> axis : Z<br><br> double time ( time )<br> standard_name : time<br> units : day as %Y%m%d.%f<br> calendar : proleptic_gregorian<br><br> float var131 ( time, lev, lat, lon )<br> table : 128<br> grid_type : gaussian<br><br></div>I got errors once I tried to subset the data using NCL as follows:<br><br>f1 = addfile ("<a href="http://day_data.1850.to.1875.131.25000.ano.nc" target="_blank">day_data.1850.to.1875.131.25000.ano.nc</a>","r")<br>ymdStrt = 18500101<br>ymdLast = 18751231<br>time = f2->time<br><b><br>ymd = cd_calendar(time,-2)<br>CDMS error: Error on relative units conversion, string = day as %Y%m%d.%f</b><br><b><br>CDMS error: Error on time conversion: invalid month = 3664<br></b><br>;======<br><br>ncl 9> print(time)<br><br><br>Variable: time<br>Type: double<br>Total Size: 75968 bytes<br> 9496 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [time | 9496]<br>Coordinates: <br> time: [18500101.75..18751231.75]<br>Number Of Attributes: 3<br> standard_name : time<br> units : day as %Y%m%d.%f<br> calendar : proleptic_gregorian<br>(0) 18500101.75<br>(1) 18500102.75<br>(2) 18500103.75<br>(3) 18500104.75<br>(4) 18500105.75<br>(5) 18500106.75<br>(6) 18500107.75<br>(7) 18500108.75<br>(8) 18500109.75<br>(9) 18500110.75<br>(10) 18500111.75<br>(11) 18500112.75<br>(12) 18500113.75<br><br><br></div>Thank you<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">-- Thomas<br clear="all"><div><div><div><div><br><br></div></div></div></div></font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>