[gradsusr] Multiple netcdf files in one control file
Charles Seman - NOAA Federal
charles.seman at noaa.gov
Mon May 12 18:22:10 EDT 2014
Mehwish,
from http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS
---
units
(DTYPE netcdf,
hdfsds, or hdf5_grid)
(GrADS version 1.9) For DTYPE netcdf or hdfsds or hdf5_grid (GrADS
version 2.0.a7+) , the units field is a comma-delimited list of the
varying dimensions of the variable. Dimensions expressed as x, y, z, or
t correspond to the four axes defined by XDEF, YDEF, ZDEF and TDEF. For
example, a surface variable such as sea level pressure might look like this:
presSFC=>psfc 0 y,x Surface Pressure
---
would the above apply since you are using "dtype netcdf"?
Hope this helps,
Chuck
On 05/12/2014 03:11 PM, James T. Potemra wrote:
> 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
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.
********************************************************************
Charles Seman Charles.Seman at noaa.gov
U.S. Department of Commerce / NOAA / OAR
Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547
201 Forrestal Road fax: (609) 987-5063
Princeton, NJ 08540-6649 http://www.gfdl.noaa.gov/~cjs/
********************************************************************
"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."
More information about the gradsusr
mailing list