<html><body><div style="color:#000; background-color:#fff, font-family:garamond, new york, times, serif;font-size:14pt"><SPAN style="RIGHT: auto">Hi Charles, <BR>After changing &nbsp;"1 99" in the "r=&gt;r" line to "0 t,y,x", it worked.<BR><BR>Thanks for your guidance.<BR style="RIGHT: auto" class=yui-cursor></SPAN>
<DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV style="RIGHT: auto" id=RTEContent>
<DIV style="RIGHT: auto">
<DIV style="RIGHT: auto">&nbsp;</DIV></DIV></DIV>
<DIV style="FONT-FAMILY: inherit; FONT-SIZE: 14pt">
<DIV style="FONT-FAMILY: inherit; FONT-SIZE: 12pt"><FONT size=2 face=Arial><VAR id=yui-ie-cursor></VAR>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Charles Seman &lt;Charles.Seman@noaa.gov&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Zablone Owiti &lt;zablonowiti@yahoo.com&gt;; GrADS Users Forum &lt;gradsusr@gradsusr.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, 20 January 2011 2:38 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [gradsusr] How to set time attribute in sdfwrite<BR></FONT><BR>Dear Zablone,<BR><BR>It would be very helpful to see the output from "ncdump -h gcpcr.nc"... can you provide this?&nbsp; Without the ncdump output,
 the following is given assuming certain things: 1) please see <A href="http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS" target=_blank>http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS</A> and note that with the "dtype netcdf" option, change the "1 99" in the "r=&gt;r" line to "0 t,y,x" (assuming gcpcr.nc has x,y,t dimensions in it; if it does have a "z" dimension, try "1 t,z,y,x"), 2) try removing the "longitude", "latitude", "z", and "t" characters in the xdef, ydef, zdef, and tdef lines, respectively (these are not used by the "open" command but are used by the "xdfopen" command: please see item #2 at <A href="http://grads.iges.org/grads/gadoc/gradcomdxdfopen.html" target=_blank>http://grads.iges.org/grads/gadoc/gradcomdxdfopen.html</A>).&nbsp; Again, these suggestions are given assuming certain things about gcpcr.nc; if you can provide the output from "ncdump -h gcpcr.nc" or "ncdump -c gcpcr.nc" that would be very
 helpful.<BR><BR>Hope this helps,<BR>Chuck<BR><BR>Zablone Owiti wrote:<BR>&gt; Dear Charles,<BR>&gt; Thanks for the explanation and the earlier emails. I wrote a .ctl file(see bellow) to read the original data (via xdfopen command), but I get the following error (on the z dimension) which I have failed to figure out how to correct :&nbsp; *Scanning Descriptor File:&nbsp; gcpcr.ctl<BR>&gt; gadsdf: Lev dimension z is not an SDF dimension.<BR>&gt; SDF Descriptor file gcpcr.ctl was not successfully opened &amp; parsed.<BR>&gt; *<BR>&gt; The gcpcr.ctl is:<BR>&gt; dset ^gcpcr.nc<BR>&gt; dtype netcdf<BR>&gt; title Test File<BR>&gt; undef 1e+20<BR>&gt; xdef longitude 360 linear 0.5 1.0<BR>&gt; ydef latitude 180 linear -89.5 1.0<BR>&gt; zdef z 1 levels 0<BR>&gt; tdef t 674 linear 0Z1jan1948 1mo<BR>&gt; vars 1<BR>&gt; r=&gt;r 1 99 Precipitation (mm/day)<BR>&gt; endvars<BR>&gt; <BR>&gt; Further, the *q dims* results for the original data file (gcpcr.nc) when opened
 with sdfopen command&nbsp; are:<BR>&gt; Default file number is: 1<BR>&gt; X is varying&nbsp; Lon = 0 to 360&nbsp; X = 0.5 to 360.5<BR>&gt; Y is varying&nbsp; Lat = -89.5 to 89.5&nbsp; Y = 1 to 180<BR>&gt; Z is fixed&nbsp; &nbsp; Lev = 0&nbsp; Z = 1<BR>&gt; T is fixed&nbsp; &nbsp; Time = 00Z01JAN1948&nbsp; T = 1<BR>&gt; E is fixed&nbsp; &nbsp; Ens = 1&nbsp; E = 1<BR>&gt; <BR>&gt; Thanks<BR>&gt; */===================================================/*<BR>&gt; */ZABLONE OWITI<BR>&gt; GRADUATE STUDENT<BR>&gt; Nanjing University of Information, Science and Technology<BR>&gt; College of International Education<BR>&gt; Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China<BR>&gt; /*Tel: +86-25-58731402<BR>&gt; Fax: +86-25-58731456<BR>&gt; */Mob. 15077895632/*<BR>&gt; */Website: www.nuist.edu.cn &lt;<A href="http://www.nuist.edu.cn/" target=_blank>http://www.nuist.edu.cn/</A>&gt;<BR>&gt; /*/*====================================================<BR>&gt;
 *<BR>&gt; /"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."///<BR>&gt;&nbsp; /<BR>&gt; <BR>&gt; *From:* Charles Seman &lt;<A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A>&gt;<BR>&gt; *To:* Zablone Owiti &lt;<A href="mailto:zablonowiti@yahoo.com" ymailto="mailto:zablonowiti@yahoo.com">zablonowiti@yahoo.com</A>&gt;; GrADS Users Forum &lt;<A href="mailto:gradsusr@gradsusr.org" ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A>&gt;<BR>&gt; *Cc:*<BR>&gt; *Sent:* Wednesday, 19 January 2011 1:29 AM<BR>&gt; *Subject:* Re: [gradsusr] How to set time attribute in sdfwrite<BR>&gt; <BR>&gt; Zablone,<BR>&gt; <BR>&gt; I'll forward a couple of emails from Jennifer Adams who helped me put a time axis on a GrADS sdfwrite netCDF output file (the input netCDF file had no Z or T dimension...).&nbsp; In
 essence, the solution involved defining a data descriptor file to open the input netCDF file to define the time axis... I'm not sure what your input dataset attributes look like, so I'm guessing here...&nbsp; If you have questions or want sample code from a script, feel free to email me.<BR>&gt; <BR>&gt; Hope this helps,<BR>&gt; Chuck<BR>&gt; <BR>&gt; Zablone Owiti wrote:<BR>&gt; &gt; Dear users,<BR>&gt; &gt;<BR>&gt; &gt; I am writting out monthly data from a .nc file using the sdfwrite command. When I open the data I get the following warning:<BR>&gt; &gt; *SDF file has no discernable time coordinate -- using default values.<BR>&gt; &gt; *and when I q dims&nbsp; Time = 00z01Jan001 instead of the time for the data extracted i.e&nbsp; 00z01Jul1960. How can I use the *sdfattr* command to force the time attribute. Below is the script I am using to extract the data:<BR>&gt; &gt; 'reinit'<BR>&gt; &gt; 'sdfopen gcpcr.nc'<BR>&gt; &gt; 'set x 0.5 360.5'<BR>&gt;
 &gt; 'set y 1 180'<BR>&gt; &gt; 'set time 00z01jul1960'<BR>&gt; &gt; 'set sdfwrite r1.nc'<BR>&gt; &gt; 'define pcp=r'<BR>&gt; &gt; 'sdfwrite pcp'<BR>&gt; &gt; 'clear sdfwrite'<BR>&gt; &gt;<BR>&gt; &gt; Thanks<BR>&gt; &gt; */===================================================/*<BR>&gt; &gt; */ZABLONE OWITI<BR>&gt; &gt; GRADUATE STUDENT<BR>&gt; &gt; Nanjing University of Information, Science and Technology<BR>&gt; &gt; College of International Education<BR>&gt; &gt; Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China<BR>&gt; &gt; /*Tel: +86-25-58731402<BR>&gt; &gt; Fax: +86-25-58731456<BR>&gt; &gt; */Mob. 15077895632/*<BR>&gt; &gt; */Website: www.nuist.edu.cn &lt;<A href="http://www.nuist.edu.cn/" target=_blank>http://www.nuist.edu.cn/</A>&gt;<BR>&gt; &gt; /*/*====================================================<BR>&gt; &gt; *<BR>&gt; &gt; /"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid
 the wrong thing at the tempting moment."///<BR>&gt; &gt;&nbsp; /<BR>&gt; &gt;<BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt;<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; gradsusr mailing list<BR>&gt; &gt; <A href="mailto:gradsusr@gradsusr.org" ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A> &lt;mailto:<A href="mailto:gradsusr@gradsusr.org" ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A>&gt;<BR>&gt; &gt; <A href="http://gradsusr.org/mailman/listinfo/gradsusr" target=_blank>http://gradsusr.org/mailman/listinfo/gradsusr</A><BR>&gt; &gt; <BR>&gt; -- Please note that <A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A> &lt;mailto:<A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A>&gt; should be considered my NOAA<BR>&gt; email address,
 not <A href="mailto:cjs@gfdl.noaa.gov" ymailto="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</A> &lt;mailto:<A href="mailto:cjs@gfdl.noaa.gov" ymailto="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</A>&gt;.<BR>&gt; <BR>&gt; ********************************************************************<BR>&gt; Charles Seman&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A> &lt;mailto:<A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A>&gt;<BR>&gt; U.S. Department of Commerce / NOAA / OAR<BR>&gt; Geophysical Fluid Dynamics Laboratory&nbsp; &nbsp; &nbsp; &nbsp; voice: (609) 452-6547<BR>&gt; 201 Forrestal Road&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fax: (609) 987-5063<BR>&gt; Princeton,
 NJ&nbsp; 08540-6649&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.gfdl.noaa.gov/~cjs/" target=_blank>http://www.gfdl.noaa.gov/~cjs/</A> &lt;<A href="http://www.gfdl.noaa.gov/~cjs/" target=_blank>http://www.gfdl.noaa.gov/%7Ecjs/</A>&gt;<BR>&gt; ********************************************************************<BR>&gt; <BR>&gt; "The contents of this message are mine personally and do not reflect any<BR>&gt; official or unofficial position of the United States Federal Government,<BR>&gt; the United States Department of Commerce, or NOAA."<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR><BR>-- <BR>Please note that <A href="mailto:Charles.Seman@noaa.gov" ymailto="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" ymailto="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</A>.<BR><BR>********************************************************************<BR>Charles
 Seman&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A><BR>U.S. Department of Commerce / NOAA / OAR<BR>Geophysical Fluid Dynamics Laboratory&nbsp; &nbsp; &nbsp; &nbsp; voice: (609) 452-6547<BR>201 Forrestal Road&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fax: (609) 987-5063<BR>Princeton, NJ&nbsp; 08540-6649&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.gfdl.noaa.gov/~cjs/" target=_blank>http://www.gfdl.noaa.gov/~cjs/</A><BR>********************************************************************<BR><BR>"The contents of this message are mine personally and do not reflect any<BR>official or unofficial position of the United States Federal Government,<BR>the United States Department of Commerce, or
 NOAA."<BR><BR><BR><BR></DIV></DIV></div><br></body></html>