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 13067 – NEMO

Changeset 13067


Ignore:
Timestamp:
2020-06-09T10:12:15+02:00 (4 years ago)
Author:
smasson
Message:

r4.0-HEAD: fix trdtra when used with traadv_ubs, see #2277

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/TRD/trdtra.F90

    r10425 r13067  
    8181      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   ptra    ! now tracer variable 
    8282      ! 
    83       INTEGER ::   jk   ! loop indices 
     83      INTEGER ::   jk    ! loop indices 
     84      INTEGER ::   i01   ! 0 or 1 
    8485      REAL(wp),        DIMENSION(jpi,jpj,jpk) ::   ztrds             ! 3D workspace 
    8586      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zwt, zws, ztrdt   ! 3D workspace 
     
    8990         IF( trd_tra_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_tra : unable to allocate arrays' ) 
    9091      ENDIF 
    91  
     92      ! 
     93      i01 = COUNT( (/ PRESENT(pun) .OR. ( ktrd /= jptra_xad .AND. ktrd /= jptra_yad .AND. ktrd /= jptra_zad ) /) ) 
     94      ! 
    9295      IF( ctype == 'TRA' .AND. ktra == jp_tem ) THEN   !==  Temperature trend  ==! 
    9396         ! 
    94          SELECT CASE( ktrd ) 
     97         SELECT CASE( ktrd*i01 ) 
    9598         !                            ! advection: transform the advective flux into a trend 
    9699         CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx )  
     
    111114      IF( ctype == 'TRA' .AND. ktra == jp_sal ) THEN      !==  Salinity trends  ==! 
    112115         ! 
    113          SELECT CASE( ktrd ) 
     116         SELECT CASE( ktrd*i01 ) 
    114117         !                            ! advection: transform the advective flux into a trend 
    115118         !                            !            and send T & S trends to trd_tra_mng 
     
    162165      IF( ctype == 'TRC' ) THEN                           !==  passive tracer trend  ==! 
    163166         ! 
    164          SELECT CASE( ktrd ) 
     167         SELECT CASE( ktrd*i01 ) 
    165168         !                            ! advection: transform the advective flux into a masked trend 
    166169         CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd , pun , ptra, 'X', ztrds )  
Note: See TracChangeset for help on using the changeset viewer.