Re: gc_inout for multiple test points

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sat Apr 06 2013 - 17:18:32 MDT

Hi Dave,

The gc_inout function is indeed slow and one that we like to "hold up to the light" whenever we talk about exceptionally slow functions we'd like to parallelize.

The features you requested are simlar to something that I tested awhile back to see if I could improve the timings. I didn't get very encouraging results though, and I think this is because most of the slowness comes from the Fortran "gcinout" function itself, and not the looping.

However, I agree that allowing special looping across leftmost dimensions as you described would be useful, especially if you end up with large multi-dimensional arrays.

I also tried creating a special function called gc_inout_mask that takes as input a data array (along with the two sets of lat,lon arrays), and then returns a data array of the same size that is masked based on the input lat/lon points. I believe I did this specifically to try speeding up the "mask_9.ncl" shapefile example, and again, the results weren't encouraging.

I will revisit this issue, hopefully before 6.2.0. The ticket on this is NCL-721 (created 2-1/2 years ago!).

Thanks as always for your useful comments!


On Apr 3, 2013, at 3:52 PM, Dave Allured - NOAA Affiliate wrote:

> NCL team,
> This is an enhancement request for the gc_inout function. The current
> version in NCL 6.1.2 will test a single coordinate pair against one
> polygon, in a single function call. But there is no direct way to
> test an array of coordinate pairs against the same polygon. This
> could be done with looping and many function calls, such as in
> examples 4 and 5 on the shapefiles example page. Or one could make
> many temporary copies of the test polygon with NCL conform methods,
> and then use a single function call with its documented array method.
> With increasing use of high resolution gridded data and high
> resolution outline data, both of these existing iteration methods
> become very taxing on CPU time and memory. Would it be possible to
> enhance gc_inout so that if the third and fourth arguments are a
> single polygon (i.e. one dimensional), then the first and second
> arguments representing test points may be multidimensional, and the
> same polygon test will be repeated over all test points? The function
> result should then have the same dimensions as the first and second
> arguments.
> It seems to me that array methods inside gc_inout should yield
> significant speed improvements for large array tests. Thanks for your
> consideration.
> --Dave
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Sat Apr 6 17:18:43 2013

This archive was generated by hypermail 2.1.8 : Sun Apr 07 2013 - 21:13:30 MDT