Skip to content

Commit

Permalink
Add point to test the case when the test point coincides with
Browse files Browse the repository at this point in the history
one of the polygon's corner points.

Fixes ufs-community#1000.
  • Loading branch information
GeorgeGayno-NOAA committed Dec 2, 2024
1 parent 35c06bd commit cc477f4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/orog/ftst_inside_polygon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,27 @@ program inside_polygon

if (inside) stop 12 ! Test point should be outside polygon.

! Test the case when the test point coincides with a corner point
! of the polygon. Result should be 'inside'.

print*, "Test point 7"

lon1 = 90.0 * D2R ! Test point.
lat1 = 0.0 * D2R

lon2(1) = 90.0 * D2R ! Polygon.
lat2(1) = 0.0 * D2R
lon2(2) = 90.0 * D2R
lat2(2) = 1.0 * D2R
lon2(3) = 91.0 * D2R
lat2(3) = 1.0 * D2R
lon2(4) = 91.0 * D2R
lat2(4) = 0.0 * D2R

inside=inside_a_polygon(lon1, lat1, npts, lon2, lat2)

if (.not.inside) stop 14 ! Test point should be inside polygon.

print*,"OK"
print*,"SUCCSSS"

Expand Down

0 comments on commit cc477f4

Please sign in to comment.