1 | MODULE traadv |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE traadv *** |
---|
4 | !! Ocean active tracers: advection trend |
---|
5 | !!============================================================================== |
---|
6 | !! History : 2.0 ! 2005-11 (G. Madec) Original code |
---|
7 | !! 3.3 ! 2010-09 (C. Ethe, G. Madec) merge TRC-TRA + switch from velocity to transport |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! tra_adv : compute ocean tracer advection trend |
---|
12 | !! tra_adv_ctl : control the different options of advection scheme |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | USE oce ! ocean dynamics and active tracers |
---|
15 | USE dom_oce ! ocean space and time domain |
---|
16 | USE traadv_cen2 ! 2nd order centered scheme (tra_adv_cen2 routine) |
---|
17 | USE traadv_tvd ! TVD scheme (tra_adv_tvd routine) |
---|
18 | USE traadv_muscl ! MUSCL scheme (tra_adv_muscl routine) |
---|
19 | USE traadv_muscl2 ! MUSCL2 scheme (tra_adv_muscl2 routine) |
---|
20 | USE traadv_ubs ! UBS scheme (tra_adv_ubs routine) |
---|
21 | USE traadv_qck ! QUICKEST scheme (tra_adv_qck routine) |
---|
22 | USE traadv_eiv ! eddy induced velocity (tra_adv_eiv routine) |
---|
23 | USE cla ! cross land advection (cla_traadv routine) |
---|
24 | USE ldftra_oce ! lateral diffusion coefficient on tracers |
---|
25 | USE in_out_manager ! I/O manager |
---|
26 | USE prtctl ! Print control |
---|
27 | USE iom |
---|
28 | |
---|
29 | IMPLICIT NONE |
---|
30 | PRIVATE |
---|
31 | |
---|
32 | PUBLIC tra_adv ! routine called by step module |
---|
33 | PUBLIC tra_adv_init ! routine called by opa module |
---|
34 | |
---|
35 | ! !!* Namelist namtra_adv * |
---|
36 | LOGICAL :: ln_traadv_cen2 = .TRUE. ! 2nd order centered scheme flag |
---|
37 | LOGICAL :: ln_traadv_tvd = .FALSE. ! TVD scheme flag |
---|
38 | LOGICAL :: ln_traadv_muscl = .FALSE. ! MUSCL scheme flag |
---|
39 | LOGICAL :: ln_traadv_muscl2 = .FALSE. ! MUSCL2 scheme flag |
---|
40 | LOGICAL :: ln_traadv_ubs = .FALSE. ! UBS scheme flag |
---|
41 | LOGICAL :: ln_traadv_qck = .FALSE. ! QUICKEST scheme flag |
---|
42 | |
---|
43 | INTEGER :: nadv ! choice of the type of advection scheme |
---|
44 | |
---|
45 | REAL(wp), DIMENSION(jpk) :: r2dt ! vertical profile time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 |
---|
46 | |
---|
47 | !! * Substitutions |
---|
48 | # include "domzgr_substitute.h90" |
---|
49 | # include "vectopt_loop_substitute.h90" |
---|
50 | !!---------------------------------------------------------------------- |
---|
51 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
52 | !! $Id$ |
---|
53 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
54 | !!---------------------------------------------------------------------- |
---|
55 | CONTAINS |
---|
56 | |
---|
57 | SUBROUTINE tra_adv( kt ) |
---|
58 | !!---------------------------------------------------------------------- |
---|
59 | !! *** ROUTINE tra_adv *** |
---|
60 | !! |
---|
61 | !! ** Purpose : compute the ocean tracer advection trend. |
---|
62 | !! |
---|
63 | !! ** Method : - Update (ua,va) with the advection term following nadv |
---|
64 | !!---------------------------------------------------------------------- |
---|
65 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
66 | ! |
---|
67 | INTEGER :: jk ! dummy loop index |
---|
68 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zun, zvn, zwn ! 3D workspace: effective transport |
---|
69 | !!---------------------------------------------------------------------- |
---|
70 | ! ! set time step |
---|
71 | IF( neuler == 0 .AND. kt == nit000 ) THEN ! at nit000 |
---|
72 | r2dt(:) = rdttra(:) ! = rdtra (restarting with Euler time stepping) |
---|
73 | ELSEIF( kt <= nit000 + 1) THEN ! at nit000 or nit000+1 |
---|
74 | r2dt(:) = 2. * rdttra(:) ! = 2 rdttra (leapfrog) |
---|
75 | ENDIF |
---|
76 | ! |
---|
77 | IF( nn_cla == 1 ) CALL cla_traadv( kt ) !== Cross Land Advection ==! (hor. advection) |
---|
78 | ! |
---|
79 | ! !== effective transport ==! |
---|
80 | DO jk = 1, jpkm1 |
---|
81 | zun(:,:,jk) = e2u(:,:) * fse3u(:,:,jk) * un(:,:,jk) ! eulerian transport only |
---|
82 | zvn(:,:,jk) = e1v(:,:) * fse3v(:,:,jk) * vn(:,:,jk) |
---|
83 | zwn(:,:,jk) = e1t(:,:) * e2t(:,:) * wn(:,:,jk) |
---|
84 | END DO |
---|
85 | zun(:,:,jpk) = 0._wp ! no transport trough the bottom |
---|
86 | zvn(:,:,jpk) = 0._wp ! no transport trough the bottom |
---|
87 | zwn(:,:,jpk) = 0._wp ! no transport trough the bottom |
---|
88 | ! |
---|
89 | IF( lk_traldf_eiv .AND. .NOT. ln_traldf_grif ) & |
---|
90 | & CALL tra_adv_eiv( kt, zun, zvn, zwn, 'TRA' ) ! add the eiv transport (if necessary) |
---|
91 | ! |
---|
92 | CALL iom_put( "uoce_eff", zun ) ! output effective transport |
---|
93 | CALL iom_put( "voce_eff", zvn ) |
---|
94 | CALL iom_put( "woce_eff", zwn ) |
---|
95 | |
---|
96 | SELECT CASE ( nadv ) !== compute advection trend and add it to general trend ==! |
---|
97 | CASE ( 1 ) ; CALL tra_adv_cen2 ( kt, 'TRA', zun, zvn, zwn, tsb, tsn, tsa, jpts ) ! 2nd order centered |
---|
98 | CASE ( 2 ) ; CALL tra_adv_tvd ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) ! TVD |
---|
99 | CASE ( 3 ) ; CALL tra_adv_muscl ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsa, jpts ) ! MUSCL |
---|
100 | CASE ( 4 ) ; CALL tra_adv_muscl2( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) ! MUSCL2 |
---|
101 | CASE ( 5 ) ; CALL tra_adv_ubs ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) ! UBS |
---|
102 | CASE ( 6 ) ; CALL tra_adv_qck ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) ! QUICKEST |
---|
103 | ! |
---|
104 | CASE (-1 ) !== esopa: test all possibility with control print ==! |
---|
105 | CALL tra_adv_cen2 ( kt, 'TRA', zun, zvn, zwn, tsb, tsn, tsa, jpts ) |
---|
106 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv0 - Ta: ', mask1=tmask, & |
---|
107 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
108 | CALL tra_adv_tvd ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) |
---|
109 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv1 - Ta: ', mask1=tmask, & |
---|
110 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
111 | CALL tra_adv_muscl ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsa, jpts ) |
---|
112 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv3 - Ta: ', mask1=tmask, & |
---|
113 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
114 | CALL tra_adv_muscl2( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) |
---|
115 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv4 - Ta: ', mask1=tmask, & |
---|
116 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
117 | CALL tra_adv_ubs ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) |
---|
118 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv5 - Ta: ', mask1=tmask, & |
---|
119 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
120 | CALL tra_adv_qck ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts ) |
---|
121 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv6 - Ta: ', mask1=tmask, & |
---|
122 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
123 | END SELECT |
---|
124 | ! |
---|
125 | ! ! print mean trends (used for debugging) |
---|
126 | IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv - Ta: ', mask1=tmask, & |
---|
127 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
128 | ! |
---|
129 | END SUBROUTINE tra_adv |
---|
130 | |
---|
131 | |
---|
132 | SUBROUTINE tra_adv_init |
---|
133 | !!--------------------------------------------------------------------- |
---|
134 | !! *** ROUTINE tra_adv_init *** |
---|
135 | !! |
---|
136 | !! ** Purpose : Control the consistency between namelist options for |
---|
137 | !! tracer advection schemes and set nadv |
---|
138 | !!---------------------------------------------------------------------- |
---|
139 | INTEGER :: ioptio |
---|
140 | !! |
---|
141 | NAMELIST/namtra_adv/ ln_traadv_cen2 , ln_traadv_tvd, & |
---|
142 | & ln_traadv_muscl, ln_traadv_muscl2, & |
---|
143 | & ln_traadv_ubs , ln_traadv_qck |
---|
144 | !!---------------------------------------------------------------------- |
---|
145 | |
---|
146 | REWIND ( numnam ) ! Read Namelist namtra_adv : tracer advection scheme |
---|
147 | READ ( numnam, namtra_adv ) |
---|
148 | |
---|
149 | IF(lwp) THEN ! Namelist print |
---|
150 | WRITE(numout,*) |
---|
151 | WRITE(numout,*) 'tra_adv_init : choice/control of the tracer advection scheme' |
---|
152 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
153 | WRITE(numout,*) ' Namelist namtra_adv : chose a advection scheme for tracers' |
---|
154 | WRITE(numout,*) ' 2nd order advection scheme ln_traadv_cen2 = ', ln_traadv_cen2 |
---|
155 | WRITE(numout,*) ' TVD advection scheme ln_traadv_tvd = ', ln_traadv_tvd |
---|
156 | WRITE(numout,*) ' MUSCL advection scheme ln_traadv_muscl = ', ln_traadv_muscl |
---|
157 | WRITE(numout,*) ' MUSCL2 advection scheme ln_traadv_muscl2 = ', ln_traadv_muscl2 |
---|
158 | WRITE(numout,*) ' UBS advection scheme ln_traadv_ubs = ', ln_traadv_ubs |
---|
159 | WRITE(numout,*) ' QUICKEST advection scheme ln_traadv_qck = ', ln_traadv_qck |
---|
160 | ENDIF |
---|
161 | |
---|
162 | ioptio = 0 ! Parameter control |
---|
163 | IF( ln_traadv_cen2 ) ioptio = ioptio + 1 |
---|
164 | IF( ln_traadv_tvd ) ioptio = ioptio + 1 |
---|
165 | IF( ln_traadv_muscl ) ioptio = ioptio + 1 |
---|
166 | IF( ln_traadv_muscl2 ) ioptio = ioptio + 1 |
---|
167 | IF( ln_traadv_ubs ) ioptio = ioptio + 1 |
---|
168 | IF( ln_traadv_qck ) ioptio = ioptio + 1 |
---|
169 | IF( lk_esopa ) ioptio = 1 |
---|
170 | |
---|
171 | IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE advection scheme in namelist namtra_adv' ) |
---|
172 | |
---|
173 | ! ! Set nadv |
---|
174 | IF( ln_traadv_cen2 ) nadv = 1 |
---|
175 | IF( ln_traadv_tvd ) nadv = 2 |
---|
176 | IF( ln_traadv_muscl ) nadv = 3 |
---|
177 | IF( ln_traadv_muscl2 ) nadv = 4 |
---|
178 | IF( ln_traadv_ubs ) nadv = 5 |
---|
179 | IF( ln_traadv_qck ) nadv = 6 |
---|
180 | IF( lk_esopa ) nadv = -1 |
---|
181 | |
---|
182 | IF(lwp) THEN ! Print the choice |
---|
183 | WRITE(numout,*) |
---|
184 | IF( nadv == 1 ) WRITE(numout,*) ' 2nd order scheme is used' |
---|
185 | IF( nadv == 2 ) WRITE(numout,*) ' TVD scheme is used' |
---|
186 | IF( nadv == 3 ) WRITE(numout,*) ' MUSCL scheme is used' |
---|
187 | IF( nadv == 4 ) WRITE(numout,*) ' MUSCL2 scheme is used' |
---|
188 | IF( nadv == 5 ) WRITE(numout,*) ' UBS scheme is used' |
---|
189 | IF( nadv == 6 ) WRITE(numout,*) ' QUICKEST scheme is used' |
---|
190 | IF( nadv == -1 ) WRITE(numout,*) ' esopa test: use all advection scheme' |
---|
191 | ENDIF |
---|
192 | ! |
---|
193 | END SUBROUTINE tra_adv_init |
---|
194 | |
---|
195 | !!====================================================================== |
---|
196 | END MODULE traadv |
---|