New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 13226 for NEMO/trunk/src/OCE/OBS/grt_cir_dis.h90 – NEMO

Ignore:
Timestamp:
2020-07-02T16:24:31+02:00 (4 years ago)
Author:
orioltp
Message:

Merging dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation into the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/OBS/grt_cir_dis.h90

    r10068 r13226  
    2828      REAL(KIND=wp) :: pc2   !  cos(lat2) * sin(lon2) 
    2929 
     30      REAL(KIND=wp) :: cosdist ! cosine of great circle distance 
     31 
     32      ! Compute cosine of great circle distance, constraining it to be between 
     33      ! -1 and 1 (rounding errors can take it slightly outside this range 
     34      cosdist = MAX( MIN( pa1 * pa2 + pb1 * pb2 + pc1 * pc2, 1.0_wp), -1.0_wp ) 
     35 
    3036      grt_cir_dis = & 
    31          &  ASIN( SQRT( 1.0 - ( pa1 * pa2 + pb1 * pb2 + pc1 * pc2 )**2 ) ) 
     37         &  ASIN( SQRT( 1.0_wp - cosdist**2.0_wp ) ) 
    3238       
    3339   END FUNCTION grt_cir_dis 
Note: See TracChangeset for help on using the changeset viewer.