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 9863 for NEMO/branches/2018/dev_r9838_ENHANCE04_MLF/src/OCE/TRA/trazdf.F90 – NEMO

Ignore:
Timestamp:
2018-06-30T12:51:02+02:00 (6 years ago)
Author:
gm
Message:

#1911 (ENHANCE-04): simplified implementation of the Euler stepping at nit000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r9838_ENHANCE04_MLF/src/OCE/TRA/trazdf.F90

    r9598 r9863  
    5252      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    5353      ! 
    54       INTEGER  ::   jk   ! Dummy loop indices 
    55       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace 
     54      INTEGER  ::   jk, jts   ! Dummy loop indices 
     55      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   ztrd   ! 4D workspace 
    5656      !!--------------------------------------------------------------------- 
    5757      ! 
     
    6464      ENDIF 
    6565      ! 
    66       IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt =      rdt   ! at nit000, =   rdt (restarting with Euler time stepping) 
    67       ELSEIF( kt <= nit000 + 1           ) THEN   ;   r2dt = 2. * rdt   ! otherwise, = 2 rdt (leapfrog) 
    68       ENDIF 
    69       ! 
    7066      IF( l_trdtra )   THEN                  !* Save ta and sa trends 
    71          ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    72          ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
    73          ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
     67         ALLOCATE( ztrd(jpi,jpj,jpk,jpts) ) 
     68         ztrd(:,:,:,:) = tsa(:,:,:,:) 
    7469      ENDIF 
    7570      ! 
     
    8580 
    8681      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    87          DO jk = 1, jpkm1 
    88             ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_tem)*e3t_b(:,:,jk) ) & 
    89                &          / (e3t_n(:,:,jk)*r2dt) ) - ztrdt(:,:,jk) 
    90             ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_sal)*e3t_b(:,:,jk) ) & 
    91               &           / (e3t_n(:,:,jk)*r2dt) ) - ztrds(:,:,jk) 
     82         DO jts = 1, jpts 
     83            DO jk = 1, jpkm1 
     84               ztrd(:,:,jk,jts) = ( ( tsa(:,:,jk,jts)*e3t_a(:,:,jk) - tsb(:,:,jk,jts)*e3t_b(:,:,jk) ) / (e3t_n(:,:,jk)*r2dt) )   & 
     85                  &            - ztrd(:,:,jk,jts) 
     86            END DO 
    9287         END DO 
    9388!!gm this should be moved in trdtra.F90 and done on all trends 
    94          CALL lbc_lnk_multi( ztrdt, 'T', 1. , ztrds, 'T', 1. ) 
     89         CALL lbc_lnk( ztrd, 'T', 1. ) 
    9590!!gm 
    96          CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
    97          CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdf, ztrds ) 
    98          DEALLOCATE( ztrdt , ztrds ) 
     91         CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdf, ztrd(:,:,:,jp_tem) ) 
     92         CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdf, ztrd(:,:,:,jp_sal) ) 
     93         DEALLOCATE( ztrd ) 
    9994      ENDIF 
    10095      !                                          ! print mean trends (used for debugging) 
Note: See TracChangeset for help on using the changeset viewer.