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_qco.F90 in NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/OCE/TRA – NEMO

source: NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/OCE/TRA/traatf_qco.F90 @ 14037

Last change on this file since 14037 was 14037, checked in by ayoung, 3 years ago

Updated to trunk at 14020. Sette tests passed with change of results for configurations with non-linear ssh. Ticket #2506.

  • Property svn:keywords set to Id
File size: 19.1 KB
RevLine 
[12624]1MODULE traatfqco
[3]2   !!======================================================================
[12624]3   !!                       ***  MODULE  traatfqco  ***
[11475]4   !! Ocean active tracers:  Asselin time filtering for temperature and salinity
[3]5   !!======================================================================
[1110]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
[1438]16   !!            3.1  !  2009-02  (G. Madec, R. Benshila)  re-introduce the vvl option
[2528]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
[12581]19   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rename tranxt.F90 -> traatfLF.F90. Now only does time filtering.
[3]20   !!----------------------------------------------------------------------
[503]21
22   !!----------------------------------------------------------------------
[11475]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
[3]26   !!----------------------------------------------------------------------
27   USE oce             ! ocean dynamics and tracers variables
[12581]28   USE dom_oce         ! ocean space and time domain variables
[2528]29   USE sbc_oce         ! surface boundary condition: ocean
[5467]30   USE sbcrnf          ! river runoffs
[12150]31   USE isf_oce         ! ice shelf melting
[4990]32   USE zdf_oce         ! ocean vertical mixing
[1438]33   USE domvvl          ! variable volume
[4990]34   USE trd_oce         ! trends: ocean variables
[12581]35   USE trdtra          ! trends manager: tracers
[4990]36   USE traqsr          ! penetrative solar radiation (needed for nksr)
37   USE phycst          ! physical constant
[9019]38   USE ldftra          ! lateral physics : tracers
39   USE ldfslp          ! lateral physics : slopes
40   USE bdy_oce  , ONLY : ln_bdy
[3294]41   USE bdytra          ! open boundary condition (bdy_tra routine)
[4990]42   !
[3]43   USE in_out_manager  ! I/O manager
44   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
[258]45   USE prtctl          ! Print control
[4990]46   USE timing          ! Timing
[2528]47#if defined key_agrif
[9570]48   USE agrif_oce_interp
[2528]49#endif
[3]50
51   IMPLICIT NONE
52   PRIVATE
53
[12624]54   PUBLIC   tra_atf_qco       ! routine called by step.F90
[12732]55   PUBLIC   tra_atf_fix_lf    ! to be used in trcnxt !!st WARNING discrepancy here interpol is used by PISCES
56   PUBLIC   tra_atf_qco_lf    ! to be used in trcnxt !!st WARNING discrepancy here interpol is used by PISCES
[592]57
58   !! * Substitutions
[12340]59#  include "do_loop_substitute.h90"
[12624]60#  include "domzgr_substitute.h90"
[3]61   !!----------------------------------------------------------------------
[10068]62   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[2715]63   !! $Id$
[10068]64   !! Software governed by the CeCILL license (see ./LICENSE)
[3]65   !!----------------------------------------------------------------------
66CONTAINS
67
[12624]68   SUBROUTINE tra_atf_qco( kt, Kbb, Kmm, Kaa, pts )
[3]69      !!----------------------------------------------------------------------
[12581]70      !!                   ***  ROUTINE traatfLF  ***
[3]71      !!
[12581]72      !! ** Purpose :   Apply the boundary condition on the after temperature
[11475]73      !!             and salinity fields and add the Asselin time filter on now fields.
[12581]74      !!
75      !! ** Method  :   At this stage of the computation, ta and sa are the
[1110]76      !!             after temperature and salinity as the time stepping has
77      !!             been performed in trazdf_imp or trazdf_exp module.
[3]78      !!
[12581]79      !!              - Apply lateral boundary conditions on (ta,sa)
80      !!             at the local domain   boundaries through lbc_lnk call,
81      !!             at the one-way open boundaries (ln_bdy=T),
[4990]82      !!             at the AGRIF zoom   boundaries (lk_agrif=T)
[1110]83      !!
[1438]84      !!              - Update lateral boundary conditions on AGRIF children
85      !!             domains (lk_agrif=T)
[1110]86      !!
[11475]87      !! ** Action  : - ts(Kmm) time filtered
[503]88      !!----------------------------------------------------------------------
[11057]89      INTEGER                                  , INTENT(in   ) :: kt             ! ocean time-step index
90      INTEGER                                  , INTENT(in   ) :: Kbb, Kmm, Kaa  ! time level indices
[12581]91      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers
[503]92      !!
[6140]93      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
94      REAL(wp) ::   zfact            ! local scalars
[9019]95      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
[3]96      !!----------------------------------------------------------------------
[3294]97      !
[12624]98      IF( ln_timing )   CALL timing_start( 'tra_atf_qco')
[3294]99      !
[1110]100      IF( kt == nit000 ) THEN
101         IF(lwp) WRITE(numout,*)
[12624]102         IF(lwp) WRITE(numout,*) 'tra_atf_qco : apply Asselin time filter to "now" fields'
[1110]103         IF(lwp) WRITE(numout,*) '~~~~~~~'
[592]104      ENDIF
[12732]105!!st  Update after tracer on domain lateral boundaries as been removed outside
[592]106
[1110]107      ! trends computation initialisation
[12581]108      IF( l_trdtra )   THEN
[9019]109         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
[8698]110         ztrdt(:,:,jpk) = 0._wp
111         ztrds(:,:,jpk) = 0._wp
[12581]112         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend
[11057]113            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_zdfp, ztrdt )
114            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_zdfp, ztrds )
[4990]115         ENDIF
[12581]116         ! total trend for the non-time-filtered variables.
[12724]117         zfact = 1.0 / rn_Dt
[11057]118         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms
[7646]119         DO jk = 1, jpkm1
[12624]120            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kaa) * (1._wp + r3t(:,:,Kaa) * tmask(:,:,jk))/(1._wp + r3t(:,:,Kmm) * tmask(:,:,jk))  &
121               &            - pts(:,:,jk,jp_tem,Kmm) ) * zfact
122            ztrds(:,:,jk) = ( pts(:,:,jk,jp_sal,Kaa) * (1._wp + r3t(:,:,Kaa) * tmask(:,:,jk))/(1._wp + r3t(:,:,Kmm) * tmask(:,:,jk))  &
123               &            - pts(:,:,jk,jp_sal,Kmm) ) * zfact
[7646]124         END DO
[11057]125         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_tot, ztrdt )
126         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_tot, ztrds )
[9019]127         IF( ln_linssh ) THEN       ! linear sea surface height only
[12581]128            ! Store now fields before applying the Asselin filter
[8698]129            ! in order to calculate Asselin filter trend later.
[12581]130            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm)
[11057]131            ztrds(:,:,:) = pts(:,:,:,jp_sal,Kmm)
[8698]132         ENDIF
[1110]133      ENDIF
134
[12724]135      IF( l_1st_euler ) THEN       ! Euler time-stepping
[11099]136         !
[9019]137         IF (l_trdtra .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl
[11057]138            !                                        ! Asselin filter is output by tra_atf_vvl that is not called on this time step
[8698]139            ztrdt(:,:,:) = 0._wp
140            ztrds(:,:,:) = 0._wp
[11057]141            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_atf, ztrdt )
142            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_atf, ztrds )
[8698]143         END IF
[6140]144         !
[2528]145      ELSE                                            ! Leap-Frog + Asselin filter time stepping
146         !
[12724]147         IF ( ln_linssh ) THEN   ;   CALL tra_atf_fix_lf( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface
148         ELSE                    ;   CALL tra_atf_qco_lf( kt, Kbb, Kmm, Kaa, nit000, rn_Dt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface
[2528]149         ENDIF
[6140]150         !
[14037]151         CALL lbc_lnk_multi( 'traatfqco', pts(:,:,:,jp_tem,Kmm) , 'T', 1., pts(:,:,:,jp_sal,Kmm) , 'T', 1. )
152
[12581]153      ENDIF
[2715]154      !
[12581]155      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt
[1110]156         DO jk = 1, jpkm1
[12724]157            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * r1_Dt
158            ztrds(:,:,jk) = ( pts(:,:,jk,jp_sal,Kmm) - ztrds(:,:,jk) ) * r1_Dt
[1110]159         END DO
[11057]160         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_atf, ztrdt )
161         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_atf, ztrds )
[1438]162      END IF
[9019]163      IF( l_trdtra )   DEALLOCATE( ztrdt , ztrds )
[2715]164      !
[1438]165      !                        ! control print
[12236]166      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Kmm), clinfo1=' nxt  - Tn: ', mask1=tmask,   &
167         &                                  tab3d_2=pts(:,:,:,jp_sal,Kmm), clinfo2=       ' Sn: ', mask2=tmask )
[1438]168      !
[12624]169      IF( ln_timing )   CALL timing_stop('tra_atf_qco')
[3294]170      !
[12624]171   END SUBROUTINE tra_atf_qco
[1438]172
173
[12581]174   SUBROUTINE tra_atf_fix_lf( kt, Kbb, Kmm, Kaa, kit000, cdtype, pt, kjpt )
[1438]175      !!----------------------------------------------------------------------
[11057]176      !!                   ***  ROUTINE tra_atf_fix  ***
[1438]177      !!
[11475]178      !! ** Purpose :   fixed volume: apply the Asselin time filter to the "now" field
[12581]179      !!
[1438]180      !! ** Method  : - Apply a Asselin time filter on now fields.
181      !!
[11475]182      !! ** Action  : - pt(Kmm) ready for the next time step
[1438]183      !!----------------------------------------------------------------------
[11057]184      INTEGER                                  , INTENT(in   ) ::  kt            ! ocean time-step index
185      INTEGER                                  , INTENT(in   ) ::  Kbb, Kmm, Kaa ! time level indices
186      INTEGER                                  , INTENT(in   ) ::  kit000        ! first time step index
187      CHARACTER(len=3)                         , INTENT(in   ) ::  cdtype        ! =TRA or TRC (tracer indicator)
188      INTEGER                                  , INTENT(in   ) ::  kjpt          ! number of tracers
189      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::  pt            ! tracer fields
[2715]190      !
[2528]191      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
192      REAL(wp) ::   ztn, ztd         ! local scalars
[1438]193      !!----------------------------------------------------------------------
[6140]194      !
[3294]195      IF( kt == kit000 )  THEN
[1438]196         IF(lwp) WRITE(numout,*)
[12581]197         IF(lwp) WRITE(numout,*) 'tra_atf_fix_lf : time filtering', cdtype
[1438]198         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
199      ENDIF
200      !
[2528]201      DO jn = 1, kjpt
[1438]202         !
[14037]203         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
[12581]204            ztn = pt(ji,jj,jk,jn,Kmm)
[12340]205            ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers
206            !
[12724]207            pt(ji,jj,jk,jn,Kmm) = ztn + rn_atfp * ztd                      ! pt <-- filtered pt
[12340]208         END_3D
[1110]209         !
[2528]210      END DO
[1438]211      !
[12581]212   END SUBROUTINE tra_atf_fix_lf
[3]213
[1110]214
[12624]215   SUBROUTINE tra_atf_qco_lf( kt, Kbb, Kmm, Kaa, kit000, p2dt, cdtype, pt, psbc_tc, psbc_tc_b, kjpt )
[1438]216      !!----------------------------------------------------------------------
[11057]217      !!                   ***  ROUTINE tra_atf_vvl  ***
[1438]218      !!
[12581]219      !! ** Purpose :   Time varying volume: apply the Asselin time filter
220      !!
[1438]221      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields.
[12724]222      !!             pt(Kmm)  = ( e3t_m*pt(Kmm) + rn_atfp*[ e3t_b*pt(Kbb) - 2 e3t_m*pt(Kmm) + e3t_a*pt(Kaa) ] )
223      !!                       /( e3t_m         + rn_atfp*[ e3t_b         - 2 e3t_m         + e3t_a    ] )
[1438]224      !!
[11475]225      !! ** Action  : - pt(Kmm) ready for the next time step
[1438]226      !!----------------------------------------------------------------------
[11057]227      INTEGER                                  , INTENT(in   ) ::  kt        ! ocean time-step index
228      INTEGER                                  , INTENT(in   ) ::  Kbb, Kmm, Kaa ! time level indices
229      INTEGER                                  , INTENT(in   ) ::  kit000    ! first time step index
230      REAL(wp)                                 , INTENT(in   ) ::  p2dt      ! time-step
231      CHARACTER(len=3)                         , INTENT(in   ) ::  cdtype    ! =TRA or TRC (tracer indicator)
232      INTEGER                                  , INTENT(in   ) ::  kjpt      ! number of tracers
233      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::  pt        ! tracer fields
234      REAL(wp), DIMENSION(jpi,jpj    ,kjpt)    , INTENT(in   ) ::  psbc_tc   ! surface tracer content
235      REAL(wp), DIMENSION(jpi,jpj    ,kjpt)    , INTENT(in   ) ::  psbc_tc_b ! before surface tracer content
[6140]236      !
[5930]237      LOGICAL  ::   ll_traqsr, ll_rnf, ll_isf   ! local logical
[2528]238      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
[8698]239      REAL(wp) ::   zfact, zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
[12732]240      REAL(wp) ::   zfact2, ze3t_b, ze3t_n, ze3t_a, ze3t_f                  !   -      -
[9019]241      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrd_atf
[1438]242      !!----------------------------------------------------------------------
[3294]243      !
244      IF( kt == kit000 )  THEN
[1438]245         IF(lwp) WRITE(numout,*)
[12624]246         IF(lwp) WRITE(numout,*) 'tra_atf_qco : time filtering', cdtype
[1438]247         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
248      ENDIF
[2528]249      !
[12581]250      IF( cdtype == 'TRA' )  THEN
[2528]251         ll_traqsr  = ln_traqsr        ! active  tracers case  and  solar penetration
[5467]252         ll_rnf     = ln_rnf           ! active  tracers case  and  river runoffs
[6140]253         ll_isf     = ln_isf           ! active  tracers case  and  ice shelf melting
254      ELSE                          ! passive tracers case
255         ll_traqsr  = .FALSE.          ! NO solar penetration
[12581]256         ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ?
257         ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ??
[2528]258      ENDIF
259      !
[9019]260      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
261         ALLOCATE( ztrd_atf(jpi,jpj,jpk,kjpt) )
[8698]262         ztrd_atf(:,:,:,:) = 0.0_wp
263      ENDIF
[10095]264      zfact = 1._wp / p2dt
[12724]265      zfact1 = rn_atfp * p2dt
266      zfact2 = zfact1 * r1_rho0
[12581]267      DO jn = 1, kjpt
[14037]268         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
[12340]269            ze3t_b = e3t(ji,jj,jk,Kbb)
270            ze3t_n = e3t(ji,jj,jk,Kmm)
271            ze3t_a = e3t(ji,jj,jk,Kaa)
272            !                                         ! tracer content at Before, now and after
273            ztc_b  = pt(ji,jj,jk,jn,Kbb) * ze3t_b
274            ztc_n  = pt(ji,jj,jk,jn,Kmm) * ze3t_n
275            ztc_a  = pt(ji,jj,jk,jn,Kaa) * ze3t_a
276            !
277            ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b
278            !
[12724]279            ztc_f  = ztc_n  + rn_atfp * ztc_d
[12340]280            !
[12581]281            ! Asselin correction on scale factors is done via ssh in r3t_f
282            ze3t_f = e3t_0(ji,jj,jk) * ( 1._wp + r3t_f(ji,jj) * tmask(ji,jj,jk) )
283
[12372]284            !
[12581]285            IF( jk == mikt(ji,jj) ) THEN           ! first level
[12340]286               ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) )
287            ENDIF
288            !
289            ! solar penetration (temperature only)
[12581]290            IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            &
291               &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )
[12340]292               !
293            !
294            IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          &
[12581]295               &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &
[12340]296               &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj)
[12156]297
[12340]298            !
299            ! ice shelf
300            IF( ll_isf ) THEN
301               !
302               ! melt in the cavity
303               IF ( ln_isfcav_mlt ) THEN
304                  ! level fully include in the Losch_2008 ice shelf boundary layer
305                  IF ( jk >= misfkt_cav(ji,jj) .AND. jk < misfkb_cav(ji,jj) ) THEN
306                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) ) &
307                        &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj)
308                  END IF
[12581]309                  ! level partially include in Losch_2008 ice shelf boundary layer
[12340]310                  IF ( jk == misfkb_cav(ji,jj) ) THEN
311                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) )  &
[12624]312                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj)               &
313                            &                 * rfrac_tbl_cav(ji,jj)
[12340]314                  END IF
315               END IF
316               !
317               ! parametrised melt (cavity closed)
318               IF ( ln_isfpar_mlt ) THEN
319                  ! level fully include in the Losch_2008 ice shelf boundary layer
320                  IF ( jk >= misfkt_par(ji,jj) .AND. jk < misfkb_par(ji,jj) ) THEN
321                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
322                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj)
323                  END IF
[12581]324                  ! level partially include in Losch_2008 ice shelf boundary layer
[12340]325                  IF ( jk == misfkb_par(ji,jj) ) THEN
326                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
[12624]327                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj)               &
328                            &                 * rfrac_tbl_par(ji,jj)
[12340]329                  END IF
330               END IF
331               !
332               ! ice sheet coupling correction
333               IF ( ln_isfcpl ) THEN
[12156]334                  !
[12340]335                  ! at kt = nit000,  risfcpl_vol_n = 0 and risfcpl_vol_b = risfcpl_vol so contribution nul
336                  IF ( ln_rstart .AND. kt == nit000+1 ) THEN
337                     ztc_f  = ztc_f  + zfact1 * risfcpl_tsc(ji,jj,jk,jn) * r1_e1e2t(ji,jj)
[12372]338                     ! Shouldn't volume increment be spread according thanks to zscale  ?
[5643]339                  END IF
[6140]340                  !
[12340]341               END IF
342               !
343            END IF
344            !
345            ze3t_f = 1.e0 / ze3t_f
346            pt(ji,jj,jk,jn,Kmm) = ztc_f * ze3t_f    ! time filtered "now" field
347            !
348            IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) ) THEN
349               ztrd_atf(ji,jj,jk,jn) = (ztc_f - ztc_n) * zfact/ze3t_n
350            ENDIF
351            !
352         END_3D
[12581]353         !
[2528]354      END DO
[503]355      !
[9019]356      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
[12581]357         IF( l_trdtra .AND. cdtype == 'TRA' ) THEN
[11057]358            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) )
359            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) )
[9019]360         ENDIF
361         IF( l_trdtrc .AND. cdtype == 'TRC' ) THEN
362            DO jn = 1, kjpt
[11057]363               CALL trd_tra( kt, Kmm, Kaa, cdtype, jn, jptra_atf, ztrd_atf(:,:,:,jn) )
[9019]364            END DO
365         ENDIF
366         DEALLOCATE( ztrd_atf )
[8698]367      ENDIF
368      !
[12624]369   END SUBROUTINE tra_atf_qco_lf
[3]370
371   !!======================================================================
[12624]372END MODULE traatfqco
Note: See TracBrowser for help on using the repository browser.