1 | MODULE 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 | !! 4.x ! 2021-08 (S. Techene, G. Madec) Adapt for RK3 time-stepping |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | #if defined key_top |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | !! 'key_top' TOP models |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | !! trc_trp : passive tracer transport |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | USE par_trc ! need jptra, number of passive tracers |
---|
17 | USE oce_trc ! ocean dynamics and active tracers variables |
---|
18 | USE trc ! ocean passive tracers variables |
---|
19 | USE trcbbl ! bottom boundary layer (trc_bbl routine) |
---|
20 | USE trcdmp ! internal damping (trc_dmp routine) |
---|
21 | USE trcldf ! lateral mixing (trc_ldf routine) |
---|
22 | USE trcadv ! advection (trc_adv routine) |
---|
23 | USE trczdf ! vertical diffusion (trc_zdf routine) |
---|
24 | USE trcatf ! time filtering (trc_atf routine) |
---|
25 | USE trcrad ! positivity (trc_rad routine) |
---|
26 | USE trcsbc ! surface boundary condition (trc_sbc routine) |
---|
27 | USE trcbc ! Tracers boundary condtions ( trc_bc routine) |
---|
28 | USE trcais ! Antarctic Ice Sheet tracers (trc_ais routine) |
---|
29 | USE zpshde ! partial step: hor. derivative (zps_hde routine) |
---|
30 | USE bdy_oce , ONLY: ln_bdy |
---|
31 | USE trcbdy ! BDY open boundaries |
---|
32 | USE in_out_manager |
---|
33 | |
---|
34 | #if defined key_agrif |
---|
35 | USE agrif_top_sponge ! tracers sponges |
---|
36 | #endif |
---|
37 | |
---|
38 | IMPLICIT NONE |
---|
39 | PRIVATE |
---|
40 | |
---|
41 | PUBLIC trc_trp ! called by trc_stp and stprk3_stg |
---|
42 | |
---|
43 | !!---------------------------------------------------------------------- |
---|
44 | !! NEMO/TOP 4.0 , NEMO Consortium (2018) |
---|
45 | !! $Id$ |
---|
46 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
47 | !!---------------------------------------------------------------------- |
---|
48 | |
---|
49 | CONTAINS |
---|
50 | |
---|
51 | SUBROUTINE trc_trp( kt, Kbb, Kmm, Krhs, Kaa ) |
---|
52 | !!---------------------------------------------------------------------- |
---|
53 | !! *** ROUTINE trc_trp *** |
---|
54 | !! |
---|
55 | !! ** Purpose : Management of passive tracers transport |
---|
56 | !! |
---|
57 | !! ** Method : - Compute the passive tracers trends |
---|
58 | !! - Update the passive tracers |
---|
59 | !!---------------------------------------------------------------------- |
---|
60 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
61 | INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs, Kaa ! time level indices (not swapped in this routine) |
---|
62 | !! --------------------------------------------------------------------- |
---|
63 | ! |
---|
64 | IF( ln_timing ) CALL timing_start('trc_trp') |
---|
65 | ! |
---|
66 | IF( .NOT. lk_c1d ) THEN |
---|
67 | ! |
---|
68 | ! ! Partial top/bottom cell: GRADh( trb ) |
---|
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_sbc ( kt, Kmm, tr, Krhs ) ! surface boundary condition |
---|
76 | IF( ln_trcbc .AND. lltrcbc .AND. kt /= nit000 ) & |
---|
77 | CALL trc_bc ( kt, Kmm, tr, Krhs ) ! tracers: surface and lateral Boundary Conditions |
---|
78 | IF( ln_trcais ) CALL trc_ais ( kt, Kmm, tr, Krhs ) ! tracers from Antarctic Ice Sheet (icb, isf) |
---|
79 | IF( ln_trabbl ) CALL trc_bbl ( kt, Kbb, Kmm, tr, Krhs ) ! advective (and/or diffusive) bottom boundary layer scheme |
---|
80 | IF( ln_trcdmp ) CALL trc_dmp ( kt, Kbb, Kmm, tr, Krhs ) ! internal damping trends |
---|
81 | IF( ln_bdy ) CALL trc_bdy_dmp( kt, Kbb, Krhs ) ! BDY damping trends |
---|
82 | #if defined key_agrif |
---|
83 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc ! tracers sponge |
---|
84 | #endif |
---|
85 | #if ! defined key_RK3 |
---|
86 | ! ! MLF only: add the advection trend to the RHS |
---|
87 | CALL trc_adv ( kt, Kbb, Kmm, tr, Krhs ) ! horizontal & vertical advection |
---|
88 | #endif |
---|
89 | CALL trc_ldf ( kt, Kbb, Kmm, tr, Krhs ) ! lateral mixing |
---|
90 | CALL trc_zdf ( kt, Kbb, Kmm, Krhs, tr, Kaa ) ! vert. mixing & after tracer ==> after |
---|
91 | #if defined key_RK3 |
---|
92 | ! ! RK3: only manage lateral boundary |
---|
93 | # if defined key_agrif |
---|
94 | CALL Agrif_trc ( kt ) ! AGRIF zoom boundaries |
---|
95 | # endif |
---|
96 | ! ! Update after tracer on domain lateral boundaries |
---|
97 | CALL lbc_lnk( 'stprk3_stg', tr(:,:,:,:,Kaa), 'T', 1._wp ) |
---|
98 | ! |
---|
99 | IF( ln_bdy ) CALL trc_bdy ( kt, Kbb, Kmm, Kaa ) |
---|
100 | #else |
---|
101 | ! ! MLF: apply Asselin time filter and manage lateral boundary |
---|
102 | CALL trc_atf ( kt, Kbb, Kmm, Kaa , tr ) ! time filtering of "now" tracer fields |
---|
103 | #endif |
---|
104 | ! |
---|
105 | ! Subsequent calls use the filtered values: Kmm and Kaa |
---|
106 | ! These are used explicitly here since time levels will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp |
---|
107 | ! |
---|
108 | IF( ln_trcrad ) CALL trc_rad ( kt, Kmm, Kaa, tr ) ! Correct artificial negative concentrations |
---|
109 | IF( ln_trcdmp_clo ) CALL trc_dmp_clo( kt, Kmm, Kaa ) ! internal damping trends on closed seas only |
---|
110 | |
---|
111 | ! |
---|
112 | ELSE ! 1D vertical configuration |
---|
113 | CALL trc_sbc( kt, Kmm, tr, Krhs ) ! surface boundary condition |
---|
114 | IF( ln_trcdmp ) CALL trc_dmp( kt, Kbb, Kmm, tr, Krhs ) ! internal damping trends |
---|
115 | CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa ) ! vert. mixing & after tracer ==> after |
---|
116 | CALL trc_atf( kt, Kbb, Kmm, Kaa , tr ) ! time filtering of "now" tracer fields |
---|
117 | ! |
---|
118 | ! Subsequent calls use the filtered values: Kmm and Kaa |
---|
119 | ! These are used explicitly here since time levels will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp |
---|
120 | ! |
---|
121 | IF( ln_trcrad ) CALL trc_rad( kt, Kmm, Kaa, tr ) ! Correct artificial negative concentrations |
---|
122 | ! |
---|
123 | END IF |
---|
124 | ! |
---|
125 | IF( ln_timing ) CALL timing_stop('trc_trp') |
---|
126 | ! |
---|
127 | END SUBROUTINE trc_trp |
---|
128 | |
---|
129 | #else |
---|
130 | !!---------------------------------------------------------------------- |
---|
131 | !! Dummy module : No TOP models |
---|
132 | !!---------------------------------------------------------------------- |
---|
133 | CONTAINS |
---|
134 | SUBROUTINE trc_trp( kt ) ! Empty routine |
---|
135 | INTEGER, INTENT(in) :: kt |
---|
136 | WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kt |
---|
137 | END SUBROUTINE trc_trp |
---|
138 | #endif |
---|
139 | |
---|
140 | !!====================================================================== |
---|
141 | END MODULE trctrp |
---|