<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="OPENWEBMAIL" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
Dear Bernd,
<br />
<br />I would use the fwrite command:
<br />
<br />For each computation, you can fwrite the new defined fields in a single binary file, if they have the same horizontal dimensions. With an appropriate ctl that describe correctly the new binary file as the defined fields were at the same time, you can do calculations.
<br />
<br />Ricardo
<br />
<br /><font size="2"><b>On Sat, 10 Sep 2011 09:30:06 +0100, Becker, Bernd wrote</b>
<br />&gt; <span class="116280308-10092011"><font size="2" face="Arial" color="#0000ff">Thanks 
Arlindo,</font></span>

<br />&gt; <span class="116280308-10092011"></span> 

<br />&gt; <span class="116280308-10092011"><font size="2" face="Arial" color="#0000ff">That would be nice for single 
numbers.</font></span>

<br />&gt; <span class="116280308-10092011"></span> 

<br />&gt; <span class="116280308-10092011"><font size="2" face="Arial" color="#0000ff">It as one notch more 
elaborate:</font></span>

<br />&gt; <span class="116280308-10092011"></span> 

<br />&gt; <span class="116280308-10092011"><font size="2" face="Arial" color="#0000ff">  'set dfile 2'
<br />&gt;   'set t 2  33'
<br />&gt; 
  

'define obs     = 'var'.2'
<br />&gt; 
</font></span>

<br />&gt; <span class="116280308-10092011"><font size="2" face="Arial" color="#0000ff"> 'set dfile 3'
<br />&gt;   'set t 2  33'
<br />&gt;  
 
'define fx     = 'var'.3'
<br />&gt; 
</font></span>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">file 2 

and 3 have different time 
frames.</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011"></span></font> 

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">d 

fx-obs 
</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011"></span></font> 

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">fails. 

</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">And it 

would be a real bummer to have to calculate the times from one file 

relative</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">to 
the 

other 
file.</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011"></span></font> 

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">Compositing in this way would be really hard. 

</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011"></span></font> 

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011">Enjoy 

the weekend!
<br />&gt; 
Bernd.</span></font>

<br />&gt; <font size="2" face="Arial" color="#0000ff"><span class="116280308-10092011"></span></font> 

<br />&gt; <font size="2">--
<br />&gt; Bernd Becker   Climate Impacts 
Product 

Development
<br />&gt; Met Office Hadley Centre    FitzRoy Road 
 
Exeter   Devon EX1 3PB  United Kingdom
<br />&gt; Tel.: +44 (0) 1392 

884511 Fax: +44 (0)870 900 5050
<br />&gt; E-mail:bernd.becker@metoffice.gov.uk - 
<a href="http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/bernd-becker">http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/bernd-becker</a>
<br />&gt; 
<a href="http://www.metoffice.gov.uk/news/releases/archive/2011/weather-game">http://www.metoffice.gov.uk/news/releases/archive/2011/weather-game</a>
<br />&gt; 
</font>

<br />&gt;  
<br />&gt; 
<br />&gt; 

<hr tabindex="-1" />
<font size="2" face="Tahoma"><b>From:</b> gradsusr-bounces@gradsusr.org 

[mailto:gradsusr-bounces@gradsusr.org] <b>On Behalf Of </b>Arlindo da 

Silva
<br />&gt; <b>Sent:</b> 09 September 2011 17:40
<br />&gt; <b>To:</b> GrADS 
Users 

Forum
<br />&gt; <b>Subject:</b> Re: [gradsusr] define variable independent of 

time
<br />&gt; </font>
<br />&gt; 
<br />&gt; On Fri, Sep 9, 2011 at 12:05 PM, Becker, 
Bernd <span dir="ltr">&lt;<a href="mailto:bernd.becker@metoffice.gov.uk">bernd.becker@metoffice.gov.uk</a>&gt;</span> 

wrote:
<br />&gt; 
<br />&gt; 

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<br />&gt; Simple question,
<br />&gt; complicated answer:
<br />&gt; 

<br />&gt; I would 

  like to composite stuff from several  files.
<br />&gt; 
<br />&gt; Each file 
has its own 

  time and date info in its own .ctl file.
<br />&gt; 
<br />&gt; How can I add 
elements from 

  different such files?
<br />&gt; 
<br />&gt; How can I break away from the strict 
treatment of 

  the time dimension in
<br />&gt; grads?
<br />&gt; 
<br />&gt; open file1.ctl
<br />&gt; 
define 

  a=ave(b,t=1,t=34)
<br />&gt; close 1
<br />&gt; open file2.ctl
<br />&gt; define c= 

  ave(b,t=3,t=9)
<br />&gt; close 2
<br />&gt; etc.
<br />&gt; 
<br />&gt; d a+c
<br />&gt; 
Cannot contour grid - all 

  undefined values
<br />&gt; 
<br />&gt; 
</blockquote>

<br />&gt; 
<br />&gt; 
Try:

<br />&gt; 
<br />&gt; d 
a(t=1)+c(t=1)

<br />&gt; 
<br />&gt; -- 
<br />&gt; Arlindo da Silva
<br />&gt; <a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a>
<br />
<br />
</font>

</BODY>
</HTML>