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 6493 for trunk/NEMOGCM/NEMO/OPA_SRC – NEMO

Ignore:
Timestamp:
2016-04-22T15:52:52+02:00 (8 years ago)
Author:
mathiot
Message:

add lbc_sum interface + USE lib_mpi in cool_skin if key_mpi_mpp not defined

Location:
trunk/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DIU/cool_skin.F90

    r6075 r6493  
    1717   USE in_out_manager 
    1818   USE sbc_oce 
     19   USE lib_mpp 
    1920   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2021    
  • trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90

    r6490 r6493  
    3030   END INTERFACE 
    3131   ! 
    32 !JMM interface not defined if not key_mpp_mpi : likely do not compile without this CPP key !!!! 
    3332   INTERFACE lbc_sum 
    3433      MODULE PROCEDURE mpp_lnk_sum_3d, mpp_lnk_sum_2d 
    3534   END INTERFACE 
    36  
     35   ! 
    3736   INTERFACE lbc_bdy_lnk 
    3837      MODULE PROCEDURE mpp_lnk_bdy_2d, mpp_lnk_bdy_3d 
     
    8483   ! 
    8584   INTERFACE lbc_sum 
    86       MODULE PROCEDURE mpp_lnk_sum_3d, mpp_lnk_sum_2d 
     85      MODULE PROCEDURE lbc_lnk_sum_3d, lbc_lnk_sum_2d 
    8786   END INTERFACE 
    8887 
     
    109108 
    110109   PUBLIC   lbc_lnk       ! ocean/ice  lateral boundary conditions 
     110   PUBLIC   lbc_sum       ! ocean/ice  lateral boundary conditions (sum of the overlap region) 
    111111   PUBLIC   lbc_lnk_e     ! 
    112112   PUBLIC   lbc_lnk_multi ! modified ocean lateral boundary conditions 
     
    501501   END SUBROUTINE lbc_lnk_2d_9 
    502502 
     503   SUBROUTINE lbc_lnk_sum_2d( pt2d, cd_type, psgn, cd_mpp, pval ) 
     504      !!--------------------------------------------------------------------- 
     505      !!                 ***  ROUTINE lbc_lnk_sum_2d  *** 
     506      !! 
     507      !! ** Purpose :   set lateral boundary conditions on a 2D array (non mpp case) 
     508      !! 
     509      !! ** Comments:   compute the sum of the common cell (overlap region) for the ice sheet/ocean  
     510      !!                coupling if conservation option activated. As no ice shelf are present along 
     511      !!                this line, nothing is done along the north fold. 
     512      !!---------------------------------------------------------------------- 
     513      CHARACTER(len=1)            , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
     514      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout)           ::   pt2d      ! 2D array on which the lbc is applied 
     515      REAL(wp)                    , INTENT(in   )           ::   psgn      ! control of the sign  
     516      CHARACTER(len=3)            , INTENT(in   ), OPTIONAL ::   cd_mpp    ! MPP only (here do nothing) 
     517      REAL(wp)                    , INTENT(in   ), OPTIONAL ::   pval      ! background value (for closed boundaries) 
     518      !! 
     519      REAL(wp) ::   zland 
     520      !!---------------------------------------------------------------------- 
     521 
     522      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value (zero by default) 
     523      ELSE                         ;   zland = 0._wp 
     524      ENDIF 
     525 
     526      IF (PRESENT(cd_mpp)) THEN 
     527         ! only fill the overlap area and extra allows  
     528         ! this is in mpp case. In this module, just do nothing 
     529      ELSE 
     530         !                                     ! East-West boundaries 
     531         !                                     ! ==================== 
     532         SELECT CASE ( nperio ) 
     533         ! 
     534         CASE ( 1 , 4 , 6 )                       !** cyclic east-west 
     535            pt2d(jpim1,:) = pt2d(jpim1,:) + pt2d( 1 ,:) 
     536            pt2d(  2  ,:) = pt2d(  2  ,:) + pt2d(jpi,:) 
     537            pt2d( 1 ,:) = 0.0_wp               ! all points 
     538            pt2d(jpi,:) = 0.0_wp 
     539            ! 
     540         CASE DEFAULT                             !** East closed  --  West closed 
     541            SELECT CASE ( cd_type ) 
     542            CASE ( 'T' , 'U' , 'V' , 'W' )            ! T-, U-, V-, W-points 
     543               pt2d( 1 ,:) = zland 
     544               pt2d(jpi,:) = zland 
     545            CASE ( 'F' )                              ! F-point 
     546               pt2d(jpi,:) = zland 
     547            END SELECT 
     548            ! 
     549         END SELECT 
     550         !                                     ! North-South boundaries 
     551         !                                     ! ====================== 
     552         ! Nothing to do for the north fold, there is no ice shelf along this line. 
     553         ! 
     554      END IF 
     555 
     556   END SUBROUTINE 
     557 
     558   SUBROUTINE lbc_lnk_sum_3d( pt3d, cd_type, psgn, cd_mpp, pval ) 
     559      !!--------------------------------------------------------------------- 
     560      !!                 ***  ROUTINE lbc_lnk_sum_3d  *** 
     561      !! 
     562      !! ** Purpose :   set lateral boundary conditions on a 3D array (non mpp case) 
     563      !! 
     564      !! ** Comments:   compute the sum of the common cell (overlap region) for the ice sheet/ocean  
     565      !!                coupling if conservation option activated. As no ice shelf are present along 
     566      !!                this line, nothing is done along the north fold. 
     567      !!---------------------------------------------------------------------- 
     568      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
     569      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied 
     570      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
     571      CHARACTER(len=3)                , INTENT(in   ), OPTIONAL ::   cd_mpp    ! MPP only (here do nothing) 
     572      REAL(wp)                        , INTENT(in   ), OPTIONAL ::   pval      ! background value (for closed boundaries) 
     573      !! 
     574      REAL(wp) ::   zland 
     575      !!---------------------------------------------------------------------- 
     576 
     577      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value (zero by default) 
     578      ELSE                         ;   zland = 0._wp 
     579      ENDIF 
     580 
     581 
     582      IF( PRESENT( cd_mpp ) ) THEN 
     583         ! only fill the overlap area and extra allows  
     584         ! this is in mpp case. In this module, just do nothing 
     585      ELSE 
     586         !                                     !  East-West boundaries 
     587         !                                     ! ====================== 
     588         SELECT CASE ( nperio ) 
     589         ! 
     590         CASE ( 1 , 4 , 6 )                       !**  cyclic east-west 
     591            pt3d(jpim1,:,:) = pt3d(jpim1,:,:) + pt3d( 1 ,:,:) 
     592            pt3d(  2  ,:,:) = pt3d(  2  ,:,:) + pt3d(jpi,:,:)  
     593            pt3d( 1 ,:,:) = 0.0_wp            ! all points 
     594            pt3d(jpi,:,:) = 0.0_wp 
     595            ! 
     596         CASE DEFAULT                             !**  East closed  --  West closed 
     597            SELECT CASE ( cd_type ) 
     598            CASE ( 'T' , 'U' , 'V' , 'W' )             ! T-, U-, V-, W-points 
     599               pt3d( 1 ,:,:) = zland 
     600               pt3d(jpi,:,:) = zland 
     601            CASE ( 'F' )                               ! F-point 
     602               pt3d(jpi,:,:) = zland 
     603            END SELECT 
     604            ! 
     605         END SELECT 
     606         !                                     ! North-South boundaries 
     607         !                                     ! ====================== 
     608         ! Nothing to do for the north fold, there is no ice shelf along this line. 
     609         ! 
     610      END IF 
     611   END SUBROUTINE 
     612 
    503613 
    504614#endif 
Note: See TracChangeset for help on using the changeset viewer.