source: CONFIG/UNIFORM/v6/NEMO_v6.5/SOURCES/trctrp.F90 @ 6877

Last change on this file since 6877 was 6877, checked in by cetlod, 3 weeks ago

NEMOv6.5 : Bugfix to ensure NEMO-PISCES restartability

File size: 6.6 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 par_trc         ! need jptra, number of passive tracers
16   USE oce_trc         ! ocean dynamics and active tracers variables
17   USE trc             ! ocean passive tracers variables
18   USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
19   USE trcdmp          ! internal damping                    (trc_dmp routine)
20   USE trcldf          ! lateral mixing                      (trc_ldf routine)
21   USE trcadv          ! advection                           (trc_adv routine)
22   USE trczdf          ! vertical diffusion                  (trc_zdf routine)
23   USE trcatf          ! time filtering                      (trc_atf routine)
24   USE trcrad          ! positivity                          (trc_rad routine)
25   USE trcsbc          ! surface boundary condition          (trc_sbc routine)
26   USE trcbc           ! Tracers boundary condtions          ( trc_bc routine)
27   USE trcais          ! Antarctic Ice Sheet tracers         (trc_ais routine)
28   USE zpshde          ! partial step: hor. derivative       (zps_hde routine)
29   USE bdy_oce   , ONLY: ln_bdy
30   USE trcbdy          ! BDY open boundaries
31   USE in_out_manager
32
33#if defined key_agrif
34   USE agrif_top_sponge ! tracers sponges
35#endif
36
37   IMPLICIT NONE
38   PRIVATE
39
40   PUBLIC   trc_trp    ! called by trc_stp
41
42   !!----------------------------------------------------------------------
43   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
44   !! $Id: trctrp.F90 15023 2021-06-18 14:35:25Z gsamson $
45   !! Software governed by the CeCILL license (see ./LICENSE)
46   !!----------------------------------------------------------------------
47
48CONTAINS
49
50   SUBROUTINE trc_trp( kt, Kbb, Kmm, Krhs, Kaa )
51      !!----------------------------------------------------------------------
52      !!                     ***  ROUTINE trc_trp  ***
53      !!                     
54      !! ** Purpose :   Management of passive tracers transport
55      !!
56      !! ** Method  : - Compute the passive tracers trends
57      !!              - Update the passive tracers
58      !!----------------------------------------------------------------------
59      INTEGER, INTENT( in ) :: kt                  ! ocean time-step index
60      INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs, Kaa ! time level indices (not swapped in this routine)
61      !! ---------------------------------------------------------------------
62      !
63      IF( ln_timing )   CALL timing_start('trc_trp')
64      !
65      IF( .NOT. ln_c1d ) THEN
66         !
67         !                                                         ! Partial top/bottom cell: GRADh( trb ) 
68         IF( ln_zps ) THEN
69            IF( ln_isfcav ) THEN ; CALL zps_hde_isf( kt, jptra, tr(:,:,:,:,Kbb), pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! both top & bottom
70            ELSE                 ; CALL zps_hde    ( kt, jptra, tr(:,:,:,:,Kbb), gtru, gtrv )                                      !  only bottom
71            ENDIF
72         ENDIF
73         !
74                                CALL trc_sbc    ( kt,      Kmm, tr, Krhs )      ! surface boundary condition
75         IF( ln_trabbl )        CALL trc_bbl    ( kt, Kbb, Kmm, tr, Krhs )      ! advective (and/or diffusive) bottom boundary layer scheme
76         IF( ln_trcdmp )        CALL trc_dmp    ( kt, Kbb, Kmm, tr, Krhs )      ! internal damping trends
77         IF( ln_bdy )           CALL trc_bdy_dmp( kt, Kbb,      Krhs )      ! BDY damping trends
78#if defined key_agrif
79         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc       ! tracers sponge
80#endif
81                                CALL trc_adv    ( kt, Kbb, Kmm, tr, Krhs )      ! horizontal & vertical advection
82                                CALL trc_ldf    ( kt, Kbb, Kmm,       tr, Krhs )  ! lateral mixing
83                                CALL trc_zdf    ( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer ==> after
84                                CALL trc_atf    ( kt, Kbb, Kmm, Kaa , tr )        ! time filtering of "now" tracer fields   
85         !
86         ! Subsequent calls use the filtered values: Kmm and Kaa
87         ! These are used explicitly here since time levels will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp
88         !
89         IF( ln_trcrad )        CALL trc_rad    ( kt, Kmm, Kaa, tr       )    ! Correct artificial negative concentrations
90         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt, Kmm, Kaa )              ! internal damping trends on closed seas only
91
92         !
93      ELSE                                               ! 1D vertical configuration
94                                CALL trc_sbc( kt,      Kmm,       tr, Krhs )  ! surface boundary condition
95         IF( ln_trcdmp )        CALL trc_dmp( kt, Kbb, Kmm,       tr, Krhs )  ! internal damping trends
96                                CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer     ==> after
97                                CALL trc_atf( kt, Kbb, Kmm, Kaa , tr )        ! time filtering of "now" tracer fields
98         !
99         ! Subsequent calls use the filtered values: Kmm and Kaa
100         ! These are used explicitly here since time levels will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp
101         !
102         IF( ln_trcrad )       CALL trc_rad( kt, Kmm, Kaa, tr       )  ! Correct artificial negative concentrations
103         !
104      END IF
105      !
106      IF( ln_timing )   CALL timing_stop('trc_trp')
107      !
108   END SUBROUTINE trc_trp
109
110#else
111   !!----------------------------------------------------------------------
112   !!   Dummy module :                                        No TOP models
113   !!----------------------------------------------------------------------
114CONTAINS
115   SUBROUTINE trc_trp( kt )              ! Empty routine
116      INTEGER, INTENT(in) ::   kt
117      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kt
118   END SUBROUTINE trc_trp
119#endif
120   
121   !!======================================================================
122END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.