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

Ignore:
Timestamp:
2018-07-13T09:28:50+02:00 (6 years ago)
Author:
gm
Message:

#1911 (ENHANCE-04): RK3 branche phased with MLF@9937 branche

Location:
NEMO/branches/2018/dev_r9838_ENHANCE04_RK3
Files:
1 edited
1 copied

Legend:

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

    r9598 r9939  
    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) 
     66      IF( l_trdtra )   THEN                  !* Save input tsa  trend 
     67         ALLOCATE( ztrd(jpi,jpj,jpk,jpts) ) 
     68         ztrd(:,:,:,:) = tsa(:,:,:,:) 
    6869      ENDIF 
    6970      ! 
    70       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) 
    74       ENDIF 
    75       ! 
    7671      !                                      !* compute lateral mixing trend and add it to the general trend 
    77       CALL tra_zdf_imp( kt, nit000, 'TRA', r2dt, tsb, tsa, jpts )  
     72      CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, tsb, tsa, jpts )  
    7873 
    7974!!gm WHY here !   and I don't like that ! 
     
    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)*rDt) )   & 
     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) 
     
    180175               DO jj = 2, jpjm1 
    181176                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    182 !!gm BUG  I think, use e3w_a instead of e3w_n, not sure of that 
    183177                     zwi(ji,jj,jk) = - p2dt * zwt(ji,jj,jk  ) / e3w_n(ji,jj,jk  ) 
    184178                     zws(ji,jj,jk) = - p2dt * zwt(ji,jj,jk+1) / e3w_n(ji,jj,jk+1) 
Note: See TracChangeset for help on using the changeset viewer.