<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div>HI!! </div><div><br></div><div><span><span style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">I'm trying to use print dates in string format, c<span>onverts UTreferenced
date <span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">to Julian/Gregorian date. Dates are hourly (2004-07-09 to 2004-07-11) and in a netcdf file. </span></span></span></span></span><br></div><div><span><span style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">But the hours and day are wrongs. What can I do??<span><br class="ydp749c67ddApple-interchange-newline"></span><span><br class="ydp83f0bcdfApple-interchange-newline"><br></span></span></span></span></span></span></div><div><span><span style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><br></span></span></span></span></span></div><div><span><span style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span><div><span><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" </div><div><br></div><div> begin</div><div><br></div><div> f1=addfile("MMOUT_DOMAIN3_34_sigma.nc","r")</div><div> ;</div><div> ; Array to hold month abbreviations. Don't store anything in index</div><div> ; '0' (i.e. let index 1=Jan, 2=Feb, ..., index 12=Dec).</div><div> ;</div><div> month_abbr = (/"","Jul","Aug","Sep", \</div><div> "Oct","Nov","Dec"/)</div><div> ;</div><div> ; Time values and units.</div><div> ;</div><div> time = f1->time</div><div> time@units = "hours since 2004-07-09 00:00:0.0"</div><div> ;</div><div> utc_date = ut_calendar(time, 0)</div><div> ;</div><div> ; Store return information into more meaningful variables.</div><div> ;</div><div> year = tointeger(utc_date(:,0)) ; Convert to integer for</div><div> month = tointeger(utc_date(:,1)) ; use sprinti </div><div> day = tointeger(utc_date(:,2))</div><div> hour = tointeger(utc_date(:,3))</div><div> </div><div> ; Write out strings in the format "hhZ dd mmm yyyy".</div><div> ;</div><div><br></div><div> date_str = sprinti("%0.2iZ ", hour) + sprinti("%0.2i ", day) + \</div><div> sprinti("%0.4i", year)</div><div> </div><div> print(date_str) </div><div> end</div></span><br></div></span></span></span></span></span></span></div></div></body></html>