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/releases/r4.0/r4.0-HEAD/src/OCE/TRD – NEMO

source: NEMO/releases/r4.0/r4.0-HEAD/src/OCE/TRD/trdtra.F90 @ 13067

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

r4.0-HEAD: fix trdtra when used with traadv_ubs, see #2277

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