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

Ignore:
Timestamp:
2021-02-23T15:18:28+01:00 (3 years ago)
Author:
hadcv
Message:

#2600: Reorganise dom_tile code

File:
1 edited

Legend:

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

    r14090 r14537  
    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 
    2829   USE domtile 
    2930   USE domvvl          ! domain: variable volume level 
     
    519520      ! 
    520521      INTEGER  :: ji, jj, jk 
    521       INTEGER  :: it, itile 
     522      INTEGER  :: it 
    522523      REAL(wp) :: zincwgt  ! IAU weight for current time step 
    523524      REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: fzptnz ! 3d freezing point values 
     
    541542            zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step 
    542543            ! 
    543             IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     544            IF( .NOT. l_istiled .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
    544545               IF(lwp) THEN 
    545546                  WRITE(numout,*) 
     
    578579         ENDIF 
    579580         ! 
    580          IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
     581         IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    581582            IF ( kt == nitiaufin_r + 1  ) THEN   ! For bias crcn to work 
    582583               DEALLOCATE( t_bkginc ) 
     
    625626 
    626627            ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from zps_hde*) 
    627             IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain 
    628                itile = ntile 
    629                IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )            ! Use full domain 
     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 
    630630 
    631631               IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)           & 
     
    636636                  &                                  rhd, gru , grv , grui, grvi          )  ! of t, s, rd at the last ocean level 
    637637 
    638                IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )            ! Revert to tile domain 
     638               IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='asminc' )            ! Revert to tile domain 
    639639            ENDIF 
    640640 
    641             IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
     641            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    642642               DEALLOCATE( t_bkginc ) 
    643643               DEALLOCATE( s_bkginc ) 
     
    683683            zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step 
    684684            ! 
    685             IF(lwp) THEN 
    686                WRITE(numout,*) 
    687                WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it) 
    688                WRITE(numout,*) '~~~~~~~~~~~~' 
    689             ENDIF 
     685               IF(lwp) THEN 
     686                  WRITE(numout,*) 
     687                  WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it) 
     688                  WRITE(numout,*) '~~~~~~~~~~~~' 
     689               ENDIF 
    690690            ! 
    691691            ! Update the dynamic tendencies 
     
    695695            END DO 
    696696            ! 
    697             IF ( kt == nitiaufin_r ) THEN 
    698                DEALLOCATE( u_bkginc ) 
    699                DEALLOCATE( v_bkginc ) 
     697               IF ( kt == nitiaufin_r ) THEN 
     698                  DEALLOCATE( u_bkginc ) 
     699                  DEALLOCATE( v_bkginc ) 
     700               ENDIF 
     701            ! 
    700702            ENDIF 
    701             ! 
    702          ENDIF 
    703703         !                          !----------------------------------------- 
    704704      ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization 
     
    754754            zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step 
    755755            ! 
    756             IF(lwp) THEN 
    757                WRITE(numout,*) 
    758                WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', & 
    759                   &  kt,' with IAU weight = ', wgtiau(it) 
    760                WRITE(numout,*) '~~~~~~~~~~~~' 
    761             ENDIF 
     756               IF(lwp) THEN 
     757                  WRITE(numout,*) 
     758                  WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', & 
     759                     &  kt,' with IAU weight = ', wgtiau(it) 
     760                  WRITE(numout,*) '~~~~~~~~~~~~' 
     761               ENDIF 
    762762            ! 
    763763            ! Save the tendency associated with the IAU weighted SSH increment 
     
    770770            ! 
    771771            ! test on ssh_bkginc needed as ssh_asm_inc is called twice by time step 
    772             IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc ) 
     772               IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc ) 
    773773            ! 
    774774#if defined key_asminc 
     
    832832         ALLOCATE( ztim(jpi,jpj) ) 
    833833         ztim(:,:) = ssh_iau(:,:) / ( ht(:,:) + 1.0 - ssmask(:,:) ) 
    834          DO jk = 1, jpkm1 
     834            DO jk = 1, jpkm1 
    835835            phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk) 
    836          END DO 
     836            END DO 
    837837         ! 
    838838         DEALLOCATE(ztim) 
     
    876876            ! note this is not a tendency so should not be divided by rn_Dt (as with the tracer and other increments) 
    877877            ! 
    878             IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     878            IF( .NOT. l_istiled .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
    879879               IF(lwp) THEN 
    880880                  WRITE(numout,*) 
     
    920920#endif 
    921921            ! 
    922             IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
     922            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    923923               IF ( kt == nitiaufin_r ) THEN 
    924924                  DEALLOCATE( seaice_bkginc ) 
     
    979979            END_2D 
    980980#endif 
    981             IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
     981            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
    982982               IF ( .NOT. PRESENT(kindic) ) THEN 
    983983                  DEALLOCATE( seaice_bkginc ) 
Note: See TracChangeset for help on using the changeset viewer.