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 6808 for branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90 – NEMO

Ignore:
Timestamp:
2016-07-19T10:38:35+02:00 (8 years ago)
Author:
jamesharle
Message:

merge with trunk@6232 for consistency with SSB code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90

    r5429 r6808  
    44   !! Ocean        : lateral boundary conditions 
    55   !!===================================================================== 
    6    !! History :  OPA  ! 1997-06  (G. Madec)     Original code 
    7    !!   NEMO     1.0  ! 2002-09  (G. Madec)     F90: Free form and module 
     6   !! History :  OPA  ! 1997-06  (G. Madec)  Original code 
     7   !!   NEMO     1.0  ! 2002-09  (G. Madec)  F90: Free form and module 
    88   !!            3.2  ! 2009-03  (R. Benshila)  External north fold treatment   
    9    !!            3.5  ! 2012     (S.Mocavero, I. Epicoco) Add 'lbc_bdy_lnk'  
    10    !!                            and lbc_obc_lnk' routine to optimize   
    11    !!                            the BDY/OBC communications 
    12    !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add a C1D case   
     9   !!            3.5  ! 2012     (S.Mocavero, I. Epicoco) optimization of BDY comm. via lbc_bdy_lnk and lbc_obc_lnk 
     10   !!            3.4  ! 2012-12  (R. Bourdalle-Badie, G. Reffray)  add a C1D case   
    1311   !!---------------------------------------------------------------------- 
    1412#if defined key_mpp_mpi 
     
    1715   !!---------------------------------------------------------------------- 
    1816   !!   lbc_lnk      : generic interface for mpp_lnk_3d and mpp_lnk_2d routines defined in lib_mpp 
     17   !!   lbc_sum      : generic interface for mpp_lnk_sum_3d and mpp_lnk_sum_2d routines defined in lib_mpp 
    1918   !!   lbc_lnk_e    : generic interface for mpp_lnk_2d_e routine defined in lib_mpp 
    2019   !!   lbc_bdy_lnk  : generic interface for mpp_lnk_bdy_2d and mpp_lnk_bdy_3d routines defined in lib_mpp 
    2120   !!---------------------------------------------------------------------- 
    22    USE lib_mpp          ! distributed memory computing library 
    23  
     21   USE lib_mpp        ! distributed memory computing library 
    2422 
    2523   INTERFACE lbc_lnk_multi 
    2624      MODULE PROCEDURE mpp_lnk_2d_9 
    2725   END INTERFACE 
    28  
     26   ! 
    2927   INTERFACE lbc_lnk 
    3028      MODULE PROCEDURE mpp_lnk_3d_gather, mpp_lnk_3d, mpp_lnk_2d 
    3129   END INTERFACE 
     30   ! 
     31!JMM interface not defined if not key_mpp_mpi : likely do not compile without this CPP key !!!! 
     32   INTERFACE lbc_sum 
     33      MODULE PROCEDURE mpp_lnk_sum_3d, mpp_lnk_sum_2d 
     34   END INTERFACE 
    3235 
    3336   INTERFACE lbc_bdy_lnk 
    3437      MODULE PROCEDURE mpp_lnk_bdy_2d, mpp_lnk_bdy_3d 
    3538   END INTERFACE 
    36  
     39   ! 
    3740   INTERFACE lbc_lnk_e 
    3841      MODULE PROCEDURE mpp_lnk_2d_e 
    3942   END INTERFACE 
    40  
     43   ! 
    4144   INTERFACE lbc_lnk_icb 
    4245      MODULE PROCEDURE mpp_lnk_2d_icb 
    4346   END INTERFACE 
    4447 
    45    PUBLIC lbc_lnk       ! ocean lateral boundary conditions 
    46    PUBLIC lbc_lnk_multi ! modified ocean lateral boundary conditions 
    47    PUBLIC lbc_lnk_e 
    48    PUBLIC lbc_bdy_lnk   ! ocean lateral BDY boundary conditions 
    49    PUBLIC lbc_lnk_icb 
     48   PUBLIC   lbc_lnk       ! ocean lateral boundary conditions 
     49   PUBLIC   lbc_lnk_multi ! modified ocean lateral boundary conditions 
     50   PUBLIC   lbc_sum 
     51   PUBLIC   lbc_lnk_e     ! 
     52   PUBLIC   lbc_bdy_lnk   ! ocean lateral BDY boundary conditions 
     53   PUBLIC   lbc_lnk_icb   ! 
    5054 
    5155   !!---------------------------------------------------------------------- 
     
    5458   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    5559   !!---------------------------------------------------------------------- 
    56  
    5760#else 
    5861   !!---------------------------------------------------------------------- 
    5962   !!   Default option                              shared memory computing 
    6063   !!---------------------------------------------------------------------- 
    61    !!   lbc_lnk      : generic interface for lbc_lnk_3d and lbc_lnk_2d 
    62    !!   lbc_lnk_3d   : set the lateral boundary condition on a 3D variable on ocean mesh 
    63    !!   lbc_lnk_2d   : set the lateral boundary condition on a 2D variable on ocean mesh 
    64    !!   lbc_bdy_lnk  : set the lateral BDY boundary condition 
     64   !!   lbc_sum       : generic interface for mpp_lnk_sum_3d and mpp_lnk_sum_2d  
     65   !!   lbc_lnk_sum_3d: compute sum over the halos on a 3D variable on ocean mesh 
     66   !!   lbc_lnk_sum_3d: compute sum over the halos on a 2D variable on ocean mesh 
     67   !!   lbc_lnk       : generic interface for lbc_lnk_3d and lbc_lnk_2d 
     68   !!   lbc_lnk_3d    : set the lateral boundary condition on a 3D variable on ocean mesh 
     69   !!   lbc_lnk_2d    : set the lateral boundary condition on a 2D variable on ocean mesh 
     70   !!   lbc_bdy_lnk   : set the lateral BDY boundary condition 
    6571   !!---------------------------------------------------------------------- 
    6672   USE oce             ! ocean dynamics and tracers    
     
    7581      MODULE PROCEDURE lbc_lnk_3d_gather, lbc_lnk_3d, lbc_lnk_2d 
    7682   END INTERFACE 
     83   ! 
     84   INTERFACE lbc_sum 
     85      MODULE PROCEDURE mpp_lnk_sum_3d, mpp_lnk_sum_2d 
     86   END INTERFACE 
    7787 
    7888   INTERFACE lbc_lnk_e 
    7989      MODULE PROCEDURE lbc_lnk_2d_e 
    8090   END INTERFACE 
    81  
     91   ! 
    8292   INTERFACE lbc_bdy_lnk 
    8393      MODULE PROCEDURE lbc_bdy_lnk_2d, lbc_bdy_lnk_3d 
    8494   END INTERFACE 
    85  
     95   ! 
    8696   INTERFACE lbc_lnk_icb 
    8797      MODULE PROCEDURE lbc_lnk_2d_e 
     
    8999 
    90100   PUBLIC   lbc_lnk       ! ocean/ice  lateral boundary conditions 
    91    PUBLIC   lbc_lnk_e  
     101   PUBLIC   lbc_lnk_e     ! 
    92102   PUBLIC   lbc_bdy_lnk   ! ocean lateral BDY boundary conditions 
    93    PUBLIC   lbc_lnk_icb 
     103   PUBLIC   lbc_lnk_icb   ! 
    94104    
    95105   !!---------------------------------------------------------------------- 
    96    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     106   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
    97107   !! $Id$ 
    98108   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    230240         ! this is in mpp case. In this module, just do nothing 
    231241      ELSE 
    232          ! 
    233242         !                                     !  East-West boundaries 
    234243         !                                     ! ====================== 
     
    249258            ! 
    250259         END SELECT 
    251          ! 
    252260         !                                     ! North-South boundaries 
    253261         !                                     ! ====================== 
     
    287295   END SUBROUTINE lbc_lnk_3d 
    288296 
     297 
    289298   SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) 
    290299      !!--------------------------------------------------------------------- 
     
    316325         ! this is in mpp case. In this module, just do nothing 
    317326      ELSE       
    318          ! 
    319327         !                                     ! East-West boundaries 
    320328         !                                     ! ==================== 
     
    335343            ! 
    336344         END SELECT 
    337          ! 
    338345         !                                     ! North-South boundaries 
    339346         !                                     ! ====================== 
     
    375382#endif 
    376383 
    377  
    378384   SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy ) 
    379385      !!--------------------------------------------------------------------- 
     
    381387      !! 
    382388      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 
    383       !!                to maintain the same interface with regards to the mpp 
    384       !case 
    385       !! 
    386       !!---------------------------------------------------------------------- 
    387       CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
    388       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied 
    389       REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
    390       INTEGER                                                   ::   ib_bdy    ! BDY boundary set 
    391       !! 
     389      !!              to maintain the same interface with regards to the mpp case 
     390      !! 
     391      !!---------------------------------------------------------------------- 
     392      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type   ! nature of pt3d grid-points 
     393      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pt3d      ! 3D array on which the lbc is applied 
     394      REAL(wp)                        , INTENT(in   ) ::   psgn      ! control of the sign  
     395      INTEGER                         , INTENT(in   ) ::   ib_bdy    ! BDY boundary set 
     396      !!---------------------------------------------------------------------- 
     397      ! 
    392398      CALL lbc_lnk_3d( pt3d, cd_type, psgn) 
    393  
     399      ! 
    394400   END SUBROUTINE lbc_bdy_lnk_3d 
    395401 
     402 
    396403   SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy ) 
    397404      !!--------------------------------------------------------------------- 
     
    399406      !! 
    400407      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 
    401       !!                to maintain the same interface with regards to the mpp 
    402       !case 
    403       !! 
    404       !!---------------------------------------------------------------------- 
    405       CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
    406       REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied 
    407       REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
    408       INTEGER                                                   ::   ib_bdy    ! BDY boundary set 
    409       !! 
     408      !!              to maintain the same interface with regards to the mpp case 
     409      !! 
     410      !!---------------------------------------------------------------------- 
     411      CHARACTER(len=1)            , INTENT(in   ) ::   cd_type   ! nature of pt3d grid-points 
     412      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pt2d      ! 3D array on which the lbc is applied 
     413      REAL(wp)                    , INTENT(in   ) ::   psgn      ! control of the sign  
     414      INTEGER                     , INTENT(in   ) ::   ib_bdy    ! BDY boundary set 
     415      !!---------------------------------------------------------------------- 
     416      ! 
    410417      CALL lbc_lnk_2d( pt2d, cd_type, psgn) 
    411  
     418      ! 
    412419   END SUBROUTINE lbc_bdy_lnk_2d 
    413420 
     
    426433      !!                             for closed boundaries. 
    427434      !!---------------------------------------------------------------------- 
    428       CHARACTER(len=1)            , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
    429       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout)           ::   pt2d      ! 2D array on which the lbc is applied 
    430       REAL(wp)                    , INTENT(in   )           ::   psgn      ! control of the sign  
    431       INTEGER                     , INTENT(in   )           ::   jpri      ! size of extra halo (not needed in non-mpp) 
    432       INTEGER                     , INTENT(in   )           ::   jprj      ! size of extra halo (not needed in non-mpp) 
    433       !!---------------------------------------------------------------------- 
    434  
     435      CHARACTER(len=1)            , INTENT(in   ) ::   cd_type   ! nature of pt3d grid-points 
     436      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pt2d      ! 2D array on which the lbc is applied 
     437      REAL(wp)                    , INTENT(in   ) ::   psgn      ! control of the sign  
     438      INTEGER                     , INTENT(in   ) ::   jpri      ! size of extra halo (not needed in non-mpp) 
     439      INTEGER                     , INTENT(in   ) ::   jprj      ! size of extra halo (not needed in non-mpp) 
     440      !!---------------------------------------------------------------------- 
     441      ! 
    435442      CALL lbc_lnk_2d( pt2d, cd_type, psgn ) 
    436443      !     
Note: See TracChangeset for help on using the changeset viewer.