[gradsusr] Masking out grid boxes for elevation correction

Eric Altshuler ela at cola.iges.org
Thu Feb 20 18:33:23 EST 2014


Hi Robert, 


You can define a variable on the 25 km grid that contains the lapse rate you want for each grid point. Since most points will have the 6.5 lapse rate, define a constant variable: 


'lapse=const(var,0.0065,-a)' 


where 'var' is a variable already defined on the 25 km grid. Then use 'set defval' to change the value of lapse at selected points to 0.0045 (see defval documentation). You'll have to do this one grid point at a time, since it's a custom mask that can't be calculated from any other variables you have. Once this is done, you can use the lapse variable to calculate the temperature adjustment, something like 


'adjust=lapse*(hs2-hs1)' 


where hs1 and hs2 are the surface topography of the two datasets, in meters, interpolated to the 25 km grid. The way you've calculated the temperature difference, hs1 should be the NARR topography and hs2 the HadRM topography so the adjustment has the correct sign. 


Best regards, 



Eric L. Altshuler 
Research Scientist 
Center for Ocean-Land-Atmosphere Studies 
253 Research Hall, Mail Stop 6C5 
George Mason University 
4400 University Drive 
Fairfax, VA 22030 USA 

E-mail: ela at cola.iges.org 
Phone: (703) 993-5725 
Fax: (703) 993-5770 

----- Original Message -----
From: "Roberto Mera" <RMera at ucsusa.org> 
To: "GrADS Users Forum" <gradsusr at gradsusr.org> 
Sent: Tuesday, February 18, 2014 1:15:20 PM 
Subject: Re: [gradsusr] Masking out grid boxes for elevation correction 




Sure thing. 



I’m putting output from HadRM and NARR onto a common 25 km grid. 



I will only be adjusting temperature such that once the adjustment has been calculated, I can do the following: Tavg_dif = Tavg_model - Tavg_narr + adjust 



So, what I need is to be able to make a mask with the adjustment such that it gets computed using 6.5 c/km lapse rate except for over the grid cells over the Cascades and Sierra as I specified below. Over the mountains the lapse rate is 4.5 c/km. 



I want to know how I can mask out a couple of boxes of grid points over the mountains. In the past I have been able to mask out the ocean, for example. But in this work it’s not necessarily a mask over a certain height (say 2000 meters). Doing so misses most of the Cascades and adds other areas in the high desert that we prefer to leave at 6.5 c/km. Instead we want to do it specifically for the mountain ranges. 



Thanks! 



Robert 



From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Jeff Duda 
Sent: Tuesday, February 18, 2014 12:22 PM 
To: GrADS Users Forum 
Subject: Re: [gradsusr] Masking out grid boxes for elevation correction 




Robert, 


Can you be a little more precise in what you want to do? Which two grids are you putting onto a common 25 km grid? Are you trying to adjust just the temperature? 





Jeff Duda 





On Tue, Feb 18, 2014 at 8:20 AM, Roberto Mera < RMera at ucsusa.org > wrote: 



All, 



I’m trying to apply an elevation correction to model data by adjusting the lapse rate based on NARR. Basically, I’m looking to use a rate of 4.5 C/km for mountains, otherwise 6.5. where the adjustment is the rate the times the elevation difference. 



The location where I’d like to apply the masks are lon -122.5 -121 lat 43.5 45.2 for the Oregon Cascades and lat 46 49 for Washington Cascades and lon -121 -117.9, lat 35.5 - 40.5 for the Sierra. 



I’m placing the two grids on a common 25km grid and taking the difference between elevation. 



I appreciate the help. 



Robert 






_______________________________________________ 
gradsusr mailing list 
gradsusr at gradsusr.org 
http://gradsusr.org/mailman/listinfo/gradsusr 








-- 
Jeff Duda 
Graduate research assistant 
University of Oklahoma School of Meteorology 
Center for Analysis and Prediction of Storms 
_______________________________________________ 
gradsusr mailing list 
gradsusr at gradsusr.org 
http://gradsusr.org/mailman/listinfo/gradsusr 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140220/92b69e07/attachment.html 


More information about the gradsusr mailing list