Template problem

Douglas Clark dbcl at CEH.AC.UK
Fri Mar 9 04:19:41 EST 2007


John,

This kind of approach should work....I think.....

'open 199701_01-09_2D.ctl'
'open 199701_10-19_2D.ctl'
'open 199701_20-31_2D.ctl'

# Set t to cover full range required.
'set t 1 31'

# Use const to set the data to zero where they are undef (i.e. outside of time range in file), then add data from all files together.
'd const(var.1,0,-u)+const(var.2,0,-u)+const(var.3,0,-u)'

Or of course you could first define the variable in this way, if you want to do more manipulation.

Hope this works,
Doug




>>> "John Guhin" <johnguhin at gmail.com> 08/03/2007 04:32:43 >>>
 Thanks Doug. I could do it in a linux with GrADS 1.9b4. But I think  this
version is not available for IBM/AIX (ncar supercomputers like bluevista),
so I could not do that there.  Please  correct me if I am wrong.
  A related question which comes from the above is following:
I have the following three control files and the corresponding binary files
are more than 1.5 GB.
199701_01-09_2D.ctl
199701_10-19_2D.ctl
199701_20-31_2D.ctl
So I have total 4.5 GB. Using cat to make a single file does not work (since
grads cannot handle more than 2 GB).  Is there any way I can open three
files, and do some calculation simultaneously!!! When I tried there is a gap
as expected in the figure generated using three data files.
Any help would be appreciated.




On 2/26/07, Douglas Clark <dbcl at ceh.ac.uk> wrote:
>
> John,
>
> Assuming that your files have 9 or 10 days' of data in each, I think
> you'll need to use the CHSUB option - see GrADS index
> http://grads.iges.org/grads/gadoc/gadocindex.html
> under control file > options > template (or the likes).
>
> With your current template, the way the template works is such that every
> day's data is assumed to be in a different file - because you have %d2 in
> the template. So when you set the time to 1997/01/01, GrADS looks for data
> in a file called 199701_01-01_2D.dat, which doesn't exist - so it says all
> values are undefined (arguably it might be more useful if GrADS said "can't
> find file" at this point, but it doesn't).  With time 1997/01/02, GrADS
> looks for data in a file called 199701_02-02_2D.dat, and so on.
>
> I think CHSUB will come to your rescue (although I have never used it
> myself). You need a ctl file with something along the lines of
> DSET ^199701_%ch_2D.dat
> CHSUB   1  9 01-09
> CHSUB   10  19 10-19
> CHSUB   20 31 20-31
> OPTIONS template
>
> The first two integers on each CHSUB line will depend on the time step
> given in yout TDEF line - I have assumed daily data. See the GrADS
> documentation for details.
>
> Doug
>
>
> >>> johnguhin at GMAIL.COM 26/02/2007 07:14 >>>
> Hi,
>        I have three files like these....
> 199701_01-09_2D.ctl
> 199701_10-19_2D.ctl
> 199701_20-31_2D.ctl
>
> I wrote a control file like this...
> dset ^199701_%d2-%d2_2D.dat
> options template
> ................................................
>
> I can open the control file, but while plotting it says
> Cannot contour grid - all undefined values
>
> But I can plot from individual files.  Where am I doing wrong?
>
> --
> John Guhin
>
>
> --
> This message (and any attachments) is for the recipient only. NERC
> is subject to the Freedom of Information Act 2000 and the contents
> of this email and any reply you make may be disclosed by NERC unless
> it is exempt from release under the Act. Any material supplied to
> NERC may be stored in an electronic records management system.
>



--
John Guhin


--
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.



More information about the gradsusr mailing list