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/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA – NEMO

source: NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/traatf.F90 @ 12680

Last change on this file since 12680 was 12680, checked in by techene, 4 years ago

dynatfQCO.F90, stepLF.F90 : fixed (remove pe3. from dyn_atf_qco input arguments), all : remove e3. tables and include gurvan's feedbacks

  • Property svn:keywords set to Id
File size: 20.1 KB
RevLine 
[11057]1MODULE traatf
[3]2   !!======================================================================
[11057]3   !!                       ***  MODULE  traatf  ***
[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
[11475]19   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rename tranxt.F90 -> traatf.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
[11057]54   PUBLIC   tra_atf       ! routine called by step.F90
55   PUBLIC   tra_atf_fix   ! to be used in trcnxt
56   PUBLIC   tra_atf_vvl   ! to be used in trcnxt
[592]57
58   !! * Substitutions
[12340]59#  include "do_loop_substitute.h90"
[12656]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
[11057]68   SUBROUTINE tra_atf( kt, Kbb, Kmm, Kaa, pts )
[3]69      !!----------------------------------------------------------------------
[11057]70      !!                   ***  ROUTINE traatf  ***
[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      !
[11057]98      IF( ln_timing )   CALL timing_start( 'tra_atf')
[3294]99      !
[1110]100      IF( kt == nit000 ) THEN
101         IF(lwp) WRITE(numout,*)
[11475]102         IF(lwp) WRITE(numout,*) 'tra_atf : apply Asselin time filter to "now" fields'
[1110]103         IF(lwp) WRITE(numout,*) '~~~~~~~'
[592]104      ENDIF
105
[1110]106      ! Update after tracer on domain lateral boundaries
[12581]107      !
[5656]108#if defined key_agrif
109      CALL Agrif_tra                     ! AGRIF zoom boundaries
110#endif
[9094]111      !                                              ! local domain boundaries  (T-point, unchanged sign)
[11057]112      CALL lbc_lnk_multi( 'traatf', pts(:,:,:,jp_tem,Kaa), 'T', 1., pts(:,:,:,jp_sal,Kaa), 'T', 1. )
[5656]113      !
[11057]114      IF( ln_bdy )   CALL bdy_tra( kt, Kbb, pts, Kaa )  ! BDY open boundaries
[12581]115
[1438]116      ! set time step size (Euler/Leapfrog)
[9019]117      IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt =        rdt   ! at nit000             (Euler)
[6140]118      ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dt = 2._wp* rdt   ! at nit000 or nit000+1 (Leapfrog)
[1438]119      ENDIF
[3]120
[1110]121      ! trends computation initialisation
[12581]122      IF( l_trdtra )   THEN
[9019]123         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
[8698]124         ztrdt(:,:,jpk) = 0._wp
125         ztrds(:,:,jpk) = 0._wp
[12581]126         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend
[11057]127            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_zdfp, ztrdt )
128            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_zdfp, ztrds )
[4990]129         ENDIF
[12581]130         ! total trend for the non-time-filtered variables.
[8698]131         zfact = 1.0 / rdt
[11057]132         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms
[7646]133         DO jk = 1, jpkm1
[12680]134            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) / e3t(:,:,jk,Kmm) - pts(:,:,jk,jp_tem,Kmm)) * zfact
135            ztrds(:,:,jk) = ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa) / e3t(:,:,jk,Kmm) - pts(:,:,jk,jp_sal,Kmm)) * zfact
[7646]136         END DO
[11057]137         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_tot, ztrdt )
138         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_tot, ztrds )
[9019]139         IF( ln_linssh ) THEN       ! linear sea surface height only
[12581]140            ! Store now fields before applying the Asselin filter
[8698]141            ! in order to calculate Asselin filter trend later.
[12581]142            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm)
[11057]143            ztrds(:,:,:) = pts(:,:,:,jp_sal,Kmm)
[8698]144         ENDIF
[1110]145      ENDIF
146
[12581]147      IF( neuler == 0 .AND. kt == nit000 ) THEN       ! Euler time-stepping
[11099]148         !
[9019]149         IF (l_trdtra .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl
[11057]150            !                                        ! Asselin filter is output by tra_atf_vvl that is not called on this time step
[8698]151            ztrdt(:,:,:) = 0._wp
152            ztrds(:,:,:) = 0._wp
[11057]153            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_atf, ztrdt )
154            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_atf, ztrds )
[8698]155         END IF
[6140]156         !
[2528]157      ELSE                                            ! Leap-Frog + Asselin filter time stepping
158         !
[12581]159         IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,      'TRA', pts, jpts )  ! linear free surface
[11057]160         ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rdt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface
[2528]161         ENDIF
[6140]162         !
[11057]163         CALL lbc_lnk_multi( 'traatf', pts(:,:,:,jp_tem,Kbb) , 'T', 1., pts(:,:,:,jp_sal,Kbb) , 'T', 1., &
164                  &                    pts(:,:,:,jp_tem,Kmm) , 'T', 1., pts(:,:,:,jp_sal,Kmm) , 'T', 1., &
165                  &                    pts(:,:,:,jp_tem,Kaa), 'T', 1., pts(:,:,:,jp_sal,Kaa), 'T', 1.  )
[9094]166         !
[12581]167      ENDIF
[2715]168      !
[12581]169      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt
170         zfact = 1._wp / r2dt
[1110]171         DO jk = 1, jpkm1
[11099]172            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * zfact
173            ztrds(:,:,jk) = ( pts(:,:,jk,jp_sal,Kmm) - ztrds(:,:,jk) ) * zfact
[1110]174         END DO
[11057]175         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_atf, ztrdt )
176         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_atf, ztrds )
[1438]177      END IF
[9019]178      IF( l_trdtra )   DEALLOCATE( ztrdt , ztrds )
[2715]179      !
[1438]180      !                        ! control print
[12236]181      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Kmm), clinfo1=' nxt  - Tn: ', mask1=tmask,   &
182         &                                  tab3d_2=pts(:,:,:,jp_sal,Kmm), clinfo2=       ' Sn: ', mask2=tmask )
[1438]183      !
[11057]184      IF( ln_timing )   CALL timing_stop('tra_atf')
[3294]185      !
[11057]186   END SUBROUTINE tra_atf
[1438]187
188
[11099]189   SUBROUTINE tra_atf_fix( kt, Kbb, Kmm, Kaa, kit000, cdtype, pt, kjpt )
[1438]190      !!----------------------------------------------------------------------
[11057]191      !!                   ***  ROUTINE tra_atf_fix  ***
[1438]192      !!
[11475]193      !! ** Purpose :   fixed volume: apply the Asselin time filter to the "now" field
[12581]194      !!
[1438]195      !! ** Method  : - Apply a Asselin time filter on now fields.
196      !!
[11475]197      !! ** Action  : - pt(Kmm) ready for the next time step
[1438]198      !!----------------------------------------------------------------------
[11057]199      INTEGER                                  , INTENT(in   ) ::  kt            ! ocean time-step index
200      INTEGER                                  , INTENT(in   ) ::  Kbb, Kmm, Kaa ! time level indices
201      INTEGER                                  , INTENT(in   ) ::  kit000        ! first time step index
202      CHARACTER(len=3)                         , INTENT(in   ) ::  cdtype        ! =TRA or TRC (tracer indicator)
203      INTEGER                                  , INTENT(in   ) ::  kjpt          ! number of tracers
204      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::  pt            ! tracer fields
[2715]205      !
[2528]206      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
207      REAL(wp) ::   ztn, ztd         ! local scalars
[1438]208      !!----------------------------------------------------------------------
[6140]209      !
[3294]210      IF( kt == kit000 )  THEN
[1438]211         IF(lwp) WRITE(numout,*)
[11475]212         IF(lwp) WRITE(numout,*) 'tra_atf_fix : time filtering', cdtype
[1438]213         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
214      ENDIF
215      !
[2528]216      DO jn = 1, kjpt
[1438]217         !
[12340]218         DO_3D_00_00( 1, jpkm1 )
[12581]219            ztn = pt(ji,jj,jk,jn,Kmm)
[12340]220            ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers
221            !
222            pt(ji,jj,jk,jn,Kmm) = ztn + atfp * ztd                      ! pt <-- filtered pt
223         END_3D
[1110]224         !
[2528]225      END DO
[1438]226      !
[11057]227   END SUBROUTINE tra_atf_fix
[3]228
[1110]229
[11057]230   SUBROUTINE tra_atf_vvl( kt, Kbb, Kmm, Kaa, kit000, p2dt, cdtype, pt, psbc_tc, psbc_tc_b, kjpt )
[1438]231      !!----------------------------------------------------------------------
[11057]232      !!                   ***  ROUTINE tra_atf_vvl  ***
[1438]233      !!
[12581]234      !! ** Purpose :   Time varying volume: apply the Asselin time filter
235      !!
[1438]236      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields.
[12656]237      !!             pt(Kmm)  = ( e3t_Kmm*pt(Kmm) + atfp*[ e3t_Kbb*pt(Kbb) - 2 e3t_Kmm*pt(Kmm) + e3t_Kaa*pt(Kaa) ] )
238      !!                       /( e3t_Kmm         + atfp*[ e3t_Kbb         - 2 e3t_Kmm         + e3t_Kaa    ] )
[1438]239      !!
[11475]240      !! ** Action  : - pt(Kmm) ready for the next time step
[1438]241      !!----------------------------------------------------------------------
[11057]242      INTEGER                                  , INTENT(in   ) ::  kt        ! ocean time-step index
243      INTEGER                                  , INTENT(in   ) ::  Kbb, Kmm, Kaa ! time level indices
244      INTEGER                                  , INTENT(in   ) ::  kit000    ! first time step index
245      REAL(wp)                                 , INTENT(in   ) ::  p2dt      ! time-step
246      CHARACTER(len=3)                         , INTENT(in   ) ::  cdtype    ! =TRA or TRC (tracer indicator)
247      INTEGER                                  , INTENT(in   ) ::  kjpt      ! number of tracers
248      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::  pt        ! tracer fields
249      REAL(wp), DIMENSION(jpi,jpj    ,kjpt)    , INTENT(in   ) ::  psbc_tc   ! surface tracer content
250      REAL(wp), DIMENSION(jpi,jpj    ,kjpt)    , INTENT(in   ) ::  psbc_tc_b ! before surface tracer content
[6140]251      !
[5930]252      LOGICAL  ::   ll_traqsr, ll_rnf, ll_isf   ! local logical
[2528]253      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
[8698]254      REAL(wp) ::   zfact, zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
[12372]255      REAL(wp) ::   zfact2, ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d, zscale  !   -      -
[9019]256      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrd_atf
[1438]257      !!----------------------------------------------------------------------
[3294]258      !
259      IF( kt == kit000 )  THEN
[1438]260         IF(lwp) WRITE(numout,*)
[11475]261         IF(lwp) WRITE(numout,*) 'tra_atf_vvl : time filtering', cdtype
[1438]262         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
263      ENDIF
[2528]264      !
[12581]265      IF( cdtype == 'TRA' )  THEN
[2528]266         ll_traqsr  = ln_traqsr        ! active  tracers case  and  solar penetration
[5467]267         ll_rnf     = ln_rnf           ! active  tracers case  and  river runoffs
[6140]268         ll_isf     = ln_isf           ! active  tracers case  and  ice shelf melting
269      ELSE                          ! passive tracers case
270         ll_traqsr  = .FALSE.          ! NO solar penetration
[12581]271         ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ?
272         ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ??
[2528]273      ENDIF
274      !
[9019]275      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
276         ALLOCATE( ztrd_atf(jpi,jpj,jpk,kjpt) )
[8698]277         ztrd_atf(:,:,:,:) = 0.0_wp
278      ENDIF
[10095]279      zfact = 1._wp / p2dt
[9019]280      zfact1 = atfp * p2dt
281      zfact2 = zfact1 * r1_rau0
[12581]282      DO jn = 1, kjpt
[12340]283         DO_3D_00_00( 1, jpkm1 )
284            ze3t_b = e3t(ji,jj,jk,Kbb)
285            ze3t_n = e3t(ji,jj,jk,Kmm)
286            ze3t_a = e3t(ji,jj,jk,Kaa)
287            !                                         ! tracer content at Before, now and after
288            ztc_b  = pt(ji,jj,jk,jn,Kbb) * ze3t_b
289            ztc_n  = pt(ji,jj,jk,jn,Kmm) * ze3t_n
290            ztc_a  = pt(ji,jj,jk,jn,Kaa) * ze3t_a
291            !
292            ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b
293            ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b
294            !
295            ze3t_f = ze3t_n + atfp * ze3t_d
296            ztc_f  = ztc_n  + atfp * ztc_d
297            !
[12372]298            ! Add asselin correction on scale factors:
[12581]299            zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) )
300            ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) )
301            IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * (    rnf_b(ji,jj) -    rnf(ji,jj) )
[12372]302            IF ( ll_isf ) THEN
303               IF ( ln_isfcav_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) )
304               IF ( ln_isfpar_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_par_b(ji,jj) - fwfisf_par(ji,jj) )
305            ENDIF
306            !
[12581]307            IF( jk == mikt(ji,jj) ) THEN           ! first level
[12340]308               ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) )
309            ENDIF
310            !
311            ! solar penetration (temperature only)
[12581]312            IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            &
313               &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )
[12340]314               !
315            !
316            IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          &
[12581]317               &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &
[12340]318               &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj)
[12156]319
[12340]320            !
321            ! ice shelf
322            IF( ll_isf ) THEN
323               !
324               ! melt in the cavity
325               IF ( ln_isfcav_mlt ) THEN
326                  ! level fully include in the Losch_2008 ice shelf boundary layer
327                  IF ( jk >= misfkt_cav(ji,jj) .AND. jk < misfkb_cav(ji,jj) ) THEN
328                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) ) &
329                        &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj)
330                  END IF
[12581]331                  ! level partially include in Losch_2008 ice shelf boundary layer
[12340]332                  IF ( jk == misfkb_cav(ji,jj) ) THEN
333                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) )  &
[12680]334                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) * rfrac_tbl_cav(ji,jj)
[12340]335                  END IF
336               END IF
337               !
338               ! parametrised melt (cavity closed)
339               IF ( ln_isfpar_mlt ) THEN
340                  ! level fully include in the Losch_2008 ice shelf boundary layer
341                  IF ( jk >= misfkt_par(ji,jj) .AND. jk < misfkb_par(ji,jj) ) THEN
342                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
343                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj)
344                  END IF
[12581]345                  ! level partially include in Losch_2008 ice shelf boundary layer
[12340]346                  IF ( jk == misfkb_par(ji,jj) ) THEN
347                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  &
[12680]348                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) * rfrac_tbl_par(ji,jj)
[12340]349                  END IF
350               END IF
351               !
352               ! ice sheet coupling correction
353               IF ( ln_isfcpl ) THEN
[12156]354                  !
[12340]355                  ! at kt = nit000,  risfcpl_vol_n = 0 and risfcpl_vol_b = risfcpl_vol so contribution nul
356                  IF ( ln_rstart .AND. kt == nit000+1 ) THEN
357                     ztc_f  = ztc_f  + zfact1 * risfcpl_tsc(ji,jj,jk,jn) * r1_e1e2t(ji,jj)
[12372]358                     ! Shouldn't volume increment be spread according thanks to zscale  ?
[12340]359                     ze3t_f = ze3t_f - zfact1 * risfcpl_vol(ji,jj,jk   ) * r1_e1e2t(ji,jj)
[5643]360                  END IF
[6140]361                  !
[12340]362               END IF
363               !
364            END IF
365            !
366            ze3t_f = 1.e0 / ze3t_f
367            pt(ji,jj,jk,jn,Kmm) = ztc_f * ze3t_f    ! time filtered "now" field
368            !
369            IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) ) THEN
370               ztrd_atf(ji,jj,jk,jn) = (ztc_f - ztc_n) * zfact/ze3t_n
371            ENDIF
372            !
373         END_3D
[12581]374         !
[2528]375      END DO
[503]376      !
[9019]377      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN
[12581]378         IF( l_trdtra .AND. cdtype == 'TRA' ) THEN
[11057]379            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) )
380            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) )
[9019]381         ENDIF
382         IF( l_trdtrc .AND. cdtype == 'TRC' ) THEN
383            DO jn = 1, kjpt
[11057]384               CALL trd_tra( kt, Kmm, Kaa, cdtype, jn, jptra_atf, ztrd_atf(:,:,:,jn) )
[9019]385            END DO
386         ENDIF
387         DEALLOCATE( ztrd_atf )
[8698]388      ENDIF
389      !
[11057]390   END SUBROUTINE tra_atf_vvl
[3]391
392   !!======================================================================
[11057]393END MODULE traatf
Note: See TracBrowser for help on using the repository browser.