<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi,</p>
<p><br>
</p>
<p>I am running NCL 6.3.0 and am trying to create a UT referenced time array using cd_inv_calendar. I have code to read strings containing Gregorian time. I break up this string into individual variables and then pass these to cd_inv_calendar. In a test
case I seem to get a truncation error when printing out the time values. Any insight would be appreciated. Thanks .</p>
<p><br>
</p>
<p>Dave</p>
<p><br>
</p>
<p>----------------------------------- attached code --------------------------</p>
<p>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/ut_string.ncl"<br>
<br>
begin<br>
; time_create<br>
; Modified by djv 10/15/15<br>
<br>
data = new((/3/),"string")<br>
data = (/"090102 000130 ","090102 000132 ","090102 000133 "/)<br>
parm_mon = stringtoint(str_get_cols(data, 0,1))<br>
parm_day = stringtoint(str_get_cols(data, 2,3))<br>
parm_yr = stringtoint(str_get_cols(data, 4,5))<br>
parm_hr = stringtoint(str_get_cols(data, 7,8))<br>
parm_min = stringtoint(str_get_cols(data, 9,10))<br>
parm_sec = stringtoint(str_get_cols(data, 11,12))<br>
parm = True<br>
parm_year = parm_yr + 2000<br>
print(parm_year)<br>
<br>
<br>
tatts = True<br>
tatts@longname = "time"<br>
tatts@units = "seconds since 1988-01-01 00:00:00" <br>
<br>
; ******** generate UT referenced value fo reach time in dataset **********<br>
time = cd_inv_calendar(parm_year,parm_mon,parm_day,parm_hr,parm_min,parm_sec,tatts@units,0) <br>
time!0= "time"<br>
time&time= time<br>
printVarSummary(time)<br>
print(time)<br>
end</p>
<p>-------------------------------- end attached code --------------------------</p>
<p><br>
</p>
<p><br>
</p>
</div>
</body>
</html>