<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 "1 99" in the "r=>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> </DIV>
<DIV style="RIGHT: auto" id=RTEContent>
<DIV style="RIGHT: auto">
<DIV style="RIGHT: auto"> </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 <Charles.Seman@noaa.gov><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Zablone Owiti <zablonowiti@yahoo.com>; GrADS Users Forum <gradsusr@gradsusr.org><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? 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=>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>). 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>> Dear Charles,<BR>> 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 : *Scanning Descriptor File: gcpcr.ctl<BR>> gadsdf: Lev dimension z is not an SDF dimension.<BR>> SDF Descriptor file gcpcr.ctl was not successfully opened & parsed.<BR>> *<BR>> The gcpcr.ctl is:<BR>> dset ^gcpcr.nc<BR>> dtype netcdf<BR>> title Test File<BR>> undef 1e+20<BR>> xdef longitude 360 linear 0.5 1.0<BR>> ydef latitude 180 linear -89.5 1.0<BR>> zdef z 1 levels 0<BR>> tdef t 674 linear 0Z1jan1948 1mo<BR>> vars 1<BR>> r=>r 1 99 Precipitation (mm/day)<BR>> endvars<BR>> <BR>> Further, the *q dims* results for the original data file (gcpcr.nc) when opened
with sdfopen command are:<BR>> Default file number is: 1<BR>> X is varying Lon = 0 to 360 X = 0.5 to 360.5<BR>> Y is varying Lat = -89.5 to 89.5 Y = 1 to 180<BR>> Z is fixed Lev = 0 Z = 1<BR>> T is fixed Time = 00Z01JAN1948 T = 1<BR>> E is fixed Ens = 1 E = 1<BR>> <BR>> Thanks<BR>> */===================================================/*<BR>> */ZABLONE OWITI<BR>> GRADUATE STUDENT<BR>> Nanjing University of Information, Science and Technology<BR>> College of International Education<BR>> Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China<BR>> /*Tel: +86-25-58731402<BR>> Fax: +86-25-58731456<BR>> */Mob. 15077895632/*<BR>> */Website: www.nuist.edu.cn <<A href="http://www.nuist.edu.cn/" target=_blank>http://www.nuist.edu.cn/</A>><BR>> /*/*====================================================<BR>>
*<BR>> /"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>> /<BR>> <BR>> *From:* Charles Seman <<A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A>><BR>> *To:* Zablone Owiti <<A href="mailto:zablonowiti@yahoo.com" ymailto="mailto:zablonowiti@yahoo.com">zablonowiti@yahoo.com</A>>; GrADS Users Forum <<A href="mailto:gradsusr@gradsusr.org" ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A>><BR>> *Cc:*<BR>> *Sent:* Wednesday, 19 January 2011 1:29 AM<BR>> *Subject:* Re: [gradsusr] How to set time attribute in sdfwrite<BR>> <BR>> Zablone,<BR>> <BR>> 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...). 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... If you have questions or want sample code from a script, feel free to email me.<BR>> <BR>> Hope this helps,<BR>> Chuck<BR>> <BR>> Zablone Owiti wrote:<BR>> > Dear users,<BR>> ><BR>> > 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>> > *SDF file has no discernable time coordinate -- using default values.<BR>> > *and when I q dims Time = 00z01Jan001 instead of the time for the data extracted i.e 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>> > 'reinit'<BR>> > 'sdfopen gcpcr.nc'<BR>> > 'set x 0.5 360.5'<BR>>
> 'set y 1 180'<BR>> > 'set time 00z01jul1960'<BR>> > 'set sdfwrite r1.nc'<BR>> > 'define pcp=r'<BR>> > 'sdfwrite pcp'<BR>> > 'clear sdfwrite'<BR>> ><BR>> > Thanks<BR>> > */===================================================/*<BR>> > */ZABLONE OWITI<BR>> > GRADUATE STUDENT<BR>> > Nanjing University of Information, Science and Technology<BR>> > College of International Education<BR>> > Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China<BR>> > /*Tel: +86-25-58731402<BR>> > Fax: +86-25-58731456<BR>> > */Mob. 15077895632/*<BR>> > */Website: www.nuist.edu.cn <<A href="http://www.nuist.edu.cn/" target=_blank>http://www.nuist.edu.cn/</A>><BR>> > /*/*====================================================<BR>> > *<BR>> > /"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>> > /<BR>> ><BR>> > ------------------------------------------------------------------------<BR>> ><BR>> > _______________________________________________<BR>> > gradsusr mailing list<BR>> > <A href="mailto:gradsusr@gradsusr.org" ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A> <mailto:<A href="mailto:gradsusr@gradsusr.org" ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A>><BR>> > <A href="http://gradsusr.org/mailman/listinfo/gradsusr" target=_blank>http://gradsusr.org/mailman/listinfo/gradsusr</A><BR>> > <BR>> -- Please note that <A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A> <mailto:<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> <mailto:<A href="mailto:cjs@gfdl.noaa.gov" ymailto="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</A>>.<BR>> <BR>> ********************************************************************<BR>> Charles Seman <A href="mailto:Charles.Seman@noaa.gov" ymailto="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</A> <mailto:<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 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/" target=_blank>http://www.gfdl.noaa.gov/~cjs/</A> <<A href="http://www.gfdl.noaa.gov/~cjs/" target=_blank>http://www.gfdl.noaa.gov/%7Ecjs/</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>> <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 <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 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/" 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>