Jonni,<br>This way may not be "easier", but it allows you to not have to reset your dimension environment so frequently. Instead of defining the gradient and then getting the value at a point, just set your dimension environment to that point and replicate what cdiff does:<br>
<br>'d [icethickness(x+1) - icethickness(x-1)]*xdistance (which you are ignoring for now) + [icethickness(y+1) - icethickness(y-1)]*ydistance (again, being ignored).<br><br>Jeff Duda<br><br><div class="gmail_quote">On Mon, Nov 28, 2011 at 11:37 AM, Jonni Lehtiranta <span dir="ltr"><<a href="mailto:Jonni.Lehtiranta@fmi.fi">Jonni.Lehtiranta@fmi.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear grads-list,<br>
<br>
I'm using grads to pick up model results from lots of locations in<br>
spacetime, for example to find out how a ship should have<br>
experienced the situation on its route, which is known from AIS data.<br>
Right now I have a bash script that writes and runs a GrADS script<br>
with stuff like:<br>
<br>
..<br>
set time 02z03mar2011<br>
set lat 65.03<br>
set lon 24.1<br>
d winddir<br>
d icethickness<br>
..<br>
<br>
over and over again, with gxout set to fwrite.<br>
<br>
I would want to also print the magnitude of the gradient of ice<br>
thickness, as some evidence suggests harsh ice conditions<br>
are found where there are discontinuities in the ice pack. I found<br>
out about<br>
<br>
d mag(cdiff(icethickness, x), cdiff(icethickness, y))<br>
<br>
but this only works when x and y are varying. I can get this value from<br>
a point by defining a variable to equal the above thing while x and y vary,<br>
and then setting lat and lon to a point. But should I really switch back<br>
and forth between varying and non-varying spatial variables? Is there a<br>
better way to do this? (for now I don't care about physical values, which<br>
I could get by dividing cdiff results by grid cell width).<br>
<br>
I thought I could do something like<br>
<br>
set lat mylat-0.1 mylat+0.1<br>
<br>
to at least save computation time for cdiff, but I couldn't find a way. Any<br>
ideas about how this could be made to work?<br>
<br>
I'm grateful for all ideas, thank you in advance!<br>
<br>
regards<br>
<font color="#888888"> -Jonni Lehtiranta<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>
</font></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Grad student - PhD, Meteorology<br>University of Oklahoma School of Meteorology - Center for Analysis and Prediction of Storms<br><br>