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 14751 for NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/ASM/asminc.F90 – NEMO

Ignore:
Timestamp:
2021-04-27T13:27:53+02:00 (3 years ago)
Author:
hadcv
Message:

#2600: Tiling for DYN

File:
1 edited

Legend:

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

    r14537 r14751  
    2626   USE par_oce         ! Ocean space and time domain variables 
    2727   USE dom_oce         ! Ocean space and time domain 
    28    ! TEMP: [tiling] This change not necessary after extended haloes development 
    29    USE domtile 
    3028   USE domvvl          ! domain: variable volume level 
    3129   USE ldfdyn          ! lateral diffusion: eddy viscosity coefficients 
     
    596594            IF (ln_temnofreeze) THEN 
    597595               ! Do not apply negative increments if the temperature will fall below freezing 
    598                WHERE( t_bkginc(A2D(0),:) > 0.0_wp .OR. pts(A2D(0),:,jp_tem,Kmm) + t_bkginc(A2D(0),:) > fzptnz(:,:,:) ) 
    599                   pts(A2D(0),:,jp_tem,Kmm) = t_bkg(A2D(0),:) + t_bkginc(A2D(0),:) 
     596               WHERE( t_bkginc(:,:,:) > 0.0_wp .OR. pts(:,:,:,jp_tem,Kmm) + t_bkginc(:,:,:) > fzptnz(:,:,:) ) 
     597                  pts(:,:,:,jp_tem,Kmm) = t_bkg(:,:,:) + t_bkginc(:,:,:) 
    600598               END WHERE 
    601599            ELSE 
    602                DO_3D( 0, 0, 0, 0, 1, jpk ) 
    603                   pts(ji,jj,jk,jp_tem,Kmm) = t_bkg(ji,jj,jk) + t_bkginc(ji,jj,jk) 
    604                END_3D 
     600               pts(:,:,:,jp_tem,Kmm) = t_bkg(:,:,:) + t_bkginc(:,:,:) 
    605601            ENDIF 
    606602            IF (ln_salfix) THEN 
    607603               ! Do not apply negative increments if the salinity will fall below a specified 
    608604               ! minimum value salfixmin 
    609                WHERE( s_bkginc(A2D(0),:) > 0.0_wp .OR. pts(A2D(0),:,jp_sal,Kmm) + s_bkginc(A2D(0),:) > salfixmin ) 
    610                   pts(A2D(0),:,jp_sal,Kmm) = s_bkg(A2D(0),:) + s_bkginc(A2D(0),:) 
     605               WHERE( s_bkginc(:,:,:) > 0.0_wp .OR. pts(:,:,:,jp_sal,Kmm) + s_bkginc(:,:,:) > salfixmin ) 
     606                  pts(:,:,:,jp_sal,Kmm) = s_bkg(:,:,:) + s_bkginc(:,:,:) 
    611607               END WHERE 
    612608            ELSE 
    613                DO_3D( 0, 0, 0, 0, 1, jpk ) 
    614                   pts(ji,jj,jk,jp_sal,Kmm) = s_bkg(ji,jj,jk) + s_bkginc(ji,jj,jk) 
    615                END_3D 
    616             ENDIF 
    617  
    618             DO_3D( 0, 0, 0, 0, 1, jpk ) 
    619                pts(ji,jj,jk,:,Kbb) = pts(ji,jj,jk,:,Kmm)             ! Update before fields 
    620             END_3D 
     609               pts(:,:,:,jp_sal,Kmm) = s_bkg(:,:,:) + s_bkginc(:,:,:) 
     610            ENDIF 
     611 
     612            pts(:,:,:,:,Kbb) = pts(:,:,:,:,Kmm)                 ! Update before fields 
    621613 
    622614            CALL eos( pts(:,:,:,:,Kbb), rhd, rhop, gdept_0(:,:,:) )  ! Before potential and in situ densities 
     
    625617!!gm 
    626618 
    627             ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from zps_hde*) 
    628             IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only for the full domain 
    629                IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='asminc' )             ! Use full domain 
    630  
    631                IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)           & 
    632                   &  CALL zps_hde    ( kt, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv,        &  ! Partial steps: before horizontal gradient 
    633                   &                              rhd, gru , grv               )  ! of t, s, rd at the last ocean level 
    634                IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav)                       & 
    635                   &  CALL zps_hde_isf( nit000, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv, gtui, gtvi,    &  ! Partial steps for top cell (ISF) 
    636                   &                                  rhd, gru , grv , grui, grvi          )  ! of t, s, rd at the last ocean level 
    637  
    638                IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='asminc' )            ! Revert to tile domain 
    639             ENDIF 
    640  
    641             IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    642                DEALLOCATE( t_bkginc ) 
    643                DEALLOCATE( s_bkginc ) 
    644                DEALLOCATE( t_bkg    ) 
    645                DEALLOCATE( s_bkg    ) 
    646             ENDIF 
    647          ! 
     619            IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)           & 
     620               &  CALL zps_hde    ( kt, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv,        &  ! Partial steps: before horizontal gradient 
     621               &                              rhd, gru , grv               )  ! of t, s, rd at the last ocean level 
     622            IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav)                       & 
     623               &  CALL zps_hde_isf( nit000, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv, gtui, gtvi,    &  ! Partial steps for top cell (ISF) 
     624               &                                  rhd, gru , grv , grui, grvi          )  ! of t, s, rd at the last ocean level 
     625 
     626            DEALLOCATE( t_bkginc ) 
     627            DEALLOCATE( s_bkginc ) 
     628            DEALLOCATE( t_bkg    ) 
     629            DEALLOCATE( s_bkg    ) 
    648630         ENDIF 
    649631         ! 
     
    669651      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv       ! ocean velocities and RHS of momentum equation 
    670652      ! 
    671       INTEGER :: jk 
     653      INTEGER :: ji, jj, jk 
    672654      INTEGER :: it 
    673655      REAL(wp) :: zincwgt  ! IAU weight for current time step 
     
    683665            zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step 
    684666            ! 
     667            IF( .NOT. l_istiled .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
    685668               IF(lwp) THEN 
    686669                  WRITE(numout,*) 
     
    688671                  WRITE(numout,*) '~~~~~~~~~~~~' 
    689672               ENDIF 
     673            ENDIF 
    690674            ! 
    691675            ! Update the dynamic tendencies 
    692             DO jk = 1, jpkm1 
    693                puu(:,:,jk,Krhs) = puu(:,:,jk,Krhs) + u_bkginc(:,:,jk) * zincwgt 
    694                pvv(:,:,jk,Krhs) = pvv(:,:,jk,Krhs) + v_bkginc(:,:,jk) * zincwgt 
    695             END DO 
    696             ! 
     676            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     677               puu(ji,jj,jk,Krhs) = puu(ji,jj,jk,Krhs) + u_bkginc(ji,jj,jk) * zincwgt 
     678               pvv(ji,jj,jk,Krhs) = pvv(ji,jj,jk,Krhs) + v_bkginc(ji,jj,jk) * zincwgt 
     679            END_3D 
     680            ! 
     681            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    697682               IF ( kt == nitiaufin_r ) THEN 
    698683                  DEALLOCATE( u_bkginc ) 
    699684                  DEALLOCATE( v_bkginc ) 
    700685               ENDIF 
    701             ! 
    702             ENDIF 
     686            ENDIF 
     687            ! 
     688         ENDIF 
    703689         !                          !----------------------------------------- 
    704690      ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization 
     
    741727      ! 
    742728      INTEGER :: it 
    743       INTEGER :: jk 
     729      INTEGER :: ji, jj, jk 
    744730      REAL(wp) :: zincwgt  ! IAU weight for current time step 
    745731      !!---------------------------------------------------------------------- 
     
    754740            zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step 
    755741            ! 
     742            IF( .NOT. l_istiled .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
    756743               IF(lwp) THEN 
    757744                  WRITE(numout,*) 
     
    760747                  WRITE(numout,*) '~~~~~~~~~~~~' 
    761748               ENDIF 
     749            ENDIF 
    762750            ! 
    763751            ! Save the tendency associated with the IAU weighted SSH increment 
    764752            ! (applied in dynspg.*) 
    765753#if defined key_asminc 
    766             ssh_iau(:,:) = ssh_bkginc(:,:) * zincwgt 
     754            DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 
     755               ssh_iau(ji,jj) = ssh_bkginc(ji,jj) * zincwgt 
     756            END_2D 
    767757#endif 
    768758            ! 
     
    770760            ! 
    771761            ! test on ssh_bkginc needed as ssh_asm_inc is called twice by time step 
     762            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    772763               IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc ) 
     764            ENDIF 
    773765            ! 
    774766#if defined key_asminc 
    775             ssh_iau(:,:) = 0._wp 
     767            DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls ) 
     768               ssh_iau(ji,jj) = 0._wp 
     769            END_2D 
    776770#endif 
    777771            ! 
     
    820814      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   phdivn   ! horizontal divergence 
    821815      !! 
    822       INTEGER  ::   jk                                        ! dummy loop index 
     816      INTEGER  ::   ji, jj, jk                                ! dummy loop index 
    823817      REAL(wp), DIMENSION(:,:)  , POINTER       ::   ztim     ! local array 
    824818      !!---------------------------------------------------------------------- 
     
    828822      ! 
    829823      IF( ln_linssh ) THEN 
    830          phdivn(:,:,1) = phdivn(:,:,1) - ssh_iau(:,:) / e3t(:,:,1,Kmm) * tmask(:,:,1) 
     824         DO_2D_OVR( nn_hls-1, nn_hls, nn_hls-1, nn_hls ) 
     825            phdivn(ji,jj,1) = phdivn(ji,jj,1) - ssh_iau(ji,jj) / e3t(ji,jj,1,Kmm) * tmask(ji,jj,1) 
     826         END_2D 
    831827      ELSE 
    832          ALLOCATE( ztim(jpi,jpj) ) 
    833          ztim(:,:) = ssh_iau(:,:) / ( ht(:,:) + 1.0 - ssmask(:,:) ) 
     828         ALLOCATE( ztim(A2D(nn_hls)) ) 
     829         DO_2D_OVR( nn_hls-1, nn_hls, nn_hls-1, nn_hls ) 
     830            ztim(ji,jj) = ssh_iau(ji,jj) / ( ht(ji,jj) + 1.0 - ssmask(ji,jj) ) 
    834831            DO jk = 1, jpkm1 
    835             phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk) 
     832               phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ztim(ji,jj) * tmask(ji,jj,jk) 
    836833            END DO 
     834         END_2D 
    837835         ! 
    838836         DEALLOCATE(ztim) 
Note: See TracChangeset for help on using the changeset viewer.