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 14680 for NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DYN/sshwzv.F90 – NEMO

Ignore:
Timestamp:
2021-04-07T19:16:18+02:00 (3 years ago)
Author:
hadcv
Message:

#2600: Merge in dev_r14393_HPC-03_Mele_Comm_Cleanup [14667]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DYN/sshwzv.F90

    r14205 r14680  
    7878      REAL(wp), DIMENSION(jpi,jpj,jpt), INTENT(inout) ::   pssh           ! sea-surface height 
    7979      !  
    80       INTEGER  ::   jk      ! dummy loop index 
     80      INTEGER  ::   ji, jj, jk      ! dummy loop index 
    8181      REAL(wp) ::   zcoef   ! local scalar 
    8282      REAL(wp), DIMENSION(jpi,jpj) ::   zhdiv   ! 2D workspace 
     
    103103      ! 
    104104      zhdiv(:,:) = 0._wp 
    105       DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports 
    106         zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 
    107       END DO 
     105      ! [comm_cleanup] ! DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports  
     106      DO_3D( nn_hls-1, nn_hls, nn_hls-1, nn_hls, 1, jpkm1 )                                 ! Horizontal divergence of barotropic transports  
     107        zhdiv(ji,jj) = zhdiv(ji,jj) + e3t(ji,jj,jk,Kmm) * hdiv(ji,jj,jk) 
     108      END_3D 
    108109      !                                                ! Sea surface elevation time stepping 
    109110      ! In time-split case we need a first guess of the ssh after (using the baroclinic timestep) in order to 
    110111      ! compute the vertical velocity which can be used to compute the non-linear terms of the momentum equations. 
    111112      !  
    112       pssh(:,:,Kaa) = (  pssh(:,:,Kbb) - rDt * ( zcoef * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * ssmask(:,:) 
     113      ! [comm_cleanup]  
     114      DO_2D( nn_hls-1, nn_hls, nn_hls-1, nn_hls ) 
     115         pssh(ji,jj,Kaa) = (  pssh(ji,jj,Kbb) - rDt * ( zcoef * ( emp_b(ji,jj) + emp(ji,jj) ) + zhdiv(ji,jj) )  ) * ssmask(ji,jj) 
     116      END_2D 
    113117      ! 
    114118#if defined key_agrif 
     
    119123      IF ( .NOT.ln_dynspg_ts ) THEN 
    120124         IF( ln_bdy ) THEN 
    121             CALL lbc_lnk( 'sshwzv', pssh(:,:,Kaa), 'T', 1.0_wp )    ! Not sure that's necessary 
     125            ! [comm_cleanup]  
     126            IF (nn_hls.eq.1) CALL lbc_lnk( 'sshwzv', pssh(:,:,Kaa), 'T', 1.0_wp )    ! Not sure that's necessary 
    122127            CALL bdy_ssh( pssh(:,:,Kaa) )             ! Duplicate sea level across open boundaries 
    123128         ENDIF 
     
    178183            ! horizontal divergence of thickness diffusion transport ( velocity multiplied by e3t) 
    179184            ! - ML - note: computation already done in dom_vvl_sf_nxt. Could be optimized (not critical and clearer this way) 
    180             DO_2D( 0, 0, 0, 0 ) 
     185            ! [comm_cleanup] ! DO_2D( 0, 0, 0, 0 ) 
     186            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 
    181187               zhdiv(ji,jj,jk) = r1_e1e2t(ji,jj) * ( un_td(ji,jj,jk) - un_td(ji-1,jj,jk) + vn_td(ji,jj,jk) - vn_td(ji,jj-1,jk) ) 
    182188            END_2D 
    183189         END DO 
    184          CALL lbc_lnk('sshwzv', zhdiv, 'T', 1.0_wp)  ! - ML - Perhaps not necessary: not used for horizontal "connexions" 
     190         IF (nn_hls.eq.1) CALL lbc_lnk('sshwzv', zhdiv, 'T', 1.0_wp)  ! - ML - Perhaps not necessary: not used for horizontal "connexions" 
    185191         !                             ! Is it problematic to have a wrong vertical velocity in boundary cells? 
    186192         !                             ! Same question holds for hdiv. Perhaps just for security 
     
    357363      zdt = 2._wp * rn_Dt                            ! 2*rn_Dt and not rDt (for restartability) 
    358364      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN 
    359          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     365         ! [comm_cleanup] ! DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     366         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 ) 
    360367            z1_e3t = 1._wp / e3t(ji,jj,jk,Kmm) 
    361368            Cu_adv(ji,jj,jk) =   zdt *                                                         & 
     
    374381         END_3D 
    375382      ELSE 
    376          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     383         ! [comm_cleanup] ! DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     384         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 ) 
    377385            z1_e3t = 1._wp / e3t(ji,jj,jk,Kmm) 
    378386            Cu_adv(ji,jj,jk) =   zdt *                                                      & 
     
    387395         END_3D 
    388396      ENDIF 
    389       CALL lbc_lnk( 'sshwzv', Cu_adv, 'T', 1.0_wp ) 
     397      IF (nn_hls.eq.1) CALL lbc_lnk( 'sshwzv', Cu_adv, 'T', 1.0_wp ) 
    390398      ! 
    391399      CALL iom_put("Courant",Cu_adv) 
    392400      ! 
    393401      IF( MAXVAL( Cu_adv(:,:,:) ) > Cu_min ) THEN       ! Quick check if any breaches anywhere 
    394          DO_3DS( 1, 1, 1, 1, jpkm1, 2, -1 )             ! or scan Courant criterion and partition ! w where necessary 
     402         ! [comm_cleanup] ! DO_3DS( 1, 1, 1, 1, jpkm1, 2, -1 )             ! or scan Courant criterion and partition ! w where necessary 
     403         DO_3DS( nn_hls, nn_hls, nn_hls, nn_hls, jpkm1, 2, -1 )             ! or scan Courant criterion and partition ! w where necessary 
    395404            ! 
    396405            zCu = MAX( Cu_adv(ji,jj,jk) , Cu_adv(ji,jj,jk-1) ) 
Note: See TracChangeset for help on using the changeset viewer.