Li,<br>If you want to find a temperature gradient, why not just use cdiff? Just realize that you'll have to use the following expression for dy (the incremental change in meridional distance between grid points, in meters):<br>
<br>dy = Re*cdiff(lat,y)*(3.14159/180)<br><br>where Re is the radius of the Earth (about 6.371e6 meters, I believe). This is to account for the projection Grads uses to display your data. Hope this helps.<br><br>Jeff Duda<br>
<br><div class="gmail_quote">On Mon, May 3, 2010 at 3:20 PM, Li Dong <span dir="ltr"><<a href="mailto:ldong@unm.edu">ldong@unm.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello list,<br>
<br>
I need to calculate the meridional temperature gradient across 20 degree<br>
latitude belt using global gridded data. Below is what I did:<br>
<br>
'open ta.ctl'<br>
'set t 1'<br>
'set lev 1000'<br>
'set lon 0 360'<br>
'set lat -80 80'<br>
'define Tgrad=ta(lat+10)-ta(lat-10)'<br>
<br>
However, Grads complained "Cannot use an offset value with a varying<br>
dimension". If I set 'lat' at a fixed value, such as 'set lat 40', the<br>
above script did work, but the downside is that this only gives<br>
temperature meridional gradient at the specified latitude instead of<br>
over the entire latitude range. Any inputs would be highly appreciated!<br>
<br>
Best,<br>
<br>
Li<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><br>