From 01a1ff461845004bf506408b586ef9d0bd3d28c1 Mon Sep 17 00:00:00 2001 From: kgerheiser Date: Tue, 2 Mar 2021 10:26:25 -0500 Subject: [PATCH 1/2] Create doxygen documentation for enclosure_cnvx --- .../lake.fd/enclosure_cnvx.F90 | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 b/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 index 98693c369..b78ea59d6 100644 --- a/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 +++ b/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 @@ -1,4 +1,6 @@ !> @file +!! @brief Test whether a point is inside a spherical convex polygon. +!! @author N Wang #ifdef INCLUDE_TEST_DRIVER PROGRAM testenc IMPLICIT NONE @@ -32,15 +34,17 @@ PROGRAM testenc END PROGRAM #endif - +!> Test whether a given point, p, is inside a convex spherical polygon defined with a series of n vertices. +!! Both the test point and the polygon are specified in latitude and longitude radians. +!! +!! @param[in] v set of vertices +!! @param[in] n number of vertices in v +!! @param[in] p point to test +!! @param[out] co_gc +!! @return enclosure_cnvx whether the point is inside the polygon +!! +!! @author N Wang LOGICAL FUNCTION enclosure_cnvx(v, n, p, co_gc) -!<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> -! Function enclosure tests whether a given point p(2) is inside a convex spherical polygon -! defined with a sequence of n vertices v(2,n). Both the test point and the polygon are -! apecified in latitude and longitude radians. -! -! N. Wang, Jan 2007 - Initial version -!<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> IMPLICIT NONE REAL*8, INTENT(IN) :: v(2,n), p(2) INTEGER, INTENT(IN) :: n @@ -79,5 +83,3 @@ LOGICAL FUNCTION enclosure_cnvx(v, n, p, co_gc) RETURN END FUNCTION enclosure_cnvx - -!<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> From 977db1b3c0c7201e5a193e71bef0e81f9616d872 Mon Sep 17 00:00:00 2001 From: kgerheiser Date: Thu, 4 Mar 2021 10:07:00 -0500 Subject: [PATCH 2/2] Add definition for co_gc --- sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 b/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 index b78ea59d6..02f0cf282 100644 --- a/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 +++ b/sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 @@ -34,13 +34,15 @@ PROGRAM testenc END PROGRAM #endif -!> Test whether a given point, p, is inside a convex spherical polygon defined with a series of n vertices. +!> Test whether a given point 'p' is inside a convex spherical polygon defined with a series of 'n' vertices. !! Both the test point and the polygon are specified in latitude and longitude radians. +!! It is assumed that a side of a spherical polygon is a great-circle arc that connects 2 adjacent vertices of the polygon. !! !! @param[in] v set of vertices !! @param[in] n number of vertices in v !! @param[in] p point to test -!! @param[out] co_gc +!! @param[out] co_gc 'i' if @p p is on or within epsilon to side 'i' of the given spherical polygon, +!! or 0 if point is not on any side of the given polygon. !! @return enclosure_cnvx whether the point is inside the polygon !! !! @author N Wang