[gradsusr] Help with cdiff for a point!?

Jeff Duda jeffduda319 at gmail.com
Mon Nov 28 12:46:36 EST 2011


Jonni,
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:

'd [icethickness(x+1) - icethickness(x-1)]*xdistance (which you are
ignoring for now) + [icethickness(y+1) - icethickness(y-1)]*ydistance
(again, being ignored).

Jeff Duda

On Mon, Nov 28, 2011 at 11:37 AM, Jonni Lehtiranta
<Jonni.Lehtiranta at fmi.fi>wrote:

> Dear grads-list,
>
> I'm using grads to pick up model results from lots of locations in
> spacetime, for example to find out how a ship should have
> experienced the situation on its route, which is known from AIS data.
> Right now I have a bash script that writes and runs a GrADS script
> with stuff like:
>
> ..
> set time 02z03mar2011
> set lat 65.03
> set lon 24.1
> d winddir
> d icethickness
> ..
>
> over and over again, with gxout set to fwrite.
>
> I would want to also print the magnitude of the gradient of ice
> thickness, as some evidence suggests harsh ice conditions
> are found where there are discontinuities in the ice pack. I found
> out about
>
> d mag(cdiff(icethickness, x), cdiff(icethickness, y))
>
> but this only works when x and y are varying. I can get this value from
> a point by defining a variable to equal the above thing while x and y vary,
> and then setting lat and lon to a point. But should I really switch back
> and forth between varying and non-varying spatial variables? Is there a
> better way to do this? (for now I don't care about physical values, which
> I could get by dividing cdiff results by grid cell width).
>
> I thought I could do something like
>
> set lat mylat-0.1 mylat+0.1
>
> to at least save computation time for cdiff, but I couldn't find a way. Any
> ideas about how this could be made to work?
>
> I'm grateful for all ideas, thank you in advance!
>
> regards
>  -Jonni Lehtiranta
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>



-- 
Jeff Duda
Grad student - PhD, Meteorology
University of Oklahoma School of Meteorology - Center for Analysis and
Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111128/a26bc6fc/attachment-0003.html 


More information about the gradsusr mailing list