1 | MODULE dynatf |
---|
2 | !!========================================================================= |
---|
3 | !! *** MODULE dynatf *** |
---|
4 | !! Ocean dynamics: time filtering |
---|
5 | !!========================================================================= |
---|
6 | !! History : OPA ! 1987-02 (P. Andrich, D. L Hostis) Original code |
---|
7 | !! ! 1990-10 (C. Levy, G. Madec) |
---|
8 | !! 7.0 ! 1993-03 (M. Guyon) symetrical conditions |
---|
9 | !! 8.0 ! 1997-02 (G. Madec & M. Imbard) opa, release 8.0 |
---|
10 | !! 8.2 ! 1997-04 (A. Weaver) Euler forward step |
---|
11 | !! - ! 1997-06 (G. Madec) lateral boudary cond., lbc routine |
---|
12 | !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and module |
---|
13 | !! - ! 2002-10 (C. Talandier, A-M. Treguier) Open boundary cond. |
---|
14 | !! 2.0 ! 2005-11 (V. Garnier) Surface pressure gradient organization |
---|
15 | !! 2.3 ! 2007-07 (D. Storkey) Calls to BDY routines. |
---|
16 | !! 3.2 ! 2009-06 (G. Madec, R.Benshila) re-introduce the vvl option |
---|
17 | !! 3.3 ! 2010-09 (D. Storkey, E.O'Dea) Bug fix for BDY module |
---|
18 | !! 3.3 ! 2011-03 (P. Oddo) Bug fix for time-splitting+(BDY-OBC) and not VVL |
---|
19 | !! 3.5 ! 2013-07 (J. Chanut) Compliant with time splitting changes |
---|
20 | !! 3.6 ! 2014-04 (G. Madec) add the diagnostic of the time filter trends |
---|
21 | !! 3.7 ! 2015-11 (J. Chanut) Free surface simplification |
---|
22 | !! 4.1 ! 2019-08 (A. Coward, D. Storkey) Rename dynnxt.F90 -> dynatf.F90. Now just does time filtering. |
---|
23 | !!------------------------------------------------------------------------- |
---|
24 | |
---|
25 | !!---------------------------------------------------------------------------------------------- |
---|
26 | !! dyn_atf : apply Asselin time filtering to "now" velocities and vertical scale factors |
---|
27 | !!---------------------------------------------------------------------------------------------- |
---|
28 | USE oce ! ocean dynamics and tracers |
---|
29 | USE dom_oce ! ocean space and time domain |
---|
30 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
31 | USE sbcrnf ! river runoffs |
---|
32 | USE phycst ! physical constants |
---|
33 | USE dynadv ! dynamics: vector invariant versus flux form |
---|
34 | USE dynspg_ts ! surface pressure gradient: split-explicit scheme |
---|
35 | USE domvvl ! variable volume |
---|
36 | USE bdy_oce , ONLY: ln_bdy |
---|
37 | USE bdydta ! ocean open boundary conditions |
---|
38 | USE bdydyn ! ocean open boundary conditions |
---|
39 | USE bdyvol ! ocean open boundary condition (bdy_vol routines) |
---|
40 | USE trd_oce ! trends: ocean variables |
---|
41 | USE trddyn ! trend manager: dynamics |
---|
42 | USE trdken ! trend manager: kinetic energy |
---|
43 | USE isf_oce , ONLY: ln_isf ! ice shelf |
---|
44 | USE isfdynatf , ONLY: isf_dynatf ! ice shelf volume filter correction subroutine |
---|
45 | ! |
---|
46 | USE in_out_manager ! I/O manager |
---|
47 | USE iom ! I/O manager library |
---|
48 | USE lbclnk ! lateral boundary condition (or mpp link) |
---|
49 | USE lib_mpp ! MPP library |
---|
50 | USE prtctl ! Print control |
---|
51 | USE timing ! Timing |
---|
52 | #if defined key_agrif |
---|
53 | USE agrif_oce_interp |
---|
54 | #endif |
---|
55 | |
---|
56 | IMPLICIT NONE |
---|
57 | PRIVATE |
---|
58 | |
---|
59 | PUBLIC dyn_atf ! routine called by step.F90 |
---|
60 | |
---|
61 | #if defined key_qco |
---|
62 | !!---------------------------------------------------------------------- |
---|
63 | !! 'key_qco' EMPTY ROUTINE Quasi-Eulerian vertical coordonate |
---|
64 | !!---------------------------------------------------------------------- |
---|
65 | CONTAINS |
---|
66 | |
---|
67 | SUBROUTINE dyn_atf ( kt, Kbb, Kmm, Kaa, puu, pvv, pe3t, pe3u, pe3v ) |
---|
68 | INTEGER , INTENT(in ) :: kt ! ocean time-step index |
---|
69 | INTEGER , INTENT(in ) :: Kbb, Kmm, Kaa ! before and after time level indices |
---|
70 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! velocities to be time filtered |
---|
71 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: pe3t, pe3u, pe3v ! scale factors to be time filtered |
---|
72 | |
---|
73 | WRITE(*,*) 'dyn_atf: You should not have seen this print! error?', kt |
---|
74 | END SUBROUTINE dyn_atf |
---|
75 | |
---|
76 | #else |
---|
77 | |
---|
78 | !! * Substitutions |
---|
79 | # include "do_loop_substitute.h90" |
---|
80 | !!---------------------------------------------------------------------- |
---|
81 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
82 | !! $Id$ |
---|
83 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
84 | !!---------------------------------------------------------------------- |
---|
85 | CONTAINS |
---|
86 | |
---|
87 | SUBROUTINE dyn_atf ( kt, Kbb, Kmm, Kaa, puu, pvv, pe3t, pe3u, pe3v ) |
---|
88 | !!---------------------------------------------------------------------- |
---|
89 | !! *** ROUTINE dyn_atf *** |
---|
90 | !! |
---|
91 | !! ** Purpose : Finalize after horizontal velocity. Apply the boundary |
---|
92 | !! condition on the after velocity and apply the Asselin time |
---|
93 | !! filter to the now fields. |
---|
94 | !! |
---|
95 | !! ** Method : * Ensure after velocities transport matches time splitting |
---|
96 | !! estimate (ln_dynspg_ts=T) |
---|
97 | !! |
---|
98 | !! * Apply lateral boundary conditions on after velocity |
---|
99 | !! at the local domain boundaries through lbc_lnk call, |
---|
100 | !! at the one-way open boundaries (ln_bdy=T), |
---|
101 | !! at the AGRIF zoom boundaries (lk_agrif=T) |
---|
102 | !! |
---|
103 | !! * Apply the Asselin time filter to the now fields |
---|
104 | !! arrays to start the next time step: |
---|
105 | !! (puu(Kmm),pvv(Kmm)) = (puu(Kmm),pvv(Kmm)) |
---|
106 | !! + rn_atfp [ (puu(Kbb),pvv(Kbb)) + (puu(Kaa),pvv(Kaa)) - 2 (puu(Kmm),pvv(Kmm)) ] |
---|
107 | !! Note that with flux form advection and non linear free surface, |
---|
108 | !! the time filter is applied on thickness weighted velocity. |
---|
109 | !! As a result, dyn_atf MUST be called after tra_atf. |
---|
110 | !! |
---|
111 | !! ** Action : puu(Kmm),pvv(Kmm) filtered now horizontal velocity |
---|
112 | !!---------------------------------------------------------------------- |
---|
113 | INTEGER , INTENT(in ) :: kt ! ocean time-step index |
---|
114 | INTEGER , INTENT(in ) :: Kbb, Kmm, Kaa ! before and after time level indices |
---|
115 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! velocities to be time filtered |
---|
116 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: pe3t, pe3u, pe3v ! scale factors to be time filtered |
---|
117 | ! |
---|
118 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
119 | REAL(wp) :: zue3a, zue3n, zue3b, zcoef ! local scalars |
---|
120 | REAL(wp) :: zve3a, zve3n, zve3b, z1_2dt ! - - |
---|
121 | REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zue, zve, zwfld |
---|
122 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ze3t_f, ze3u_f, ze3v_f, zua, zva |
---|
123 | !!---------------------------------------------------------------------- |
---|
124 | ! |
---|
125 | IF( ln_timing ) CALL timing_start('dyn_atf') |
---|
126 | IF( ln_dynspg_ts ) ALLOCATE( zue(jpi,jpj) , zve(jpi,jpj) ) |
---|
127 | IF( l_trddyn ) ALLOCATE( zua(jpi,jpj,jpk) , zva(jpi,jpj,jpk) ) |
---|
128 | ! |
---|
129 | IF( kt == nit000 ) THEN |
---|
130 | IF(lwp) WRITE(numout,*) |
---|
131 | IF(lwp) WRITE(numout,*) 'dyn_atf : Asselin time filtering' |
---|
132 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
133 | ENDIF |
---|
134 | |
---|
135 | IF ( ln_dynspg_ts ) THEN |
---|
136 | ! Ensure below that barotropic velocities match time splitting estimate |
---|
137 | ! Compute actual transport and replace it with ts estimate at "after" time step |
---|
138 | zue(:,:) = pe3u(:,:,1,Kaa) * puu(:,:,1,Kaa) * umask(:,:,1) |
---|
139 | zve(:,:) = pe3v(:,:,1,Kaa) * pvv(:,:,1,Kaa) * vmask(:,:,1) |
---|
140 | DO jk = 2, jpkm1 |
---|
141 | zue(:,:) = zue(:,:) + pe3u(:,:,jk,Kaa) * puu(:,:,jk,Kaa) * umask(:,:,jk) |
---|
142 | zve(:,:) = zve(:,:) + pe3v(:,:,jk,Kaa) * pvv(:,:,jk,Kaa) * vmask(:,:,jk) |
---|
143 | END DO |
---|
144 | DO jk = 1, jpkm1 |
---|
145 | puu(:,:,jk,Kaa) = ( puu(:,:,jk,Kaa) - zue(:,:) * r1_hu(:,:,Kaa) + uu_b(:,:,Kaa) ) * umask(:,:,jk) |
---|
146 | pvv(:,:,jk,Kaa) = ( pvv(:,:,jk,Kaa) - zve(:,:) * r1_hv(:,:,Kaa) + vv_b(:,:,Kaa) ) * vmask(:,:,jk) |
---|
147 | END DO |
---|
148 | ! |
---|
149 | IF( .NOT.ln_bt_fw ) THEN |
---|
150 | ! Remove advective velocity from "now velocities" |
---|
151 | ! prior to asselin filtering |
---|
152 | ! In the forward case, this is done below after asselin filtering |
---|
153 | ! so that asselin contribution is removed at the same time |
---|
154 | DO jk = 1, jpkm1 |
---|
155 | puu(:,:,jk,Kmm) = ( puu(:,:,jk,Kmm) - un_adv(:,:)*r1_hu(:,:,Kmm) + uu_b(:,:,Kmm) )*umask(:,:,jk) |
---|
156 | pvv(:,:,jk,Kmm) = ( pvv(:,:,jk,Kmm) - vn_adv(:,:)*r1_hv(:,:,Kmm) + vv_b(:,:,Kmm) )*vmask(:,:,jk) |
---|
157 | END DO |
---|
158 | ENDIF |
---|
159 | ENDIF |
---|
160 | |
---|
161 | ! Update after velocity on domain lateral boundaries |
---|
162 | ! -------------------------------------------------- |
---|
163 | # if defined key_agrif |
---|
164 | CALL Agrif_dyn( kt ) !* AGRIF zoom boundaries |
---|
165 | # endif |
---|
166 | ! |
---|
167 | CALL lbc_lnk_multi( 'dynatf', puu(:,:,:,Kaa), 'U', -1., pvv(:,:,:,Kaa), 'V', -1. ) !* local domain boundaries |
---|
168 | ! |
---|
169 | ! !* BDY open boundaries |
---|
170 | IF( ln_bdy .AND. ln_dynspg_exp ) CALL bdy_dyn( kt, Kbb, puu, pvv, Kaa ) |
---|
171 | IF( ln_bdy .AND. ln_dynspg_ts ) CALL bdy_dyn( kt, Kbb, puu, pvv, Kaa, dyn3d_only=.true. ) |
---|
172 | |
---|
173 | !!$ Do we need a call to bdy_vol here?? |
---|
174 | ! |
---|
175 | IF( l_trddyn ) THEN ! prepare the atf trend computation + some diagnostics |
---|
176 | ! |
---|
177 | ! ! Kinetic energy and Conversion |
---|
178 | IF( ln_KE_trd ) CALL trd_dyn( puu(:,:,:,Kaa), pvv(:,:,:,Kaa), jpdyn_ken, kt, Kmm ) |
---|
179 | ! |
---|
180 | IF( ln_dyn_trd ) THEN ! 3D output: total momentum trends |
---|
181 | zua(:,:,:) = ( puu(:,:,:,Kaa) - puu(:,:,:,Kbb) ) * r1_Dt |
---|
182 | zva(:,:,:) = ( pvv(:,:,:,Kaa) - pvv(:,:,:,Kbb) ) * r1_Dt |
---|
183 | CALL iom_put( "utrd_tot", zua ) ! total momentum trends, except the asselin time filter |
---|
184 | CALL iom_put( "vtrd_tot", zva ) |
---|
185 | ENDIF |
---|
186 | ! |
---|
187 | zua(:,:,:) = puu(:,:,:,Kmm) ! save the now velocity before the asselin filter |
---|
188 | zva(:,:,:) = pvv(:,:,:,Kmm) ! (caution: there will be a shift by 1 timestep in the |
---|
189 | ! ! computation of the asselin filter trends) |
---|
190 | ENDIF |
---|
191 | |
---|
192 | ! Time filter and swap of dynamics arrays |
---|
193 | ! ------------------------------------------ |
---|
194 | |
---|
195 | IF( .NOT. l_1st_euler ) THEN !* Leap-Frog : Asselin time filter |
---|
196 | ! ! =============! |
---|
197 | IF( ln_linssh ) THEN ! Fixed volume ! |
---|
198 | ! ! =============! |
---|
199 | DO_3D_11_11( 1, jpkm1 ) |
---|
200 | puu(ji,jj,jk,Kmm) = puu(ji,jj,jk,Kmm) + rn_atfp * ( puu(ji,jj,jk,Kbb) - 2._wp * puu(ji,jj,jk,Kmm) + puu(ji,jj,jk,Kaa) ) |
---|
201 | pvv(ji,jj,jk,Kmm) = pvv(ji,jj,jk,Kmm) + rn_atfp * ( pvv(ji,jj,jk,Kbb) - 2._wp * pvv(ji,jj,jk,Kmm) + pvv(ji,jj,jk,Kaa) ) |
---|
202 | END_3D |
---|
203 | ! ! ================! |
---|
204 | ELSE ! Variable volume ! |
---|
205 | ! ! ================! |
---|
206 | ! Time-filtered scale factor at t-points |
---|
207 | ! ---------------------------------------------------- |
---|
208 | ALLOCATE( ze3t_f(jpi,jpj,jpk), zwfld(jpi,jpj) ) |
---|
209 | DO jk = 1, jpkm1 |
---|
210 | ze3t_f(:,:,jk) = pe3t(:,:,jk,Kmm) + rn_atfp * ( pe3t(:,:,jk,Kbb) - 2._wp * pe3t(:,:,jk,Kmm) + pe3t(:,:,jk,Kaa) ) |
---|
211 | END DO |
---|
212 | ! Add volume filter correction: compatibility with tracer advection scheme |
---|
213 | ! => time filter + conservation correction |
---|
214 | zcoef = rn_atfp * rn_Dt * r1_rho0 |
---|
215 | zwfld(:,:) = emp_b(:,:) - emp(:,:) |
---|
216 | IF ( ln_rnf ) zwfld(:,:) = zwfld(:,:) - ( rnf_b(:,:) - rnf(:,:) ) |
---|
217 | |
---|
218 | DO jk = 1, jpkm1 |
---|
219 | ze3t_f(:,:,jk) = ze3t_f(:,:,jk) - zcoef * zwfld(:,:) * tmask(:,:,jk) & |
---|
220 | & * pe3t(:,:,jk,Kmm) / ( ht(:,:) + 1._wp - ssmask(:,:) ) |
---|
221 | END DO |
---|
222 | ! |
---|
223 | ! ice shelf melting (deal separately as it can be in depth) |
---|
224 | ! PM: we could probably define a generic subroutine to do the in depth correction |
---|
225 | ! to manage rnf, isf and possibly in the futur icb, tide water glacier (...) |
---|
226 | ! ...(kt, coef, ktop, kbot, hz, fwf_b, fwf) |
---|
227 | IF ( ln_isf ) CALL isf_dynatf( kt, Kmm, ze3t_f, rn_atfp * rn_Dt ) |
---|
228 | ! |
---|
229 | pe3t(:,:,1:jpkm1,Kmm) = ze3t_f(:,:,1:jpkm1) ! filtered scale factor at T-points |
---|
230 | ! |
---|
231 | IF( ln_dynadv_vec ) THEN ! Asselin filter applied on velocity |
---|
232 | ! Before filtered scale factor at (u/v)-points |
---|
233 | CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), pe3u(:,:,:,Kmm), 'U' ) |
---|
234 | CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), pe3v(:,:,:,Kmm), 'V' ) |
---|
235 | DO_3D_11_11( 1, jpkm1 ) |
---|
236 | puu(ji,jj,jk,Kmm) = puu(ji,jj,jk,Kmm) + rn_atfp * ( puu(ji,jj,jk,Kbb) - 2._wp * puu(ji,jj,jk,Kmm) + puu(ji,jj,jk,Kaa) ) |
---|
237 | pvv(ji,jj,jk,Kmm) = pvv(ji,jj,jk,Kmm) + rn_atfp * ( pvv(ji,jj,jk,Kbb) - 2._wp * pvv(ji,jj,jk,Kmm) + pvv(ji,jj,jk,Kaa) ) |
---|
238 | END_3D |
---|
239 | ! |
---|
240 | ELSE ! Asselin filter applied on thickness weighted velocity |
---|
241 | ! |
---|
242 | ALLOCATE( ze3u_f(jpi,jpj,jpk) , ze3v_f(jpi,jpj,jpk) ) |
---|
243 | ! Now filtered scale factor at (u/v)-points stored in ze3u_f, ze3v_f |
---|
244 | CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), ze3u_f, 'U' ) |
---|
245 | CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), ze3v_f, 'V' ) |
---|
246 | DO_3D_11_11( 1, jpkm1 ) |
---|
247 | zue3a = pe3u(ji,jj,jk,Kaa) * puu(ji,jj,jk,Kaa) |
---|
248 | zve3a = pe3v(ji,jj,jk,Kaa) * pvv(ji,jj,jk,Kaa) |
---|
249 | zue3n = pe3u(ji,jj,jk,Kmm) * puu(ji,jj,jk,Kmm) |
---|
250 | zve3n = pe3v(ji,jj,jk,Kmm) * pvv(ji,jj,jk,Kmm) |
---|
251 | zue3b = pe3u(ji,jj,jk,Kbb) * puu(ji,jj,jk,Kbb) |
---|
252 | zve3b = pe3v(ji,jj,jk,Kbb) * pvv(ji,jj,jk,Kbb) |
---|
253 | ! |
---|
254 | puu(ji,jj,jk,Kmm) = ( zue3n + rn_atfp * ( zue3b - 2._wp * zue3n + zue3a ) ) / ze3u_f(ji,jj,jk) |
---|
255 | pvv(ji,jj,jk,Kmm) = ( zve3n + rn_atfp * ( zve3b - 2._wp * zve3n + zve3a ) ) / ze3v_f(ji,jj,jk) |
---|
256 | END_3D |
---|
257 | pe3u(:,:,1:jpkm1,Kmm) = ze3u_f(:,:,1:jpkm1) |
---|
258 | pe3v(:,:,1:jpkm1,Kmm) = ze3v_f(:,:,1:jpkm1) |
---|
259 | ! |
---|
260 | DEALLOCATE( ze3u_f , ze3v_f ) |
---|
261 | ENDIF |
---|
262 | ! |
---|
263 | DEALLOCATE( ze3t_f, zwfld ) |
---|
264 | ENDIF |
---|
265 | ! |
---|
266 | IF( ln_dynspg_ts .AND. ln_bt_fw ) THEN |
---|
267 | ! Revert filtered "now" velocities to time split estimate |
---|
268 | ! Doing it here also means that asselin filter contribution is removed |
---|
269 | zue(:,:) = pe3u(:,:,1,Kmm) * puu(:,:,1,Kmm) * umask(:,:,1) |
---|
270 | zve(:,:) = pe3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1) |
---|
271 | DO jk = 2, jpkm1 |
---|
272 | zue(:,:) = zue(:,:) + pe3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm) * umask(:,:,jk) |
---|
273 | zve(:,:) = zve(:,:) + pe3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk) |
---|
274 | END DO |
---|
275 | DO jk = 1, jpkm1 |
---|
276 | puu(:,:,jk,Kmm) = puu(:,:,jk,Kmm) - (zue(:,:) * r1_hu(:,:,Kmm) - uu_b(:,:,Kmm)) * umask(:,:,jk) |
---|
277 | pvv(:,:,jk,Kmm) = pvv(:,:,jk,Kmm) - (zve(:,:) * r1_hv(:,:,Kmm) - vv_b(:,:,Kmm)) * vmask(:,:,jk) |
---|
278 | END DO |
---|
279 | ENDIF |
---|
280 | ! |
---|
281 | ENDIF ! .NOT. l_1st_euler |
---|
282 | ! |
---|
283 | ! Set "now" and "before" barotropic velocities for next time step: |
---|
284 | ! JC: Would be more clever to swap variables than to make a full vertical |
---|
285 | ! integration |
---|
286 | ! |
---|
287 | IF(.NOT.ln_linssh ) THEN |
---|
288 | hu(:,:,Kmm) = pe3u(:,:,1,Kmm ) * umask(:,:,1) |
---|
289 | hv(:,:,Kmm) = pe3v(:,:,1,Kmm ) * vmask(:,:,1) |
---|
290 | DO jk = 2, jpkm1 |
---|
291 | hu(:,:,Kmm) = hu(:,:,Kmm) + pe3u(:,:,jk,Kmm ) * umask(:,:,jk) |
---|
292 | hv(:,:,Kmm) = hv(:,:,Kmm) + pe3v(:,:,jk,Kmm ) * vmask(:,:,jk) |
---|
293 | END DO |
---|
294 | r1_hu(:,:,Kmm) = ssumask(:,:) / ( hu(:,:,Kmm) + 1._wp - ssumask(:,:) ) |
---|
295 | r1_hv(:,:,Kmm) = ssvmask(:,:) / ( hv(:,:,Kmm) + 1._wp - ssvmask(:,:) ) |
---|
296 | ENDIF |
---|
297 | ! |
---|
298 | uu_b(:,:,Kaa) = pe3u(:,:,1,Kaa) * puu(:,:,1,Kaa) * umask(:,:,1) |
---|
299 | uu_b(:,:,Kmm) = pe3u(:,:,1,Kmm) * puu(:,:,1,Kmm) * umask(:,:,1) |
---|
300 | vv_b(:,:,Kaa) = pe3v(:,:,1,Kaa) * pvv(:,:,1,Kaa) * vmask(:,:,1) |
---|
301 | vv_b(:,:,Kmm) = pe3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1) |
---|
302 | DO jk = 2, jpkm1 |
---|
303 | uu_b(:,:,Kaa) = uu_b(:,:,Kaa) + pe3u(:,:,jk,Kaa) * puu(:,:,jk,Kaa) * umask(:,:,jk) |
---|
304 | uu_b(:,:,Kmm) = uu_b(:,:,Kmm) + pe3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm) * umask(:,:,jk) |
---|
305 | vv_b(:,:,Kaa) = vv_b(:,:,Kaa) + pe3v(:,:,jk,Kaa) * pvv(:,:,jk,Kaa) * vmask(:,:,jk) |
---|
306 | vv_b(:,:,Kmm) = vv_b(:,:,Kmm) + pe3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk) |
---|
307 | END DO |
---|
308 | uu_b(:,:,Kaa) = uu_b(:,:,Kaa) * r1_hu(:,:,Kaa) |
---|
309 | vv_b(:,:,Kaa) = vv_b(:,:,Kaa) * r1_hv(:,:,Kaa) |
---|
310 | uu_b(:,:,Kmm) = uu_b(:,:,Kmm) * r1_hu(:,:,Kmm) |
---|
311 | vv_b(:,:,Kmm) = vv_b(:,:,Kmm) * r1_hv(:,:,Kmm) |
---|
312 | ! |
---|
313 | IF( .NOT.ln_dynspg_ts ) THEN ! output the barotropic currents |
---|
314 | CALL iom_put( "ubar", uu_b(:,:,Kmm) ) |
---|
315 | CALL iom_put( "vbar", vv_b(:,:,Kmm) ) |
---|
316 | ENDIF |
---|
317 | IF( l_trddyn ) THEN ! 3D output: asselin filter trends on momentum |
---|
318 | zua(:,:,:) = ( puu(:,:,:,Kmm) - zua(:,:,:) ) * z1_2dt |
---|
319 | zva(:,:,:) = ( pvv(:,:,:,Kmm) - zva(:,:,:) ) * z1_2dt |
---|
320 | CALL trd_dyn( zua, zva, jpdyn_atf, kt, Kmm ) |
---|
321 | ENDIF |
---|
322 | ! |
---|
323 | IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab3d_1=puu(:,:,:,Kaa), clinfo1=' nxt - puu(:,:,:,Kaa): ', mask1=umask, & |
---|
324 | & tab3d_2=pvv(:,:,:,Kaa), clinfo2=' pvv(:,:,:,Kaa): ' , mask2=vmask ) |
---|
325 | ! |
---|
326 | IF( ln_dynspg_ts ) DEALLOCATE( zue, zve ) |
---|
327 | IF( l_trddyn ) DEALLOCATE( zua, zva ) |
---|
328 | IF( ln_timing ) CALL timing_stop('dyn_atf') |
---|
329 | ! |
---|
330 | END SUBROUTINE dyn_atf |
---|
331 | |
---|
332 | #endif |
---|
333 | |
---|
334 | !!========================================================================= |
---|
335 | END MODULE dynatf |
---|