- Timestamp:
- 2016-01-08T10:35:19+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
r3632 r6225 2 2 !!====================================================================== 3 3 !! *** MODULE trdtra *** 4 !! Ocean diagnostics: ocean tracers trends 4 !! Ocean diagnostics: ocean tracers trends pre-processing 5 5 !!===================================================================== 6 !! History : 1.0 ! 2004-08 (C. Talandier) Original code 7 !! 2.0 ! 2005-04 (C. Deltel) Add Asselin trend in the ML budget 8 !! 3.3 ! 2010-06 (C. Ethe) merge TRA-TRC 9 !!---------------------------------------------------------------------- 10 #if defined key_trdtra || defined key_trdtrc || defined key_trdmld || defined key_trdmld_trc 11 !!---------------------------------------------------------------------- 12 !! trd_tra : Call the trend to be computed 13 !!---------------------------------------------------------------------- 14 USE dom_oce ! ocean domain 15 USE trdmod_oce ! ocean active mixed layer tracers trends 16 USE trdmod ! ocean active mixed layer tracers trends 17 USE trdmod_trc ! ocean passive mixed layer tracers trends 18 USE in_out_manager ! I/O manager 19 USE lib_mpp ! MPP library 20 USE wrk_nemo ! Memory allocation 21 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 USE wrk_nemo ! Memory allocation 22 34 23 35 IMPLICIT NONE 24 36 PRIVATE 25 37 26 PUBLIC trd_tra ! called by all traXXmodules27 28 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: trdtx, trdty, trdt !:38 PUBLIC trd_tra ! called by all tra_... modules 39 40 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: trdtx, trdty, trdt ! use to store the temperature trends 29 41 30 42 !! * Substitutions 31 # include " domzgr_substitute.h90"43 # include "zdfddm_substitute.h90" 32 44 # include "vectopt_loop_substitute.h90" 33 45 !!---------------------------------------------------------------------- 34 !! NEMO/OPA 4.0 , NEMO Consortium (2011)46 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 35 47 !! $Id$ 36 48 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 39 51 40 52 INTEGER FUNCTION trd_tra_alloc() 41 !!--------------------------------------------------------------------- -------53 !!--------------------------------------------------------------------- 42 54 !! *** FUNCTION trd_tra_alloc *** 43 !!--------------------------------------------------------------------- -------55 !!--------------------------------------------------------------------- 44 56 ALLOCATE( trdtx(jpi,jpj,jpk) , trdty(jpi,jpj,jpk) , trdt(jpi,jpj,jpk) , STAT= trd_tra_alloc ) 45 57 ! … … 53 65 !! *** ROUTINE trd_tra *** 54 66 !! 55 !! ** Purpose : Dispatch all trends computation, e.g. vorticity, mld or 56 !! integral constraints 67 !! ** Purpose : pre-process tracer trends 57 68 !! 58 !! ** Method /usage : For the mixed-layer trend, the control surface can be either59 !! a mixed layer depth (time varying) or a fixed surface (jk level or bowl).60 !! Choose control surface with nn_ctls in namelist NAMTRD :61 !! nn_ctls = 0 : use mixed layer with density criterion62 !! nn_ctls = 1 : read index from file 'ctlsurf_idx'63 !! nn_ctls > 1 : use fixed level surface jk = nn_ctls64 !!---------------------------------------------------------------------- 65 !66 INTEGER , INTENT(in) :: kt ! time step67 CHARACTER(len=3) , INTENT(in) :: ctype ! tracers trends type 'TRA'/'TRC'68 INTEGER , INTENT(in) :: ktra ! tracerindex69 INTEGER , INTENT(in) :: ktrd ! tracer trend index70 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: ptrd ! tracer trend or flux71 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: pun ! velocity72 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: ptra ! Tracer variablea73 !74 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrds75 !!---------------------------------------------------------------------- 76 69 !! ** Method : - mask the trend 70 !! - advection (ptra present) converte the incoming flux (U.T) 71 !! into trend (U.T => -U.grat(T)=div(U.T)-T.div(U)) through a 72 !! call to trd_tra_adv 73 !! - 'TRA' case : regroup T & S trends 74 !! - send the trends to trd_tra_mng (trdtrc) for further processing 75 !!---------------------------------------------------------------------- 76 INTEGER , INTENT(in) :: kt ! time step 77 CHARACTER(len=3) , INTENT(in) :: ctype ! tracers trends type 'TRA'/'TRC' 78 INTEGER , INTENT(in) :: ktra ! tracer index 79 INTEGER , INTENT(in) :: ktrd ! tracer trend index 80 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: ptrd ! tracer trend or flux 81 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: pun ! now velocity 82 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: ptra ! now tracer variable 83 ! 84 INTEGER :: jk ! loop indices 85 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwt, zws, ztrdt, ztrds ! 3D workspace 86 !!---------------------------------------------------------------------- 87 ! 77 88 CALL wrk_alloc( jpi, jpj, jpk, ztrds ) 78 79 IF( .NOT. ALLOCATED( trdtx ) ) THEN 89 ! 90 IF( .NOT. ALLOCATED( trdtx ) ) THEN ! allocate trdtra arrays 80 91 IF( trd_tra_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trd_tra : unable to allocate arrays' ) 81 92 ENDIF 82 83 ! Control of optional arguments 84 IF( ctype == 'TRA' .AND. ktra == jp_tem ) THEN 85 IF( PRESENT( ptra ) ) THEN 86 SELECT CASE( ktrd ) ! shift depending on the direction 87 CASE( jptra_trd_xad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx ) 88 CASE( jptra_trd_yad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Y', trdty ) 89 CASE( jptra_trd_zad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt ) 90 END SELECT 91 ELSE 92 trdt(:,:,:) = ptrd(:,:,:) 93 IF( ktrd == jptra_trd_bbc .OR. ktrd == jptra_trd_qsr ) THEN 94 ztrds(:,:,:) = 0. 95 CALL trd_mod( trdt, ztrds, ktrd, ctype, kt ) 96 END IF 97 END IF 98 END IF 99 100 IF( ctype == 'TRA' .AND. ktra == jp_sal ) THEN 101 IF( PRESENT( ptra ) ) THEN 102 SELECT CASE( ktrd ) ! shift depending on the direction 103 CASE( jptra_trd_xad ) 104 CALL trd_tra_adv( ptrd, pun, ptra, 'X', ztrds ) 105 CALL trd_mod( trdtx, ztrds, ktrd, ctype, kt ) 106 CASE( jptra_trd_yad ) 107 CALL trd_tra_adv( ptrd, pun, ptra, 'Y', ztrds ) 108 CALL trd_mod( trdty, ztrds, ktrd, ctype, kt ) 109 CASE( jptra_trd_zad ) 110 CALL trd_tra_adv( ptrd, pun, ptra, 'Z', ztrds ) 111 CALL trd_mod( trdt , ztrds, ktrd, ctype, kt ) 112 END SELECT 113 ELSE 114 ztrds(:,:,:) = ptrd(:,:,:) 115 CALL trd_mod( trdt, ztrds, ktrd, ctype, kt ) 116 END IF 117 END IF 118 119 IF( ctype == 'TRC' ) THEN 120 ! 121 IF( PRESENT( ptra ) ) THEN 122 SELECT CASE( ktrd ) ! shift depending on the direction 123 CASE( jptra_trd_xad ) 124 CALL trd_tra_adv( ptrd, pun, ptra, 'X', ztrds ) 125 CALL trd_mod_trc( ztrds, ktra, ktrd, kt ) 126 CASE( jptra_trd_yad ) 127 CALL trd_tra_adv( ptrd, pun, ptra, 'Y', ztrds ) 128 CALL trd_mod_trc( ztrds, ktra, ktrd, kt ) 129 CASE( jptra_trd_zad ) 130 CALL trd_tra_adv( ptrd, pun, ptra, 'Z', ztrds ) 131 CALL trd_mod_trc( ztrds, ktra, ktrd, kt ) 132 END SELECT 133 ELSE 134 ztrds(:,:,:) = ptrd(:,:,:) 135 CALL trd_mod_trc( ztrds, ktra, ktrd, kt ) 136 END IF 93 94 IF( ctype == 'TRA' .AND. ktra == jp_tem ) THEN !== Temperature trend ==! 95 ! 96 SELECT CASE( ktrd ) 97 ! ! advection: transform the advective flux into a trend 98 CASE( jptra_xad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx ) 99 CASE( jptra_yad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Y', trdty ) 100 CASE( jptra_zad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt ) 101 CASE( jptra_bbc, & ! qsr, bbc: on temperature only, send to trd_tra_mng 102 & jptra_qsr ) ; trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 103 ztrds(:,:,:) = 0._wp 104 CALL trd_tra_mng( trdt, ztrds, ktrd, kt ) 105 CASE DEFAULT ! other trends: masked trends 106 trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) ! mask & store 107 END SELECT 108 ! 109 ENDIF 110 111 IF( ctype == 'TRA' .AND. ktra == jp_sal ) THEN !== Salinity trends ==! 112 ! 113 SELECT CASE( ktrd ) 114 ! ! advection: transform the advective flux into a trend 115 ! ! and send T & S trends to trd_tra_mng 116 CASE( jptra_xad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'X' , ztrds ) 117 CALL trd_tra_mng( trdtx, ztrds, ktrd, kt ) 118 CASE( jptra_yad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Y' , ztrds ) 119 CALL trd_tra_mng( trdty, ztrds, ktrd, kt ) 120 CASE( jptra_zad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Z' , ztrds ) 121 CALL trd_tra_mng( trdt , ztrds, ktrd, kt ) 122 CASE( jptra_zdfp ) ! diagnose the "PURE" Kz trend (here: just before the swap) 123 ! ! iso-neutral diffusion case otherwise jptra_zdf is "PURE" 124 CALL wrk_alloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 125 ! 126 zwt(:,:, 1 ) = 0._wp ; zws(:,:, 1 ) = 0._wp ! vertical diffusive fluxes 127 zwt(:,:,jpk) = 0._wp ; zws(:,:,jpk) = 0._wp 128 DO jk = 2, jpk 129 zwt(:,:,jk) = avt(:,:,jk) * ( tsa(:,:,jk-1,jp_tem) - tsa(:,:,jk,jp_tem) ) / e3w_n(:,:,jk) * tmask(:,:,jk) 130 zws(:,:,jk) = fsavs(:,:,jk) * ( tsa(:,:,jk-1,jp_sal) - tsa(:,:,jk,jp_sal) ) / e3w_n(:,:,jk) * tmask(:,:,jk) 131 END DO 132 ! 133 ztrdt(:,:,jpk) = 0._wp ; ztrds(:,:,jpk) = 0._wp 134 DO jk = 1, jpkm1 135 ztrdt(:,:,jk) = ( zwt(:,:,jk) - zwt(:,:,jk+1) ) / e3t_n(:,:,jk) 136 ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / e3t_n(:,:,jk) 137 END DO 138 CALL trd_tra_mng( ztrdt, ztrds, jptra_zdfp, kt ) 139 ! 140 CALL wrk_dealloc( jpi, jpj, jpk, zwt, zws, ztrdt ) 141 ! 142 CASE DEFAULT ! other trends: mask and send T & S trends to trd_tra_mng 143 ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 144 CALL trd_tra_mng( trdt, ztrds, ktrd, kt ) 145 END SELECT 146 ENDIF 147 148 IF( ctype == 'TRC' ) THEN !== passive tracer trend ==! 149 ! 150 SELECT CASE( ktrd ) 151 ! ! advection: transform the advective flux into a masked trend 152 CASE( jptra_xad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'X', ztrds ) 153 CASE( jptra_yad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Y', ztrds ) 154 CASE( jptra_zad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Z', ztrds ) 155 CASE DEFAULT ! other trends: just masked 156 ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 157 END SELECT 158 ! ! send trend to trd_trc 159 CALL trd_trc( ztrds, ktra, ktrd, kt ) 137 160 ! 138 161 ENDIF … … 147 170 !! *** ROUTINE trd_tra_adv *** 148 171 !! 149 !! ** Purpose : transformed the i-, j- or k-advective flux into thes 150 !! i-, j- or k-advective trends, resp. 151 !! ** Method : i-advective trends = -un. di-1[T] = -( di-1[fi] - tn di-1[un] ) 152 !! k-advective trends = -un. di-1[T] = -( dj-1[fi] - tn dj-1[un] ) 153 !! k-advective trends = -un. di+1[T] = -( dk+1[fi] - tn dk+1[un] ) 154 !!---------------------------------------------------------------------- 155 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,jpk) :: pf ! advective flux in one direction 156 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,jpk) :: pun ! now velocity in one direction 157 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,jpk) :: ptn ! now or before tracer 158 CHARACTER(len=1), INTENT(in ) :: cdir ! X/Y/Z direction 159 REAL(wp) , INTENT(out), DIMENSION(jpi,jpj,jpk) :: ptrd ! advective trend in one direction 172 !! ** Purpose : transformed a advective flux into a masked advective trends 173 !! 174 !! ** Method : use the following transformation: -div(U.T) = - U grad(T) + T.div(U) 175 !! i-advective trends = -un. di-1[T] = -( di-1[fi] - tn di-1[un] ) 176 !! j-advective trends = -un. di-1[T] = -( dj-1[fi] - tn dj-1[un] ) 177 !! k-advective trends = -un. di+1[T] = -( dk+1[fi] - tn dk+1[un] ) 178 !! where fi is the incoming advective flux. 179 !!---------------------------------------------------------------------- 180 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in ) :: pf ! advective flux in one direction 181 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in ) :: pun ! now velocity in one direction 182 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in ) :: ptn ! now or before tracer 183 CHARACTER(len=1) , INTENT(in ) :: cdir ! X/Y/Z direction 184 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out) :: ptrd ! advective trend in one direction 160 185 ! 161 186 INTEGER :: ji, jj, jk ! dummy loop indices 162 INTEGER :: ii, ij, ik ! index shift function of the direction 163 REAL(wp) :: zbtr ! local scalar 164 !!---------------------------------------------------------------------- 165 166 SELECT CASE( cdir ) ! shift depending on the direction 167 CASE( 'X' ) ; ii = 1 ; ij = 0 ; ik = 0 ! i-advective trend 168 CASE( 'Y' ) ; ii = 0 ; ij = 1 ; ik = 0 ! j-advective trend 169 CASE( 'Z' ) ; ii = 0 ; ij = 0 ; ik =-1 ! k-advective trend 187 INTEGER :: ii, ij, ik ! index shift as function of the direction 188 !!---------------------------------------------------------------------- 189 ! 190 SELECT CASE( cdir ) ! shift depending on the direction 191 CASE( 'X' ) ; ii = 1 ; ij = 0 ; ik = 0 ! i-trend 192 CASE( 'Y' ) ; ii = 0 ; ij = 1 ; ik = 0 ! j-trend 193 CASE( 'Z' ) ; ii = 0 ; ij = 0 ; ik =-1 ! k-trend 170 194 END SELECT 171 172 ! ! set to zero uncomputed values 173 ptrd(jpi,:,:) = 0.e0 ; ptrd(1,:,:) = 0.e0 174 ptrd(:,jpj,:) = 0.e0 ; ptrd(:,1,:) = 0.e0 175 ptrd(:,:,jpk) = 0.e0 176 ! 177 ! 178 DO jk = 1, jpkm1 195 ! 196 ! ! set to zero uncomputed values 197 ptrd(jpi,:,:) = 0._wp ; ptrd(1,:,:) = 0._wp 198 ptrd(:,jpj,:) = 0._wp ; ptrd(:,1,:) = 0._wp 199 ptrd(:,:,jpk) = 0._wp 200 ! 201 DO jk = 1, jpkm1 ! advective trend 179 202 DO jj = 2, jpjm1 180 203 DO ji = fs_2, fs_jpim1 ! vector opt. 181 zbtr = 1.e0/ ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) )182 ptrd(ji,jj,jk) = - zbtr * ( pf (ji,jj,jk) - pf (ji-ii,jj-ij,jk-ik)&183 & - ( pun(ji,jj,jk) - pun(ji-ii,jj-ij,jk-ik) ) * ptn(ji,jj,jk))204 ptrd(ji,jj,jk) = - ( pf (ji,jj,jk) - pf (ji-ii,jj-ij,jk-ik) & 205 & - ( pun(ji,jj,jk) - pun(ji-ii,jj-ij,jk-ik) ) * ptn(ji,jj,jk) ) & 206 & * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) * tmask(ji,jj,jk) 184 207 END DO 185 208 END DO … … 188 211 END SUBROUTINE trd_tra_adv 189 212 190 # else 191 !!---------------------------------------------------------------------- 192 !! Default case : Dummy module No trend diagnostics 193 !!---------------------------------------------------------------------- 194 USE par_oce ! ocean variables trends 195 CONTAINS 196 SUBROUTINE trd_tra( kt, ctype, ktra, ktrd, ptrd, pu, ptra ) 197 !!---------------------------------------------------------------------- 198 INTEGER , INTENT(in) :: kt ! time step 199 CHARACTER(len=3) , INTENT(in) :: ctype ! tracers trends type 'TRA'/'TRC' 200 INTEGER , INTENT(in) :: ktra ! tracer index 201 INTEGER , INTENT(in) :: ktrd ! tracer trend index 202 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: ptrd ! tracer trend 203 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: pu ! velocity 204 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: ptra ! Tracer variable 205 WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd(1,1,1), ptra(1,1,1), pu(1,1,1), & 206 & ktrd, ktra, ctype, kt 207 END SUBROUTINE trd_tra 208 # endif 213 214 SUBROUTINE trd_tra_mng( ptrdx, ptrdy, ktrd, kt ) 215 !!--------------------------------------------------------------------- 216 !! *** ROUTINE trd_tra_mng *** 217 !! 218 !! ** Purpose : Dispatch all tracer trends computation, e.g. 3D output, 219 !! integral constraints, potential energy, and/or 220 !! mixed layer budget. 221 !!---------------------------------------------------------------------- 222 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 223 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 224 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 225 INTEGER , INTENT(in ) :: kt ! time step 226 !!---------------------------------------------------------------------- 227 228 IF( neuler == 0 .AND. kt == nit000 ) THEN ; r2dt = rdt ! = rdt (restart with Euler time stepping) 229 ELSEIF( kt <= nit000 + 1) THEN ; r2dt = 2. * rdt ! = 2 rdt (leapfrog) 230 ENDIF 231 232 ! ! 3D output of tracers trends using IOM interface 233 IF( ln_tra_trd ) CALL trd_tra_iom ( ptrdx, ptrdy, ktrd, kt ) 234 235 ! ! Integral Constraints Properties for tracers trends !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 236 IF( ln_glo_trd ) CALL trd_glo( ptrdx, ptrdy, ktrd, 'TRA', kt ) 237 238 ! ! Potential ENergy trends 239 IF( ln_PE_trd ) CALL trd_pen( ptrdx, ptrdy, ktrd, kt, r2dt ) 240 241 ! ! Mixed layer trends for active tracers 242 IF( ln_tra_mxl ) THEN 243 !----------------------------------------------------------------------------------------------- 244 ! W.A.R.N.I.N.G : 245 ! jptra_ldf : called by traldf.F90 246 ! at this stage we store: 247 ! - the lateral geopotential diffusion (here, lateral = horizontal) 248 ! - and the iso-neutral diffusion if activated 249 ! jptra_zdf : called by trazdf.F90 250 ! * in case of iso-neutral diffusion we store the vertical diffusion component in the 251 ! lateral trend including the K_z contrib, which will be removed later (see trd_mxl) 252 !----------------------------------------------------------------------------------------------- 253 254 SELECT CASE ( ktrd ) 255 CASE ( jptra_xad ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_xad, '3D' ) ! zonal advection 256 CASE ( jptra_yad ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_yad, '3D' ) ! merid. advection 257 CASE ( jptra_zad ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_zad, '3D' ) ! vertical advection 258 CASE ( jptra_ldf ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_ldf, '3D' ) ! lateral diffusion 259 CASE ( jptra_bbl ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_bbl, '3D' ) ! bottom boundary layer 260 CASE ( jptra_zdf ) 261 IF( ln_traldf_iso ) THEN ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_ldf, '3D' ) ! lateral diffusion (K_z) 262 ELSE ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_zdf, '3D' ) ! vertical diffusion (K_z) 263 ENDIF 264 CASE ( jptra_dmp ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_dmp, '3D' ) ! internal 3D restoring (tradmp) 265 CASE ( jptra_qsr ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_for, '3D' ) ! air-sea : penetrative sol radiat 266 CASE ( jptra_nsr ) ; ptrdx(:,:,2:jpk) = 0._wp ; ptrdy(:,:,2:jpk) = 0._wp 267 CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_for, '2D' ) ! air-sea : non penetr sol radiation 268 CASE ( jptra_bbc ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_bbc, '3D' ) ! bottom bound cond (geoth flux) 269 CASE ( jptra_npc ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_npc, '3D' ) ! non penetr convect adjustment 270 CASE ( jptra_atf ) ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_atf, '3D' ) ! asselin time filter (last trend) 271 ! 272 CALL trd_mxl( kt, r2dt ) ! trends: Mixed-layer (output) 273 END SELECT 274 ! 275 ENDIF 276 ! 277 END SUBROUTINE trd_tra_mng 278 279 280 SUBROUTINE trd_tra_iom( ptrdx, ptrdy, ktrd, kt ) 281 !!--------------------------------------------------------------------- 282 !! *** ROUTINE trd_tra_iom *** 283 !! 284 !! ** Purpose : output 3D tracer trends using IOM 285 !!---------------------------------------------------------------------- 286 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 287 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 288 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 289 INTEGER , INTENT(in ) :: kt ! time step 290 !! 291 INTEGER :: ji, jj, jk ! dummy loop indices 292 INTEGER :: ikbu, ikbv ! local integers 293 REAL(wp), POINTER, DIMENSION(:,:) :: z2dx, z2dy ! 2D workspace 294 !!---------------------------------------------------------------------- 295 ! 296 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 297 ! 298 SELECT CASE( ktrd ) 299 CASE( jptra_xad ) ; CALL iom_put( "ttrd_xad" , ptrdx ) ! x- horizontal advection 300 CALL iom_put( "strd_xad" , ptrdy ) 301 CASE( jptra_yad ) ; CALL iom_put( "ttrd_yad" , ptrdx ) ! y- horizontal advection 302 CALL iom_put( "strd_yad" , ptrdy ) 303 CASE( jptra_zad ) ; CALL iom_put( "ttrd_zad" , ptrdx ) ! z- vertical advection 304 CALL iom_put( "strd_zad" , ptrdy ) 305 IF( ln_linssh ) THEN ! cst volume : adv flux through z=0 surface 306 CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 307 z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / e3t_n(:,:,1) 308 z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / e3t_n(:,:,1) 309 CALL iom_put( "ttrd_sad", z2dx ) 310 CALL iom_put( "strd_sad", z2dy ) 311 CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 312 ENDIF 313 CASE( jptra_ldf ) ; CALL iom_put( "ttrd_ldf" , ptrdx ) ! lateral diffusion 314 CALL iom_put( "strd_ldf" , ptrdy ) 315 CASE( jptra_zdf ) ; CALL iom_put( "ttrd_zdf" , ptrdx ) ! vertical diffusion (including Kz contribution) 316 CALL iom_put( "strd_zdf" , ptrdy ) 317 CASE( jptra_zdfp ) ; CALL iom_put( "ttrd_zdfp", ptrdx ) ! PURE vertical diffusion (no isoneutral contribution) 318 CALL iom_put( "strd_zdfp", ptrdy ) 319 CASE( jptra_dmp ) ; CALL iom_put( "ttrd_dmp" , ptrdx ) ! internal restoring (damping) 320 CALL iom_put( "strd_dmp" , ptrdy ) 321 CASE( jptra_bbl ) ; CALL iom_put( "ttrd_bbl" , ptrdx ) ! bottom boundary layer 322 CALL iom_put( "strd_bbl" , ptrdy ) 323 CASE( jptra_npc ) ; CALL iom_put( "ttrd_npc" , ptrdx ) ! static instability mixing 324 CALL iom_put( "strd_npc" , ptrdy ) 325 CASE( jptra_nsr ) ; CALL iom_put( "ttrd_qns" , ptrdx ) ! surface forcing + runoff (ln_rnf=T) 326 CALL iom_put( "strd_cdt" , ptrdy ) 327 CASE( jptra_qsr ) ; CALL iom_put( "ttrd_qsr" , ptrdx ) ! penetrative solar radiat. (only on temperature) 328 CASE( jptra_bbc ) ; CALL iom_put( "ttrd_bbc" , ptrdx ) ! geothermal heating (only on temperature) 329 CASE( jptra_atf ) ; CALL iom_put( "ttrd_atf" , ptrdx ) ! asselin time Filter 330 CALL iom_put( "strd_atf" , ptrdy ) 331 END SELECT 332 ! 333 END SUBROUTINE trd_tra_iom 334 209 335 !!====================================================================== 210 336 END MODULE trdtra
Note: See TracChangeset
for help on using the changeset viewer.