source: NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/dynatf.F90 @ 12340

Last change on this file since 12340 was 12340, checked in by acc, 15 months ago

Branch 2019/dev_r11943_MERGE_2019. This commit introduces basic do loop macro
substitution to the 2019 option 1, merge branch. These changes have been SETTE
tested. The only addition is the do_loop_substitute.h90 file in the OCE directory but
the macros defined therein are used throughout the code to replace identifiable, 2D-
and 3D- nested loop opening and closing statements with single-line alternatives. Code
indents are also adjusted accordingly.

The following explanation is taken from comments in the new header file:

This header file contains preprocessor definitions and macros used in the do-loop
substitutions introduced between version 4.0 and 4.2. The primary aim of these macros
is to assist in future applications of tiling to improve performance. This is expected
to be achieved by alternative versions of these macros in selected locations. The
initial introduction of these macros simply replaces all identifiable nested 2D- and
3D-loops with single line statements (and adjusts indenting accordingly). Do loops
are identifiable if they comform to either:

DO jk = ….

DO jj = …. DO jj = …

DO ji = …. DO ji = …
. OR .
. .

END DO END DO

END DO END DO

END DO

and white-space variants thereof.

Additionally, only loops with recognised jj and ji loops limits are treated; these are:
Lower limits of 1, 2 or fs_2
Upper limits of jpi, jpim1 or fs_jpim1 (for ji) or jpj, jpjm1 or fs_jpjm1 (for jj)

The macro naming convention takes the form: DO_2D_BT_LR where:

B is the Bottom offset from the PE's inner domain;
T is the Top offset from the PE's inner domain;
L is the Left offset from the PE's inner domain;
R is the Right offset from the PE's inner domain

So, given an inner domain of 2,jpim1 and 2,jpjm1, a typical example would replace:

DO jj = 2, jpj

DO ji = 1, jpim1
.
.

END DO

END DO

with:

DO_2D_01_10
.
.
END_2D

similar conventions apply to the 3D loops macros. jk loop limits are retained
through macro arguments and are not restricted. This includes the possibility of
strides for which an extra set of DO_3DS macros are defined.

In the example definition below the inner PE domain is defined by start indices of
(kIs, kJs) and end indices of (kIe, KJe)

#define DO_2D_00_00 DO jj = kJs, kJe ; DO ji = kIs, kIe
#define END_2D END DO ; END DO

TO DO:


Only conventional nested loops have been identified and replaced by this step. There are constructs such as:

DO jk = 2, jpkm1

z2d(:,:) = z2d(:,:) + e3w(:,:,jk,Kmm) * z3d(:,:,jk) * wmask(:,:,jk)

END DO

which may need to be considered.

  • Property svn:keywords set to Id
