[gradsusr] Help with cdiff for a point!?
Jonni Lehtiranta
Jonni.Lehtiranta at fmi.fi
Mon Nov 28 12:37:55 EST 2011
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
More information about the gradsusr
mailing list