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.
trdtra.F90 in NEMO/trunk/src/OCE/TRD – NEMO

source: NEMO/trunk/src/OCE/TRD/trdtra.F90 @ 13084

Last change on this file since 13084 was 13084, checked in by smasson, 4 years ago

trunk: correct another typo introduced in [13069]...

  • Property svn:keywords set to Id
File size: 21.8 KB
RevLine 
[2026]1MODULE trdtra
2   !!======================================================================
3   !!                       ***  MODULE  trdtra  ***
[4990]4   !! Ocean diagnostics:  ocean tracers trends pre-processing
[2026]5   !!=====================================================================
[4990]6   !! History :  3.3  !  2010-06  (C. Ethe) creation for the TRA/TRC merge
7   !!            3.5  !  2012-02  (G. Madec) update the comments
[2026]8   !!----------------------------------------------------------------------
[4990]9
[2026]10   !!----------------------------------------------------------------------
[4990]11   !!   trd_tra       : pre-process the tracer trends
12   !!   trd_tra_adv   : transform a div(U.T) trend into a U.grad(T) trend
13   !!   trd_tra_mng   : tracer trend manager: dispatch to the diagnostic modules
14   !!   trd_tra_iom   : output 3D tracer trends using IOM
[2026]15   !!----------------------------------------------------------------------
[4990]16   USE oce            ! ocean dynamics and tracers variables
17   USE dom_oce        ! ocean domain
18   USE sbc_oce        ! surface boundary condition: ocean
19   USE zdf_oce        ! ocean vertical physics
20   USE trd_oce        ! trends: ocean variables
21   USE trdtrc         ! ocean passive mixed layer tracers trends
22   USE trdglo         ! trends: global domain averaged
23   USE trdpen         ! trends: Potential ENergy
24   USE trdmxl         ! ocean active mixed layer tracers trends
[5836]25   USE ldftra         ! ocean active tracers lateral physics
26   USE ldfslp
[4990]27   USE zdfddm         ! vertical physics: double diffusion
28   USE phycst         ! physical constants
[5836]29   !
[4990]30   USE in_out_manager ! I/O manager
31   USE iom            ! I/O manager library
32   USE lib_mpp        ! MPP library
[2026]33
34   IMPLICIT NONE
35   PRIVATE
36
[4990]37   PUBLIC   trd_tra   ! called by all tra_... modules
[2026]38
[4990]39   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   trdtx, trdty, trdt   ! use to store the temperature trends
[7646]40   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   avt_evd  ! store avt_evd to calculate EVD trend
[4990]41
[2026]42   !! * Substitutions
[12377]43#  include "do_loop_substitute.h90"
[2026]44   !!----------------------------------------------------------------------
[9598]45   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[2281]46   !! $Id$
[10068]47   !! Software governed by the CeCILL license (see ./LICENSE)
[2026]48   !!----------------------------------------------------------------------
49CONTAINS
50
[2715]51   INTEGER FUNCTION trd_tra_alloc()
[4990]52      !!---------------------------------------------------------------------
[2715]53      !!                  ***  FUNCTION trd_tra_alloc  ***
[4990]54      !!---------------------------------------------------------------------
[7646]55      ALLOCATE( trdtx(jpi,jpj,jpk) , trdty(jpi,jpj,jpk) , trdt(jpi,jpj,jpk) , avt_evd(jpi,jpj,jpk), STAT= trd_tra_alloc )
[2715]56      !
[10425]57      CALL mpp_sum ( 'trdtra', trd_tra_alloc )
58      IF( trd_tra_alloc /= 0 )   CALL ctl_stop( 'STOP', 'trd_tra_alloc: failed to allocate arrays' )
[2715]59   END FUNCTION trd_tra_alloc
60
61
[12377]62   SUBROUTINE trd_tra( kt, Kmm, Krhs, ctype, ktra, ktrd, ptrd, pu, ptra )
[2026]63      !!---------------------------------------------------------------------
64      !!                  ***  ROUTINE trd_tra  ***
65      !!
[4990]66      !! ** Purpose : pre-process tracer trends
[2026]67      !!
[4990]68      !! ** Method  : - mask the trend
69      !!              - advection (ptra present) converte the incoming flux (U.T)
70      !!              into trend (U.T => -U.grat(T)=div(U.T)-T.div(U)) through a
71      !!              call to trd_tra_adv
72      !!              - 'TRA' case : regroup T & S trends
73      !!              - send the trends to trd_tra_mng (trdtrc) for further processing
[2026]74      !!----------------------------------------------------------------------
[4990]75      INTEGER                         , INTENT(in)           ::   kt      ! time step
76      CHARACTER(len=3)                , INTENT(in)           ::   ctype   ! tracers trends type 'TRA'/'TRC'
77      INTEGER                         , INTENT(in)           ::   ktra    ! tracer index
78      INTEGER                         , INTENT(in)           ::   ktrd    ! tracer trend index
[12377]79      INTEGER                         , INTENT(in)           ::   Kmm, Krhs ! time level indices
[4990]80      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in)           ::   ptrd    ! tracer trend  or flux
[12377]81      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   pu      ! now velocity
[4990]82      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   ptra    ! now tracer variable
[2715]83      !
[13083]84      INTEGER ::   jk    ! loop indices
[13069]85      INTEGER ::   i01   ! 0 or 1
[9019]86      REAL(wp),        DIMENSION(jpi,jpj,jpk) ::   ztrds             ! 3D workspace
87      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zwt, zws, ztrdt   ! 3D workspace
[4990]88      !!----------------------------------------------------------------------
89      !     
90      IF( .NOT. ALLOCATED( trdtx ) ) THEN      ! allocate trdtra arrays
[2715]91         IF( trd_tra_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_tra : unable to allocate arrays' )
92      ENDIF
[13069]93      !
[13084]94      i01 = COUNT( (/ PRESENT(pu) .OR. ( ktrd /= jptra_xad .AND. ktrd /= jptra_yad .AND. ktrd /= jptra_zad ) /) )
[13069]95      !
[4990]96      IF( ctype == 'TRA' .AND. ktra == jp_tem ) THEN   !==  Temperature trend  ==!
97         !
[13069]98         SELECT CASE( ktrd*i01 )
[4990]99         !                            ! advection: transform the advective flux into a trend
[12377]100         CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd, pu, ptra, 'X', trdtx, Kmm ) 
101         CASE( jptra_yad )   ;   CALL trd_tra_adv( ptrd, pu, ptra, 'Y', trdty, Kmm ) 
102         CASE( jptra_zad )   ;   CALL trd_tra_adv( ptrd, pu, ptra, 'Z', trdt, Kmm )
[4990]103         CASE( jptra_bbc,    &        ! qsr, bbc: on temperature only, send to trd_tra_mng
104            &  jptra_qsr )   ;   trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)
105                                 ztrds(:,:,:) = 0._wp
[12377]106                                 CALL trd_tra_mng( trdt, ztrds, ktrd, kt, Kmm )
[9019]107 !!gm Gurvan, verify the jptra_evd trend please !
[8698]108         CASE( jptra_evd )   ;   avt_evd(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)
[4990]109         CASE DEFAULT                 ! other trends: masked trends
110            trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)              ! mask & store
111         END SELECT
112         !
113      ENDIF
[2026]114
[4990]115      IF( ctype == 'TRA' .AND. ktra == jp_sal ) THEN      !==  Salinity trends  ==!
[2026]116         !
[13069]117         SELECT CASE( ktrd*i01 )
[4990]118         !                            ! advection: transform the advective flux into a trend
119         !                            !            and send T & S trends to trd_tra_mng
[12377]120         CASE( jptra_xad  )   ;   CALL trd_tra_adv( ptrd , pu  , ptra, 'X'  , ztrds, Kmm ) 
121                                  CALL trd_tra_mng( trdtx, ztrds, ktrd, kt, Kmm   )
122         CASE( jptra_yad  )   ;   CALL trd_tra_adv( ptrd , pu  , ptra, 'Y'  , ztrds, Kmm ) 
123                                  CALL trd_tra_mng( trdty, ztrds, ktrd, kt, Kmm   )
124         CASE( jptra_zad  )   ;   CALL trd_tra_adv( ptrd , pu  , ptra, 'Z'  , ztrds, Kmm ) 
125                                  CALL trd_tra_mng( trdt , ztrds, ktrd, kt, Kmm   )
[4990]126         CASE( jptra_zdfp )           ! diagnose the "PURE" Kz trend (here: just before the swap)
127            !                         ! iso-neutral diffusion case otherwise jptra_zdf is "PURE"
[9019]128            ALLOCATE( zwt(jpi,jpj,jpk), zws(jpi,jpj,jpk), ztrdt(jpi,jpj,jpk) )
[4990]129            !
130            zwt(:,:, 1 ) = 0._wp   ;   zws(:,:, 1 ) = 0._wp            ! vertical diffusive fluxes
131            zwt(:,:,jpk) = 0._wp   ;   zws(:,:,jpk) = 0._wp
132            DO jk = 2, jpk
[12377]133               zwt(:,:,jk) = avt(:,:,jk) * ( ts(:,:,jk-1,jp_tem,Krhs) - ts(:,:,jk,jp_tem,Krhs) ) / e3w(:,:,jk,Kmm) * tmask(:,:,jk)
134               zws(:,:,jk) = avs(:,:,jk) * ( ts(:,:,jk-1,jp_sal,Krhs) - ts(:,:,jk,jp_sal,Krhs) ) / e3w(:,:,jk,Kmm) * tmask(:,:,jk)
[4990]135            END DO
136            !
137            ztrdt(:,:,jpk) = 0._wp   ;   ztrds(:,:,jpk) = 0._wp
138            DO jk = 1, jpkm1
[12377]139               ztrdt(:,:,jk) = ( zwt(:,:,jk) - zwt(:,:,jk+1) ) / e3t(:,:,jk,Kmm)
140               ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / e3t(:,:,jk,Kmm) 
[4990]141            END DO
[12377]142            CALL trd_tra_mng( ztrdt, ztrds, jptra_zdfp, kt, Kmm ) 
[4990]143            !
[7646]144            !                         ! Also calculate EVD trend at this point.
145            zwt(:,:,:) = 0._wp   ;   zws(:,:,:) = 0._wp            ! vertical diffusive fluxes
146            DO jk = 2, jpk
[12377]147               zwt(:,:,jk) = avt_evd(:,:,jk) * ( ts(:,:,jk-1,jp_tem,Krhs) - ts(:,:,jk,jp_tem,Krhs) ) / e3w(:,:,jk,Kmm) * tmask(:,:,jk)
148               zws(:,:,jk) = avt_evd(:,:,jk) * ( ts(:,:,jk-1,jp_sal,Krhs) - ts(:,:,jk,jp_sal,Krhs) ) / e3w(:,:,jk,Kmm) * tmask(:,:,jk)
[7646]149            END DO
150            !
151            ztrdt(:,:,jpk) = 0._wp   ;   ztrds(:,:,jpk) = 0._wp
152            DO jk = 1, jpkm1
[12377]153               ztrdt(:,:,jk) = ( zwt(:,:,jk) - zwt(:,:,jk+1) ) / e3t(:,:,jk,Kmm)
154               ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / e3t(:,:,jk,Kmm) 
[7646]155            END DO
[12377]156            CALL trd_tra_mng( ztrdt, ztrds, jptra_evd, kt, Kmm ) 
[7646]157            !
[9019]158            DEALLOCATE( zwt, zws, ztrdt )
[4990]159            !
160         CASE DEFAULT                 ! other trends: mask and send T & S trends to trd_tra_mng
161            ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)
[12377]162            CALL trd_tra_mng( trdt, ztrds, ktrd, kt, Kmm ) 
[4990]163         END SELECT
164      ENDIF
165
166      IF( ctype == 'TRC' ) THEN                           !==  passive tracer trend  ==!
[2026]167         !
[13069]168         SELECT CASE( ktrd*i01 )
[4990]169         !                            ! advection: transform the advective flux into a masked trend
[12377]170         CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd , pu , ptra, 'X', ztrds, Kmm ) 
171         CASE( jptra_yad )   ;   CALL trd_tra_adv( ptrd , pu , ptra, 'Y', ztrds, Kmm ) 
172         CASE( jptra_zad )   ;   CALL trd_tra_adv( ptrd , pu , ptra, 'Z', ztrds, Kmm ) 
[4990]173         CASE DEFAULT                 ! other trends: just masked
174                                 ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)
175         END SELECT
176         !                            ! send trend to trd_trc
[12377]177         CALL trd_trc( ztrds, ktra, ktrd, kt, Kmm ) 
[4990]178         !
[2026]179      ENDIF
180      !
181   END SUBROUTINE trd_tra
182
[2715]183
[12377]184   SUBROUTINE trd_tra_adv( pf, pu, pt, cdir, ptrd, Kmm )
[2026]185      !!---------------------------------------------------------------------
186      !!                  ***  ROUTINE trd_tra_adv  ***
187      !!
[4990]188      !! ** Purpose :   transformed a advective flux into a masked advective trends
189      !!
190      !! ** Method  :   use the following transformation: -div(U.T) = - U grad(T) + T.div(U)
191      !!       i-advective trends = -un. di-1[T] = -( di-1[fi] - tn di-1[un] )
192      !!       j-advective trends = -un. di-1[T] = -( dj-1[fi] - tn dj-1[un] )
193      !!       k-advective trends = -un. di+1[T] = -( dk+1[fi] - tn dk+1[un] )
194      !!                where fi is the incoming advective flux.
[2026]195      !!----------------------------------------------------------------------
[4990]196      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pf      ! advective flux in one direction
[12377]197      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pu      ! now velocity   in one direction
198      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pt      ! now or before tracer
[4990]199      CHARACTER(len=1)                , INTENT(in   ) ::   cdir    ! X/Y/Z direction
200      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   ptrd    ! advective trend in one direction
[12377]201      INTEGER,  INTENT(in)                            ::   Kmm     ! time level index
[2715]202      !
203      INTEGER  ::   ji, jj, jk   ! dummy loop indices
[4990]204      INTEGER  ::   ii, ij, ik   ! index shift as function of the direction
[2026]205      !!----------------------------------------------------------------------
[4990]206      !
207      SELECT CASE( cdir )      ! shift depending on the direction
208      CASE( 'X' )   ;   ii = 1   ;   ij = 0   ;   ik = 0      ! i-trend
209      CASE( 'Y' )   ;   ii = 0   ;   ij = 1   ;   ik = 0      ! j-trend
210      CASE( 'Z' )   ;   ii = 0   ;   ij = 0   ;   ik =-1      ! k-trend
[2026]211      END SELECT
212      !
[4990]213      !                        ! set to zero uncomputed values
214      ptrd(jpi,:,:) = 0._wp   ;   ptrd(1,:,:) = 0._wp
215      ptrd(:,jpj,:) = 0._wp   ;   ptrd(:,1,:) = 0._wp
216      ptrd(:,:,jpk) = 0._wp
[2026]217      !
[12377]218      DO_3D_00_00( 1, jpkm1 )
219         ptrd(ji,jj,jk) = - (     pf (ji,jj,jk) - pf (ji-ii,jj-ij,jk-ik)                        &
220           &                  - ( pu(ji,jj,jk) - pu(ji-ii,jj-ij,jk-ik) ) * pt(ji,jj,jk)  )   &
221           &              * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm) * tmask(ji,jj,jk)
222      END_3D
[2026]223      !
224   END SUBROUTINE trd_tra_adv
225
[4990]226
[12377]227   SUBROUTINE trd_tra_mng( ptrdx, ptrdy, ktrd, kt, Kmm )
[4990]228      !!---------------------------------------------------------------------
229      !!                  ***  ROUTINE trd_tra_mng  ***
230      !!
231      !! ** Purpose :   Dispatch all tracer trends computation, e.g. 3D output,
232      !!                integral constraints, potential energy, and/or
233      !!                mixed layer budget.
[2026]234      !!----------------------------------------------------------------------
[4990]235      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend
236      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend
237      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index
238      INTEGER                   , INTENT(in   ) ::   kt      ! time step
[12377]239      INTEGER                   , INTENT(in   ) ::   Kmm     ! time level index
[4990]240      !!----------------------------------------------------------------------
241
242      !                   ! 3D output of tracers trends using IOM interface
[12377]243      IF( ln_tra_trd )   CALL trd_tra_iom ( ptrdx, ptrdy, ktrd, kt, Kmm )
[4990]244
245      !                   ! Integral Constraints Properties for tracers trends                                       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[12377]246      IF( ln_glo_trd )   CALL trd_glo( ptrdx, ptrdy, ktrd, 'TRA', kt, Kmm )
[4990]247
248      !                   ! Potential ENergy trends
[12489]249      IF( ln_PE_trd  )   CALL trd_pen( ptrdx, ptrdy, ktrd, kt, rDt, Kmm )
[4990]250
251      !                   ! Mixed layer trends for active tracers
252      IF( ln_tra_mxl )   THEN   
253         !-----------------------------------------------------------------------------------------------
254         ! W.A.R.N.I.N.G :
255         ! jptra_ldf : called by traldf.F90
256         !                 at this stage we store:
257         !                  - the lateral geopotential diffusion (here, lateral = horizontal)
258         !                  - and the iso-neutral diffusion if activated
259         ! jptra_zdf : called by trazdf.F90
260         !                 * in case of iso-neutral diffusion we store the vertical diffusion component in the
261         !                   lateral trend including the K_z contrib, which will be removed later (see trd_mxl)
262         !-----------------------------------------------------------------------------------------------
263
264         SELECT CASE ( ktrd )
265         CASE ( jptra_xad )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_xad, '3D' )   ! zonal    advection
266         CASE ( jptra_yad )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_yad, '3D' )   ! merid.   advection
267         CASE ( jptra_zad )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_zad, '3D' )   ! vertical advection
268         CASE ( jptra_ldf )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_ldf, '3D' )   ! lateral  diffusion
269         CASE ( jptra_bbl )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_bbl, '3D' )   ! bottom boundary layer
270         CASE ( jptra_zdf )
271            IF( ln_traldf_iso ) THEN ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_ldf, '3D' )   ! lateral  diffusion (K_z)
272            ELSE                   ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_zdf, '3D' )   ! vertical diffusion (K_z)
273            ENDIF
274         CASE ( jptra_dmp )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_dmp, '3D' )   ! internal 3D restoring (tradmp)
275         CASE ( jptra_qsr )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_for, '3D' )   ! air-sea : penetrative sol radiat
276         CASE ( jptra_nsr )        ;   ptrdx(:,:,2:jpk) = 0._wp   ;   ptrdy(:,:,2:jpk) = 0._wp
277                                       CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_for, '2D' )   ! air-sea : non penetr sol radiation
278         CASE ( jptra_bbc )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_bbc, '3D' )   ! bottom bound cond (geoth flux)
279         CASE ( jptra_npc )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_npc, '3D' )   ! non penetr convect adjustment
280         CASE ( jptra_atf )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_atf, '3D' )   ! asselin time filter (last trend)
281                                   !
[12489]282                                       CALL trd_mxl( kt, rDt )                             ! trends: Mixed-layer (output)
[4990]283         END SELECT
284         !
285      ENDIF
286      !
287   END SUBROUTINE trd_tra_mng
288
289
[12377]290   SUBROUTINE trd_tra_iom( ptrdx, ptrdy, ktrd, kt, Kmm )
[4990]291      !!---------------------------------------------------------------------
292      !!                  ***  ROUTINE trd_tra_iom  ***
293      !!
294      !! ** Purpose :   output 3D tracer trends using IOM
295      !!----------------------------------------------------------------------
296      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend
297      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend
298      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index
299      INTEGER                   , INTENT(in   ) ::   kt      ! time step
[12377]300      INTEGER                   , INTENT(in   ) ::   Kmm     ! time level index
[4990]301      !!
302      INTEGER ::   ji, jj, jk   ! dummy loop indices
303      INTEGER ::   ikbu, ikbv   ! local integers
[9019]304      REAL(wp), ALLOCATABLE, DIMENSION(:,:)   ::   z2dx, z2dy   ! 2D workspace
[4990]305      !!----------------------------------------------------------------------
306      !
307!!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added
308      !
[8698]309      ! Trends evaluated every time step that could go to the standard T file and can be output every ts into a 1ts file if 1ts output is selected
[4990]310      SELECT CASE( ktrd )
[8698]311      ! This total trend is done every time step
312      CASE( jptra_tot  )   ;   CALL iom_put( "ttrd_tot" , ptrdx )           ! model total trend
[9019]313                               CALL iom_put( "strd_tot" , ptrdy )
[4990]314      END SELECT
[9019]315      !
[8698]316      ! These trends are done every second time step. When 1ts output is selected must go different (2ts) file from standard T-file
317      IF( MOD( kt, 2 ) == 0 ) THEN
318         SELECT CASE( ktrd )
[9019]319         CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad"  , ptrdx )        ! x- horizontal advection
320                                  CALL iom_put( "strd_xad"  , ptrdy )
321         CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad"  , ptrdx )        ! y- horizontal advection
322                                  CALL iom_put( "strd_yad"  , ptrdy )
323         CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad"  , ptrdx )        ! z- vertical   advection
324                                  CALL iom_put( "strd_zad"  , ptrdy )
325                                  IF( ln_linssh ) THEN                   ! cst volume : adv flux through z=0 surface
326                                     ALLOCATE( z2dx(jpi,jpj), z2dy(jpi,jpj) )
[12377]327                                     z2dx(:,:) = ww(:,:,1) * ts(:,:,1,jp_tem,Kmm) / e3t(:,:,1,Kmm)
328                                     z2dy(:,:) = ww(:,:,1) * ts(:,:,1,jp_sal,Kmm) / e3t(:,:,1,Kmm)
[9019]329                                     CALL iom_put( "ttrd_sad", z2dx )
330                                     CALL iom_put( "strd_sad", z2dy )
331                                     DEALLOCATE( z2dx, z2dy )
332                                  ENDIF
333         CASE( jptra_totad  ) ;   CALL iom_put( "ttrd_totad", ptrdx )        ! total   advection
334                                  CALL iom_put( "strd_totad", ptrdy )
335         CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf"  , ptrdx )        ! lateral diffusion
336                                  CALL iom_put( "strd_ldf"  , ptrdy )
337         CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf"  , ptrdx )        ! vertical diffusion (including Kz contribution)
338                                  CALL iom_put( "strd_zdf"  , ptrdy )
339         CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp" , ptrdx )        ! PURE vertical diffusion (no isoneutral contribution)
340                                  CALL iom_put( "strd_zdfp" , ptrdy )
341         CASE( jptra_evd )    ;   CALL iom_put( "ttrd_evd"  , ptrdx )        ! EVD trend (convection)
342                                  CALL iom_put( "strd_evd"  , ptrdy )
343         CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp"  , ptrdx )        ! internal restoring (damping)
344                                  CALL iom_put( "strd_dmp"  , ptrdy )
345         CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl"  , ptrdx )        ! bottom boundary layer
346                                  CALL iom_put( "strd_bbl"  , ptrdy )
347         CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc"  , ptrdx )        ! static instability mixing
348                                  CALL iom_put( "strd_npc"  , ptrdy )
349         CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc"  , ptrdx )        ! geothermal heating   (only on temperature)
350         CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns"  , ptrdx(:,:,1) ) ! surface forcing + runoff (ln_rnf=T)
351                                  CALL iom_put( "strd_cdt"  , ptrdy(:,:,1) )        ! output as 2D surface fields
352         CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr"  , ptrdx )        ! penetrative solar radiat. (only on temperature)
[8698]353         END SELECT
354         ! the Asselin filter trend  is also every other time step but needs to be lagged one time step
355         ! Even when 1ts output is selected can go to the same (2ts) file as the trends plotted every even time step.
356      ELSE IF( MOD( kt, 2 ) == 1 ) THEN
357         SELECT CASE( ktrd )
358         CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter
[10036]359                                  CALL iom_put( "strd_atf" , ptrdy )
[8698]360         END SELECT
361      END IF
[4990]362      !
363   END SUBROUTINE trd_tra_iom
364
[2026]365   !!======================================================================
366END MODULE trdtra
Note: See TracBrowser for help on using the repository browser.