grt_cir_dis.h90 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. !!----------------------------------------------------------------------
  2. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  3. !! $Id: grt_cir_dis.h90 2287 2010-10-18 07:53:52Z smasson $
  4. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  5. !!----------------------------------------------------------------------
  6. REAL(KIND=wp) FUNCTION grt_cir_dis( pa1, pa2, pb1, pb2, pc1, pc2 )
  7. !!----------------------------------------------------------------------
  8. !! *** FUNCTION grt_cir_dis ***
  9. !!
  10. !! ** Purpose : Great circle distance between pts (lat1,lon1)
  11. !! & (lat2,lon2)
  12. !!
  13. !! ** Method : Geometry.
  14. !!
  15. !! History :
  16. !! ! 1995-12 (G. Madec, E. Durand, A. Weaver, N. Daget) Original
  17. !! ! 2006-03 (A. Vidard) Migration to NEMOVAR
  18. !! ! 2006-10 (A. Weaver) Cleanup
  19. !!----------------------------------------------------------------------
  20. !! * Arguments
  21. REAL(KIND=wp) :: pa1 ! sin(lat1)
  22. REAL(KIND=wp) :: pa2 ! sin(lat2)
  23. REAL(KIND=wp) :: pb1 ! cos(lat1) * cos(lon1)
  24. REAL(KIND=wp) :: pb2 ! cos(lat2) * cos(lon2)
  25. REAL(KIND=wp) :: pc1 ! cos(lat1) * sin(lon1)
  26. REAL(KIND=wp) :: pc2 ! cos(lat2) * sin(lon2)
  27. grt_cir_dis = &
  28. & ASIN( SQRT( 1.0 - ( pa1 * pa2 + pb1 * pb2 + pc1 * pc2 )**2 ) )
  29. END FUNCTION grt_cir_dis