[gradsusr] Differencing values from two files in GrADS

Phil Klotzbach philk at atmos.colostate.edu
Wed Sep 18 18:57:27 EDT 2013


Hello,

I've made a bit of progress since yesterday, but I'm still running into 
trouble.  Effectively, the problem seems that I am trying to manipulate 
two files at the same time, but I'm not sure how to get around this, 
given that I have values for 2013 as well as a 30-year long-term 
climatology:

What I am trying to do is as follows, generate a height/time 
cross-section of zonal wind anomalies from June 1 - September 15, 2013.  
I have two files that each have the same lat/lon grids.  I can 
manipulate each file individually (with no other files open) and 
generate a figure, but what is giving me trouble is doing these 
calculations when both files are open at the same time.  What I want to 
do is basically difference the 2013 zonal wind from the zonal wind 
climatology to get the anomaly.  To generate the attached figures (with 
only one file open), here are the commands that I used:

For 2013 Zonal Wind File:

sdfopen uwnd.2013.nc
set t 152 258
set z 1 16
define uave = aave (uwnd, lon=-70, lon=-20, lat=0, lat=30)
set x 1
set y 1
d uave
draw ylab height
draw xlab date
draw title 2013 Zonal Wind
printim c:\2013uwind.jpg

For 1981-2010 Climatology

sdfopen uwnd.day.1981-2010.ltm.nc
set t 152 258
set z 1 16
define uave2 = aave (uwnd.2, lon=-70, lon=-20, lat=0, lat=30)
set x 1
set y 1
d uave
draw ylab height
draw xlab date
draw title 1981-2010 Zonal Wind Climatology
printim c:\zonalwindclimatology.jpg

It seems like the problem arises when I try to do the same calculations 
with both files open at the same time.  Even if I explicitly specify the 
t and z dimensions for both files before making the calculations, it 
appears that GrADS forgets(?) the dimensions in the file not being used 
for the specific calculation. For example, if I do the calculation for 
2013 first and then attempt the long-term climatology, the first 
calculation will be done correctly, and it will tell me that the second 
request is completely outside of file limits.  If I change the active 
file and then make the calculation, the value in the first variable is 
lost.

Any ideas?  Thanks so much!

Phil

-- 
----------------------------------------------------
Phil Klotzbach, Ph.D.
Research Scientist
Department of Atmospheric Science
Colorado State University
Email: philk at atmos.colostate.edu
----------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2013uwind.jpg
Type: image/jpeg
Size: 90246 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130918/30bb2714/attachment-0006.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zonalwindclimatology.jpg
Type: image/jpeg
Size: 52687 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130918/30bb2714/attachment-0007.jpg 


More information about the gradsusr mailing list