[gradsusr] Multiple netcdf files in one control file
James T. Potemra
jimp at hawaii.edu
Mon May 12 15:11:11 EDT 2014
Mehwish,
I think the problem is your file names contain different decades, so in
your .ctl file where you have:
DSET cru_ts3.21.%x31.%x30.tmp.dat.nc
the %x3 will be the same. For example, the first time through the
substitution will be 197, or
DSET cru_ts3.21.1971.1970.tmp.dat.nc
One way around this would be to instead use chsub:
DSET ^cru_ts3.21.%ch.tmp.dat.nc
CHSUB 1 120 1971.1980
CHSUB 121 240 1981.1990
CHSUB 241 360 1991.2000
OPTIONS template
DTYPE netcdf
More details at http://www.iges.org/grads/gadoc/templates.html
Jim
On 5/11/14 9:02 PM, Malleswararao Maguluri wrote:
> Hi,
>
> Better to use cdo for calculating climatology. otherwise you can
> combine your decadal files as a single file using cat command in cdo
> and use it as input to grads.
>
> Thanks & regards,
>
>
> On Mon, May 12, 2014 at 12:18 PM, mehwish ramzan
> <mehwish.ramzan at gmail.com <mailto:mehwish.ramzan at gmail.com>> wrote:
>
> Dear GrADS community,
>
> I am trying to merge multiple netcdf files into one control file
> so that i can calculate the climatology of 25 years. The data is
> available in decadal format like this;
>
> cru_ts3.21.1971.1980.tmp.dat.nc
> <http://cru_ts3.21.1971.1980.tmp.dat.nc>
> cru_ts3.21.1981.1990.tmp.dat.nc
> <http://cru_ts3.21.1981.1990.tmp.dat.nc>
> cru_ts3.21.1991.2000.tmp.dat.nc
> <http://cru_ts3.21.1991.2000.tmp.dat.nc>
> cru_ts3.21.1991.2000.tmp.dat.nc
> <http://cru_ts3.21.1991.2000.tmp.dat.nc>
>
> while the information of one .nc file is as;
>
> File 1 : CRU TS3.21 Mean Temperature
>
> Descriptor: cru_ts3.21.1971.1980.tmp.dat.nc
> <http://cru_ts3.21.1971.1980.tmp.dat.nc>
>
> Binary: cru_ts3.21.1971.1980.tmp.dat.nc
> <http://cru_ts3.21.1971.1980.tmp.dat.nc>
>
> Type = Gridded
>
> Xsize = 720Ysize = 360Zsize = 1Tsize = 120
>
> Number of Variables = 1
>
> tmp 0 -999 near-surface temperature
>
> By following some previous posts regarding same issue, according
> to my understanding i prepared one ctl file which can be used as a
> combination of above four separate files. The .ctl file is as follows;
>
> DSETcru_ts3.21.%x31.%x30.tmp.dat.nc <http://x30.tmp.dat.nc>
>
> OPTIONS template
>
> DTYPE netcdf
>
> XDEF 720 linear -89.75 89.75
>
> YDEF 360 linear 0 360
>
> ZDEF1 linear 1000
>
> TDEF 480 linear jan1971 1mo
>
> vars 1
>
> tmp 099 near-surface temperature
>
> endvars
>
>
> But when i tried to open this control file. It give error message;
>
> Invalid variable record
>
> --> The invalid description file record is:
>
> --> tmp 0 -999 near-surface temperature
>
> The data file was not opened.
>
> I know i am making mistake in preparing ctl file but i don't know
> how to put right information ?
>
> Please help me in solving this issue.
>
>
> Thank You
>
>
> With Best Regards,
>
>
> Mehwish
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
> --
> M. MALLESWARA RAO
> M.Tech (Atmospheric Science) & M.Sc (Physics)
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140512/1b93b504/attachment.html
More information about the gradsusr
mailing list