File size: 17.5 KB
Line 
1MODULE 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   !! * Substitutions
62#  include "do_loop_substitute.h90"
63   !!----------------------------------------------------------------------
64   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
65   !! $Id$
66   !! Software governed by the CeCILL license (see ./LICENSE)
67   !!----------------------------------------------------------------------
68CONTAINS
69
70   SUBROUTINE dyn_atf ( kt, Kbb, Kmm, Kaa, puu, pvv, pe3t, pe3u, pe3v )
71      !!----------------------------------------------------------------------
72      !!                  ***  ROUTINE dyn_atf  ***
73      !!                   
74      !! ** Purpose :   Finalize after horizontal velocity. Apply the boundary
75      !!             condition on the after velocity and apply the Asselin time
76      !!             filter to the now fields.
77      !!
78      !! ** Method  : * Ensure after velocities transport matches time splitting
79      !!             estimate (ln_dynspg_ts=T)
80      !!
81      !!              * Apply lateral boundary conditions on after velocity
82      !!             at the local domain boundaries through lbc_lnk call,
83      !!             at the one-way open boundaries (ln_bdy=T),
84      !!             at the AGRIF zoom   boundaries (lk_agrif=T)
85      !!
86      !!              * Apply the Asselin time filter to the now fields
87      !!             arrays to start the next time step:
88      !!                (puu(Kmm),pvv(Kmm)) = (puu(Kmm),pvv(Kmm))
89      !!                                    + atfp [ (puu(Kbb),pvv(Kbb)) + (puu(Kaa),pvv(Kaa)) - 2 (puu(Kmm),pvv(Kmm)) ]
90      !!             Note that with flux form advection and non linear free surface,
91      !!             the time filter is applied on thickness weighted velocity.
92      !!             As a result, dyn_atf MUST be called after tra_atf.
93      !!
94      !! ** Action :   puu(Kmm),pvv(Kmm)   filtered now horizontal velocity
95      !!----------------------------------------------------------------------
96      INTEGER                             , INTENT(in   ) :: kt               ! ocean time-step index
97      INTEGER                             , INTENT(in   ) :: Kbb, Kmm, Kaa    ! before and after time level indices
98      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv         ! velocities to be time filtered
99      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: pe3t, pe3u, pe3v ! scale factors to be time filtered
100      !
101      INTEGER  ::   ji, jj, jk   ! dummy loop indices
102      REAL(wp) ::   zue3a, zue3n, zue3b, zcoef    ! local scalars
103      REAL(wp) ::   zve3a, zve3n, zve3b, z1_2dt   !   -      -
104      REAL(wp), ALLOCATABLE, DIMENSION(:,:)   ::   zue, zve
105      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ze3t_f, ze3u_f, ze3v_f, zua, zva 
106      !!----------------------------------------------------------------------
107      !
108      IF( ln_timing    )   CALL timing_start('dyn_atf')
109      IF( ln_dynspg_ts )   ALLOCATE( zue(jpi,jpj)     , zve(jpi,jpj)     )
110      IF( l_trddyn     )   ALLOCATE( zua(jpi,jpj,jpk) , zva(jpi,jpj,jpk) )
111      !
112      IF( kt == nit000 ) THEN
113         IF(lwp) WRITE(numout,*)
114         IF(lwp) WRITE(numout,*) 'dyn_atf : Asselin time filtering'
115         IF(lwp) WRITE(numout,*) '~~~~~~~'
116      ENDIF
117
118      IF ( ln_dynspg_ts ) THEN
119         ! Ensure below that barotropic velocities match time splitting estimate
120         ! Compute actual transport and replace it with ts estimate at "after" time step
121         zue(:,:) = pe3u(:,:,1,Kaa) * puu(:,:,1,Kaa) * umask(:,:,1)
122         zve(:,:) = pe3v(:,:,1,Kaa) * pvv(:,:,1,Kaa) * vmask(:,:,1)
123         DO jk = 2, jpkm1
124            zue(:,:) = zue(:,:) + pe3u(:,:,jk,Kaa) * puu(:,:,jk,Kaa) * umask(:,:,jk)
125            zve(:,:) = zve(:,:) + pe3v(:,:,jk,Kaa) * pvv(:,:,jk,Kaa) * vmask(:,:,jk)
126         END DO
127         DO jk = 1, jpkm1
128            puu(:,:,jk,Kaa) = ( puu(:,:,jk,Kaa) - zue(:,:) * r1_hu(:,:,Kaa) + uu_b(:,:,Kaa) ) * umask(:,:,jk)
129            pvv(:,:,jk,Kaa) = ( pvv(:,:,jk,Kaa) - zve(:,:) * r1_hv(:,:,Kaa) + vv_b(:,:,Kaa) ) * vmask(:,:,jk)
130         END DO
131         !
132         IF( .NOT.ln_bt_fw ) THEN
133            ! Remove advective velocity from "now velocities"
134            ! prior to asselin filtering     
135            ! In the forward case, this is done below after asselin filtering   
136            ! so that asselin contribution is removed at the same time
137            DO jk = 1, jpkm1
138               puu(:,:,jk,Kmm) = ( puu(:,:,jk,Kmm) - un_adv(:,:)*r1_hu(:,:,Kmm) + uu_b(:,:,Kmm) )*umask(:,:,jk)
139               pvv(:,:,jk,Kmm) = ( pvv(:,:,jk,Kmm) - vn_adv(:,:)*r1_hv(:,:,Kmm) + vv_b(:,:,Kmm) )*vmask(:,:,jk)
140            END DO 
141         ENDIF
142      ENDIF
143
144      ! Update after velocity on domain lateral boundaries
145      ! --------------------------------------------------     
146# if defined key_agrif
147      CALL Agrif_dyn( kt )             !* AGRIF zoom boundaries
148# endif
149      !
150      CALL lbc_lnk_multi( 'dynatf', puu(:,:,:,Kaa), 'U', -1., pvv(:,:,:,Kaa), 'V', -1. )     !* local domain boundaries
151      !
152      !                                !* BDY open boundaries
153      IF( ln_bdy .AND. ln_dynspg_exp )   CALL bdy_dyn( kt, Kbb, puu, pvv, Kaa )
154      IF( ln_bdy .AND. ln_dynspg_ts  )   CALL bdy_dyn( kt, Kbb, puu, pvv, Kaa, dyn3d_only=.true. )
155
156!!$   Do we need a call to bdy_vol here??
157      !
158      IF( l_trddyn ) THEN             ! prepare the atf trend computation + some diagnostics
159         z1_2dt = 1._wp / (2. * rdt)        ! Euler or leap-frog time step
160         IF( neuler == 0 .AND. kt == nit000 )   z1_2dt = 1._wp / rdt
161         !
162         !                                  ! Kinetic energy and Conversion
163         IF( ln_KE_trd  )   CALL trd_dyn( puu(:,:,:,Kaa), pvv(:,:,:,Kaa), jpdyn_ken, kt, Kmm )
164         !
165         IF( ln_dyn_trd ) THEN              ! 3D output: total momentum trends
166            zua(:,:,:) = ( puu(:,:,:,Kaa) - puu(:,:,:,Kbb) ) * z1_2dt
167            zva(:,:,:) = ( pvv(:,:,:,Kaa) - pvv(:,:,:,Kbb) ) * z1_2dt
168            CALL iom_put( "utrd_tot", zua )        ! total momentum trends, except the asselin time filter
169            CALL iom_put( "vtrd_tot", zva )
170         ENDIF
171         !
172         zua(:,:,:) = puu(:,:,:,Kmm)             ! save the now velocity before the asselin filter
173         zva(:,:,:) = pvv(:,:,:,Kmm)             ! (caution: there will be a shift by 1 timestep in the
174         !                                  !  computation of the asselin filter trends)
175      ENDIF
176
177      ! Time filter and swap of dynamics arrays
178      ! ------------------------------------------
179         
180      IF( .NOT.( neuler == 0 .AND. kt == nit000 ) ) THEN    !* Leap-Frog : Asselin time filter
181         !                                ! =============!
182         IF( ln_linssh ) THEN             ! Fixed volume !
183            !                             ! =============!
184            DO_3D_11_11( 1, jpkm1 )
185               puu(ji,jj,jk,Kmm) = puu(ji,jj,jk,Kmm) + atfp * ( puu(ji,jj,jk,Kbb) - 2._wp * puu(ji,jj,jk,Kmm) + puu(ji,jj,jk,Kaa) )
186               pvv(ji,jj,jk,Kmm) = pvv(ji,jj,jk,Kmm) + atfp * ( pvv(ji,jj,jk,Kbb) - 2._wp * pvv(ji,jj,jk,Kmm) + pvv(ji,jj,jk,Kaa) )
187            END_3D
188            !                             ! ================!
189         ELSE                             ! Variable volume !
190            !                             ! ================!
191            ! Time-filtered scale factor at t-points
192            ! ----------------------------------------------------
193            ALLOCATE( ze3t_f(jpi,jpj,jpk) )
194            DO jk = 1, jpkm1
195               ze3t_f(:,:,jk) = pe3t(:,:,jk,Kmm) + atfp * ( pe3t(:,:,jk,Kbb) - 2._wp * pe3t(:,:,jk,Kmm) + pe3t(:,:,jk,Kaa) )
196            END DO
197            ! Add volume filter correction: compatibility with tracer advection scheme
198            ! => time filter + conservation correction (only at the first level)
199            zcoef = atfp * rdt * r1_rau0
200
201            ze3t_f(:,:,1) = ze3t_f(:,:,1) - zcoef * ( emp_b(:,:) - emp(:,:) ) * tmask(:,:,1)
202
203            IF ( ln_rnf ) THEN
204               IF( ln_rnf_depth ) THEN
205                  DO_3D_11_11( 1, jpkm1 )
206                     IF( jk <=  nk_rnf(ji,jj)  ) THEN
207                         ze3t_f(ji,jj,jk) =   ze3t_f(ji,jj,jk) - zcoef *  ( - rnf_b(ji,jj) + rnf(ji,jj) ) &
208                                &          * ( pe3t(ji,jj,jk,Kmm) / h_rnf(ji,jj) ) * tmask(ji,jj,jk)
209                     ENDIF
210                  END_3D
211               ELSE
212                  ze3t_f(:,:,1) = ze3t_f(:,:,1) - zcoef *  ( -rnf_b(:,:) + rnf(:,:))*tmask(:,:,1)
213               ENDIF
214            END IF
215            !
216            ! ice shelf melting (deal separately as it can be in depth)
217            ! PM: we could probably define a generic subroutine to do the in depth correction
218            !     to manage rnf, isf and possibly in the futur icb, tide water glacier (...)
219            !     ...(kt, coef, ktop, kbot, hz, fwf_b, fwf)
220            IF ( ln_isf ) CALL isf_dynatf( kt, Kmm, ze3t_f, atfp * rdt )
221            !
222            pe3t(:,:,1:jpkm1,Kmm) = ze3t_f(:,:,1:jpkm1)        ! filtered scale factor at T-points
223            !
224            IF( ln_dynadv_vec ) THEN      ! Asselin filter applied on velocity
225               ! Before filtered scale factor at (u/v)-points
226               CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), pe3u(:,:,:,Kmm), 'U' )
227               CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), pe3v(:,:,:,Kmm), 'V' )
228               DO_3D_11_11( 1, jpkm1 )
229                  puu(ji,jj,jk,Kmm) = puu(ji,jj,jk,Kmm) + atfp * ( puu(ji,jj,jk,Kbb) - 2._wp * puu(ji,jj,jk,Kmm) + puu(ji,jj,jk,Kaa) )
230                  pvv(ji,jj,jk,Kmm) = pvv(ji,jj,jk,Kmm) + atfp * ( pvv(ji,jj,jk,Kbb) - 2._wp * pvv(ji,jj,jk,Kmm) + pvv(ji,jj,jk,Kaa) )
231               END_3D
232               !
233            ELSE                          ! Asselin filter applied on thickness weighted velocity
234               !
235               ALLOCATE( ze3u_f(jpi,jpj,jpk) , ze3v_f(jpi,jpj,jpk) )
236               ! Now filtered scale factor at (u/v)-points stored in ze3u_f, ze3v_f
237               CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), ze3u_f, 'U' )
238               CALL dom_vvl_interpol( pe3t(:,:,:,Kmm), ze3v_f, 'V' )
239               DO_3D_11_11( 1, jpkm1 )
240                  zue3a = pe3u(ji,jj,jk,Kaa) * puu(ji,jj,jk,Kaa)
241                  zve3a = pe3v(ji,jj,jk,Kaa) * pvv(ji,jj,jk,Kaa)
242                  zue3n = pe3u(ji,jj,jk,Kmm) * puu(ji,jj,jk,Kmm)
243                  zve3n = pe3v(ji,jj,jk,Kmm) * pvv(ji,jj,jk,Kmm)
244                  zue3b = pe3u(ji,jj,jk,Kbb) * puu(ji,jj,jk,Kbb)
245                  zve3b = pe3v(ji,jj,jk,Kbb) * pvv(ji,jj,jk,Kbb)
246                  !
247                  puu(ji,jj,jk,Kmm) = ( zue3n + atfp * ( zue3b - 2._wp * zue3n  + zue3a ) ) / ze3u_f(ji,jj,jk)
248                  pvv(ji,jj,jk,Kmm) = ( zve3n + atfp * ( zve3b - 2._wp * zve3n  + zve3a ) ) / ze3v_f(ji,jj,jk)
249               END_3D
250               pe3u(:,:,1:jpkm1,Kmm) = ze3u_f(:,:,1:jpkm1) 
251               pe3v(:,:,1:jpkm1,Kmm) = ze3v_f(:,:,1:jpkm1)
252               !
253               DEALLOCATE( ze3u_f , ze3v_f )
254            ENDIF
255            !
256            DEALLOCATE( ze3t_f )
257         ENDIF
258         !
259         IF( ln_dynspg_ts .AND. ln_bt_fw ) THEN
260            ! Revert filtered "now" velocities to time split estimate
261            ! Doing it here also means that asselin filter contribution is removed 
262            zue(:,:) = pe3u(:,:,1,Kmm) * puu(:,:,1,Kmm) * umask(:,:,1)
263            zve(:,:) = pe3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1)   
264            DO jk = 2, jpkm1
265               zue(:,:) = zue(:,:) + pe3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm) * umask(:,:,jk)
266               zve(:,:) = zve(:,:) + pe3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk)   
267            END DO
268            DO jk = 1, jpkm1
269               puu(:,:,jk,Kmm) = puu(:,:,jk,Kmm) - (zue(:,:) * r1_hu(:,:,Kmm) - uu_b(:,:,Kmm)) * umask(:,:,jk)
270               pvv(:,:,jk,Kmm) = pvv(:,:,jk,Kmm) - (zve(:,:) * r1_hv(:,:,Kmm) - vv_b(:,:,Kmm)) * vmask(:,:,jk)
271            END DO
272         ENDIF
273         !
274      ENDIF ! neuler /= 0
275      !
276      ! Set "now" and "before" barotropic velocities for next time step:
277      ! JC: Would be more clever to swap variables than to make a full vertical
278      ! integration
279      !
280      IF(.NOT.ln_linssh ) THEN
281         hu(:,:,Kmm) = pe3u(:,:,1,Kmm ) * umask(:,:,1)
282         hv(:,:,Kmm) = pe3v(:,:,1,Kmm ) * vmask(:,:,1)
283         DO jk = 2, jpkm1
284            hu(:,:,Kmm) = hu(:,:,Kmm) + pe3u(:,:,jk,Kmm ) * umask(:,:,jk)
285            hv(:,:,Kmm) = hv(:,:,Kmm) + pe3v(:,:,jk,Kmm ) * vmask(:,:,jk)
286         END DO
287         r1_hu(:,:,Kmm) = ssumask(:,:) / ( hu(:,:,Kmm) + 1._wp - ssumask(:,:) )
288         r1_hv(:,:,Kmm) = ssvmask(:,:) / ( hv(:,:,Kmm) + 1._wp - ssvmask(:,:) )
289      ENDIF
290      !
291      uu_b(:,:,Kaa) = pe3u(:,:,1,Kaa) * puu(:,:,1,Kaa) * umask(:,:,1)
292      uu_b(:,:,Kmm) = pe3u(:,:,1,Kmm) * puu(:,:,1,Kmm) * umask(:,:,1)
293      vv_b(:,:,Kaa) = pe3v(:,:,1,Kaa) * pvv(:,:,1,Kaa) * vmask(:,:,1)
294      vv_b(:,:,Kmm) = pe3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1)
295      DO jk = 2, jpkm1
296         uu_b(:,:,Kaa) = uu_b(:,:,Kaa) + pe3u(:,:,jk,Kaa) * puu(:,:,jk,Kaa) * umask(:,:,jk)
297         uu_b(:,:,Kmm) = uu_b(:,:,Kmm) + pe3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm) * umask(:,:,jk)
298         vv_b(:,:,Kaa) = vv_b(:,:,Kaa) + pe3v(:,:,jk,Kaa) * pvv(:,:,jk,Kaa) * vmask(:,:,jk)
299         vv_b(:,:,Kmm) = vv_b(:,:,Kmm) + pe3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk)
300      END DO
301      uu_b(:,:,Kaa) = uu_b(:,:,Kaa) * r1_hu(:,:,Kaa)
302      vv_b(:,:,Kaa) = vv_b(:,:,Kaa) * r1_hv(:,:,Kaa)
303      uu_b(:,:,Kmm) = uu_b(:,:,Kmm) * r1_hu(:,:,Kmm)
304      vv_b(:,:,Kmm) = vv_b(:,:,Kmm) * r1_hv(:,:,Kmm)
305      !
306      IF( .NOT.ln_dynspg_ts ) THEN        ! output the barotropic currents
307         CALL iom_put(  "ubar", uu_b(:,:,Kmm) )
308         CALL iom_put(  "vbar", vv_b(:,:,Kmm) )
309      ENDIF
310      IF( l_trddyn ) THEN                ! 3D output: asselin filter trends on momentum
311         zua(:,:,:) = ( puu(:,:,:,Kmm) - zua(:,:,:) ) * z1_2dt
312         zva(:,:,:) = ( pvv(:,:,:,Kmm) - zva(:,:,:) ) * z1_2dt
313         CALL trd_dyn( zua, zva, jpdyn_atf, kt, Kmm )
314      ENDIF
315      !
316      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=puu(:,:,:,Kaa), clinfo1=' nxt  - puu(:,:,:,Kaa): ', mask1=umask,   &
317         &                                  tab3d_2=pvv(:,:,:,Kaa), clinfo2=' pvv(:,:,:,Kaa): '       , mask2=vmask )
318      !
319      IF( ln_dynspg_ts )   DEALLOCATE( zue, zve )
320      IF( l_trddyn     )   DEALLOCATE( zua, zva )
321      IF( ln_timing    )   CALL timing_stop('dyn_atf')
322      !
323   END SUBROUTINE dyn_atf
324
325   !!=========================================================================
326END MODULE dynatf
Note: See TracBrowser for help on using the repository browser.