[1] | 1 | SUBROUTINE prandtl_fluxes |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1321] | 22 | ! |
---|
| 23 | ! |
---|
| 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: prandtl_fluxes.f90 1321 2014-03-20 09:40:40Z raasch $ |
---|
| 27 | ! |
---|
| 28 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 29 | ! ONLY-attribute added to USE-statements, |
---|
| 30 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 31 | ! kinds are defined in new module kinds, |
---|
| 32 | ! old module precision_kind is removed, |
---|
| 33 | ! revision history before 2012 removed, |
---|
| 34 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 35 | ! all variable declaration statements |
---|
[1] | 36 | ! |
---|
[1277] | 37 | ! 1276 2014-01-15 13:40:41Z heinze |
---|
| 38 | ! Use LSF_DATA also in case of Dirichlet bottom boundary condition for scalars |
---|
| 39 | ! |
---|
[1258] | 40 | ! 1257 2013-11-08 15:18:40Z raasch |
---|
| 41 | ! openACC "kernels do" replaced by "kernels loop", "loop independent" added |
---|
| 42 | ! |
---|
[1037] | 43 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 44 | ! code put under GPL (PALM 3.9) |
---|
| 45 | ! |
---|
[1017] | 46 | ! 1015 2012-09-27 09:23:24Z raasch |
---|
| 47 | ! OpenACC statements added |
---|
| 48 | ! |
---|
[979] | 49 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 50 | ! roughness length for scalar quantities z0h added |
---|
| 51 | ! |
---|
[1] | 52 | ! Revision 1.1 1998/01/23 10:06:06 raasch |
---|
| 53 | ! Initial revision |
---|
| 54 | ! |
---|
| 55 | ! |
---|
| 56 | ! Description: |
---|
| 57 | ! ------------ |
---|
| 58 | ! Diagnostic computation of vertical fluxes in the Prandtl layer from the |
---|
| 59 | ! values of the variables at grid point k=1 |
---|
| 60 | !------------------------------------------------------------------------------! |
---|
| 61 | |
---|
[1320] | 62 | USE arrays_3d, & |
---|
| 63 | ONLY: e, pt, q, qs, qsws, rif, shf, ts, u, us, usws, v, vpt, vsws, & |
---|
| 64 | zu, zw, z0, z0h |
---|
[1] | 65 | |
---|
[1320] | 66 | USE control_parameters, & |
---|
| 67 | ONLY: constant_heatflux, constant_waterflux, coupling_mode, g, & |
---|
| 68 | humidity, ibc_e_b, kappa, large_scale_forcing, lsf_surf, & |
---|
| 69 | passive_scalar, pt_surface, q_surface, rif_max, rif_min, & |
---|
| 70 | run_coupled, surface_pressure |
---|
| 71 | |
---|
| 72 | USE indices, & |
---|
| 73 | ONLY: nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb_s_inner, & |
---|
| 74 | nzb_u_inner, nzb_v_inner |
---|
| 75 | |
---|
| 76 | USE kinds |
---|
| 77 | |
---|
[1] | 78 | IMPLICIT NONE |
---|
| 79 | |
---|
[1320] | 80 | INTEGER(iwp) :: i !: |
---|
| 81 | INTEGER(iwp) :: j !: |
---|
| 82 | INTEGER(iwp) :: k !: |
---|
[1] | 83 | |
---|
[1320] | 84 | LOGICAL :: coupled_run !: |
---|
| 85 | |
---|
| 86 | REAL(wp) :: a !: |
---|
| 87 | REAL(wp) :: b !: |
---|
| 88 | REAL(wp) :: e_q !: |
---|
| 89 | REAL(wp) :: rifm !: |
---|
| 90 | REAL(wp) :: uv_total !: |
---|
| 91 | REAL(wp) :: z_p !: |
---|
| 92 | |
---|
[1015] | 93 | ! |
---|
| 94 | !-- Data information for accelerators |
---|
| 95 | !$acc data present( e, nzb_u_inner, nzb_v_inner, nzb_s_inner, pt, q, qs ) & |
---|
| 96 | !$acc present( qsws, rif, shf, ts, u, us, usws, v, vpt, vsws, zu, zw, z0, z0h ) |
---|
[667] | 97 | ! |
---|
[1] | 98 | !-- Compute theta* |
---|
| 99 | IF ( constant_heatflux ) THEN |
---|
| 100 | ! |
---|
| 101 | !-- For a given heat flux in the Prandtl layer: |
---|
| 102 | !-- for u* use the value from the previous time step |
---|
| 103 | !$OMP PARALLEL DO |
---|
[1257] | 104 | !$acc kernels loop |
---|
[667] | 105 | DO i = nxlg, nxrg |
---|
| 106 | DO j = nysg, nyng |
---|
[1] | 107 | ts(j,i) = -shf(j,i) / ( us(j,i) + 1E-30 ) |
---|
| 108 | ! |
---|
| 109 | !-- ts must be limited, because otherwise overflow may occur in case of |
---|
| 110 | !-- us=0 when computing rif further below |
---|
[759] | 111 | IF ( ts(j,i) < -1.05E5 ) ts(j,i) = -1.0E5 |
---|
| 112 | IF ( ts(j,i) > 1.0E5 ) ts(j,i) = 1.0E5 |
---|
[1] | 113 | ENDDO |
---|
| 114 | ENDDO |
---|
| 115 | |
---|
| 116 | ELSE |
---|
| 117 | ! |
---|
| 118 | !-- For a given surface temperature: |
---|
| 119 | !-- (the Richardson number is still the one from the previous time step) |
---|
[1276] | 120 | |
---|
| 121 | IF ( large_scale_forcing .AND. lsf_surf ) THEN |
---|
| 122 | pt(0,:,:) = pt_surface |
---|
| 123 | ENDIF |
---|
| 124 | |
---|
[1] | 125 | !$OMP PARALLEL DO PRIVATE( a, b, k, z_p ) |
---|
[1257] | 126 | !$acc kernels loop |
---|
[667] | 127 | DO i = nxlg, nxrg |
---|
| 128 | DO j = nysg, nyng |
---|
[1] | 129 | |
---|
| 130 | k = nzb_s_inner(j,i) |
---|
| 131 | z_p = zu(k+1) - zw(k) |
---|
| 132 | |
---|
| 133 | IF ( rif(j,i) >= 0.0 ) THEN |
---|
| 134 | ! |
---|
| 135 | !-- Stable stratification |
---|
[978] | 136 | ts(j,i) = kappa * ( pt(k+1,j,i) - pt(k,j,i) ) / ( & |
---|
| 137 | LOG( z_p / z0h(j,i) ) + & |
---|
| 138 | 5.0 * rif(j,i) * ( z_p - z0h(j,i) ) / z_p & |
---|
[1] | 139 | ) |
---|
| 140 | ELSE |
---|
| 141 | ! |
---|
| 142 | !-- Unstable stratification |
---|
| 143 | a = SQRT( 1.0 - 16.0 * rif(j,i) ) |
---|
[978] | 144 | b = SQRT( 1.0 - 16.0 * rif(j,i) * z0h(j,i) / z_p ) |
---|
[187] | 145 | |
---|
[978] | 146 | ts(j,i) = kappa * ( pt(k+1,j,i) - pt(k,j,i) ) / ( & |
---|
| 147 | LOG( z_p / z0h(j,i) ) - & |
---|
[187] | 148 | 2.0 * LOG( ( 1.0 + a ) / ( 1.0 + b ) ) ) |
---|
[1] | 149 | ENDIF |
---|
| 150 | |
---|
| 151 | ENDDO |
---|
| 152 | ENDDO |
---|
| 153 | ENDIF |
---|
| 154 | |
---|
| 155 | ! |
---|
| 156 | !-- Compute z_p/L (corresponds to the Richardson-flux number) |
---|
[75] | 157 | IF ( .NOT. humidity ) THEN |
---|
[1] | 158 | !$OMP PARALLEL DO PRIVATE( k, z_p ) |
---|
[1257] | 159 | !$acc kernels loop |
---|
[667] | 160 | DO i = nxlg, nxrg |
---|
| 161 | DO j = nysg, nyng |
---|
[1] | 162 | k = nzb_s_inner(j,i) |
---|
| 163 | z_p = zu(k+1) - zw(k) |
---|
| 164 | rif(j,i) = z_p * kappa * g * ts(j,i) / & |
---|
| 165 | ( pt(k+1,j,i) * ( us(j,i)**2 + 1E-30 ) ) |
---|
| 166 | ! |
---|
| 167 | !-- Limit the value range of the Richardson numbers. |
---|
| 168 | !-- This is necessary for very small velocities (u,v --> 0), because |
---|
| 169 | !-- the absolute value of rif can then become very large, which in |
---|
| 170 | !-- consequence would result in very large shear stresses and very |
---|
| 171 | !-- small momentum fluxes (both are generally unrealistic). |
---|
| 172 | IF ( rif(j,i) < rif_min ) rif(j,i) = rif_min |
---|
| 173 | IF ( rif(j,i) > rif_max ) rif(j,i) = rif_max |
---|
| 174 | ENDDO |
---|
| 175 | ENDDO |
---|
| 176 | ELSE |
---|
| 177 | !$OMP PARALLEL DO PRIVATE( k, z_p ) |
---|
[1257] | 178 | !$acc kernels loop |
---|
[667] | 179 | DO i = nxlg, nxrg |
---|
| 180 | DO j = nysg, nyng |
---|
[1] | 181 | k = nzb_s_inner(j,i) |
---|
| 182 | z_p = zu(k+1) - zw(k) |
---|
| 183 | rif(j,i) = z_p * kappa * g * & |
---|
| 184 | ( ts(j,i) + 0.61 * pt(k+1,j,i) * qs(j,i) ) / & |
---|
| 185 | ( vpt(k+1,j,i) * ( us(j,i)**2 + 1E-30 ) ) |
---|
| 186 | ! |
---|
| 187 | !-- Limit the value range of the Richardson numbers. |
---|
| 188 | !-- This is necessary for very small velocities (u,v --> 0), because |
---|
| 189 | !-- the absolute value of rif can then become very large, which in |
---|
| 190 | !-- consequence would result in very large shear stresses and very |
---|
| 191 | !-- small momentum fluxes (both are generally unrealistic). |
---|
| 192 | IF ( rif(j,i) < rif_min ) rif(j,i) = rif_min |
---|
| 193 | IF ( rif(j,i) > rif_max ) rif(j,i) = rif_max |
---|
| 194 | ENDDO |
---|
| 195 | ENDDO |
---|
| 196 | ENDIF |
---|
| 197 | |
---|
| 198 | ! |
---|
| 199 | !-- Compute u* at the scalars' grid points |
---|
| 200 | !$OMP PARALLEL DO PRIVATE( a, b, k, uv_total, z_p ) |
---|
[1257] | 201 | !$acc kernels loop |
---|
[1] | 202 | DO i = nxl, nxr |
---|
| 203 | DO j = nys, nyn |
---|
| 204 | |
---|
| 205 | k = nzb_s_inner(j,i) |
---|
| 206 | z_p = zu(k+1) - zw(k) |
---|
| 207 | |
---|
| 208 | ! |
---|
[667] | 209 | !-- Compute the absolute value of the horizontal velocity |
---|
| 210 | !-- (relative to the surface) |
---|
| 211 | uv_total = SQRT( ( 0.5 * ( u(k+1,j,i) + u(k+1,j,i+1) & |
---|
| 212 | - u(k,j,i) - u(k,j,i+1) ) )**2 + & |
---|
| 213 | ( 0.5 * ( v(k+1,j,i) + v(k+1,j+1,i) & |
---|
| 214 | - v(k,j,i) - v(k,j+1,i) ) )**2 ) |
---|
[1] | 215 | |
---|
[667] | 216 | |
---|
[1] | 217 | IF ( rif(j,i) >= 0.0 ) THEN |
---|
| 218 | ! |
---|
| 219 | !-- Stable stratification |
---|
| 220 | us(j,i) = kappa * uv_total / ( & |
---|
| 221 | LOG( z_p / z0(j,i) ) + & |
---|
| 222 | 5.0 * rif(j,i) * ( z_p - z0(j,i) ) / z_p & |
---|
| 223 | ) |
---|
| 224 | ELSE |
---|
| 225 | ! |
---|
| 226 | !-- Unstable stratification |
---|
[187] | 227 | a = SQRT( SQRT( 1.0 - 16.0 * rif(j,i) ) ) |
---|
| 228 | b = SQRT( SQRT( 1.0 - 16.0 * rif(j,i) / z_p * z0(j,i) ) ) |
---|
| 229 | |
---|
| 230 | us(j,i) = kappa * uv_total / ( & |
---|
| 231 | LOG( z_p / z0(j,i) ) - & |
---|
| 232 | LOG( ( 1.0 + a )**2 * ( 1.0 + a**2 ) / ( & |
---|
| 233 | ( 1.0 + b )**2 * ( 1.0 + b**2 ) ) ) + & |
---|
| 234 | 2.0 * ( ATAN( a ) - ATAN( b ) ) & |
---|
| 235 | ) |
---|
[1] | 236 | ENDIF |
---|
| 237 | ENDDO |
---|
| 238 | ENDDO |
---|
| 239 | |
---|
| 240 | ! |
---|
[187] | 241 | !-- Values of us at ghost point locations are needed for the evaluation of usws |
---|
| 242 | !-- and vsws. |
---|
[1015] | 243 | !$acc update host( us ) |
---|
[187] | 244 | CALL exchange_horiz_2d( us ) |
---|
[1015] | 245 | !$acc update device( us ) |
---|
| 246 | |
---|
[187] | 247 | ! |
---|
[1] | 248 | !-- Compute u'w' for the total model domain. |
---|
| 249 | !-- First compute the corresponding component of u* and square it. |
---|
| 250 | !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p ) |
---|
[1257] | 251 | !$acc kernels loop |
---|
[1] | 252 | DO i = nxl, nxr |
---|
| 253 | DO j = nys, nyn |
---|
| 254 | |
---|
| 255 | k = nzb_u_inner(j,i) |
---|
| 256 | z_p = zu(k+1) - zw(k) |
---|
| 257 | |
---|
| 258 | ! |
---|
| 259 | !-- Compute Richardson-flux number for this point |
---|
| 260 | rifm = 0.5 * ( rif(j,i-1) + rif(j,i) ) |
---|
| 261 | IF ( rifm >= 0.0 ) THEN |
---|
| 262 | ! |
---|
| 263 | !-- Stable stratification |
---|
[667] | 264 | usws(j,i) = kappa * ( u(k+1,j,i) - u(k,j,i) )/ ( & |
---|
[1] | 265 | LOG( z_p / z0(j,i) ) + & |
---|
| 266 | 5.0 * rifm * ( z_p - z0(j,i) ) / z_p & |
---|
| 267 | ) |
---|
| 268 | ELSE |
---|
| 269 | ! |
---|
| 270 | !-- Unstable stratification |
---|
[187] | 271 | a = SQRT( SQRT( 1.0 - 16.0 * rifm ) ) |
---|
| 272 | b = SQRT( SQRT( 1.0 - 16.0 * rifm / z_p * z0(j,i) ) ) |
---|
| 273 | |
---|
[667] | 274 | usws(j,i) = kappa * ( u(k+1,j,i) - u(k,j,i) ) / ( & |
---|
[187] | 275 | LOG( z_p / z0(j,i) ) - & |
---|
| 276 | LOG( (1.0 + a )**2 * ( 1.0 + a**2 ) / ( & |
---|
| 277 | (1.0 + b )**2 * ( 1.0 + b**2 ) ) ) + & |
---|
| 278 | 2.0 * ( ATAN( a ) - ATAN( b ) ) & |
---|
[1] | 279 | ) |
---|
| 280 | ENDIF |
---|
[187] | 281 | usws(j,i) = -usws(j,i) * 0.5 * ( us(j,i-1) + us(j,i) ) |
---|
[1] | 282 | ENDDO |
---|
| 283 | ENDDO |
---|
| 284 | |
---|
| 285 | ! |
---|
| 286 | !-- Compute v'w' for the total model domain. |
---|
| 287 | !-- First compute the corresponding component of u* and square it. |
---|
| 288 | !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p ) |
---|
[1257] | 289 | !$acc kernels loop |
---|
[1] | 290 | DO i = nxl, nxr |
---|
| 291 | DO j = nys, nyn |
---|
| 292 | |
---|
| 293 | k = nzb_v_inner(j,i) |
---|
| 294 | z_p = zu(k+1) - zw(k) |
---|
| 295 | |
---|
| 296 | ! |
---|
| 297 | !-- Compute Richardson-flux number for this point |
---|
| 298 | rifm = 0.5 * ( rif(j-1,i) + rif(j,i) ) |
---|
| 299 | IF ( rifm >= 0.0 ) THEN |
---|
| 300 | ! |
---|
| 301 | !-- Stable stratification |
---|
[667] | 302 | vsws(j,i) = kappa * ( v(k+1,j,i) - v(k,j,i) ) / ( & |
---|
[1] | 303 | LOG( z_p / z0(j,i) ) + & |
---|
| 304 | 5.0 * rifm * ( z_p - z0(j,i) ) / z_p & |
---|
| 305 | ) |
---|
| 306 | ELSE |
---|
| 307 | ! |
---|
| 308 | !-- Unstable stratification |
---|
[187] | 309 | a = SQRT( SQRT( 1.0 - 16.0 * rifm ) ) |
---|
| 310 | b = SQRT( SQRT( 1.0 - 16.0 * rifm / z_p * z0(j,i) ) ) |
---|
| 311 | |
---|
[667] | 312 | vsws(j,i) = kappa * ( v(k+1,j,i) - v(k,j,i) ) / ( & |
---|
[187] | 313 | LOG( z_p / z0(j,i) ) - & |
---|
| 314 | LOG( (1.0 + a )**2 * ( 1.0 + a**2 ) / ( & |
---|
| 315 | (1.0 + b )**2 * ( 1.0 + b**2 ) ) ) + & |
---|
| 316 | 2.0 * ( ATAN( a ) - ATAN( b ) ) & |
---|
[1] | 317 | ) |
---|
| 318 | ENDIF |
---|
[187] | 319 | vsws(j,i) = -vsws(j,i) * 0.5 * ( us(j-1,i) + us(j,i) ) |
---|
[1] | 320 | ENDDO |
---|
| 321 | ENDDO |
---|
| 322 | |
---|
| 323 | ! |
---|
| 324 | !-- If required compute q* |
---|
[75] | 325 | IF ( humidity .OR. passive_scalar ) THEN |
---|
[1] | 326 | IF ( constant_waterflux ) THEN |
---|
| 327 | ! |
---|
| 328 | !-- For a given water flux in the Prandtl layer: |
---|
| 329 | !$OMP PARALLEL DO |
---|
[1257] | 330 | !$acc kernels loop |
---|
[667] | 331 | DO i = nxlg, nxrg |
---|
| 332 | DO j = nysg, nyng |
---|
[1] | 333 | qs(j,i) = -qsws(j,i) / ( us(j,i) + 1E-30 ) |
---|
| 334 | ENDDO |
---|
| 335 | ENDDO |
---|
| 336 | |
---|
[1015] | 337 | ELSE |
---|
| 338 | coupled_run = ( coupling_mode == 'atmosphere_to_ocean' .AND. run_coupled ) |
---|
[1276] | 339 | |
---|
| 340 | IF ( large_scale_forcing .AND. lsf_surf ) THEN |
---|
| 341 | q(0,:,:) = q_surface |
---|
| 342 | ENDIF |
---|
| 343 | |
---|
[1] | 344 | !$OMP PARALLEL DO PRIVATE( a, b, k, z_p ) |
---|
[1257] | 345 | !$acc kernels loop independent |
---|
[667] | 346 | DO i = nxlg, nxrg |
---|
[1257] | 347 | !$acc loop independent |
---|
[667] | 348 | DO j = nysg, nyng |
---|
[1] | 349 | |
---|
| 350 | k = nzb_s_inner(j,i) |
---|
| 351 | z_p = zu(k+1) - zw(k) |
---|
| 352 | |
---|
[108] | 353 | ! |
---|
[291] | 354 | !-- Assume saturation for atmosphere coupled to ocean (but not |
---|
| 355 | !-- in case of precursor runs) |
---|
[1015] | 356 | IF ( coupled_run ) THEN |
---|
[108] | 357 | e_q = 6.1 * & |
---|
| 358 | EXP( 0.07 * ( MIN(pt(0,j,i),pt(1,j,i)) - 273.15 ) ) |
---|
| 359 | q(k,j,i) = 0.622 * e_q / ( surface_pressure - e_q ) |
---|
| 360 | ENDIF |
---|
[1] | 361 | IF ( rif(j,i) >= 0.0 ) THEN |
---|
| 362 | ! |
---|
| 363 | !-- Stable stratification |
---|
[978] | 364 | qs(j,i) = kappa * ( q(k+1,j,i) - q(k,j,i) ) / ( & |
---|
| 365 | LOG( z_p / z0h(j,i) ) + & |
---|
| 366 | 5.0 * rif(j,i) * ( z_p - z0h(j,i) ) / z_p & |
---|
[1] | 367 | ) |
---|
| 368 | ELSE |
---|
| 369 | ! |
---|
| 370 | !-- Unstable stratification |
---|
[187] | 371 | a = SQRT( 1.0 - 16.0 * rif(j,i) ) |
---|
[978] | 372 | b = SQRT( 1.0 - 16.0 * rif(j,i) * z0h(j,i) / z_p ) |
---|
[187] | 373 | |
---|
[978] | 374 | qs(j,i) = kappa * ( q(k+1,j,i) - q(k,j,i) ) / ( & |
---|
| 375 | LOG( z_p / z0h(j,i) ) - & |
---|
[187] | 376 | 2.0 * LOG( (1.0 + a ) / ( 1.0 + b ) ) ) |
---|
[1] | 377 | ENDIF |
---|
| 378 | |
---|
| 379 | ENDDO |
---|
| 380 | ENDDO |
---|
| 381 | ENDIF |
---|
| 382 | ENDIF |
---|
| 383 | |
---|
| 384 | ! |
---|
[187] | 385 | !-- Exchange the boundaries for the momentum fluxes (only for sake of |
---|
| 386 | !-- completeness) |
---|
[1015] | 387 | !$acc update host( usws, vsws ) |
---|
[1] | 388 | CALL exchange_horiz_2d( usws ) |
---|
| 389 | CALL exchange_horiz_2d( vsws ) |
---|
[1015] | 390 | !$acc update device( usws, vsws ) |
---|
| 391 | IF ( humidity .OR. passive_scalar ) THEN |
---|
| 392 | !$acc update host( qsws ) |
---|
| 393 | CALL exchange_horiz_2d( qsws ) |
---|
| 394 | !$acc update device( qsws ) |
---|
| 395 | ENDIF |
---|
[1] | 396 | |
---|
| 397 | ! |
---|
| 398 | !-- Compute the vertical kinematic heat flux |
---|
| 399 | IF ( .NOT. constant_heatflux ) THEN |
---|
| 400 | !$OMP PARALLEL DO |
---|
[1257] | 401 | !$acc kernels loop independent |
---|
[667] | 402 | DO i = nxlg, nxrg |
---|
[1257] | 403 | !$acc loop independent |
---|
[667] | 404 | DO j = nysg, nyng |
---|
[1] | 405 | shf(j,i) = -ts(j,i) * us(j,i) |
---|
| 406 | ENDDO |
---|
| 407 | ENDDO |
---|
| 408 | ENDIF |
---|
| 409 | |
---|
| 410 | ! |
---|
| 411 | !-- Compute the vertical water/scalar flux |
---|
[315] | 412 | IF ( .NOT. constant_waterflux .AND. ( humidity .OR. passive_scalar ) ) THEN |
---|
[1] | 413 | !$OMP PARALLEL DO |
---|
[1257] | 414 | !$acc kernels loop independent |
---|
[667] | 415 | DO i = nxlg, nxrg |
---|
[1257] | 416 | !$acc loop independent |
---|
[667] | 417 | DO j = nysg, nyng |
---|
[1] | 418 | qsws(j,i) = -qs(j,i) * us(j,i) |
---|
| 419 | ENDDO |
---|
| 420 | ENDDO |
---|
| 421 | ENDIF |
---|
| 422 | |
---|
| 423 | ! |
---|
| 424 | !-- Bottom boundary condition for the TKE |
---|
| 425 | IF ( ibc_e_b == 2 ) THEN |
---|
| 426 | !$OMP PARALLEL DO |
---|
[1257] | 427 | !$acc kernels loop independent |
---|
[667] | 428 | DO i = nxlg, nxrg |
---|
[1257] | 429 | !$acc loop independent |
---|
[667] | 430 | DO j = nysg, nyng |
---|
[1] | 431 | e(nzb_s_inner(j,i)+1,j,i) = ( us(j,i) / 0.1 )**2 |
---|
| 432 | ! |
---|
| 433 | !-- As a test: cm = 0.4 |
---|
| 434 | ! e(nzb_s_inner(j,i)+1,j,i) = ( us(j,i) / 0.4 )**2 |
---|
| 435 | e(nzb_s_inner(j,i),j,i) = e(nzb_s_inner(j,i)+1,j,i) |
---|
| 436 | ENDDO |
---|
| 437 | ENDDO |
---|
| 438 | ENDIF |
---|
| 439 | |
---|
[1015] | 440 | !$acc end data |
---|
[1] | 441 | |
---|
| 442 | END SUBROUTINE prandtl_fluxes |
---|