[Thread Prev][Thread Next][Index]

[ferret_users] Re: external function samplexy_curv and modulo



Hi Patrick,
What you say is quite true. For a general curvilinear grid, some of which are very non-rectangular, the concept of modulo longitudes is difficult to define. How will the algorithm know which lon,lat cell should wrap to which cell across the branch cut?

The function SAMPLEXY_CURV looks from one side only, for the "closest" location.

In fact your data shows a shortcoming of the algorighm in samplexy_curv. For the grid in your file samplexy_curv.nc the latitudes in LAT are 0 at index j=74. For j=74, and everywhere nearby, there are no longitudes in LON anywhere near 0. So the function should not return a result for samplexy_curv(votemper, lon,lat, 0,0). What the function does is it finds where on each J line of LON the values of LON crosses the xpoint requested, here 0. It finds that LON crosses 0 only along the line x=51, j=149, at the top of the grid (do a SHADE LON to see what the LON coordinate variable is like), and it then looks in LAT and finds the location closest to (51,149) where LAT = ypt, again 0 for this example. We need to implement a threshold, so that the function will not return a result from halfway across the globe.

Ansley

Brockmann Patrick wrote:
Hi all,
A question on the external function samplexy_curv
which does not consider modulo aspect. If I sample at (lon,lat) (0,0) or (360,0),
the samplexy_curv gives different results.

See scripts: http://dods.ipsl.jussieu.fr/brocksce/ferret_sample/samplexy_curv_test.jnl

list samplexy_curv(votemper, lon,lat, 0,0)
VARIABLE : SAMPLEXY_CURV(VOTEMPER, LON,LAT, 0,0)
FILENAME : samplexy_curv.nc
X : 1
Z : 5
T : 1
0.01885
list samplexy_curv(votemper, lon,lat, 360,0)
VARIABLE : SAMPLEXY_CURV(VOTEMPER, LON,LAT, 360,0)
FILENAME : samplexy_curv.nc
X : 1
Z : 5
T : 1
30.29


What do I have to believe ?
Regards
Patrick

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement