New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
traatf.F90 in NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA – NEMO

source: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traatf.F90 @ 14753

Last change on this file since 14753 was 14753, checked in by hadcv, 3 years ago

#2600: Update step.F90

  • Property svn:keywords set to Id
File size: 20.5 KB
Line 
1MODULE traatf
2   !!======================================================================
3   !!                       ***  MODULE  traatf  ***
4   !! Ocean active tracers:  Asselin time filtering for temperature and salinity
5   !!======================================================================
6   !! History :  OPA  !  1991-11  (G. Madec)  Original code
7   !!            7.0  !  1993-03  (M. Guyon)  symetrical conditions
8   !!            8.0  !  1996-02  (G. Madec & M. Imbard)  opa release 8.0
9   !!             -   !  1996-04  (A. Weaver)  Euler forward step
10   !!            8.2  !  1999-02  (G. Madec, N. Grima)  semi-implicit pressure grad.
11   !!  NEMO      1.0  !  2002-08  (G. Madec)  F90: Free form and module
12   !!             -   !  2002-11  (C. Talandier, A-M Treguier) Open boundaries
13   !!             -   !  2005-04  (C. Deltel) Add Asselin trend in the ML budget
14   !!            2.0  !  2006-02  (L. Debreu, C. Mazauric) Agrif implementation
15   !!            3.0  !  2008-06  (G. Madec)  time stepping always done in trazdf
16   !!            3.1  !  2009-02  (G. Madec, R. Benshila)  re-introduce the vvl option
17   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  semi-implicit hpg with asselin filter + modified LF-RA
18   !!             -   !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA
19   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rename tranxt.F90 -> traatf.F90. Now only does time filtering.
20   !!----------------------------------------------------------------------
21
22   !!----------------------------------------------------------------------
23   !!   tra_atf       : time filtering on tracers
24   !!   tra_atf_fix   : time filtering on tracers : fixed    volume case
25   !!   tra_atf_vvl   : time filtering on tracers : variable volume case
26   !!----------------------------------------------------------------------
27   USE oce             ! ocean dynamics and tracers variables
28   USE dom_oce         ! ocean space and time domain variables
29   USE sbc_oce         ! surface boundary condition: ocean
30   USE sbcrnf          ! river runoffs
31   USE isf_oce         ! ice shelf melting
32   USE zdf_oce         ! ocean vertical mixing
33   USE domvvl          ! variable volume
34   USE trd_oce         ! trends: ocean variables
35   USE trdtra          ! trends manager: tracers
36   USE traqsr          ! penetrative solar radiation (needed for nksr)
37   USE phycst          ! physical constant
38   USE ldftra          ! lateral physics : tracers
39   USE ldfslp          ! lateral physics : slopes
40   USE bdy_oce  , ONLY : ln_bdy
41   USE bdytra          ! open boundary condition (bdy_tra routine)
42   !
43   USE in_out_manager  ! I/O manager
44   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
45   USE prtctl          ! Print control
46   USE timing          ! Timing
47#if defined key_agrif
48   USE agrif_oce_interp
49#endif
50
51   IMPLICIT NONE
52   PRIVATE
53
54   PUBLIC   tra_atf       ! routine called by step.F90
55
56#if defined key_qco   ||   defined key_linssh
57   !!----------------------------------------------------------------------
58   !!   'key_qco'                        Quasi-Eulerian vertical coordinate
59   !!       OR         EMPTY MODULE
60   !!   'key_linssh'                        Fix in time vertical coordinate
61   !!----------------------------------------------------------------------
62CONTAINS
63
64   SUBROUTINE tra_atf( kt, Kbb, Kmm, Kaa, pts )
65      INTEGER                                  , INTENT(in   ) :: kt             ! ocean time-step index
66      INTEGER                                  , INTENT(in   ) :: Kbb, Kmm, Kaa  ! time level indices
67      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers
68
69      WRITE(*,*) 'tra_atf: You should not have seen this print! error?', kt
70   END SUBROUTINE tra_atf
71
72#else
73
74   PUBLIC   tra_atf_fix   ! to be used in trcnxt
75   PUBLIC   tra_atf_vvl   ! to be used in trcnxt
76
77   !! * Substitutions
78#  include "do_loop_substitute.h90"
79#  include "domzgr_substitute.h90"
80   !!----------------------------------------------------------------------
81   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
82   !! $Id$
83   !! Software governed by the CeCILL license (see ./LICENSE)
84   !!----------------------------------------------------------------------
85CONTAINS
86
87   SUBROUTINE tra_atf( kt, Kbb, Kmm, Kaa, pts )
88      !!----------------------------------------------------------------------
89      !!                   ***  ROUTINE traatf  ***
90      !!
91      !! ** Purpose :   Apply the boundary condition on the after temperature
92      !!             and salinity fields and add the Asselin time filter on now fields.
93      !!
94      !! ** Method  :   At this stage of the computation, ta and sa are the
95      !!             after temperature and salinity as the time stepping has
96      !!             been performed in trazdf_imp or trazdf_exp module.
97      !!
98      !!              - Apply lateral boundary conditions on (ta,sa)
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      !!              - Update lateral boundary conditions on AGRIF children
104      !!             domains (lk_agrif=T)
105      !!
106      !! ** Action  : - ts(Kmm) time filtered
107      !!----------------------------------------------------------------------
108      INTEGER                                  , INTENT(in   ) :: kt             ! ocean time-step index
109      INTEGER                                  , INTENT(in   ) :: Kbb, Kmm, Kaa  ! time level indices
110      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers
111      !!
112      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
113      REAL(wp) ::   zfact            ! local scalars
114      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
115      !!----------------------------------------------------------------------
116      !
117      IF( ln_timing )   CALL timing_start( 'tra_atf')
118      !
119      IF( kt == nit000 ) THEN
120         IF(lwp) WRITE(numout,*)
121         IF(lwp) WRITE(numout,*) 'tra_atf : apply Asselin time filter to "now" fields'
122         IF(lwp) WRITE(numout,*) '~~~~~~~'
123      ENDIF
124
125      ! Update after tracer on domain lateral boundaries
126      !
127#if defined key_agrif
128      CALL Agrif_tra                     ! AGRIF zoom boundaries
129#endif
130      !                                              ! local domain boundaries  (T-point, unchanged sign)
131      CALL lbc_lnk( 'traatf', pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp )
132      !
133      IF( ln_bdy )   CALL bdy_tra( kt, Kbb, pts, Kaa )  ! BDY open boundaries
134
135      ! trends computation initialisation
136      IF( l_trdtra )   THEN
137         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
138         ztrdt(:,:,:) = 0._wp
139         ztrds(:,:,:) = 0._wp
140         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend
141            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_zdfp, ztrdt )
142            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_zdfp, ztrds )
143         ENDIF
144         ! total trend for the non-time-filtered variables.
145         zfact = 1.0 / rn_Dt
146         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms
147         DO jk = 1, jpkm1
148            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) / e3t(:,:,jk,Kmm) - pts(:,:,jk,jp_tem,Kmm)) * zfact
149            ztrds(:,:,jk) = ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa) / e3t(:,:,jk,Kmm) - pts(:,:,jk,jp_sal,Kmm)) * zfact
150         END DO
151         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_tot, ztrdt )
152         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_tot, ztrds )
153         IF( ln_linssh ) THEN       ! linear sea surface height only
154            ! Store now fields before applying the Asselin filter
155            ! in order to calculate Asselin filter trend later.
156            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm)
157            ztrds(:,:,:) = pts(:,:,:,jp_sal,Kmm)
158         ENDIF
159      ENDIF
160
161      IF( l_1st_euler ) THEN       ! Euler time-stepping
162         !
163         IF (l_trdtra .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl
164            !                                        ! Asselin filter is output by tra_atf_vvl that is not called on this time step
165            ztrdt(:,:,:) = 0._wp
166            ztrds(:,:,:) = 0._wp
167            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_atf, ztrdt )
168            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_atf, ztrds )
169         END IF
170         !
171      ELSE                                            ! Leap-Frog + Asselin filter time stepping
172         !
173         IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface
174         ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rn_Dt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface
175         ENDIF
176         !
177         ! [comm_cleanup]
178         IF (nn_hls.eq.1) CALL lbc_lnk( 'traatf',  pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp )
179
180      ENDIF
181      !
182      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt
183         DO jk = 1, jpkm1
184            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * r1_Dt
185            ztrds(:,:,jk) = ( pts(:,:,jk,jp_sal,Kmm) - ztrds(:,:,jk) ) * r1_Dt
186         END DO
187         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_atf, ztrdt )
188         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_atf, ztrds )
189      END IF
190      IF( l_trdtra )   DEALLOCATE( ztrdt , ztrds )
191      !
192      !                        ! control print
193      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Kmm), clinfo1=' nxt  - Tn: ', mask1=tmask,   &
194         &                                  tab3d_2=pts(:,:,:,jp_sal,Kmm), clinfo2=       ' Sn: ', mask2=tmask )
195      !
196      IF( ln_timing )   CALL timing_stop('tra_atf')
197      !
198   END SUBROUTINE tra_atf
199
200
201   SUBROUTINE tra_atf_fix( kt, Kbb, Kmm, Kaa, kit000, cdtype, pt, kjpt )
202      !!----------------------------------------------------------------------
203      !!                   ***  ROUTINE tra_atf_fix  ***
204      !!
205      !! ** Purpose :   fixed volume: apply the Asselin time filter to the "now" field
206      !!
207      !! ** Method  : - Apply a Asselin time filter on now fields.
208      !!
209      !! ** Action  : - pt(Kmm) ready for the next time step
210      !!----------------------------------------------------------------------
211      INTEGER                                  , INTENT(in   ) ::  kt            ! ocean time-step index
212      INTEGER                                  , INTENT(in   ) ::  Kbb, Kmm, Kaa ! time level indices
213      INTEGER                                  , INTENT(in   ) ::  kit000        ! first time step index
214      CHARACTER(len=3)                         , INTENT(in   ) ::  cdtype        ! =TRA or TRC (tracer indicator)
215      INTEGER                                  , INTENT(in   ) ::  kjpt          ! number of tracers
216      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::  pt            ! tracer fields
217      !
218      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
219      REAL(wp) ::   ztn, ztd         ! local scalars
220      !!----------------------------------------------------------------------
221      !
222      IF( kt == kit000 )  THEN
223         IF(lwp) WRITE(numout,*)
224         IF(lwp) WRITE(numout,*) 'tra_atf_fix : time filtering', cdtype
225         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
226      ENDIF
227      !
228      DO jn = 1, kjpt
229         !
230         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
231            ztn = pt(ji,jj,jk,jn,Kmm)
232            ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers
233            !
234            pt(ji,jj,jk,jn,Kmm) = ztn + rn_atfp * ztd                      ! pt <-- filtered pt
235         END_3D
236         !
237      END DO
238      !
239   END SUBROUTINE tra_atf_fix
240
241
242   SUBROUTINE tra_atf_vvl( kt, Kbb, Kmm, Kaa, kit000, p2dt, cdtype, pt, psbc_tc, psbc_tc_b, kjpt )
243      !!----------------------------------------------------------------------
244      !!                   ***  ROUTINE tra_atf_vvl  ***
245      !!
246      !! ** Purpose :   Time varying volume: apply the Asselin time filter
247      !!
248      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields.
249      !!             pt(Kmm)  = ( e3t_Kmm*pt(Kmm) + rn_atfp*[ e3t_Kbb*pt(Kbb) - 2 e3t_Kmm*pt(Kmm) + e3t_Kaa*pt(Kaa) ] )
250      !!                       /( e3t_Kmm         + rn_atfp*[ e3t_Kbb         - 2 e3t_Kmm         + e3t_Kaa    ] )
251      !!
252      !! ** Action  : - pt(Kmm) ready for the next time step
253      !!----------------------------------------------------------------------
254      INTEGER                                  , INTENT(in   ) ::  kt        ! ocean time-step index
255      INTEGER                                  , INTENT(in   ) ::  Kbb, Kmm, Kaa ! time level indices
256      INTEGER                                  , INTENT(in   ) ::  kit000    ! first time step index
257      REAL(wp)                                 , INTENT(in   ) ::  p2dt      ! time-step
258      CHARACTER(len=3)                         , INTENT(in   ) ::  cdtype    ! =TRA or TRC (tracer indicator)
259      INTEGER                                  , INTENT(in   ) ::  kjpt      ! number of tracers
260      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::  pt        ! tracer fields
261      REAL(wp), DIMENSION(jpi,jpj    ,kjpt)    , INTENT(in   ) ::  psbc_tc   ! surface tracer content
262      REAL(wp), DIMENSION(jpi,jpj    ,kjpt)    , INTENT(in   ) ::  psbc_tc_b ! before surface tracer content
263      !
264      LOGICAL  ::   ll_traqsr, ll_rnf, ll_isf   ! local logical
265      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
266      REAL(wp) ::   zfact, zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
267      REAL(wp) ::   zfact2, ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d, zscale  !   -      -
268      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrd_atf
269      !!----------------------------------------------------------------------
270      !
271      IF( kt == kit000 )  THEN
272         IF(lwp) WRITE(numout,*)
273         IF(lwp) WRITE(numout,*) 'tra_atf_vvl : time filtering', cdtype
274         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
275      ENDIF
276      !
277      IF( cdtype == 'TRA' )  THEN
278         ll_traqsr  = ln_traqsr        ! active  tracers case  and  solar penetration
279         ll_rnf     = ln_rnf           ! active  tracers case  and  river runoffs
280         ll_isf     = ln_isf           ! active  tracers case  and  ice shelf melting
281      ELSE                          ! passive tracers case
282         ll_traqsr  = .FALSE.          ! NO solar penetration
283         ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ?
284         ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ??
285      ENDIF
286      !
287      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
288         ALLOCATE( ztrd_atf(jpi,jpj,jpk,kjpt) )
289         ztrd_atf(:,:,:,:) = 0.0_wp
290      ENDIF
291      zfact = 1._wp / p2dt
292      zfact1 = rn_atfp * p2dt
293      zfact2 = zfact1 * r1_rho0
294      DO jn = 1, kjpt
295         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
296            ze3t_b = e3t(ji,jj,jk,Kbb)
297            ze3t_n = e3t(ji,jj,jk,Kmm)
298            ze3t_a = e3t(ji,jj,jk,Kaa)
299            !                                         ! tracer content at Before, now and after
300            ztc_b  = pt(ji,jj,jk,jn,Kbb) * ze3t_b
301            ztc_n  = pt(ji,jj,jk,jn,Kmm) * ze3t_n
302            ztc_a  = pt(ji,jj,jk,jn,Kaa) * ze3t_a
303            !
304            ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b
305            ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b
306            !
307            ze3t_f = ze3t_n + rn_atfp * ze3t_d
308            ztc_f  = ztc_n  + rn_atfp * ztc_d
309            !
310            ! Add asselin correction on scale factors:
311            zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) )
312            ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) )
313            IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * (    rnf_b(ji,jj) -    rnf(ji,jj) )
314            IF ( ll_isf ) THEN
315               IF ( ln_isfcav_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) )
316               IF ( ln_isfpar_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_par_b(ji,jj) - fwfisf_par(ji,jj) )
317            ENDIF
318            !
319            IF( jk == mikt(ji,jj) ) THEN           ! first level
320               ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) )
321            ENDIF
322            !
323            ! solar penetration (temperature only)
324            IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            &
325               &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )
326               !
327            !
328            IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          &
329               &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &
330               &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj)
331
332            !
333            ! ice shelf
334            IF( ll_isf ) THEN
335               !
336               ! melt in the cavity
337               IF ( ln_isfcav_mlt ) THEN
338                  ! level fully include in the Losch_2008 ice shelf boundary layer
339                  IF ( jk >= misfkt_cav(ji,jj) .AND. jk < misfkb_cav(ji,jj) ) THEN
340                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) ) &
341                        &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj)
342                  END IF
343                  ! level partially include in Losch_2008 ice shelf boundary layer
344                  IF ( jk == misfkb_cav(ji,jj) ) THEN
345                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) )  &
346                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) * rfrac_tbl_cav(ji,jj)
347                  END IF
348               END IF
349               !
350               ! parametrised melt (cavity closed)
351               IF ( ln_isfpar_mlt ) THEN
352                  ! level fully include in the Losch_2008 ice shelf boundary layer
353                  IF ( jk >= misfkt_par(ji,jj) .AND. jk < misfkb_par(ji,jj) ) THEN
354                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
355                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj)
356                  END IF
357                  ! level partially include in Losch_2008 ice shelf boundary layer
358                  IF ( jk == misfkb_par(ji,jj) ) THEN
359                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
360                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) * rfrac_tbl_par(ji,jj)
361                  END IF
362               END IF
363               !
364               ! ice sheet coupling correction
365               IF ( ln_isfcpl ) THEN
366                  !
367                  ! at kt = nit000,  risfcpl_vol_n = 0 and risfcpl_vol_b = risfcpl_vol so contribution nul
368                  IF ( ln_rstart .AND. kt == nit000+1 ) THEN
369                     ztc_f  = ztc_f  + zfact1 * risfcpl_tsc(ji,jj,jk,jn) * r1_e1e2t(ji,jj)
370                     ! Shouldn't volume increment be spread according thanks to zscale  ?
371                     ze3t_f = ze3t_f - zfact1 * risfcpl_vol(ji,jj,jk   ) * r1_e1e2t(ji,jj)
372                  END IF
373                  !
374               END IF
375               !
376            END IF
377            !
378            ze3t_f = 1.e0 / ze3t_f
379            pt(ji,jj,jk,jn,Kmm) = ztc_f * ze3t_f    ! time filtered "now" field
380            !
381            IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) ) THEN
382               ztrd_atf(ji,jj,jk,jn) = (ztc_f - ztc_n) * zfact/ze3t_n
383            ENDIF
384            !
385         END_3D
386         !
387      END DO
388      !
389      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
390         IF( l_trdtra .AND. cdtype == 'TRA' ) THEN
391            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) )
392            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) )
393         ENDIF
394         IF( l_trdtrc .AND. cdtype == 'TRC' ) THEN
395            DO jn = 1, kjpt
396               CALL trd_tra( kt, Kmm, Kaa, cdtype, jn, jptra_atf, ztrd_atf(:,:,:,jn) )
397            END DO
398         ENDIF
399         DEALLOCATE( ztrd_atf )
400      ENDIF
401      !
402   END SUBROUTINE tra_atf_vvl
403
404#endif
405
406   !!======================================================================
407END MODULE traatf
Note: See TracBrowser for help on using the repository browser.