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 15510 for NEMO/branches/2021 – NEMO

Changeset 15510 for NEMO/branches/2021


Ignore:
Timestamp:
2021-11-15T16:33:37+01:00 (3 years ago)
Author:
techene
Message:

#2715 RK3 & TOP: musl adv scheme is only called at stage 3

Location:
NEMO/branches/2021/dev_r14318_RK3_stage1/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14318_RK3_stage1/src/OCE/stprk3_stg.F90

    r15373 r15510  
    208208      !                       !==  Passive Tracer  ==! 
    209209      ! 
    210       IF( kstg == 1 ) THEN 
    211          CALL trc_stp_start( kstp, Kbb, Kmm, Krhs, Kaa ) 
    212       ENDIF 
    213       ! 
    214       DO jn = 1, jptra 
    215          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    216             tr(ji,jj,jk,jn,Krhs) = 0._wp                              ! set tracer trends to zero 
    217          END_3D 
    218       END DO 
    219       !                                         !==  advection of passive tracers  ==! 
    220       rDt_trc = rDt 
    221 !!st 
    222       CALL trc_sbc_RK3( kstp,      Kmm, tr, Krhs, kstg )              ! surface boundary condition 
    223       ! 
    224       CALL trc_adv    ( kstp, Kbb, Kmm, tr, Krhs, zaU, zaV, ww )      ! horizontal & vertical advection 
    225       ! 
    226       ! 
    227210      SELECT CASE( kstg ) 
    228211      !                    !-------------------! 
     
    230213         !                 !-------------------!   stg2:  Kbb = N  ;  Kmm = N+1/3  ;  Kaa = N+1/2 
    231214         ! 
    232          !                                      !==  time integration  ==!   ∆t = rn_Dt/3 (stg1) or rn_Dt/2 (stg2) 
    233          DO jn = 1, jptra 
    234             DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     215         IF( kstg == 1 ) THEN 
     216            CALL trc_stp_start( kstp, Kbb, Kmm, Krhs, Kaa ) 
     217         ENDIF 
     218         ! 
     219         IF(.NOT. ln_trcadv_mus ) THEN 
     220            ! 
     221            DO jn = 1, jptra 
     222               DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     223               tr(ji,jj,jk,jn,Krhs) = 0._wp                              ! set tracer trends to zero 
     224               END_3D 
     225            END DO 
     226            !                                      !==  advection of passive tracers  ==! 
     227            rDt_trc = rDt 
     228            ! 
     229            CALL trc_sbc_RK3( kstp,      Kmm, tr, Krhs, kstg )              ! surface boundary condition 
     230            ! 
     231            CALL trc_adv    ( kstp, Kbb, Kmm, tr, Krhs, zaU, zaV, ww )      ! horizontal & vertical advection 
     232            ! 
     233            !                                      !==  time integration  ==!   ∆t = rn_Dt/3 (stg1) or rn_Dt/2 (stg2) 
     234            DO jn = 1, jptra 
     235               DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    235236               ze3Tb = e3t(ji,jj,jk,Kbb) * tr(ji,jj,jk,jn,Kbb ) 
    236237               ze3Tr = e3t(ji,jj,jk,Kmm) * tr(ji,jj,jk,jn,Krhs) 
    237238               z1_e3t= 1._wp / e3t(ji,jj,jk, Kaa) 
    238239               tr(ji,jj,jk,jn,Kaa) = ( ze3Tb + rDt * ze3Tr*tmask(ji,jj,jk) ) * z1_e3t 
     240               END_3D 
     241            END DO 
     242            ! 
     243         ENDIF 
     244         !                 !---------------! 
     245      CASE ( 3 )           !==  Stage 3  ==!   add all RHS terms but advection (=> Kbb only) 
     246         !                 !---------------! 
     247         ! 
     248         DO jn = 1, jptra 
     249            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     250            tr(ji,jj,jk,jn,Krhs) = 0._wp                              ! set tracer trends to zero 
    239251            END_3D 
    240252         END DO 
    241          !                 !---------------! 
    242       CASE ( 3 )           !==  Stage 3  ==!   add all RHS terms but advection (=> Kbb only) 
    243          !                 !---------------! 
     253         !                                         !==  advection of passive tracers  ==! 
     254         rDt_trc = rDt 
     255         ! 
     256         CALL trc_sbc_RK3( kstp,      Kmm, tr, Krhs, kstg )              ! surface boundary condition 
     257         ! 
     258         CALL trc_adv    ( kstp, Kbb, Kmm, tr, Krhs, zaU, zaV, ww )      ! horizontal & vertical advection 
     259         ! 
    244260         CALL trc_sms    ( kstp, Kbb, Kbb, Krhs      )       ! tracers: sinks and sources 
    245261         CALL trc_trp    ( kstp, Kbb, Kmm, Krhs, Kaa )       ! transport of passive tracers (without advection) 
     
    262278!===>>> CAUTION here may be without GM velocity but stokes drift required ! 0 barotropic divergence for GM  != 0 barotropic divergence for SD  
    263279!!st consistence 2D / 3D - flux de masse  
    264       CALL tra_adv( kstp, Kbb, Kmm, ts, Krhs, zaU, zaV, ww )       ! hor. + vert. advection  ==> RHS 
     280      CALL tra_adv( kstp, Kbb, Kmm, ts, Krhs, zaU, zaV, ww, kstg )       ! hor. + vert. advection  ==> RHS 
    265281 
    266282!===>>>>>> stg1&2:  Verify the necessity of these trends (we may need it as there are in the RHS of dynspg_ts ?) 
  • NEMO/branches/2021/dev_r14318_RK3_stage1/src/TOP/TRP/trcadv.F90

    r15188 r15510  
    4848   LOGICAL ::   ln_trcadv_fct    ! FCT scheme flag 
    4949   INTEGER ::      nn_fct_h, nn_fct_v   ! =2/4 : horizontal and vertical choices of the order of FCT scheme 
    50    LOGICAL ::   ln_trcadv_mus    ! MUSCL scheme flag 
     50   LOGICAL, PUBLIC ::   ln_trcadv_mus    ! MUSCL scheme flag 
    5151   LOGICAL ::      ln_mus_ups           ! use upstream scheme in vivcinity of river mouths 
    5252   LOGICAL ::   ln_trcadv_ubs    ! UBS scheme flag 
Note: See TracChangeset for help on using the changeset viewer.