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

source: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/TRP/trctrp.F90 @ 11434

Last change on this file since 11434 was 11434, checked in by davestorkey, 5 years ago

dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap :
Bug fix for trctrp.F90 and rewrite of trcrad.F90.
This version passes all SETTE tests involving PISCES, but fails the following idealised tests at this stage:
ISOMIP, OVERFLOW, LOCK_EXCHANGE.

  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1MODULE trctrp
2   !!======================================================================
3   !!                       ***  MODULE trctrp  ***
4   !! Ocean Physics    : manage the passive tracer transport
5   !!======================================================================
6   !! History :   1.0  !  2004-03 (C. Ethe) Original code
7   !!             3.3  !  2010-07 (C. Ethe) Merge TRA-TRC
8   !!----------------------------------------------------------------------
9#if defined key_top
10   !!----------------------------------------------------------------------
11   !!   'key_top'                                                TOP models
12   !!----------------------------------------------------------------------
13   !!   trc_trp        : passive tracer transport
14   !!----------------------------------------------------------------------
15   USE oce_trc         ! ocean dynamics and active tracers variables
16   USE trc             ! ocean passive tracers variables
17   USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
18   USE trcdmp          ! internal damping                    (trc_dmp routine)
19   USE trcldf          ! lateral mixing                      (trc_ldf routine)
20   USE trcadv          ! advection                           (trc_adv routine)
21   USE trczdf          ! vertical diffusion                  (trc_zdf routine)
22   USE trcatf          ! time filtering                      (trc_atf routine)
23   USE trcrad          ! positivity                          (trc_rad routine)
24   USE trcsbc          ! surface boundary condition          (trc_sbc routine)
25   USE zpshde          ! partial step: hor. derivative       (zps_hde routine)
26   USE bdy_oce   , ONLY: ln_bdy
27   USE trcbdy          ! BDY open boundaries
28
29#if defined key_agrif
30   USE agrif_top_sponge ! tracers sponges
31#endif
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   trc_trp    ! called by trc_stp
37
38   !!----------------------------------------------------------------------
39   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
40   !! $Id$
41   !! Software governed by the CeCILL license (see ./LICENSE)
42   !!----------------------------------------------------------------------
43
44CONTAINS
45
46   SUBROUTINE trc_trp( kt, Kbb, Kmm, Krhs, Kaa )
47      !!----------------------------------------------------------------------
48      !!                     ***  ROUTINE trc_trp  ***
49      !!                     
50      !! ** Purpose :   Management of passive tracers transport
51      !!
52      !! ** Method  : - Compute the passive tracers trends
53      !!              - Update the passive tracers
54      !!----------------------------------------------------------------------
55      INTEGER, INTENT( in    ) :: kt                  ! ocean time-step index
56      INTEGER, INTENT( inout ) :: Kbb, Kmm, Krhs, Kaa ! TOP time level indices (swapped in this routine)
57      !! ---------------------------------------------------------------------
58      !
59      IF( ln_timing )   CALL timing_start('trc_trp')
60      !
61      IF( .NOT. lk_c1d ) THEN
62         !
63                                CALL trc_sbc    ( kt,      Kmm, tr, Krhs )  ! surface boundary condition
64         IF( ln_trabbl )        CALL trc_bbl    ( kt, Kbb, Kmm, tr, Krhs )  ! advective (and/or diffusive) bottom boundary layer scheme
65         IF( ln_trcdmp )        CALL trc_dmp    ( kt, Kbb, Kmm, tr, Krhs )  ! internal damping trends
66         IF( ln_bdy )           CALL trc_bdy_dmp( kt, Kbb,      Krhs )      ! BDY damping trends
67                                CALL trc_adv    ( kt, Kbb, Kmm, tr, Krhs )  ! horizontal & vertical advection
68         !                                                             ! Partial top/bottom cell: GRADh( tr(Kbb) ) 
69         IF( ln_zps ) THEN
70           IF( ln_isfcav ) THEN ; CALL zps_hde_isf( kt, Kmm, jptra, tr(:,:,:,:,Kbb), pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! both top & bottom
71           ELSE                 ; CALL zps_hde    ( kt, Kmm, jptra, tr(:,:,:,:,Kbb), gtru, gtrv )                                      !  only bottom
72           ENDIF
73         ENDIF
74         !                                                     
75                                CALL trc_ldf    ( kt, Kbb, Kmm,       tr, Krhs )  ! lateral mixing
76#if defined key_agrif
77         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc       ! tracers sponge
78#endif
79                                CALL trc_zdf    ( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer   ==> after
80                                CALL trc_atf    ( kt, Kbb, Kmm, Kaa , tr )        ! time filtering of "now" tracer fields   
81         !
82         ! Swap TOP time levels (= Nrhs_trc, Nbb_trc etc)
83         Krhs = Kbb
84         Kbb = Kmm
85         Kmm = Kaa
86         Kaa = Krhs
87         !
88         IF( ln_trcrad )        CALL trc_rad    ( kt, Kbb, Kmm, tr       )    ! Correct artificial negative concentrations
89         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt, Kbb, Kmm )              ! internal damping trends on closed seas only
90
91         !
92      ELSE                                               ! 1D vertical configuration
93                                CALL trc_sbc( kt,      Kmm,       tr, Krhs )  ! surface boundary condition
94         IF( ln_trcdmp )        CALL trc_dmp( kt, Kbb, Kmm,       tr, Krhs )  ! internal damping trends
95                                CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer ==> after
96                                CALL trc_atf( kt, Kbb, Kmm, Kaa , tr )        ! time filtering of "now" tracer fields
97         !
98         ! Swap TOP time levels (= Nrhs_trc, Nbb_trc etc)
99         Krhs = Kbb
100         Kbb = Kmm
101         Kmm = Kaa
102         Kaa = Krhs
103         !
104         IF( ln_trcrad )       CALL trc_rad( kt, Kbb, Kmm, tr       )  ! Correct artificial negative concentrations
105         !
106      END IF
107      !
108      IF( ln_timing )   CALL timing_stop('trc_trp')
109      !
110   END SUBROUTINE trc_trp
111
112#else
113   !!----------------------------------------------------------------------
114   !!   Dummy module :                                        No TOP models
115   !!----------------------------------------------------------------------
116CONTAINS
117   SUBROUTINE trc_trp( kt )              ! Empty routine
118      INTEGER, INTENT(in) ::   kt
119      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kt
120   END SUBROUTINE trc_trp
121#endif
122   
123   !!======================================================================
124END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.