Fwd: lats4d for defined variable
Arlindo da Silva
dasilva at ALUM.MIT.EDU
Fri Apr 4 13:52:27 EDT 2008
On Fri, Apr 4, 2008 at 1:10 PM, Semyon Grodsky <senya at atmos.umd.edu> wrote:
> Arlindo,
> thank you very much. It works.
>
> >
> > ga-> open ../sst/sst_month
> > ga-> set x 1 360
> > ga-> sst1 = sst - 273
> > ga-> lats4d -o qq -func sst1 -time nov1981 dec2007 -vars sst
> >
> > Hopefuly, the last question. Suppose I have two defined variables, sst1
> and sst2. What modifications should be done to the above lats4d command in
> order to output two variables in a single netcdf.
>
Create a fake ctl file:
dset ^fake.data
options template
xdef ...
ydef ...
zdef ...
tdef ...
vars 2
sst1 0 0 whatever
sst2 0 0 whatever
endvars
If you open this file you always get missing values for whatever you try to
plot; this is OK. Define the *def records above to match your original file;
the easiest way of doing this is to open your original file and do a
ga-> q ctlinfo
Once you create a fake file with the structure and variable names of what
you want on output, then
ga-> open fake.ctl
ga-> open ../sst/sst_month
ga-> set x 1 360
ga-> dsst1 = sst.2 - 273
ga-> dsst2 = sst.2 / 3
ga-> set dfile 1 (to make sure)
ga-> lats4d -o qq -func d@
So it loops over the time/variables on the fake file but saves the defined
variables dsst1 and dsst2; the output file will have variable names ss1,
sst2. If you want more than 1 time level on output try this variant:
ga-> open fake.ctl
ga-> open ../sst/sst_month
ga-> set x 1 360
ga-> set t 1 12
ga-> dsst1 = sst.2 - 273 (this takes memory)
ga-> dsst2 = sst.2 / 3
ga-> set t 1
ga-> set dfile 1 (to make sure)
ga-> lats4d -o qq -func d@
and have the TDEF match the number of times above.
Arlindo
>
> --Senya
>
--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080404/dee2f381/attachment.html
More information about the gradsusr
mailing list