<div dir="ltr"><div>Dear Jim and Charles,</div><div><br></div><div>Thank you so much for your kind reply and help. </div><div>Based upon Jim's suggestions, I prepared the following control file by using %ch template to use multiple files like below;</div>
<div><br></div><div>dset ^cru_ts3.21.%<a href="http://ch.tmp.dat.nc">ch.tmp.dat.nc</a><br>chsub 1 120 1971.1980<br>chsub 121 240 1981.1990<br>chsub 241 360 1991.2000<br>options template<br>title cru_ts3.21 near-surface temperature<br>
undef -9.99+08<br>xdef 720 linear 0.0 0.5<br>ydef 360 linear -89.75 0.5<br>zdef 1 levels 0 0<br>tdef 480 linear jan1971 1mo<br>vars 1<br> tmp 0 -999 near-surface temperature<br>endvars</div><div><br></div>
<div><br></div><div>Also based upon Charles kind suggestion I checked for dtype netcdf but as I just followed the this link <u><a href="http://www.iges.org/grads/gadoc/templates.html">http://www.iges.org/grads/gadoc/templates.html</a> </u>when first prepared the control file so I am not sure whether dtype option is needed or not? (sorry for my poor understanding)</div>
<div><br></div><div>But when I exclude the dtype option from control file, it opened in GrADS but the output image was incorrect. </div><div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br>
</font></span></div><div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">The correct output from original netcdf file as well as the one prepared using above ch. ctl is attached. </font></span></div>
<div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Kindly guide me further in this regards or suggest me an alternate method (such as using fwrite script etc.)</font></span></div>
<div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br></font></span></div><div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">I will be grateful</font></span></div>
<div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br></font></span></div><div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Thank you</font></span></div>
<div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br></font></span></div><div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">With Best Regards,</font></span></div>
<div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br></font></span></div><div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Mehwish</font></span></div>
<div><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br></font></span></div><p><span style="line-height:115%;font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><br>
</font></span></p><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 13, 2014 at 7:22 AM, Charles Seman - NOAA Federal <span dir="ltr"><<a href="mailto:charles.seman@noaa.gov" target="_blank">charles.seman@noaa.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">Mehwish,<br>
<br>
from <a href="http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS" target="_blank">http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS</a><br>
---<br>
units<br>
(DTYPE netcdf,<br>
hdfsds, or hdf5_grid)<br>
<br>
(GrADS version 1.9) For DTYPE netcdf or hdfsds or hdf5_grid (GrADS<br>
version 2.0.a7+) , the units field is a comma-delimited list of the<br>
varying dimensions of the variable. Dimensions expressed as x, y, z, or<br>
t correspond to the four axes defined by XDEF, YDEF, ZDEF and TDEF. For<br>
example, a surface variable such as sea level pressure might look like this:<br>
<br>
presSFC=>psfc 0 y,x Surface Pressure<br>
---<br>
<br>
would the above apply since you are using "dtype netcdf"?<br>
<br>
Hope this helps,<br>
Chuck<br>
<div><br>
On 05/12/2014 03:11 PM, James T. Potemra wrote:<br>
> Mehwish,<br>
><br>
> I think the problem is your file names contain different decades, so in<br>
> your .ctl file where you have:<br>
><br>
> DSET cru_ts3.21.%x31.%<a href="http://x30.tmp.dat.nc" target="_blank">x30.tmp.dat.nc</a><br>
><br>
> the %x3 will be the same. For example, the first time through the<br>
> substitution will be 197, or<br>
><br>
> DSET <a href="http://cru_ts3.21.1971.1970.tmp.dat.nc" target="_blank">cru_ts3.21.1971.1970.tmp.dat.nc</a><br>
><br>
> One way around this would be to instead use chsub:<br>
><br>
> DSET ^cru_ts3.21.%<a href="http://ch.tmp.dat.nc" target="_blank">ch.tmp.dat.nc</a><br>
> CHSUB <a href="tel:1%20%20120%201971.1980" value="+12019711980">1 120 1971.1980</a><br>
> CHSUB 121 240 1981.1990<br>
> CHSUB 241 360 1991.2000<br>
> OPTIONS template<br>
> DTYPE netcdf<br>
><br>
> More details at <a href="http://www.iges.org/grads/gadoc/templates.html" target="_blank">http://www.iges.org/grads/gadoc/templates.html</a><br>
><br>
> Jim<br>
><br>
> On 5/11/14 9:02 PM, Malleswararao Maguluri wrote:<br>
>> Hi,<br>
>><br>
>> Better to use cdo for calculating climatology. otherwise you can<br>
>> combine your decadal files as a single file using cat command in cdo<br>
>> and use it as input to grads.<br>
>><br>
>> Thanks & regards,<br>
>><br>
>><br>
>> On Mon, May 12, 2014 at 12:18 PM, mehwish ramzan<br>
</div><div>>> <<a href="mailto:mehwish.ramzan@gmail.com">mehwish.ramzan@gmail.com</a> <mailto:<a href="mailto:mehwish.ramzan@gmail.com">mehwish.ramzan@gmail.com</a>>> wrote:<br>
>><br>
>> Dear GrADS community,<br>
>><br>
>> I am trying to merge multiple netcdf files into one control file<br>
>> so that i can calculate the climatology of 25 years. The data is<br>
>> available in decadal format like this;<br>
>><br>
>> <a href="http://cru_ts3.21.1971.1980.tmp.dat.nc" target="_blank">cru_ts3.21.1971.1980.tmp.dat.nc</a><br>
</div>>> <<a href="http://cru_ts3.21.1971.1980.tmp.dat.nc" target="_blank">http://cru_ts3.21.1971.1980.tmp.dat.nc</a>><br>
>> <a href="http://cru_ts3.21.1981.1990.tmp.dat.nc" target="_blank">cru_ts3.21.1981.1990.tmp.dat.nc</a><br>
>> <<a href="http://cru_ts3.21.1981.1990.tmp.dat.nc" target="_blank">http://cru_ts3.21.1981.1990.tmp.dat.nc</a>><br>
>> <a href="http://cru_ts3.21.1991.2000.tmp.dat.nc" target="_blank">cru_ts3.21.1991.2000.tmp.dat.nc</a><br>
>> <<a href="http://cru_ts3.21.1991.2000.tmp.dat.nc" target="_blank">http://cru_ts3.21.1991.2000.tmp.dat.nc</a>><br>
>> <a href="http://cru_ts3.21.1991.2000.tmp.dat.nc" target="_blank">cru_ts3.21.1991.2000.tmp.dat.nc</a><br>
>> <<a href="http://cru_ts3.21.1991.2000.tmp.dat.nc" target="_blank">http://cru_ts3.21.1991.2000.tmp.dat.nc</a>><br>
<div>>><br>
>> while the information of one .nc file is as;<br>
>><br>
>> File 1 : CRU TS3.21 Mean Temperature<br>
>><br>
>> Descriptor: <a href="http://cru_ts3.21.1971.1980.tmp.dat.nc" target="_blank">cru_ts3.21.1971.1980.tmp.dat.nc</a><br>
</div>>> <<a href="http://cru_ts3.21.1971.1980.tmp.dat.nc" target="_blank">http://cru_ts3.21.1971.1980.tmp.dat.nc</a>><br>
>><br>
>> Binary: <a href="http://cru_ts3.21.1971.1980.tmp.dat.nc" target="_blank">cru_ts3.21.1971.1980.tmp.dat.nc</a><br>
>> <<a href="http://cru_ts3.21.1971.1980.tmp.dat.nc" target="_blank">http://cru_ts3.21.1971.1980.tmp.dat.nc</a>><br>
>><br>
>> Type = Gridded<br>
>><br>
>> Xsize = 720Ysize = 360Zsize = 1Tsize = 120<br>
<div>>><br>
>> Number of Variables = 1<br>
>><br>
>> tmp 0 -999 near-surface temperature<br>
>><br>
>> By following some previous posts regarding same issue, according<br>
>> to my understanding i prepared one ctl file which can be used as a<br>
>> combination of above four separate files. The .ctl file is as follows;<br>
>><br>
</div>>> DSETcru_ts3.21.%x31.%<a href="http://x30.tmp.dat.nc" target="_blank">x30.tmp.dat.nc</a> <<a href="http://x30.tmp.dat.nc" target="_blank">http://x30.tmp.dat.nc</a>><br>
<div>>><br>
>> OPTIONS template<br>
>><br>
>> DTYPE netcdf<br>
>><br>
>> XDEF 720 linear -89.75 89.75<br>
>><br>
>> YDEF 360 linear 0 360<br>
>><br>
</div>>> ZDEF1 linear 1000<br>
<div>>><br>
>> TDEF 480 linear jan1971 1mo<br>
>><br>
>> vars 1<br>
>><br>
</div>>> tmp 099 near-surface temperature<br>
<div>>><br>
>> endvars<br>
>><br>
>><br>
>> But when i tried to open this control file. It give error message;<br>
>><br>
>> Invalid variable record<br>
>><br>
>> --> The invalid description file record is:<br>
>><br>
>> --> tmp 0 -999 near-surface temperature<br>
>><br>
>> The data file was not opened.<br>
>><br>
>> I know i am making mistake in preparing ctl file but i don't know<br>
>> how to put right information ?<br>
>><br>
>> Please help me in solving this issue.<br>
>><br>
>><br>
>> Thank You<br>
>><br>
>><br>
>> With Best Regards,<br>
>><br>
>><br>
>> Mehwish<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> gradsusr mailing list<br>
</div>>> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
<div>>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> M. MALLESWARA RAO<br>
>> M.Tech (Atmospheric Science) & M.Sc (Physics)<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> gradsusr mailing list<br>
>> <a href="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>
><br>
><br>
> _______________________________________________<br>
> gradsusr mailing list<br>
> <a href="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>
<br>
--<br>
<br>
</div>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: <a href="tel:%28609%29%20452-6547" value="+16094526547">(609) 452-6547</a><br>
201 Forrestal Road fax: <a href="tel:%28609%29%20987-5063" value="+16099875063">(609) 987-5063</a><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>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
gradsusr mailing list<br>
<a href="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>
</div></div></blockquote></div><br><br clear="all"><br><div dir="ltr"><div style="font-family:arial;font-size:small"><br></div><div style="font-family:arial;font-size:small"><font color="#500050"> </font></div><div><br></div>
<div><br></div></div>
</div></div>