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 14576 for NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/tramle.F90 – NEMO

Ignore:
Timestamp:
2021-03-03T17:04:07+01:00 (3 years ago)
Author:
hadcv
Message:

#2600: Merge in dev_r14393_HPC-03_Mele_Comm_Cleanup r14538

File:
1 edited

Legend:

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

    r14574 r14576  
    110110         SELECT CASE( nn_mld_uv )                         ! MLD at u- & v-pts 
    111111         CASE ( 0 )                                               != min of the 2 neighbour MLDs 
    112             DO_2D( 1, 0, 1, 0 ) 
     112            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     113            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    113114               zhu(ji,jj) = MIN( hmle(ji+1,jj), hmle(ji,jj) ) 
    114115               zhv(ji,jj) = MIN( hmle(ji,jj+1), hmle(ji,jj) ) 
    115116            END_2D 
    116117         CASE ( 1 )                                               != average of the 2 neighbour MLDs 
    117             DO_2D( 1, 0, 1, 0 ) 
     118            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     119            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    118120               zhu(ji,jj) = MAX( hmle(ji+1,jj), hmle(ji,jj) ) 
    119121               zhv(ji,jj) = MAX( hmle(ji,jj+1), hmle(ji,jj) ) 
    120122            END_2D 
    121123         CASE ( 2 )                                               != max of the 2 neighbour MLDs 
    122             DO_2D( 1, 0, 1, 0 ) 
     124            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     125            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    123126               zhu(ji,jj) = MAX( hmle(ji+1,jj), hmle(ji,jj) ) 
    124127               zhv(ji,jj) = MAX( hmle(ji,jj+1), hmle(ji,jj) ) 
     
    126129         END SELECT 
    127130         IF( nn_mle == 0 ) THEN           ! Fox-Kemper et al. 2010 formulation 
    128             DO_2D( 1, 0, 1, 0 ) 
     131            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     132            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    129133               zpsim_u(ji,jj) = rn_ce * zhu(ji,jj) * zhu(ji,jj)  * e2u(ji,jj)                                            & 
    130134                    &           * dbdx_mle(ji,jj) * MIN( 111.e3_wp , e1u(ji,jj) )   & 
     
    137141            ! 
    138142         ELSEIF( nn_mle == 1 ) THEN       ! New formulation (Lf = 5km fo/ff with fo=Coriolis parameter at latitude rn_lat) 
    139             DO_2D( 1, 0, 1, 0 ) 
     143            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     144            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    140145               zpsim_u(ji,jj) = rc_f *   zhu(ji,jj)   * zhu(ji,jj)   * e2u(ji,jj)               & 
    141146                    &                  * dbdx_mle(ji,jj) * MIN( 111.e3_wp , e1u(ji,jj) ) 
     
    149154         !                                      !==  MLD used for MLE  ==! 
    150155         !                                                ! compute from the 10m density to deal with the diurnal cycle 
    151          DO_2D( 1, 1, 1, 1 ) 
     156         ! [comm_cleanup] ! DO_2D( 1, 1, 1, 1 ) 
     157         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    152158            inml_mle(ji,jj) = mbkt(ji,jj) + 1                    ! init. to number of ocean w-level (T-level + 1) 
    153159         END_2D 
    154160         IF ( nla10 > 0 ) THEN                            ! avoid case where first level is thicker than 10m 
    155            DO_3DS( 1, 1, 1, 1, jpkm1, nlb10, -1 )        ! from the bottom to nlb10 (10m) 
     161           ! [comm_cleanup] ! DO_3DS( 1, 1, 1, 1, jpkm1, nlb10, -1 )        ! from the bottom to nlb10 (10m) 
     162           DO_3DS( nn_hls, nn_hls, nn_hls, nn_hls, jpkm1, nlb10, -1 )        ! from the bottom to nlb10 (10m) 
    156163              IF( rhop(ji,jj,jk) > rhop(ji,jj,nla10) + rn_rho_c_mle )   inml_mle(ji,jj) = jk      ! Mixed layer 
    157164           END_3D 
     
    163170         zbm (:,:) = 0._wp 
    164171         zn2 (:,:) = 0._wp 
    165          DO_3D( 1, 1, 1, 1, 1, ikmax )                    ! MLD and mean buoyancy and N2 over the mixed layer 
     172         ! [comm_cleanup] ! DO_3D( 1, 1, 1, 1, 1, ikmax )                    ! MLD and mean buoyancy and N2 over the mixed layer 
     173         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, ikmax )                    ! MLD and mean buoyancy and N2 over the mixed layer 
    166174            zc = e3t(ji,jj,jk,Kmm) * REAL( MIN( MAX( 0, inml_mle(ji,jj)-jk ) , 1  )  )    ! zc being 0 outside the ML t-points 
    167175            zmld(ji,jj) = zmld(ji,jj) + zc 
     
    172180         SELECT CASE( nn_mld_uv )                         ! MLD at u- & v-pts 
    173181         CASE ( 0 )                                               != min of the 2 neighbour MLDs 
    174             DO_2D( 1, 0, 1, 0 ) 
     182            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     183            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    175184               zhu(ji,jj) = MIN( zmld(ji+1,jj), zmld(ji,jj) ) 
    176185               zhv(ji,jj) = MIN( zmld(ji,jj+1), zmld(ji,jj) ) 
    177186            END_2D 
    178187         CASE ( 1 )                                               != average of the 2 neighbour MLDs 
    179             DO_2D( 1, 0, 1, 0 ) 
     188            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     189            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    180190               zhu(ji,jj) = ( zmld(ji+1,jj) + zmld(ji,jj) ) * 0.5_wp 
    181191               zhv(ji,jj) = ( zmld(ji,jj+1) + zmld(ji,jj) ) * 0.5_wp 
    182192            END_2D 
    183193         CASE ( 2 )                                               != max of the 2 neighbour MLDs 
    184             DO_2D( 1, 0, 1, 0 ) 
     194            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     195            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    185196               zhu(ji,jj) = MAX( zmld(ji+1,jj), zmld(ji,jj) ) 
    186197               zhv(ji,jj) = MAX( zmld(ji,jj+1), zmld(ji,jj) ) 
     
    188199         END SELECT 
    189200         !                                                ! convert density into buoyancy 
    190          DO_2D( 1, 1, 1, 1 ) 
     201         ! [comm_cleanup] ! DO_2D( 1, 1, 1, 1 ) 
     202         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    191203            zbm(ji,jj) = + grav * zbm(ji,jj) / MAX( e3t(ji,jj,1,Kmm), zmld(ji,jj) ) 
    192204         END_2D 
     
    201213         ! 
    202214         IF( nn_mle == 0 ) THEN           ! Fox-Kemper et al. 2010 formulation 
    203             DO_2D( 1, 0, 1, 0 ) 
     215            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     216            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    204217               zpsim_u(ji,jj) = rn_ce * zhu(ji,jj) * zhu(ji,jj)  * e2_e1u(ji,jj)                                            & 
    205218                    &           * ( zbm(ji+1,jj) - zbm(ji,jj) ) * MIN( 111.e3_wp , e1u(ji,jj) )   & 
     
    212225            ! 
    213226         ELSEIF( nn_mle == 1 ) THEN       ! New formulation (Lf = 5km fo/ff with fo=Coriolis parameter at latitude rn_lat) 
    214             DO_2D( 1, 0, 1, 0 ) 
     227            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     228            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    215229               zpsim_u(ji,jj) = rc_f *   zhu(ji,jj)   * zhu(ji,jj)   * e2_e1u(ji,jj)               & 
    216230                    &                  * ( zbm(ji+1,jj) - zbm(ji,jj) ) * MIN( 111.e3_wp , e1u(ji,jj) ) 
     
    222236         ! 
    223237         IF( nn_conv == 1 ) THEN              ! No MLE in case of convection 
    224             DO_2D( 1, 0, 1, 0 ) 
     238            ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     239            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    225240               IF( MIN( zn2(ji,jj) , zn2(ji+1,jj) ) < 0._wp )   zpsim_u(ji,jj) = 0._wp 
    226241               IF( MIN( zn2(ji,jj) , zn2(ji,jj+1) ) < 0._wp )   zpsim_v(ji,jj) = 0._wp 
     
    230245      ENDIF  ! end of ln_osm_mle conditional 
    231246    !                                      !==  structure function value at uw- and vw-points  ==! 
    232     DO_2D( 1, 0, 1, 0 ) 
     247    ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 ) 
     248    DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    233249       zhu(ji,jj) = 1._wp / MAX(zhu(ji,jj), rsmall)                   ! hu --> 1/hu 
    234250       zhv(ji,jj) = 1._wp / MAX(zhv(ji,jj), rsmall)  
     
    238254    zpsi_vw(:,:,:) = 0._wp 
    239255    ! 
    240       DO_3D( 1, 0, 1, 0, 2, ikmax )                ! start from 2 : surface value = 0 
     256      ! [comm_cleanup] ! DO_3D( 1, 0, 1, 0, 2, ikmax )                ! start from 2 : surface value = 0 
     257      DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 2, ikmax )                ! start from 2 : surface value = 0 
     258       
    241259         zcuw = 1._wp - ( gdepw(ji+1,jj,jk,Kmm) + gdepw(ji,jj,jk,Kmm) ) * zhu(ji,jj) 
    242260         zcvw = 1._wp - ( gdepw(ji,jj+1,jk,Kmm) + gdepw(ji,jj,jk,Kmm) ) * zhv(ji,jj) 
     
    252270      !                                      !==  transport increased by the MLE induced transport ==! 
    253271      DO jk = 1, ikmax 
    254          DO_2D( 1, 0, 1, 0 )                      ! CAUTION pu,pv must be defined at row/column i=1 / j=1 
     272         ! [comm_cleanup] ! DO_2D( 1, 0, 1, 0 )                      ! CAUTION pu,pv must be defined at row/column i=1 / j=1 
     273         DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 
    255274            pu(ji,jj,jk) = pu(ji,jj,jk) + ( zpsi_uw(ji,jj,jk) - zpsi_uw(ji,jj,jk+1) ) 
    256275            pv(ji,jj,jk) = pv(ji,jj,jk) + ( zpsi_vw(ji,jj,jk) - zpsi_vw(ji,jj,jk+1) ) 
    257276         END_2D 
    258          DO_2D( 0, 0, 0, 0 ) 
     277         ! [comm_cleanup] ! DO_2D( 0, 0, 0, 0 ) 
     278         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 
    259279            pw(ji,jj,jk) = pw(ji,jj,jk) - ( zpsi_uw(ji,jj,jk) - zpsi_uw(ji-1,jj,jk)   & 
    260280               &                          + zpsi_vw(ji,jj,jk) - zpsi_vw(ji,jj-1,jk) ) * wmask(ji,jj,1) 
     
    270290         ! 
    271291         IF (ln_osm_mle.and.ln_zdfosm) THEN 
    272             DO_2D( 0, 0, 0, 0 ) 
     292            ! [comm_cleanup] ! DO_2D( 0, 0, 0, 0 ) 
     293            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 
    273294               zLf_NH(ji,jj) = SQRT( rb_c * hmle(ji,jj) ) * r1_ft(ji,jj)      ! Lf = N H / f 
    274295            END_2D 
    275296         ELSE 
    276             DO_2D( 0, 0, 0, 0 ) 
     297            ! [comm_cleanup] ! DO_2D( 0, 0, 0, 0 ) 
     298            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 
    277299               zLf_NH(ji,jj) = SQRT( rb_c * zmld(ji,jj) ) * r1_ft(ji,jj)      ! Lf = N H / f 
    278300            END_2D 
     
    280302         ! 
    281303         ! divide by cross distance to give streamfunction with dimensions m^2/s 
    282          DO_3D( 0, 0, 0, 0, 1, ikmax+1 ) 
     304         ! [comm_cleanup] ! DO_3D( 0, 0, 0, 0, 1, ikmax+1 ) 
     305         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, ikmax+1 ) 
    283306            zpsiu_mle(ji,jj,jk) = zpsi_uw(ji,jj,jk) * r1_e2u(ji,jj) 
    284307            zpsiv_mle(ji,jj,jk) = zpsi_vw(ji,jj,jk) * r1_e1v(ji,jj) 
Note: See TracChangeset for help on using the changeset viewer.