Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Doxygen documentation for orog_mask_tools.fd/lake.fd/enclosure_cnvx #376

Merged
merged 4 commits into from
Mar 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

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