Since dx is dependent on latitude, the contour plot for dx is correct. The largest values of dx are going to be at the equator where there is the largest meridional distance between longitude lines. <br><br>For your dy plot, I guess we need to make sure you actually have a latitude variable in your data. Try just 'd lat'. You should not get a constant value. If that doesn't work, send me either the .ctl file or the result of ncdump -h if your data is coming from a netCDF file.<br>
<br>Jeff<br><br><div class="gmail_quote">On Mon, Jun 27, 2011 at 12:13 AM, sushant puranik <span dir="ltr"><<a href="mailto:sushantpuranik@gmail.com">sushantpuranik@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Jeff <br>I tried with making changes asper your suggestion. <br>I got results as Constant field value =333533 for dy=6.37e6*cdiff(lat,y)*(3.1416/180) command<br><br>and also tried dx=6.37e6*cos(lat*(3.1416/180))*cdiff(lon,x)*(3.1416/180) in this case it shows simply parallel lines on the plot.<br>
Results are attached with this mail.<br><br>Thank you<br><br>Sushant<br><br><div class="gmail_quote">On Sat, Jun 25, 2011 at 8:58 PM, Jeffrey Duda <span dir="ltr"><<a href="mailto:jdduda@iastate.edu" target="_blank">jdduda@iastate.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">Put the literal argument "lat" in place of "19.5" in the cdiff command for dy and put "lon" for "30" in the cdiff for the dx definition. There's nothing wrong with setting your dimensions first, as that will only affect the horizontal scope of the subsequent fields you define.<br>
<br>Jeff<div><div></div><div><br><br><div class="gmail_quote">On Sat, Jun 25, 2011 at 12:11 AM, sushant puranik <span dir="ltr"><<a href="mailto:sushantpuranik@gmail.com" target="_blank">sushantpuranik@gmail.com</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">
Thanks Jeff. <br>But i am not able to plot the output. It gives error with the latitudinal command <br><br>ga-> define dy=6.37e6*cdiff(19.5,y)*(3.1416/180)<br>Error from CDIFF: Specified dimension non varying<br>Operation Error: Error from cdiff function<br>
Error ocurred at column 8<br>DEFINE error: Invalid expression.<br><br>and also tried with the longitudinal command<br><br>ga-> define dx=6.37e6*cos(10*(3.1416/180))*cdiff(30,x)*(3.1416/180)<br>Error from CDIFF: Specified dimension non varying<br>
Operation Error: Error from cdiff function<br> Error ocurred at column 29<br>DEFINE error: Invalid expression. <br>Segmentation fault<br><br>i think i am have to set dimensions first?<br><br>Thank you<br><font color="#888888"><br>
Sushant</font><div><div></div><div><br>
<br><div class="gmail_quote">On Fri, Jun 24, 2011 at 10:14 PM, Jeffrey Duda <span dir="ltr"><<a href="mailto:jdduda@iastate.edu" target="_blank">jdduda@iastate.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">
Sushant,<br>Unfortunately, no. Getting the longitudinal gradient is not as simple since the distance between longitude lines is a function of the latitude. However, the formula is<br><br>dx = Re*cos(lat*(pi/180))*cdiff(lon,x)*(pi/180).<br>
<br>The cos(lat*(pi/180)) term is the adjustment for dependence of longitude space on latitude.<br><br>Jeff<div><div></div><div><br><br><div class="gmail_quote">On Fri, Jun 24, 2011 at 12:55 AM, sushant puranik <span dir="ltr"><<a href="mailto:sushantpuranik@gmail.com" target="_blank">sushantpuranik@gmail.com</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">Hi Jeff<br>Can i use same command for longitudinal gradient computation by replacing lat --> lon in the command <br>
dy = Re*cdiff(lat,y)*(3.14159/180)<br><br>thanks <br><br>Sushant<br><br><br><div class="gmail_quote">On Tue, May 4, 2010 at 2:33 AM, Jeffrey Duda <span dir="ltr"><<a href="mailto:jdduda@iastate.edu" target="_blank">jdduda@iastate.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">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<div>
<div></div><div><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" target="_blank">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" target="_blank">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></div></div><font color="#888888">-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/%7Ejdduda" target="_blank">www.meteor.iastate.edu/~jdduda</a><br>
</font><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br><br><br><br>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<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/%7Ejdduda" target="_blank">www.meteor.iastate.edu/~jdduda</a><br>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><br><br><br>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<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/%7Ejdduda" target="_blank">www.meteor.iastate.edu/~jdduda</a><br>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br><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>
<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>