<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, Charles -- <div>Good question! The units of the time axis cannot be changed with the 'set sdfattr' command. The units attribute will always be written out as 'minutes since' and the base time will always be the time value of the first time step in your defined variable. The way to fix this problem is to assign a time value of 1jan1998 to netcdf variable in the first place instead of allowing it to default to 1jan0001. Use a descriptor file (for xdfopen or open) that has a tdef statement with the time you wish to assign. Then when you define your variable and write it out with sdfwrite, it will have the correct time value. </div><div>--Jennifer</div><div><br><div><div>On Mar 29, 2010, at 7:58 PM, Charles Seman wrote:</div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>I'm unable to modify the time axis units for an sdfwrite netCDF file <br>using the following command:<br>'set sdfattr time String units "minutes since 1998-01-01 00:00:00"'<br>the units remain at "minutes since 0001-01-01 00:00"<br><br>Here are the commands used to generate "nc_file" (the original file had <br>only lat/lon axes; no "z" or "t" axes...)<br><br>'set sdfwrite -4d 'nc_file<br>'set sdfattr level String long_name height'<br>'set sdfattr level String units m'<br>'set sdfattr time String units "minutes since 1998-01-01 00:00:00"'<br>'set sdfattr rprecip String long_name regridded precipitation'<br>'set sdfattr rprecip String units mm/h'<br>'set undef 'undef_value ;* change from default -9.99e8 to use source <br>netCDF file undef<br>say<br>'q sdfwrite'<br>say result<br>'sdfwrite rprecip'<br>'c sdfwrite'<br><br>Here's the "q sdfwrite" output (except for the SDFwrite file name):<br><br>SDFwrite format is NetCDF<br>SDFwrite output undef value is set to -9999.900000<br>SDFwrite file will have at least 4 dimensions<br>SDFwrite attribute metadata:<br> level String long_name height<br> level String units m<br> time String units "minutes since 1998-01-01 00:00:00"<br> rprecip String long_name regridded precipitation<br> rprecip String units mm/h<br><br>Here's output from the "\ncdump -c" on the output "nc_file"... the <br>"level" and "rprecip" attributes were modified as desired, but not the <br>time units:<br><br>dimensions:<br> longitude = 144 ;<br> latitude = 50 ;<br> level = 1 ;<br> time = 1 ;<br>variables:<br> double longitude(longitude) ;<br> longitude:units = "degrees_east" ;<br> longitude:long_name = "Longitude" ;<br> double latitude(latitude) ;<br> latitude:units = "degrees_north" ;<br> latitude:long_name = "Latitude" ;<br> double level(level) ;<br> level:units = "m" ;<br> level:long_name = "height" ;<br> double time(time) ;<br> time:long_name = "Time" ;<br> time:units = "minutes since 0001-01-01 00:00" ;<br> double rprecip(time, level, latitude, longitude) ;<br> rprecip:missing_value = -9999.9 ;<br> rprecip:long_name = "regridded precipitation" ;<br> rprecip:units = "mm/h" ;<br>data:<br><br> longitude = 1.25, 3.75, 6.25, 8.75, 11.25, 13.75, 16.25, 18.75, 21.25,<br> 23.75, 26.25, 28.75, 31.25, 33.75, 36.25, 38.75, 41.25, 43.75, 46.25,<br> 48.75, 51.25, 53.75, 56.25, 58.75, 61.25, 63.75, 66.25, 68.75, 71.25,<br> 73.75, 76.25, 78.75, 81.25, 83.75, 86.25, 88.75, 91.25, 93.75, 96.25,<br> 98.75, 101.25, 103.75, 106.25, 108.75, 111.25, 113.75, 116.25, 118.75,<br> 121.25, 123.75, 126.25, 128.75, 131.25, 133.75, 136.25, 138.75, 141.25,<br> 143.75, 146.25, 148.75, 151.25, 153.75, 156.25, 158.75, 161.25, 163.75,<br> 166.25, 168.75, 171.25, 173.75, 176.25, 178.75, 181.25, 183.75, 186.25,<br> 188.75, 191.25, 193.75, 196.25, 198.75, 201.25, 203.75, 206.25, 208.75,<br> 211.25, 213.75, 216.25, 218.75, 221.25, 223.75, 226.25, 228.75, 231.25,<br> 233.75, 236.25, 238.75, 241.25, 243.75, 246.25, 248.75, 251.25, 253.75,<br> 256.25, 258.75, 261.25, 263.75, 266.25, 268.75, 271.25, 273.75, 276.25,<br> 278.75, 281.25, 283.75, 286.25, 288.75, 291.25, 293.75, 296.25, 298.75,<br> 301.25, 303.75, 306.25, 308.75, 311.25, 313.75, 316.25, 318.75, 321.25,<br> 323.75, 326.25, 328.75, 331.25, 333.75, 336.25, 338.75, 341.25, 343.75,<br> 346.25, 348.75, 351.25, 353.75, 356.25, 358.75 ;<br><br> latitude = -49, -47, -45, -43, -41, -39, -37, -35, -33, -31, -29, -27, <br>-25,<br> -23, -21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, <br>9, 11,<br> 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, <br>47, 49 ;<br><br> level = 0 ;<br><br> time = 0 ;<br><br>Thanks for your help,<br>Chuck<br><br>-- <br><br>Please note that <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a> should be considered my NOAA<br>email address, not <a href="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</a>.<br><br>********************************************************************<br> Charles Seman <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a><br> U.S. Department of Commerce / NOAA / OAR<br> Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547<br> 201 Forrestal Road fax: (609) 987-5063<br> Princeton, NJ 08540-6649 <a href="http://www.gfdl.noaa.gov/~cjs/">http://www.gfdl.noaa.gov/~cjs/</a><br>********************************************************************<br><br>"The contents of this message are mine personally and do not necessarily<br>reflect any position of the Government or NOAA."<br><br>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br></div></body></html>