[gradsusr] saving more than one variable in one file

Sujata Mandke amin at tropmet.res.in
Wed Sep 26 01:35:59 EDT 2012


Hello!

   If you want to write time series of both the variables
   of 60 times each, then in the ctl file to open
   newly created data, make following changes:

> tdef 103 linear jan1900 1yr

  change to
  tdef 60 linear jan1900 1yr

  With this change both variables are defined
  for time series of 60 times each.
  Hope this will match newly created variable with
  that from original data.
Regards
Sujata Mandke
Indian Institute of Tropical Meteorology
Pune,India.
-------------------------

----- Original Message -----
From: Jennifer Adams <jma at cola.iges.org>
To: GrADS Users Forum <gradsusr at gradsusr.org>
Sent: Tue, 25 Sep 2012 20:54:49 +0530 (IST)
Subject: Re: [gradsusr] saving more than one variable in one file

Use the -ap flag with 'set fwrite' to append to an existing file. Also, it is not necessary to define N3 and N4 before displaying them -- why waste the memory? Simply change your 'define' to a 'd' and then you can remove the two 'd N3' and 'd N4' lines. 
--Jennifer


On Sep 25, 2012, at 5:20 AM, Mubashar Dogar wrote:

> Dear GrADS users,
> 
> I have 2 spatial variables in one file. I wanted to do some operation
> on each one and wanted to save 2 new variables in a new GrADS file. I
> am doing some thing as given below:
> 
> 'open File.ctl'
> 'set gxout fwrite'
> 'set fwrite NEW_FILE.dat'
> t=1                       ********************T=1 is Jan1900 and it is
> monthly data
> tmax=60
> while (t<=tmax)
> 'set t 't
> 'define N3=aave(temp,lon=-150,lon=-90,lat=-5,lat=5)'
> 'define N4=aave(temp,lon=160,lon=210,lat=-5,lat=5)'
> 'd N3'
> 'd N4'
> t=t+1
> endwhile
> 'disable fwrite'
> ********************************
> As the new variables are a 1-D time series, so my ctl file to open
> newly written data file is as:
> 
> dset NEW_FILE.dat
> title N3 and N4 indices
> undef -9.99e+08
> xdef 1 linear 1 1
> ydef 1 linear 1 1
> zdef 1 linear 1 1
> tdef 103 linear jan1900 1yr
> vars 2
> N3   0 99  N3 variable
> N4   0 99  N4 variable
> endvars
> 
> It works fine but it looks that the values of both variables are not
> representing to original values. How can I work with two or more
> variables in one file?
> 
> Thanks,
> 
> Mubashar
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org







More information about the gradsusr mailing list