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 11427 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/TRP/trctrp.F90 – NEMO

Ignore:
Timestamp:
2019-08-09T15:44:20+02:00 (5 years ago)
Author:
davestorkey
Message:

dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap :
Restore independent time level indices for TOP in order to enable the option for
TOP to have a different timestep to OCE (nn_dttrc > 1). But note that this version of
the code only works for nn_dttrc=1. Also sort out the time-level swapping for OFF.
This commit passes the GYRE_PISCES and ORCA2_OFF_PISCES tests but fails restartability
and bit-comparison with the control for ORCA2_ICE_PISCES.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/TRP/trctrp.F90

    r11057 r11427  
    3636   PUBLIC   trc_trp    ! called by trc_stp 
    3737 
     38   INTEGER, SAVE :: N_save  !  Save value of time index for time swapping for ln_top_euler=.true. 
     39 
    3840   !!---------------------------------------------------------------------- 
    3941   !! NEMO/TOP 4.0 , NEMO Consortium (2018) 
     
    5355      !!              - Update the passive tracers 
    5456      !!---------------------------------------------------------------------- 
    55       INTEGER, INTENT( in ) :: kt                  ! ocean time-step index 
    56       INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs, Kaa ! time level indices 
     57      INTEGER, INTENT( in    ) :: kt                  ! ocean time-step index 
     58      INTEGER, INTENT( inout ) :: Kbb, Kmm, Krhs, Kaa ! TOP time level indices (swapped in this routine) 
    5759      !! --------------------------------------------------------------------- 
    5860      ! 
    5961      IF( ln_timing )   CALL timing_start('trc_trp') 
     62      ! 
     63      IF ( kt == nit000 ) N_save = Kbb 
    6064      ! 
    6165      IF( .NOT. lk_c1d ) THEN 
     
    7983                                CALL trc_zdf    ( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer   ==> after 
    8084                                CALL trc_atf    ( kt, Kbb, Kmm, Kaa , tr )        ! time filtering of "now" tracer fields     
    81          IF( ln_trcrad )        CALL trc_rad    ( kt, Kbb, Kmm, Krhs, tr       )  ! Correct artificial negative concentrations 
    82          IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt, Kbb, Kmm )                  ! internal damping trends on closed seas only 
     85         ! 
     86         ! Swap TOP time levels (= Nrhs_trc, Nbb_trc etc) 
     87         IF( ln_top_euler ) THEN 
     88            ! For Euler timestepping we need the "before" and "now" fields to be the same. 
     89            ! Use N_save to ensure that the indices stay in sync with the (leapfrogging) OCE time indices for nn_dttrc=1. 
     90            Krhs = N_save 
     91            N_save = Kmm 
     92            Kbb = Kaa 
     93         ELSE 
     94            Krhs = Kbb 
     95            Kbb = Kmm 
     96         ENDIF 
     97         Kmm = Kaa 
     98         Kaa = Krhs 
     99         ! 
     100         IF( ln_trcrad )        CALL trc_rad    ( kt, Kbb, Kmm, Krhs, tr   )    ! Correct artificial negative concentrations 
     101         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt, Kbb, Kmm )                ! internal damping trends on closed seas only 
    83102 
    84103         ! 
     
    88107                                CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer ==> after 
    89108                                CALL trc_atf( kt, Kbb, Kmm, Kaa , tr )        ! time filtering of "now" tracer fields 
    90           IF( ln_trcrad )       CALL trc_rad( kt, Kbb, Kmm, Krhs, tr       )  ! Correct artificial negative concentrations 
     109         ! 
     110         ! Swap TOP time levels (= Nrhs_trc, Nbb_trc etc) 
     111         Krhs = Kbb 
     112         Kbb = Kmm 
     113         Kmm = Kaa 
     114         Kaa = Krhs 
     115         ! 
     116         IF( ln_trcrad )       CALL trc_rad( kt, Kbb, Kmm, Krhs, tr       )  ! Correct artificial negative concentrations 
    91117         ! 
    92118      END IF 
Note: See TracChangeset for help on using the changeset viewer.