[1418] | 1 | MODULE zdftmx |
---|
| 2 | !!======================================================================== |
---|
| 3 | !! *** MODULE zdftmx *** |
---|
| 4 | !! Ocean physics: vertical tidal mixing coefficient |
---|
| 5 | !!======================================================================== |
---|
| 6 | !! History : 1.0 ! 2004-04 (L. Bessieres, G. Madec) Original code |
---|
| 7 | !! - ! 2006-08 (A. Koch-Larrouy) Indonesian strait |
---|
| 8 | !!---------------------------------------------------------------------- |
---|
| 9 | #if defined key_zdftmx |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | !! 'key_zdftmx' Tidal vertical mixing |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
| 13 | !! zdf_tmx : global momentum & tracer Kz with tidal induced Kz |
---|
| 14 | !! tmx_itf : Indonesian momentum & tracer Kz with tidal induced Kz |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
| 16 | USE oce ! ocean dynamics and tracers variables |
---|
| 17 | USE dom_oce ! ocean space and time domain variables |
---|
| 18 | USE zdf_oce ! ocean vertical physics variables |
---|
| 19 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 20 | USE eosbn2 ! ocean equation of state |
---|
| 21 | USE phycst ! physical constants |
---|
| 22 | USE prtctl ! Print control |
---|
[1496] | 23 | USE in_out_manager ! I/O manager |
---|
| 24 | USE iom ! I/O Manager |
---|
[1418] | 25 | |
---|
| 26 | IMPLICIT NONE |
---|
| 27 | PRIVATE |
---|
| 28 | |
---|
[1518] | 29 | PUBLIC zdf_tmx ! called in step module |
---|
[1418] | 30 | |
---|
| 31 | LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .TRUE. !: tidal mixing flag |
---|
| 32 | |
---|
[1601] | 33 | ! !!* Namelist namzdf_tmx : tidal mixing * |
---|
[1518] | 34 | REAL(wp) :: rn_htmx = 500. ! vertical decay scale for turbulence (meters) |
---|
| 35 | REAL(wp) :: rn_n2min = 1.e-8 ! threshold of the Brunt-Vaisala frequency (s-1) |
---|
| 36 | REAL(wp) :: rn_tfe = 1./3. ! tidal dissipation efficiency (St Laurent et al. 2002) |
---|
| 37 | REAL(wp) :: rn_me = 0.2 ! mixing efficiency (Osborn 1980) |
---|
| 38 | LOGICAL :: ln_tmx_itf = .TRUE. ! Indonesian Through Flow (ITF): Koch-Larrouy et al. (2007) parameterization |
---|
| 39 | REAL(wp) :: rn_tfe_itf = 1. ! ITF tidal dissipation efficiency (St Laurent et al. 2002) |
---|
[1418] | 40 | |
---|
[1518] | 41 | REAL(wp), DIMENSION(jpi,jpj) :: en_tmx ! energy available for tidal mixing (W/m2) |
---|
| 42 | REAL(wp), DIMENSION(jpi,jpj) :: mask_itf ! mask to use over Indonesian area |
---|
| 43 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: az_tmx ! coefficient used to evaluate the tidal induced Kz |
---|
[1418] | 44 | |
---|
| 45 | !! * Substitutions |
---|
| 46 | # include "domzgr_substitute.h90" |
---|
| 47 | # include "vectopt_loop_substitute.h90" |
---|
| 48 | !!---------------------------------------------------------------------- |
---|
| 49 | !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) |
---|
[1495] | 50 | !! $Id$ |
---|
[1418] | 51 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
| 52 | !!---------------------------------------------------------------------- |
---|
| 53 | |
---|
| 54 | CONTAINS |
---|
| 55 | |
---|
| 56 | SUBROUTINE zdf_tmx( kt ) |
---|
| 57 | !!---------------------------------------------------------------------- |
---|
| 58 | !! *** ROUTINE zdf_tmx *** |
---|
| 59 | !! |
---|
| 60 | !! ** Purpose : add to the vertical mixing coefficients the effect of |
---|
[1496] | 61 | !! tidal mixing (Simmons et al 2004). |
---|
[1418] | 62 | !! |
---|
| 63 | !! ** Method : - tidal-induced vertical mixing is given by: |
---|
[1496] | 64 | !! Kz_tides = az_tmx / max( rn_n2min, N^2 ) |
---|
| 65 | !! where az_tmx is a coefficient that specified the 3D space |
---|
| 66 | !! distribution of the faction of tidal energy taht is used |
---|
| 67 | !! for mixing. Its expression is set in zdf_tmx_init routine, |
---|
| 68 | !! following Simmons et al. 2004. |
---|
| 69 | !! NB: a specific bounding procedure is performed on av_tide |
---|
| 70 | !! so that the input tidal energy is actually almost used. The |
---|
| 71 | !! basic maximum value is 60 cm2/s, but values of 300 cm2/s |
---|
| 72 | !! can be reached in area where bottom stratification is too |
---|
| 73 | !! weak. |
---|
[1418] | 74 | !! |
---|
[1496] | 75 | !! - update av_tide in the Indonesian Through Flow area |
---|
| 76 | !! following Koch-Larrouy et al. (2007) parameterisation |
---|
| 77 | !! (see tmx_itf routine). |
---|
[1418] | 78 | !! |
---|
[1496] | 79 | !! - update the model vertical eddy viscosity and diffusivity: |
---|
| 80 | !! avt = avt + av_tides |
---|
[1527] | 81 | !! avm = avm + av_tides |
---|
[1496] | 82 | !! avmu = avmu + mi(av_tides) |
---|
| 83 | !! avmv = avmv + mj(av_tides) |
---|
| 84 | !! |
---|
[1527] | 85 | !! ** Action : avt, avm, avmu, avmv increased by tidal mixing |
---|
[1496] | 86 | !! |
---|
[1418] | 87 | !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. |
---|
[1496] | 88 | !! Koch-Larrouy et al. 2007, GRL. |
---|
[1418] | 89 | !!---------------------------------------------------------------------- |
---|
[1601] | 90 | USE oce, zav_tide => ua ! use ua as workspace |
---|
[1546] | 91 | !! |
---|
[1418] | 92 | INTEGER, INTENT(in) :: kt ! ocean time-step |
---|
| 93 | !! |
---|
| 94 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 95 | REAL(wp) :: ztpc ! scalar workspace |
---|
| 96 | REAL(wp), DIMENSION(jpi,jpj) :: zkz ! temporary 2D workspace |
---|
| 97 | !!---------------------------------------------------------------------- |
---|
| 98 | |
---|
[1496] | 99 | ! |
---|
| 100 | IF( kt == nit000 ) CALL zdf_tmx_init ! Initialization (first time-step only) |
---|
[1418] | 101 | |
---|
[1546] | 102 | ! ! ----------------------- ! |
---|
| 103 | ! ! Standard tidal mixing ! (compute zav_tide) |
---|
| 104 | ! ! ----------------------- ! |
---|
[1496] | 105 | ! !* First estimation (with n2 bound by rn_n2min) bounded by 60 cm2/s |
---|
[1546] | 106 | zav_tide(:,:,:) = MIN( 60.e-4, az_tmx(:,:,:) / MAX( rn_n2min, rn2(:,:,:) ) ) |
---|
[1418] | 107 | |
---|
[1496] | 108 | zkz(:,:) = 0.e0 !* Associated potential energy consummed over the whole water column |
---|
[1418] | 109 | DO jk = 2, jpkm1 |
---|
[1546] | 110 | zkz(:,:) = zkz(:,:) + fse3w(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * zav_tide(:,:,jk)* tmask(:,:,jk) |
---|
[1418] | 111 | END DO |
---|
| 112 | |
---|
[1496] | 113 | DO jj = 1, jpj !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx |
---|
[1418] | 114 | DO ji = 1, jpi |
---|
| 115 | IF( zkz(ji,jj) /= 0.e0 ) zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) |
---|
| 116 | END DO |
---|
| 117 | END DO |
---|
| 118 | |
---|
[1546] | 119 | DO jk = 2, jpkm1 !* Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zav_tide bound by 300 cm2/s |
---|
| 120 | zav_tide(:,:,jk) = zav_tide(:,:,jk) * MIN( zkz(:,:), 30./6. ) !kz max = 300 cm2/s |
---|
[1418] | 121 | END DO |
---|
| 122 | |
---|
[1546] | 123 | IF( kt == nit000 ) THEN !* check at first time-step: diagnose the energy consumed by zav_tide |
---|
[1418] | 124 | ztpc = 0.e0 |
---|
| 125 | DO jk= 1, jpk |
---|
| 126 | DO jj= 1, jpj |
---|
| 127 | DO ji= 1, jpi |
---|
[1496] | 128 | ztpc = ztpc + fse3w(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) & |
---|
[1546] | 129 | & * MAX( 0.e0, rn2(ji,jj,jk) ) * zav_tide(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
[1418] | 130 | END DO |
---|
| 131 | END DO |
---|
| 132 | END DO |
---|
[1495] | 133 | ztpc= rau0 / ( rn_tfe * rn_me ) * ztpc |
---|
[1418] | 134 | IF(lwp) WRITE(numout,*) |
---|
[1496] | 135 | IF(lwp) WRITE(numout,*) ' N Total power consumption by av_tide : ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
[1418] | 136 | ENDIF |
---|
[1495] | 137 | |
---|
[1546] | 138 | ! ! ----------------------- ! |
---|
| 139 | ! ! ITF tidal mixing ! (update zav_tide) |
---|
| 140 | ! ! ----------------------- ! |
---|
| 141 | IF( ln_tmx_itf ) CALL tmx_itf( kt, zav_tide ) |
---|
[1418] | 142 | |
---|
[1546] | 143 | ! ! ----------------------- ! |
---|
| 144 | ! ! Update mixing coefs ! |
---|
| 145 | ! ! ----------------------- ! |
---|
[1495] | 146 | DO jk = 2, jpkm1 !* update momentum & tracer diffusivity with tidal mixing |
---|
[1546] | 147 | avt(:,:,jk) = avt(:,:,jk) + zav_tide(:,:,jk) |
---|
| 148 | avm(:,:,jk) = avm(:,:,jk) + zav_tide(:,:,jk) |
---|
[1418] | 149 | DO jj = 2, jpjm1 |
---|
| 150 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[1546] | 151 | avmu(ji,jj,jk) = avmu(ji,jj,jk) + 0.5 * ( zav_tide(ji,jj,jk) + zav_tide(ji+1,jj ,jk) ) * umask(ji,jj,jk) |
---|
| 152 | avmv(ji,jj,jk) = avmv(ji,jj,jk) + 0.5 * ( zav_tide(ji,jj,jk) + zav_tide(ji ,jj+1,jk) ) * vmask(ji,jj,jk) |
---|
[1418] | 153 | END DO |
---|
| 154 | END DO |
---|
| 155 | END DO |
---|
[1496] | 156 | CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. ) ! lateral boundary condition |
---|
[1418] | 157 | |
---|
[1546] | 158 | ! !* output tidal mixing coefficient |
---|
| 159 | CALL iom_put( "av_tide", zav_tide ) |
---|
| 160 | |
---|
| 161 | IF(ln_ctl) CALL prt_ctl(tab3d_1=zav_tide , clinfo1=' tmx - av_tide: ', tab3d_2=avt, clinfo2=' avt: ', ovlap=1, kdim=jpk) |
---|
[1418] | 162 | ! |
---|
| 163 | END SUBROUTINE zdf_tmx |
---|
| 164 | |
---|
| 165 | |
---|
[1546] | 166 | SUBROUTINE tmx_itf( kt, pav ) |
---|
[1418] | 167 | !!---------------------------------------------------------------------- |
---|
| 168 | !! *** ROUTINE tmx_itf *** |
---|
| 169 | !! |
---|
[1496] | 170 | !! ** Purpose : modify the vertical eddy diffusivity coefficients |
---|
[1546] | 171 | !! (pav) in the Indonesian Through Flow area (ITF). |
---|
[1418] | 172 | !! |
---|
[1496] | 173 | !! ** Method : - Following Koch-Larrouy et al. (2007), in the ITF defined |
---|
| 174 | !! by msk_itf (read in a file, see tmx_init), the tidal |
---|
| 175 | !! mixing coefficient is computed with : |
---|
| 176 | !! * q=1 (i.e. all the tidal energy remains trapped in |
---|
| 177 | !! the area and thus is used for mixing) |
---|
| 178 | !! * the vertical distribution of the tifal energy is a |
---|
| 179 | !! proportional to N above the thermocline (d(N^2)/dz > 0) |
---|
| 180 | !! and to N^2 below the thermocline (d(N^2)/dz < 0) |
---|
[1418] | 181 | !! |
---|
[1496] | 182 | !! ** Action : av_tide updated in the ITF area (msk_itf) |
---|
[1418] | 183 | !! |
---|
| 184 | !! References : Koch-Larrouy et al. 2007, GRL |
---|
| 185 | !!---------------------------------------------------------------------- |
---|
[1546] | 186 | INTEGER , INTENT(in ) :: kt ! ocean time-step |
---|
| 187 | REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) :: pav ! Tidal mixing coef. |
---|
[1418] | 188 | !! |
---|
[1495] | 189 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 190 | REAL(wp) :: zcoef, ztpc ! temporary scalar |
---|
[1518] | 191 | REAL(wp), DIMENSION(jpi,jpj) :: zkz ! 2D workspace |
---|
| 192 | REAL(wp), DIMENSION(jpi,jpj) :: zsum1 , zsum2 , zsum ! - - |
---|
| 193 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zempba_3d_1, zempba_3d_2 ! 3D workspace |
---|
| 194 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zempba_3d , zdn2dz ! - - |
---|
| 195 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zavt_itf ! - - |
---|
[1418] | 196 | !!---------------------------------------------------------------------- |
---|
| 197 | |
---|
| 198 | ! ! compute the form function using N2 at each time step |
---|
[1518] | 199 | zempba_3d_1(:,:,jpk) = 0.e0 |
---|
| 200 | zempba_3d_2(:,:,jpk) = 0.e0 |
---|
| 201 | DO jk = 1, jpkm1 |
---|
| 202 | zdn2dz (:,:,jk) = rn2(:,:,jk) - rn2(:,:,jk+1) ! Vertical profile of dN2/dz |
---|
[1495] | 203 | !CDIR NOVERRCHK |
---|
[1518] | 204 | zempba_3d_1(:,:,jk) = SQRT( MAX( 0.e0, rn2(:,:,jk) ) ) ! - - of N |
---|
| 205 | zempba_3d_2(:,:,jk) = MAX( 0.e0, rn2(:,:,jk) ) ! - - of N^2 |
---|
[1418] | 206 | END DO |
---|
[1518] | 207 | ! |
---|
| 208 | zsum (:,:) = 0.e0 |
---|
| 209 | zsum1(:,:) = 0.e0 |
---|
| 210 | zsum2(:,:) = 0.e0 |
---|
[1418] | 211 | DO jk= 2, jpk |
---|
[1518] | 212 | zsum1(:,:) = zsum1(:,:) + zempba_3d_1(:,:,jk) * fse3w(:,:,jk) |
---|
| 213 | zsum2(:,:) = zsum2(:,:) + zempba_3d_2(:,:,jk) * fse3w(:,:,jk) |
---|
[1418] | 214 | END DO |
---|
| 215 | DO jj = 1, jpj |
---|
[1518] | 216 | DO ji = 1, jpi |
---|
| 217 | IF( zsum1(ji,jj) /= 0.e0 ) zsum1(ji,jj) = 1.e0 / zsum1(ji,jj) |
---|
| 218 | IF( zsum2(ji,jj) /= 0.e0 ) zsum2(ji,jj) = 1.e0 / zsum2(ji,jj) |
---|
| 219 | END DO |
---|
[1418] | 220 | END DO |
---|
| 221 | |
---|
| 222 | DO jk= 1, jpk |
---|
| 223 | DO jj = 1, jpj |
---|
| 224 | DO ji = 1, jpi |
---|
[1518] | 225 | zcoef = 0.5 - SIGN( 0.5, zdn2dz(ji,jj,jk) ) ! =0 if dN2/dz > 0, =1 otherwise |
---|
| 226 | ztpc = zempba_3d_1(ji,jj,jk) * zsum1(ji,jj) * zcoef & |
---|
| 227 | & + zempba_3d_2(ji,jj,jk) * zsum2(ji,jj) * ( 1. - zcoef ) |
---|
| 228 | ! |
---|
| 229 | zempba_3d(ji,jj,jk) = ztpc |
---|
| 230 | zsum (ji,jj) = zsum(ji,jj) + ztpc * fse3w(ji,jj,jk) |
---|
[1418] | 231 | END DO |
---|
| 232 | END DO |
---|
| 233 | END DO |
---|
| 234 | DO jj = 1, jpj |
---|
| 235 | DO ji = 1, jpi |
---|
[1518] | 236 | IF( zsum(ji,jj) > 0.e0 ) zsum(ji,jj) = 1.e0 / zsum(ji,jj) |
---|
[1418] | 237 | END DO |
---|
| 238 | END DO |
---|
| 239 | |
---|
[1495] | 240 | ! ! first estimation bounded by 10 cm2/s (with n2 bounded by rn_n2min) |
---|
| 241 | zcoef = rn_tfe_itf / ( rn_tfe * rau0 ) |
---|
[1518] | 242 | DO jk = 1, jpk |
---|
| 243 | zavt_itf(:,:,jk) = MIN( 10.e-4, zcoef * en_tmx(:,:) * zsum(:,:) * zempba_3d(:,:,jk) & |
---|
| 244 | & / MAX( rn_n2min, rn2(:,:,jk) ) * tmask(:,:,jk) ) |
---|
[1495] | 245 | END DO |
---|
[1418] | 246 | |
---|
| 247 | zkz(:,:) = 0.e0 ! Associated potential energy consummed over the whole water column |
---|
| 248 | DO jk = 2, jpkm1 |
---|
[1495] | 249 | zkz(:,:) = zkz(:,:) + fse3w(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * zavt_itf(:,:,jk) * tmask(:,:,jk) |
---|
[1418] | 250 | END DO |
---|
| 251 | |
---|
| 252 | DO jj = 1, jpj ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx |
---|
| 253 | DO ji = 1, jpi |
---|
| 254 | IF( zkz(ji,jj) /= 0.e0 ) zkz(ji,jj) = en_tmx(ji,jj) * rn_tfe_itf / rn_tfe / zkz(ji,jj) |
---|
| 255 | END DO |
---|
| 256 | END DO |
---|
| 257 | |
---|
[1495] | 258 | DO jk = 2, jpkm1 ! Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zavt_itf bound by 300 cm2/s |
---|
| 259 | zavt_itf(:,:,jk) = zavt_itf(:,:,jk) * MIN( zkz(:,:), 120./10. ) ! kz max = 120 cm2/s |
---|
[1418] | 260 | END DO |
---|
| 261 | |
---|
[1495] | 262 | IF( kt == nit000 ) THEN ! diagnose the nergy consumed by zavt_itf |
---|
[1418] | 263 | ztpc = 0.e0 |
---|
| 264 | DO jk= 1, jpk |
---|
| 265 | DO jj= 1, jpj |
---|
| 266 | DO ji= 1, jpi |
---|
[1495] | 267 | ztpc = ztpc + e1t(ji,jj) * e2t(ji,jj) * fse3w(ji,jj,jk) * MAX( 0.e0, rn2(ji,jj,jk) ) & |
---|
| 268 | & * zavt_itf(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
[1418] | 269 | END DO |
---|
| 270 | END DO |
---|
| 271 | END DO |
---|
[1495] | 272 | ztpc= rau0 * ztpc / ( rn_me * rn_tfe_itf ) |
---|
| 273 | IF(lwp) WRITE(numout,*) ' N Total power consumption by zavt_itf: ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
[1418] | 274 | ENDIF |
---|
| 275 | |
---|
[1546] | 276 | ! ! Update pav with the ITF mixing coefficient |
---|
[1418] | 277 | DO jk = 2, jpkm1 |
---|
[1546] | 278 | pav(:,:,jk) = pav (:,:,jk) * ( 1.e0 - mask_itf(:,:) ) & |
---|
| 279 | & + zavt_itf(:,:,jk) * mask_itf(:,:) |
---|
[1418] | 280 | END DO |
---|
| 281 | ! |
---|
| 282 | END SUBROUTINE tmx_itf |
---|
| 283 | |
---|
| 284 | |
---|
| 285 | SUBROUTINE zdf_tmx_init |
---|
| 286 | !!---------------------------------------------------------------------- |
---|
| 287 | !! *** ROUTINE zdf_tmx_init *** |
---|
| 288 | !! |
---|
| 289 | !! ** Purpose : Initialization of the vertical tidal mixing, Reading |
---|
[1496] | 290 | !! of M2 and K1 tidal energy in nc files |
---|
[1418] | 291 | !! |
---|
[1496] | 292 | !! ** Method : - Read the namtmx namelist and check the parameters |
---|
| 293 | !! |
---|
| 294 | !! - Read the input data in NetCDF files : |
---|
| 295 | !! M2 and K1 tidal energy. The total tidal energy, en_tmx, |
---|
| 296 | !! is the sum of M2, K1 and S2 energy where S2 is assumed |
---|
| 297 | !! to be: S2=(1/2)^2 * M2 |
---|
| 298 | !! mask_itf, a mask array that determine where substituing |
---|
| 299 | !! the standard Simmons et al. (2005) formulation with the |
---|
| 300 | !! one of Koch_Larrouy et al. (2007). |
---|
| 301 | !! |
---|
[1418] | 302 | !! - Compute az_tmx, a 3D coefficient that allows to compute |
---|
[1496] | 303 | !! the standard tidal-induced vertical mixing as follows: |
---|
| 304 | !! Kz_tides = az_tmx / max( rn_n2min, N^2 ) |
---|
| 305 | !! with az_tmx a bottom intensified coefficient is given by: |
---|
| 306 | !! az_tmx(z) = en_tmx / ( rau0 * rn_htmx ) * EXP( -(H-z)/rn_htmx ) |
---|
| 307 | !! / ( 1. - EXP( - H /rn_htmx ) ) |
---|
| 308 | !! where rn_htmx the characteristic length scale of the bottom |
---|
| 309 | !! intensification, en_tmx the tidal energy, and H the ocean depth |
---|
[1418] | 310 | !! |
---|
| 311 | !! ** input : - Namlist namtmx |
---|
[1496] | 312 | !! - NetCDF file : M2_ORCA2.nc, K1_ORCA2.nc, and mask_itf.nc |
---|
[1418] | 313 | !! |
---|
| 314 | !! ** Action : - Increase by 1 the nstop flag is setting problem encounter |
---|
| 315 | !! - defined az_tmx used to compute tidal-induced mixing |
---|
[1496] | 316 | !! |
---|
| 317 | !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. |
---|
| 318 | !! Koch-Larrouy et al. 2007, GRL. |
---|
[1418] | 319 | !!---------------------------------------------------------------------- |
---|
[1546] | 320 | USE oce, zav_tide => ua ! use ua as workspace |
---|
| 321 | !! |
---|
[1518] | 322 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 323 | INTEGER :: inum ! temporary logical unit |
---|
| 324 | REAL(wp) :: ztpc, ze_z ! total power consumption |
---|
| 325 | REAL(wp), DIMENSION(jpi,jpj) :: zem2, zek1 ! read M2 and K1 tidal energy |
---|
| 326 | REAL(wp), DIMENSION(jpi,jpj) :: zkz ! total M2, K1 and S2 tidal energy |
---|
| 327 | REAL(wp), DIMENSION(jpi,jpj) :: zfact ! used for vertical structure function |
---|
| 328 | REAL(wp), DIMENSION(jpi,jpj) :: zhdep ! Ocean depth |
---|
| 329 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpc ! power consumption |
---|
[1496] | 330 | !! |
---|
[1601] | 331 | NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf |
---|
[1418] | 332 | !!---------------------------------------------------------------------- |
---|
| 333 | |
---|
[1601] | 334 | REWIND( numnam ) ! Read Namelist namtmx : Tidal Mixing |
---|
| 335 | READ ( numnam, namzdf_tmx ) |
---|
[1537] | 336 | |
---|
| 337 | IF(lwp) THEN ! Control print |
---|
[1418] | 338 | WRITE(numout,*) |
---|
| 339 | WRITE(numout,*) 'zdf_tmx_init : tidal mixing' |
---|
| 340 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
[1601] | 341 | WRITE(numout,*) ' Namelist namzdf_tmx : set tidal mixing parameters' |
---|
[1537] | 342 | WRITE(numout,*) ' Vertical decay scale for turbulence = ', rn_htmx |
---|
| 343 | WRITE(numout,*) ' Brunt-Vaisala frequency threshold = ', rn_n2min |
---|
| 344 | WRITE(numout,*) ' Tidal dissipation efficiency = ', rn_tfe |
---|
| 345 | WRITE(numout,*) ' Mixing efficiency = ', rn_me |
---|
| 346 | WRITE(numout,*) ' ITF specific parameterisation = ', ln_tmx_itf |
---|
| 347 | WRITE(numout,*) ' ITF tidal dissipation efficiency = ', rn_tfe_itf |
---|
[1418] | 348 | ENDIF |
---|
| 349 | |
---|
[1537] | 350 | IF( ln_tmx_itf ) THEN ! read the Indonesian Through Flow mask |
---|
[1518] | 351 | CALL iom_open('mask_itf',inum) |
---|
| 352 | CALL iom_get (inum, jpdom_data, 'tmaskitf',mask_itf,1) ! |
---|
| 353 | CALL iom_close(inum) |
---|
| 354 | ENDIF |
---|
[1418] | 355 | |
---|
| 356 | ! read M2 tidal energy flux : W/m2 ( zem2 < 0 ) |
---|
| 357 | CALL iom_open('M2rowdrg',inum) |
---|
| 358 | CALL iom_get (inum, jpdom_data, 'field',zem2,1) ! |
---|
| 359 | CALL iom_close(inum) |
---|
| 360 | |
---|
| 361 | ! read K1 tidal energy flux : W/m2 ( zek1 < 0 ) |
---|
| 362 | CALL iom_open('K1rowdrg',inum) |
---|
| 363 | CALL iom_get (inum, jpdom_data, 'field',zek1,1) ! |
---|
| 364 | CALL iom_close(inum) |
---|
| 365 | |
---|
| 366 | ! Total tidal energy ( M2, S2 and K1 with S2=(1/2)^2 * M2 ) |
---|
| 367 | ! only the energy available for mixing is taken into account, |
---|
| 368 | ! (mixing efficiency tidal dissipation efficiency) |
---|
| 369 | en_tmx(:,:) = - rn_tfe * rn_me * ( zem2(:,:) * 1.25 + zek1(:,:) ) * tmask(:,:,1) |
---|
| 370 | |
---|
[1496] | 371 | ! Vertical structure (az_tmx) |
---|
| 372 | DO jj = 1, jpj ! part independent of the level |
---|
[1418] | 373 | DO ji = 1, jpi |
---|
| 374 | zhdep(ji,jj) = fsdepw(ji,jj,mbathy(ji,jj)) ! depth of the ocean |
---|
| 375 | zfact(ji,jj) = rau0 * rn_htmx * ( 1. - EXP( -zhdep(ji,jj) / rn_htmx ) ) |
---|
| 376 | IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = en_tmx(ji,jj) / zfact(ji,jj) |
---|
| 377 | END DO |
---|
| 378 | END DO |
---|
| 379 | DO jk= 1, jpk ! complete with the level-dependent part |
---|
| 380 | DO jj = 1, jpj |
---|
| 381 | DO ji = 1, jpi |
---|
| 382 | az_tmx(ji,jj,jk) = zfact(ji,jj) * EXP( -( zhdep(ji,jj)-fsdepw(ji,jj,jk) ) / rn_htmx ) * tmask(ji,jj,jk) |
---|
| 383 | END DO |
---|
| 384 | END DO |
---|
| 385 | END DO |
---|
| 386 | |
---|
| 387 | IF( nprint == 1 .AND. lwp ) THEN |
---|
| 388 | ! Control print |
---|
| 389 | ! Total power consumption due to vertical mixing |
---|
[1546] | 390 | ! zpc = rau0 * 1/rn_me * rn2 * zav_tide |
---|
| 391 | zav_tide(:,:,:) = 0.e0 |
---|
[1418] | 392 | DO jk = 2, jpkm1 |
---|
[1546] | 393 | zav_tide(:,:,jk) = az_tmx(:,:,jk) / MAX( rn_n2min, rn2(:,:,jk) ) |
---|
[1418] | 394 | END DO |
---|
| 395 | |
---|
| 396 | ztpc = 0.e0 |
---|
[1546] | 397 | zpc(:,:,:) = MAX(rn_n2min,rn2(:,:,:)) * zav_tide(:,:,:) |
---|
[1418] | 398 | DO jk= 2, jpkm1 |
---|
| 399 | DO jj = 1, jpj |
---|
| 400 | DO ji = 1, jpi |
---|
| 401 | ztpc = ztpc + fse3w(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) * zpc(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
| 402 | END DO |
---|
| 403 | END DO |
---|
| 404 | END DO |
---|
| 405 | ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc |
---|
| 406 | |
---|
| 407 | WRITE(numout,*) |
---|
| 408 | WRITE(numout,*) ' Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
| 409 | |
---|
| 410 | |
---|
| 411 | ! control print 2 |
---|
[1546] | 412 | zav_tide(:,:,:) = MIN( zav_tide(:,:,:), 60.e-4 ) |
---|
[1418] | 413 | zkz(:,:) = 0.e0 |
---|
| 414 | DO jk = 2, jpkm1 |
---|
| 415 | DO jj = 1, jpj |
---|
| 416 | DO ji = 1, jpi |
---|
[1546] | 417 | zkz(ji,jj) = zkz(ji,jj) + fse3w(ji,jj,jk) * MAX( 0.e0, rn2(ji,jj,jk) ) * rau0 * zav_tide(ji,jj,jk)* tmask(ji,jj,jk) |
---|
[1418] | 418 | END DO |
---|
| 419 | END DO |
---|
| 420 | END DO |
---|
| 421 | ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz |
---|
| 422 | DO jj = 1, jpj |
---|
| 423 | DO ji = 1, jpi |
---|
| 424 | IF( zkz(ji,jj) /= 0.e0 ) THEN |
---|
| 425 | zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) |
---|
| 426 | ENDIF |
---|
| 427 | END DO |
---|
| 428 | END DO |
---|
| 429 | ztpc = 1.e50 |
---|
| 430 | DO jj = 1, jpj |
---|
| 431 | DO ji = 1, jpi |
---|
| 432 | IF( zkz(ji,jj) /= 0.e0 ) THEN |
---|
| 433 | ztpc = Min( zkz(ji,jj), ztpc) |
---|
| 434 | ENDIF |
---|
| 435 | END DO |
---|
| 436 | END DO |
---|
| 437 | WRITE(numout,*) ' Min de zkz ', ztpc, ' Max = ', maxval(zkz(:,:) ) |
---|
| 438 | |
---|
| 439 | DO jk = 2, jpkm1 |
---|
[1546] | 440 | zav_tide(:,:,jk) = zav_tide(:,:,jk) * MIN( zkz(:,:), 30./6. ) !kz max = 300 cm2/s |
---|
[1418] | 441 | END DO |
---|
| 442 | ztpc = 0.e0 |
---|
[1546] | 443 | zpc(:,:,:) = Max(0.e0,rn2(:,:,:)) * zav_tide(:,:,:) |
---|
[1418] | 444 | DO jk= 1, jpk |
---|
| 445 | DO jj = 1, jpj |
---|
| 446 | DO ji = 1, jpi |
---|
| 447 | ztpc = ztpc + fse3w(ji,jj,jk) * e1t(ji,jj) * e2t(ji,jj) * zpc(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) |
---|
| 448 | END DO |
---|
| 449 | END DO |
---|
| 450 | END DO |
---|
| 451 | ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc |
---|
| 452 | WRITE(numout,*) ' 2 Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW' |
---|
| 453 | |
---|
| 454 | DO jk = 1, jpk |
---|
[1546] | 455 | ze_z = SUM( e1t(:,:) * e2t(:,:) * zav_tide(:,:,jk) * tmask_i(:,:) ) & |
---|
[1418] | 456 | & / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * tmask (:,:,jk) * tmask_i(:,:) ) ) |
---|
| 457 | ztpc = 1.E50 |
---|
| 458 | DO jj = 1, jpj |
---|
| 459 | DO ji = 1, jpi |
---|
[1546] | 460 | IF( zav_tide(ji,jj,jk) /= 0.e0 ) ztpc =Min( ztpc, zav_tide(ji,jj,jk) ) |
---|
[1418] | 461 | END DO |
---|
| 462 | END DO |
---|
| 463 | WRITE(numout,*) ' N2 min - jk= ', jk,' ', ze_z * 1.e4,' cm2/s min= ',ztpc*1.e4, & |
---|
[1546] | 464 | & 'max= ', MAXVAL(zav_tide(:,:,jk) )*1.e4, ' cm2/s' |
---|
[1418] | 465 | END DO |
---|
| 466 | |
---|
| 467 | WRITE(numout,*) ' e_tide : ', SUM( e1t*e2t*en_tmx ) / ( rn_tfe * rn_me ) * 1.e-12, 'TW' |
---|
| 468 | WRITE(numout,*) |
---|
| 469 | WRITE(numout,*) ' Initial profile of tidal vertical mixing' |
---|
| 470 | DO jk = 1, jpk |
---|
| 471 | DO jj = 1,jpj |
---|
| 472 | DO ji = 1,jpi |
---|
| 473 | zkz(ji,jj) = az_tmx(ji,jj,jk) /MAX( rn_n2min, rn2(ji,jj,jk) ) |
---|
| 474 | END DO |
---|
| 475 | END DO |
---|
| 476 | ze_z = SUM( e1t(:,:) * e2t(:,:) * zkz(:,:) * tmask_i(:,:) ) & |
---|
| 477 | & / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * tmask (:,:,jk) * tmask_i(:,:) ) ) |
---|
| 478 | WRITE(numout,*) ' jk= ', jk,' ', ze_z * 1.e4,' cm2/s' |
---|
| 479 | END DO |
---|
| 480 | DO jk = 1, jpk |
---|
| 481 | zkz(:,:) = az_tmx(:,:,jk) /rn_n2min |
---|
| 482 | ze_z = SUM( e1t(:,:) * e2t(:,:) * zkz(:,:) * tmask_i(:,:) ) & |
---|
| 483 | & / MAX( 1.e-20, SUM( e1t(:,:) * e2t(:,:) * tmask (:,:,jk) * tmask_i(:,:) ) ) |
---|
| 484 | WRITE(numout,*) |
---|
| 485 | WRITE(numout,*) ' N2 min - jk= ', jk,' ', ze_z * 1.e4,' cm2/s min= ',MINVAL(zkz)*1.e4, & |
---|
| 486 | & 'max= ', MAXVAL(zkz)*1.e4, ' cm2/s' |
---|
| 487 | END DO |
---|
| 488 | ! |
---|
| 489 | ENDIF |
---|
| 490 | |
---|
| 491 | END SUBROUTINE zdf_tmx_init |
---|
| 492 | |
---|
| 493 | #else |
---|
| 494 | !!---------------------------------------------------------------------- |
---|
| 495 | !! Default option Dummy module NO Tidal MiXing |
---|
| 496 | !!---------------------------------------------------------------------- |
---|
| 497 | LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .FALSE. !: tidal mixing flag |
---|
| 498 | CONTAINS |
---|
| 499 | SUBROUTINE zdf_tmx( kt ) ! Empty routine |
---|
| 500 | WRITE(*,*) 'zdf_tmx: You should not have seen this print! error?', kt |
---|
| 501 | END SUBROUTINE zdf_tmx |
---|
| 502 | #endif |
---|
| 503 | |
---|
| 504 | !!====================================================================== |
---|
| 505 | END MODULE zdftmx |
---|