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/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/OCE/TRD – NEMO

source: NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/OCE/TRD/trdtra.F90 @ 15540

Last change on this file since 15540 was 15540, checked in by sparonuz, 3 years ago

Mixed precision version, tested up to 30 years on ORCA2.

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