Skip to content

Commit

Permalink
Create Doxygen documentation for orog_mask_tools.fd/lake.fd/enclosure…
Browse files Browse the repository at this point in the history
…_cnvx (#376)

Create doxygen documentation for enclosure_cnvx
  • Loading branch information
kgerheiser committed Mar 4, 2021
1 parent cf23dca commit 8754552
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions sorc/orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -32,15 +34,19 @@ 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.
!! 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 '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
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
Expand Down Expand Up @@ -79,5 +85,3 @@ LOGICAL FUNCTION enclosure_cnvx(v, n, p, co_gc)
RETURN

END FUNCTION enclosure_cnvx

!<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

0 comments on commit 8754552

Please sign in to comment.