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 2878 for branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90 – NEMO

Ignore:
Timestamp:
2011-09-30T08:26:28+02:00 (13 years ago)
Author:
cbricaud
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90

    r2877 r2878  
    33   !!                       ***  MODULE  sections_tools  *** 
    44   !!  
    5    !! History: 2011: cbricaud Mercator-Ocean 
     5   !! History: 2011: Clement Bricaud, Mercator-Ocean 
    66   !!  
    77   !!===================================================================== 
     
    1414   !! * Routine accessibility 
    1515   PUBLIC pointToCoordF         ! define a point with geographical coordinates 
    16    PUBLIC distance              ! compute distance between 2 points    
    1716   PUBLIC distance2             ! compute distance between 2 points 
    1817   PUBLIC distance3             ! compute distance between a point and a line 
     
    4241 
    4342  END FUNCTION pointToCoordF 
    44  
    45   REAL(wp) FUNCTION distance(coordA,coordB,ld_date_line) 
    46      !!--------------------------------------------------------------------- 
    47      !!         ***  FUNCTION distance  *** 
    48      !! 
    49      !! ** Purpose: Compute distance between coordA and coordB 
    50      !!             We add 360° to coordB%long if the line (coordA,coordB) 
    51      !!             crosses the date-line. 
    52      !! 
    53      !!--------------------------------------------------------------------- 
    54      !! * arguments 
    55      TYPE(COORD_SECTION), INTENT(IN) :: coordA,coordB 
    56      LOGICAL,INTENT(IN),OPTIONAL     :: ld_date_line 
    57  
    58      !! * Local declarations  
    59      INTEGER ::idateline             ! local integer 
    60  
    61      !----------------------------------------------- 
    62      ! 
    63      idateline=0 
    64      IF( PRESENT( ld_date_line))THEN 
    65        IF( ld_date_line )idateline=1 
    66      ENDIF 
    67      ! 
    68      !function output 
    69      distance = (sqrt((coordA%lon-coordB%lon-360*idateline )**2 + (coordA%lat-coordB%lat )**2)) 
    70      ! 
    71      RETURN 
    72      ! 
    73   END FUNCTION distance 
    7443 
    7544  REAL(wp) FUNCTION distance2(coordA,coordB,ld_date_line) 
Note: See TracChangeset for help on using the changeset viewer.