[gradsusr] Difference two files in GrADS continued

Davide Sacchetti davide.sacchetti at arpal.gov.it
Thu Sep 19 13:17:06 EDT 2013


difficult: actually you want to display time varying differences ...
grads does all it can for deny this operation: grads wants you can
perform operations between "compatable" data: if your data are defined
in 2009 they are not in 2010, so combining them you obtain "entire grid
undefined"

there is a trick, i'm trying to explain it.

suppose you want to plot time differences between U of 2 different
years, suppose one data each day, two files: one for 2009 and another
for 2010.
'set dfile 2' (2010)
'set t 1 365'
'define U2=U.2'
'define U1=U.1(t-365)
in this way variables U1 and U2 are time compatable ...
'display U1-U2' should work ...

it should help
bye bye
Davide

On Thu, 2013-09-19 at 09:45 -0700, Phil Klotzbach wrote:
> Hi everyone,
> 
> Thanks so much for your help!  In order to zero in on the problem 
> further, I've tried to simplify the problem by opening two files with 
> the exact same dimensions (latitude/longitude/time/levels) (uwnd.2009.nc 
> and uwnd.2010.nc).  Basically, what I want to obtain is a height/time 
> cross-section of the difference between the two years (e.g., zonal wind 
> in 2010 minus zonal wind in 2009).  Let's say in this case, I've opened 
> up uwnd.2010.nc first and then uwnd.2009.nc second - using the sdfopen 
> command.  Since I want to create a height/time cross-section, I need to 
> set the following dimensions before starting the calculation:
> 
> set dfile 1
> set t 152 258
> set z 1 16
> set x 1
> set y 1
> 
> Then, I want to create an average over a specific area:
> 
> uave = aave(uwnd, lon=-70, lon=-20, lat=0, lat=30)
> 
> When I display the uave field, it looks perfect - a height/time 
> cross-section for zonal wind in 2010.   But, if I then switch to the 
> second file (e.g., set dfile 2) (zonal wind in 2009) and try to change 
> the dimensions on that file, it instantly tells me that uave (the 
> variable that had the height/time cross-section for 2010) has all 
> undefined values.  For example:
> 
> set dfile 2
> set t 152 258
> display uave - Gives message saying cannot contour grid - all undefined 
> values
> 
> I'm not sure how to get around this issue.  I tried this with two files 
> that have the exact same dimensions (e.g., uwnd.2009.nc and 
> uwnd.2010.nc) - in order to make sure that it wasn't a time dimension 
> mismatch that was causing the original problem.
> 
> Is there any way to specify the dimensions in both files at the same 
> time?  Thanks for any additional help.
> 
> Phil
> 

-- 
--> Attenzione cambio indirizzo: davide.sacchetti at arpal.gov.it
--
Davide Sacchetti
Centro Funzionale Meteo Idrologico di Protezione Civile della Regione Liguria
ARPAL Unità Tecnica Complessa di livello Regionale
V.le Brigare Partigiane 2 16121 Genova (I)
tel: +39 010 6437535                    fax: +39 010 6437520
mail: davide.sacchetti at arpal.gov.it     web: www.meteoliguria.it





More information about the gradsusr mailing list