[1682] | 1 | !> @file boundary_conds.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1036] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1036] | 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 | ! |
---|
[2101] | 17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1933] | 22 | ! |
---|
[2233] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: boundary_conds.f90 2233 2017-05-30 18:08:54Z raasch $ |
---|
| 27 | ! |
---|
[2233] | 28 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 29 | ! Set boundary conditions on topography top using flag method. |
---|
| 30 | ! |
---|
[2119] | 31 | ! 2118 2017-01-17 16:38:49Z raasch |
---|
| 32 | ! OpenACC directives removed |
---|
| 33 | ! |
---|
[2001] | 34 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 35 | ! Forced header and separation lines into 80 columns |
---|
| 36 | ! |
---|
[1993] | 37 | ! 1992 2016-08-12 15:14:59Z suehring |
---|
| 38 | ! Adjustments for top boundary condition for passive scalar |
---|
| 39 | ! |
---|
[1961] | 40 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 41 | ! Treat humidity and passive scalar separately |
---|
| 42 | ! |
---|
[1933] | 43 | ! 1823 2016-04-07 08:57:52Z hoffmann |
---|
| 44 | ! Initial version of purely vertical nesting introduced. |
---|
| 45 | ! |
---|
[1823] | 46 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
| 47 | ! icloud_scheme removed. microphyisics_seifert added. |
---|
| 48 | ! |
---|
[1765] | 49 | ! 1764 2016-02-28 12:45:19Z raasch |
---|
| 50 | ! index bug for u_p at left outflow removed |
---|
| 51 | ! |
---|
[1763] | 52 | ! 1762 2016-02-25 12:31:13Z hellstea |
---|
| 53 | ! Introduction of nested domain feature |
---|
| 54 | ! |
---|
[1744] | 55 | ! 1742 2016-01-13 09:50:06Z raasch |
---|
| 56 | ! bugfix for outflow Neumann boundary conditions at bottom and top |
---|
| 57 | ! |
---|
[1718] | 58 | ! 1717 2015-11-11 15:09:47Z raasch |
---|
| 59 | ! Bugfix: index error in outflow conditions for left boundary |
---|
| 60 | ! |
---|
[1683] | 61 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 62 | ! Code annotations made doxygen readable |
---|
| 63 | ! |
---|
[1717] | 64 | ! 1410 2014-05-23 12:16:18Z suehring |
---|
[1463] | 65 | ! Bugfix: set dirichlet boundary condition for passive_scalar at model domain |
---|
| 66 | ! top |
---|
| 67 | ! |
---|
[1410] | 68 | ! 1399 2014-05-07 11:16:25Z heinze |
---|
| 69 | ! Bugfix: set inflow boundary conditions also if no humidity or passive_scalar |
---|
| 70 | ! is used. |
---|
| 71 | ! |
---|
[1399] | 72 | ! 1398 2014-05-07 11:15:00Z heinze |
---|
| 73 | ! Dirichlet-condition at the top for u and v changed to u_init and v_init also |
---|
| 74 | ! for large_scale_forcing |
---|
| 75 | ! |
---|
[1381] | 76 | ! 1380 2014-04-28 12:40:45Z heinze |
---|
| 77 | ! Adjust Dirichlet-condition at the top for pt in case of nudging |
---|
| 78 | ! |
---|
[1362] | 79 | ! 1361 2014-04-16 15:17:48Z hoffmann |
---|
| 80 | ! Bottom and top boundary conditions of rain water content (qr) and |
---|
| 81 | ! rain drop concentration (nr) changed to Dirichlet |
---|
| 82 | ! |
---|
[1354] | 83 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 84 | ! REAL constants provided with KIND-attribute |
---|
| 85 | ! |
---|
[1321] | 86 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 87 | ! ONLY-attribute added to USE-statements, |
---|
| 88 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 89 | ! kinds are defined in new module kinds, |
---|
| 90 | ! revision history before 2012 removed, |
---|
| 91 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 92 | ! all variable declaration statements |
---|
[1160] | 93 | ! |
---|
[1258] | 94 | ! 1257 2013-11-08 15:18:40Z raasch |
---|
| 95 | ! loop independent clauses added |
---|
| 96 | ! |
---|
[1242] | 97 | ! 1241 2013-10-30 11:36:58Z heinze |
---|
| 98 | ! Adjust ug and vg at each timestep in case of large_scale_forcing |
---|
| 99 | ! |
---|
[1160] | 100 | ! 1159 2013-05-21 11:58:22Z fricke |
---|
[1159] | 101 | ! Bugfix: Neumann boundary conditions for the velocity components at the |
---|
| 102 | ! outflow are in fact radiation boundary conditions using the maximum phase |
---|
| 103 | ! velocity that ensures numerical stability (CFL-condition). |
---|
| 104 | ! Hence, logical operator use_cmax is now used instead of bc_lr_dirneu/_neudir. |
---|
| 105 | ! Bugfix: In case of use_cmax at the outflow, u, v, w are replaced by |
---|
| 106 | ! u_p, v_p, w_p |
---|
[1116] | 107 | ! |
---|
| 108 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 109 | ! boundary conditions of two-moment cloud scheme are restricted to Neumann- |
---|
| 110 | ! boundary-conditions |
---|
| 111 | ! |
---|
[1114] | 112 | ! 1113 2013-03-10 02:48:14Z raasch |
---|
| 113 | ! GPU-porting |
---|
| 114 | ! dummy argument "range" removed |
---|
| 115 | ! Bugfix: wrong index in loops of radiation boundary condition |
---|
[1113] | 116 | ! |
---|
[1054] | 117 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 118 | ! boundary conditions for the two new prognostic equations (nr, qr) of the |
---|
| 119 | ! two-moment cloud scheme |
---|
| 120 | ! |
---|
[1037] | 121 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 122 | ! code put under GPL (PALM 3.9) |
---|
| 123 | ! |
---|
[997] | 124 | ! 996 2012-09-07 10:41:47Z raasch |
---|
| 125 | ! little reformatting |
---|
| 126 | ! |
---|
[979] | 127 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 128 | ! Neumann boudnary conditions are added at the inflow boundary for the SGS-TKE. |
---|
| 129 | ! Outflow boundary conditions for the velocity components can be set to Neumann |
---|
| 130 | ! conditions or to radiation conditions with a horizontal averaged phase |
---|
| 131 | ! velocity. |
---|
| 132 | ! |
---|
[876] | 133 | ! 875 2012-04-02 15:35:15Z gryschka |
---|
| 134 | ! Bugfix in case of dirichlet inflow bc at the right or north boundary |
---|
| 135 | ! |
---|
[1] | 136 | ! Revision 1.1 1997/09/12 06:21:34 raasch |
---|
| 137 | ! Initial revision |
---|
| 138 | ! |
---|
| 139 | ! |
---|
| 140 | ! Description: |
---|
| 141 | ! ------------ |
---|
[1682] | 142 | !> Boundary conditions for the prognostic quantities. |
---|
| 143 | !> One additional bottom boundary condition is applied for the TKE (=(u*)**2) |
---|
| 144 | !> in prandtl_fluxes. The cyclic lateral boundary conditions are implicitly |
---|
| 145 | !> handled in routine exchange_horiz. Pressure boundary conditions are |
---|
| 146 | !> explicitly set in routines pres, poisfft, poismg and sor. |
---|
[1] | 147 | !------------------------------------------------------------------------------! |
---|
[1682] | 148 | SUBROUTINE boundary_conds |
---|
| 149 | |
---|
[1] | 150 | |
---|
[1320] | 151 | USE arrays_3d, & |
---|
| 152 | ONLY: c_u, c_u_m, c_u_m_l, c_v, c_v_m, c_v_m_l, c_w, c_w_m, c_w_m_l, & |
---|
[1960] | 153 | dzu, e_p, nr_p, pt, pt_p, q, q_p, qr_p, s, s_p, sa, sa_p, & |
---|
[1320] | 154 | u, ug, u_init, u_m_l, u_m_n, u_m_r, u_m_s, u_p, & |
---|
| 155 | v, vg, v_init, v_m_l, v_m_n, v_m_r, v_m_s, v_p, & |
---|
[1960] | 156 | w, w_p, w_m_l, w_m_n, w_m_r, w_m_s, pt_init |
---|
[1320] | 157 | |
---|
| 158 | USE control_parameters, & |
---|
[1960] | 159 | ONLY: bc_pt_t_val, bc_q_t_val, bc_s_t_val, constant_diffusion, & |
---|
[1320] | 160 | cloud_physics, dt_3d, humidity, & |
---|
[1960] | 161 | ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_s_b, ibc_s_t, & |
---|
| 162 | ibc_sa_t, ibc_uv_b, ibc_uv_t, inflow_l, inflow_n, inflow_r, & |
---|
| 163 | inflow_s, intermediate_timestep_count, large_scale_forcing, & |
---|
[1822] | 164 | microphysics_seifert, nest_domain, nest_bound_l, nest_bound_s, & |
---|
| 165 | nudging, ocean, outflow_l, outflow_n, outflow_r, outflow_s, & |
---|
| 166 | passive_scalar, tsc, use_cmax |
---|
[1320] | 167 | |
---|
| 168 | USE grid_variables, & |
---|
| 169 | ONLY: ddx, ddy, dx, dy |
---|
| 170 | |
---|
| 171 | USE indices, & |
---|
| 172 | ONLY: nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, & |
---|
[2232] | 173 | nzb, nzt, wall_flags_0 |
---|
[1320] | 174 | |
---|
| 175 | USE kinds |
---|
| 176 | |
---|
[1] | 177 | USE pegrid |
---|
| 178 | |
---|
[1933] | 179 | USE pmc_interface, & |
---|
| 180 | ONLY : nesting_mode |
---|
[1320] | 181 | |
---|
[2232] | 182 | USE surface_mod, & |
---|
| 183 | ONLY : bc_h |
---|
[1933] | 184 | |
---|
[1] | 185 | IMPLICIT NONE |
---|
| 186 | |
---|
[2232] | 187 | INTEGER(iwp) :: i !< grid index x direction |
---|
| 188 | INTEGER(iwp) :: j !< grid index y direction |
---|
| 189 | INTEGER(iwp) :: k !< grid index z direction |
---|
| 190 | INTEGER(iwp) :: kb !< variable to set respective boundary value, depends on facing. |
---|
| 191 | INTEGER(iwp) :: l !< running index boundary type, for up- and downward-facing walls |
---|
| 192 | INTEGER(iwp) :: m !< running index surface elements |
---|
[1] | 193 | |
---|
[1682] | 194 | REAL(wp) :: c_max !< |
---|
| 195 | REAL(wp) :: denom !< |
---|
[1] | 196 | |
---|
[73] | 197 | |
---|
[1] | 198 | ! |
---|
[1113] | 199 | !-- Bottom boundary |
---|
| 200 | IF ( ibc_uv_b == 1 ) THEN |
---|
| 201 | u_p(nzb,:,:) = u_p(nzb+1,:,:) |
---|
| 202 | v_p(nzb,:,:) = v_p(nzb+1,:,:) |
---|
| 203 | ENDIF |
---|
[2232] | 204 | ! |
---|
| 205 | !-- Set zero vertical velocity at topography top (l=0), or bottom (l=1) in case |
---|
| 206 | !-- of downward-facing surfaces. |
---|
| 207 | DO l = 0, 1 |
---|
| 208 | ! |
---|
| 209 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 210 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 211 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 212 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 213 | DO m = 1, bc_h(l)%ns |
---|
| 214 | i = bc_h(l)%i(m) |
---|
| 215 | j = bc_h(l)%j(m) |
---|
| 216 | k = bc_h(l)%k(m) |
---|
| 217 | w_p(k+kb,j,i) = 0.0_wp |
---|
[1113] | 218 | ENDDO |
---|
| 219 | ENDDO |
---|
| 220 | |
---|
| 221 | ! |
---|
[1762] | 222 | !-- Top boundary. A nested domain ( ibc_uv_t = 3 ) does not require settings. |
---|
[1113] | 223 | IF ( ibc_uv_t == 0 ) THEN |
---|
| 224 | u_p(nzt+1,:,:) = u_init(nzt+1) |
---|
| 225 | v_p(nzt+1,:,:) = v_init(nzt+1) |
---|
[1762] | 226 | ELSEIF ( ibc_uv_t == 1 ) THEN |
---|
[1113] | 227 | u_p(nzt+1,:,:) = u_p(nzt,:,:) |
---|
| 228 | v_p(nzt+1,:,:) = v_p(nzt,:,:) |
---|
| 229 | ENDIF |
---|
| 230 | |
---|
[1762] | 231 | IF ( .NOT. nest_domain ) THEN |
---|
| 232 | w_p(nzt:nzt+1,:,:) = 0.0_wp ! nzt is not a prognostic level (but cf. pres) |
---|
| 233 | ENDIF |
---|
| 234 | |
---|
[1113] | 235 | ! |
---|
[2232] | 236 | !-- Temperature at bottom and top boundary. |
---|
[1113] | 237 | !-- In case of coupled runs (ibc_pt_b = 2) the temperature is given by |
---|
| 238 | !-- the sea surface temperature of the coupled ocean model. |
---|
[2232] | 239 | !-- Dirichlet |
---|
[1113] | 240 | IF ( ibc_pt_b == 0 ) THEN |
---|
[2232] | 241 | DO l = 0, 1 |
---|
| 242 | ! |
---|
| 243 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 244 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 245 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 246 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 247 | DO m = 1, bc_h(l)%ns |
---|
| 248 | i = bc_h(l)%i(m) |
---|
| 249 | j = bc_h(l)%j(m) |
---|
| 250 | k = bc_h(l)%k(m) |
---|
| 251 | pt_p(k+kb,j,i) = pt(k+kb,j,i) |
---|
[1] | 252 | ENDDO |
---|
| 253 | ENDDO |
---|
[2232] | 254 | ! |
---|
| 255 | !-- Neumann, zero-gradient |
---|
[1113] | 256 | ELSEIF ( ibc_pt_b == 1 ) THEN |
---|
[2232] | 257 | DO l = 0, 1 |
---|
| 258 | ! |
---|
| 259 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 260 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 261 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 262 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 263 | DO m = 1, bc_h(l)%ns |
---|
| 264 | i = bc_h(l)%i(m) |
---|
| 265 | j = bc_h(l)%j(m) |
---|
| 266 | k = bc_h(l)%k(m) |
---|
| 267 | pt_p(k+kb,j,i) = pt_p(k,j,i) |
---|
[1113] | 268 | ENDDO |
---|
| 269 | ENDDO |
---|
| 270 | ENDIF |
---|
[1] | 271 | |
---|
| 272 | ! |
---|
[1113] | 273 | !-- Temperature at top boundary |
---|
| 274 | IF ( ibc_pt_t == 0 ) THEN |
---|
| 275 | pt_p(nzt+1,:,:) = pt(nzt+1,:,:) |
---|
[1380] | 276 | ! |
---|
| 277 | !-- In case of nudging adjust top boundary to pt which is |
---|
| 278 | !-- read in from NUDGING-DATA |
---|
| 279 | IF ( nudging ) THEN |
---|
| 280 | pt_p(nzt+1,:,:) = pt_init(nzt+1) |
---|
| 281 | ENDIF |
---|
[1113] | 282 | ELSEIF ( ibc_pt_t == 1 ) THEN |
---|
| 283 | pt_p(nzt+1,:,:) = pt_p(nzt,:,:) |
---|
| 284 | ELSEIF ( ibc_pt_t == 2 ) THEN |
---|
[1992] | 285 | pt_p(nzt+1,:,:) = pt_p(nzt,:,:) + bc_pt_t_val * dzu(nzt+1) |
---|
[1113] | 286 | ENDIF |
---|
[1] | 287 | |
---|
| 288 | ! |
---|
[1113] | 289 | !-- Boundary conditions for TKE |
---|
| 290 | !-- Generally Neumann conditions with de/dz=0 are assumed |
---|
| 291 | IF ( .NOT. constant_diffusion ) THEN |
---|
[2232] | 292 | |
---|
| 293 | DO l = 0, 1 |
---|
| 294 | ! |
---|
| 295 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 296 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 297 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 298 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 299 | DO m = 1, bc_h(l)%ns |
---|
| 300 | i = bc_h(l)%i(m) |
---|
| 301 | j = bc_h(l)%j(m) |
---|
| 302 | k = bc_h(l)%k(m) |
---|
| 303 | e_p(k+kb,j,i) = e_p(k,j,i) |
---|
[73] | 304 | ENDDO |
---|
[1113] | 305 | ENDDO |
---|
[2232] | 306 | |
---|
[1762] | 307 | IF ( .NOT. nest_domain ) THEN |
---|
| 308 | e_p(nzt+1,:,:) = e_p(nzt,:,:) |
---|
| 309 | ENDIF |
---|
[1113] | 310 | ENDIF |
---|
| 311 | |
---|
| 312 | ! |
---|
| 313 | !-- Boundary conditions for salinity |
---|
| 314 | IF ( ocean ) THEN |
---|
| 315 | ! |
---|
| 316 | !-- Bottom boundary: Neumann condition because salinity flux is always |
---|
[2232] | 317 | !-- given. |
---|
| 318 | DO l = 0, 1 |
---|
| 319 | ! |
---|
| 320 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 321 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 322 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 323 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 324 | DO m = 1, bc_h(l)%ns |
---|
| 325 | i = bc_h(l)%i(m) |
---|
| 326 | j = bc_h(l)%j(m) |
---|
| 327 | k = bc_h(l)%k(m) |
---|
| 328 | sa_p(k+kb,j,i) = sa_p(k,j,i) |
---|
[1] | 329 | ENDDO |
---|
[1113] | 330 | ENDDO |
---|
[1] | 331 | ! |
---|
[1113] | 332 | !-- Top boundary: Dirichlet or Neumann |
---|
| 333 | IF ( ibc_sa_t == 0 ) THEN |
---|
| 334 | sa_p(nzt+1,:,:) = sa(nzt+1,:,:) |
---|
| 335 | ELSEIF ( ibc_sa_t == 1 ) THEN |
---|
| 336 | sa_p(nzt+1,:,:) = sa_p(nzt,:,:) |
---|
[1] | 337 | ENDIF |
---|
| 338 | |
---|
[1113] | 339 | ENDIF |
---|
| 340 | |
---|
[1] | 341 | ! |
---|
[1960] | 342 | !-- Boundary conditions for total water content, |
---|
[1113] | 343 | !-- bottom and top boundary (see also temperature) |
---|
[1960] | 344 | IF ( humidity ) THEN |
---|
[1113] | 345 | ! |
---|
| 346 | !-- Surface conditions for constant_humidity_flux |
---|
[2232] | 347 | !-- Run loop over all non-natural and natural walls. Note, in wall-datatype |
---|
| 348 | !-- the k coordinate belongs to the atmospheric grid point, therefore, set |
---|
| 349 | !-- q_p at k-1 |
---|
[1113] | 350 | IF ( ibc_q_b == 0 ) THEN |
---|
[2232] | 351 | |
---|
| 352 | DO l = 0, 1 |
---|
| 353 | ! |
---|
| 354 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 355 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 356 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 357 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 358 | DO m = 1, bc_h(l)%ns |
---|
| 359 | i = bc_h(l)%i(m) |
---|
| 360 | j = bc_h(l)%j(m) |
---|
| 361 | k = bc_h(l)%k(m) |
---|
| 362 | q_p(k+kb,j,i) = q(k+kb,j,i) |
---|
[1] | 363 | ENDDO |
---|
| 364 | ENDDO |
---|
[2232] | 365 | |
---|
[1113] | 366 | ELSE |
---|
[2232] | 367 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 368 | DO m = 1, bc_h(0)%ns |
---|
| 369 | i = bc_h(0)%i(m) |
---|
| 370 | j = bc_h(0)%j(m) |
---|
| 371 | k = bc_h(0)%k(m) |
---|
| 372 | q_p(k-1,j,i) = q_p(k,j,i) |
---|
| 373 | ENDDO |
---|
| 374 | |
---|
| 375 | DO l = 0, 1 |
---|
| 376 | ! |
---|
| 377 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 378 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 379 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 380 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 381 | DO m = 1, bc_h(l)%ns |
---|
| 382 | i = bc_h(l)%i(m) |
---|
| 383 | j = bc_h(l)%j(m) |
---|
| 384 | k = bc_h(l)%k(m) |
---|
| 385 | q_p(k+kb,j,i) = q_p(k,j,i) |
---|
[95] | 386 | ENDDO |
---|
| 387 | ENDDO |
---|
[1113] | 388 | ENDIF |
---|
[95] | 389 | ! |
---|
[1113] | 390 | !-- Top boundary |
---|
[1462] | 391 | IF ( ibc_q_t == 0 ) THEN |
---|
| 392 | q_p(nzt+1,:,:) = q(nzt+1,:,:) |
---|
| 393 | ELSEIF ( ibc_q_t == 1 ) THEN |
---|
[1992] | 394 | q_p(nzt+1,:,:) = q_p(nzt,:,:) + bc_q_t_val * dzu(nzt+1) |
---|
[1462] | 395 | ENDIF |
---|
[95] | 396 | |
---|
[1822] | 397 | IF ( cloud_physics .AND. microphysics_seifert ) THEN |
---|
[1113] | 398 | ! |
---|
[1361] | 399 | !-- Surface conditions rain water (Dirichlet) |
---|
[2232] | 400 | !-- Run loop over all non-natural and natural walls. Note, in wall-datatype |
---|
| 401 | !-- the k coordinate belongs to the atmospheric grid point, therefore, set |
---|
| 402 | !-- qr_p and nr_p at k-1 |
---|
| 403 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 404 | DO m = 1, bc_h(0)%ns |
---|
| 405 | i = bc_h(0)%i(m) |
---|
| 406 | j = bc_h(0)%j(m) |
---|
| 407 | k = bc_h(0)%k(m) |
---|
| 408 | qr_p(k-1,j,i) = 0.0_wp |
---|
| 409 | nr_p(k-1,j,i) = 0.0_wp |
---|
[1115] | 410 | ENDDO |
---|
[1] | 411 | ! |
---|
[1361] | 412 | !-- Top boundary condition for rain water (Dirichlet) |
---|
| 413 | qr_p(nzt+1,:,:) = 0.0_wp |
---|
| 414 | nr_p(nzt+1,:,:) = 0.0_wp |
---|
[1115] | 415 | |
---|
[1] | 416 | ENDIF |
---|
[1409] | 417 | ENDIF |
---|
[1] | 418 | ! |
---|
[1960] | 419 | !-- Boundary conditions for scalar, |
---|
| 420 | !-- bottom and top boundary (see also temperature) |
---|
| 421 | IF ( passive_scalar ) THEN |
---|
| 422 | ! |
---|
| 423 | !-- Surface conditions for constant_humidity_flux |
---|
[2232] | 424 | !-- Run loop over all non-natural and natural walls. Note, in wall-datatype |
---|
| 425 | !-- the k coordinate belongs to the atmospheric grid point, therefore, set |
---|
| 426 | !-- s_p at k-1 |
---|
[1960] | 427 | IF ( ibc_s_b == 0 ) THEN |
---|
[2232] | 428 | |
---|
| 429 | DO l = 0, 1 |
---|
| 430 | ! |
---|
| 431 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 432 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 433 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 434 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 435 | DO m = 1, bc_h(l)%ns |
---|
| 436 | i = bc_h(l)%i(m) |
---|
| 437 | j = bc_h(l)%j(m) |
---|
| 438 | k = bc_h(l)%k(m) |
---|
| 439 | s_p(k+kb,j,i) = s(k+kb,j,i) |
---|
[1960] | 440 | ENDDO |
---|
| 441 | ENDDO |
---|
[2232] | 442 | |
---|
[1960] | 443 | ELSE |
---|
[2232] | 444 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 445 | DO m = 1, bc_h(0)%ns |
---|
| 446 | i = bc_h(0)%i(m) |
---|
| 447 | j = bc_h(0)%j(m) |
---|
| 448 | k = bc_h(0)%k(m) |
---|
| 449 | s_p(k-1,j,i) = s_p(k,j,i) |
---|
| 450 | ENDDO |
---|
| 451 | |
---|
| 452 | DO l = 0, 1 |
---|
| 453 | ! |
---|
| 454 | !-- Set kb, for upward-facing surfaces value at topography top (k-1) is set, |
---|
| 455 | !-- for downward-facing surfaces at topography bottom (k+1). |
---|
| 456 | kb = MERGE( -1, 1, l == 0 ) |
---|
| 457 | !$OMP PARALLEL DO PRIVATE( i, j, k ) |
---|
| 458 | DO m = 1, bc_h(l)%ns |
---|
| 459 | i = bc_h(l)%i(m) |
---|
| 460 | j = bc_h(l)%j(m) |
---|
| 461 | k = bc_h(l)%k(m) |
---|
| 462 | s_p(k+kb,j,i) = s_p(k,j,i) |
---|
[1960] | 463 | ENDDO |
---|
| 464 | ENDDO |
---|
| 465 | ENDIF |
---|
| 466 | ! |
---|
[1992] | 467 | !-- Top boundary condition |
---|
| 468 | IF ( ibc_s_t == 0 ) THEN |
---|
[1960] | 469 | s_p(nzt+1,:,:) = s(nzt+1,:,:) |
---|
[1992] | 470 | ELSEIF ( ibc_s_t == 1 ) THEN |
---|
| 471 | s_p(nzt+1,:,:) = s_p(nzt,:,:) |
---|
| 472 | ELSEIF ( ibc_s_t == 2 ) THEN |
---|
| 473 | s_p(nzt+1,:,:) = s_p(nzt,:,:) + bc_s_t_val * dzu(nzt+1) |
---|
[1960] | 474 | ENDIF |
---|
| 475 | |
---|
| 476 | ENDIF |
---|
| 477 | ! |
---|
[1762] | 478 | !-- In case of inflow or nest boundary at the south boundary the boundary for v |
---|
| 479 | !-- is at nys and in case of inflow or nest boundary at the left boundary the |
---|
| 480 | !-- boundary for u is at nxl. Since in prognostic_equations (cache optimized |
---|
| 481 | !-- version) these levels are handled as a prognostic level, boundary values |
---|
| 482 | !-- have to be restored here. |
---|
[1409] | 483 | !-- For the SGS-TKE, Neumann boundary conditions are used at the inflow. |
---|
| 484 | IF ( inflow_s ) THEN |
---|
| 485 | v_p(:,nys,:) = v_p(:,nys-1,:) |
---|
| 486 | IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:) |
---|
| 487 | ELSEIF ( inflow_n ) THEN |
---|
| 488 | IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:) |
---|
| 489 | ELSEIF ( inflow_l ) THEN |
---|
| 490 | u_p(:,:,nxl) = u_p(:,:,nxl-1) |
---|
| 491 | IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl) |
---|
| 492 | ELSEIF ( inflow_r ) THEN |
---|
| 493 | IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr) |
---|
| 494 | ENDIF |
---|
[1] | 495 | |
---|
| 496 | ! |
---|
[1762] | 497 | !-- The same restoration for u at i=nxl and v at j=nys as above must be made |
---|
[1933] | 498 | !-- in case of nest boundaries. This must not be done in case of vertical nesting |
---|
| 499 | !-- mode as in that case the lateral boundaries are actually cyclic. |
---|
| 500 | IF ( nesting_mode /= 'vertical' ) THEN |
---|
| 501 | IF ( nest_bound_s ) THEN |
---|
| 502 | v_p(:,nys,:) = v_p(:,nys-1,:) |
---|
| 503 | ENDIF |
---|
| 504 | IF ( nest_bound_l ) THEN |
---|
| 505 | u_p(:,:,nxl) = u_p(:,:,nxl-1) |
---|
| 506 | ENDIF |
---|
[1762] | 507 | ENDIF |
---|
| 508 | |
---|
| 509 | ! |
---|
[1409] | 510 | !-- Lateral boundary conditions for scalar quantities at the outflow |
---|
| 511 | IF ( outflow_s ) THEN |
---|
| 512 | pt_p(:,nys-1,:) = pt_p(:,nys,:) |
---|
[2232] | 513 | IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:) |
---|
[1960] | 514 | IF ( humidity ) THEN |
---|
[1409] | 515 | q_p(:,nys-1,:) = q_p(:,nys,:) |
---|
[1822] | 516 | IF ( cloud_physics .AND. microphysics_seifert ) THEN |
---|
[1409] | 517 | qr_p(:,nys-1,:) = qr_p(:,nys,:) |
---|
| 518 | nr_p(:,nys-1,:) = nr_p(:,nys,:) |
---|
[1053] | 519 | ENDIF |
---|
[1409] | 520 | ENDIF |
---|
[1960] | 521 | IF ( passive_scalar ) s_p(:,nys-1,:) = s_p(:,nys,:) |
---|
[1409] | 522 | ELSEIF ( outflow_n ) THEN |
---|
| 523 | pt_p(:,nyn+1,:) = pt_p(:,nyn,:) |
---|
| 524 | IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:) |
---|
[1960] | 525 | IF ( humidity ) THEN |
---|
[1409] | 526 | q_p(:,nyn+1,:) = q_p(:,nyn,:) |
---|
[1822] | 527 | IF ( cloud_physics .AND. microphysics_seifert ) THEN |
---|
[1409] | 528 | qr_p(:,nyn+1,:) = qr_p(:,nyn,:) |
---|
| 529 | nr_p(:,nyn+1,:) = nr_p(:,nyn,:) |
---|
[1053] | 530 | ENDIF |
---|
[1409] | 531 | ENDIF |
---|
[1960] | 532 | IF ( passive_scalar ) s_p(:,nyn+1,:) = s_p(:,nyn,:) |
---|
[1409] | 533 | ELSEIF ( outflow_l ) THEN |
---|
| 534 | pt_p(:,:,nxl-1) = pt_p(:,:,nxl) |
---|
| 535 | IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl) |
---|
[1960] | 536 | IF ( humidity ) THEN |
---|
[1409] | 537 | q_p(:,:,nxl-1) = q_p(:,:,nxl) |
---|
[1822] | 538 | IF ( cloud_physics .AND. microphysics_seifert ) THEN |
---|
[1409] | 539 | qr_p(:,:,nxl-1) = qr_p(:,:,nxl) |
---|
| 540 | nr_p(:,:,nxl-1) = nr_p(:,:,nxl) |
---|
[1053] | 541 | ENDIF |
---|
[1409] | 542 | ENDIF |
---|
[1960] | 543 | IF ( passive_scalar ) s_p(:,:,nxl-1) = s_p(:,:,nxl) |
---|
[1409] | 544 | ELSEIF ( outflow_r ) THEN |
---|
| 545 | pt_p(:,:,nxr+1) = pt_p(:,:,nxr) |
---|
| 546 | IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr) |
---|
[1960] | 547 | IF ( humidity ) THEN |
---|
[1409] | 548 | q_p(:,:,nxr+1) = q_p(:,:,nxr) |
---|
[1822] | 549 | IF ( cloud_physics .AND. microphysics_seifert ) THEN |
---|
[1409] | 550 | qr_p(:,:,nxr+1) = qr_p(:,:,nxr) |
---|
| 551 | nr_p(:,:,nxr+1) = nr_p(:,:,nxr) |
---|
[1053] | 552 | ENDIF |
---|
[1] | 553 | ENDIF |
---|
[1960] | 554 | IF ( passive_scalar ) s_p(:,:,nxr+1) = s_p(:,:,nxr) |
---|
[1] | 555 | ENDIF |
---|
| 556 | |
---|
| 557 | ! |
---|
[1159] | 558 | !-- Radiation boundary conditions for the velocities at the respective outflow. |
---|
| 559 | !-- The phase velocity is either assumed to the maximum phase velocity that |
---|
| 560 | !-- ensures numerical stability (CFL-condition) or calculated after |
---|
| 561 | !-- Orlanski(1976) and averaged along the outflow boundary. |
---|
[106] | 562 | IF ( outflow_s ) THEN |
---|
[75] | 563 | |
---|
[1159] | 564 | IF ( use_cmax ) THEN |
---|
| 565 | u_p(:,-1,:) = u(:,0,:) |
---|
| 566 | v_p(:,0,:) = v(:,1,:) |
---|
| 567 | w_p(:,-1,:) = w(:,0,:) |
---|
| 568 | ELSEIF ( .NOT. use_cmax ) THEN |
---|
[75] | 569 | |
---|
[978] | 570 | c_max = dy / dt_3d |
---|
[75] | 571 | |
---|
[1353] | 572 | c_u_m_l = 0.0_wp |
---|
| 573 | c_v_m_l = 0.0_wp |
---|
| 574 | c_w_m_l = 0.0_wp |
---|
[978] | 575 | |
---|
[1353] | 576 | c_u_m = 0.0_wp |
---|
| 577 | c_v_m = 0.0_wp |
---|
| 578 | c_w_m = 0.0_wp |
---|
[978] | 579 | |
---|
[75] | 580 | ! |
---|
[996] | 581 | !-- Calculate the phase speeds for u, v, and w, first local and then |
---|
| 582 | !-- average along the outflow boundary. |
---|
| 583 | DO k = nzb+1, nzt+1 |
---|
| 584 | DO i = nxl, nxr |
---|
[75] | 585 | |
---|
[106] | 586 | denom = u_m_s(k,0,i) - u_m_s(k,1,i) |
---|
| 587 | |
---|
[1353] | 588 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 589 | c_u(k,i) = -c_max * ( u(k,0,i) - u_m_s(k,0,i) ) / ( denom * tsc(2) ) |
---|
[1353] | 590 | IF ( c_u(k,i) < 0.0_wp ) THEN |
---|
| 591 | c_u(k,i) = 0.0_wp |
---|
[106] | 592 | ELSEIF ( c_u(k,i) > c_max ) THEN |
---|
| 593 | c_u(k,i) = c_max |
---|
| 594 | ENDIF |
---|
| 595 | ELSE |
---|
| 596 | c_u(k,i) = c_max |
---|
[75] | 597 | ENDIF |
---|
| 598 | |
---|
[106] | 599 | denom = v_m_s(k,1,i) - v_m_s(k,2,i) |
---|
| 600 | |
---|
[1353] | 601 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 602 | c_v(k,i) = -c_max * ( v(k,1,i) - v_m_s(k,1,i) ) / ( denom * tsc(2) ) |
---|
[1353] | 603 | IF ( c_v(k,i) < 0.0_wp ) THEN |
---|
| 604 | c_v(k,i) = 0.0_wp |
---|
[106] | 605 | ELSEIF ( c_v(k,i) > c_max ) THEN |
---|
| 606 | c_v(k,i) = c_max |
---|
| 607 | ENDIF |
---|
| 608 | ELSE |
---|
| 609 | c_v(k,i) = c_max |
---|
[75] | 610 | ENDIF |
---|
| 611 | |
---|
[106] | 612 | denom = w_m_s(k,0,i) - w_m_s(k,1,i) |
---|
[75] | 613 | |
---|
[1353] | 614 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 615 | c_w(k,i) = -c_max * ( w(k,0,i) - w_m_s(k,0,i) ) / ( denom * tsc(2) ) |
---|
[1353] | 616 | IF ( c_w(k,i) < 0.0_wp ) THEN |
---|
| 617 | c_w(k,i) = 0.0_wp |
---|
[106] | 618 | ELSEIF ( c_w(k,i) > c_max ) THEN |
---|
| 619 | c_w(k,i) = c_max |
---|
| 620 | ENDIF |
---|
| 621 | ELSE |
---|
| 622 | c_w(k,i) = c_max |
---|
[75] | 623 | ENDIF |
---|
[106] | 624 | |
---|
[978] | 625 | c_u_m_l(k) = c_u_m_l(k) + c_u(k,i) |
---|
| 626 | c_v_m_l(k) = c_v_m_l(k) + c_v(k,i) |
---|
| 627 | c_w_m_l(k) = c_w_m_l(k) + c_w(k,i) |
---|
[106] | 628 | |
---|
[978] | 629 | ENDDO |
---|
| 630 | ENDDO |
---|
[75] | 631 | |
---|
[978] | 632 | #if defined( __parallel ) |
---|
| 633 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dx, ierr ) |
---|
| 634 | CALL MPI_ALLREDUCE( c_u_m_l(nzb+1), c_u_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 635 | MPI_SUM, comm1dx, ierr ) |
---|
| 636 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dx, ierr ) |
---|
| 637 | CALL MPI_ALLREDUCE( c_v_m_l(nzb+1), c_v_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 638 | MPI_SUM, comm1dx, ierr ) |
---|
| 639 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dx, ierr ) |
---|
| 640 | CALL MPI_ALLREDUCE( c_w_m_l(nzb+1), c_w_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 641 | MPI_SUM, comm1dx, ierr ) |
---|
| 642 | #else |
---|
| 643 | c_u_m = c_u_m_l |
---|
| 644 | c_v_m = c_v_m_l |
---|
| 645 | c_w_m = c_w_m_l |
---|
| 646 | #endif |
---|
| 647 | |
---|
| 648 | c_u_m = c_u_m / (nx+1) |
---|
| 649 | c_v_m = c_v_m / (nx+1) |
---|
| 650 | c_w_m = c_w_m / (nx+1) |
---|
| 651 | |
---|
[75] | 652 | ! |
---|
[978] | 653 | !-- Save old timelevels for the next timestep |
---|
| 654 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
| 655 | u_m_s(:,:,:) = u(:,0:1,:) |
---|
| 656 | v_m_s(:,:,:) = v(:,1:2,:) |
---|
| 657 | w_m_s(:,:,:) = w(:,0:1,:) |
---|
| 658 | ENDIF |
---|
| 659 | |
---|
| 660 | ! |
---|
| 661 | !-- Calculate the new velocities |
---|
[996] | 662 | DO k = nzb+1, nzt+1 |
---|
| 663 | DO i = nxlg, nxrg |
---|
[978] | 664 | u_p(k,-1,i) = u(k,-1,i) - dt_3d * tsc(2) * c_u_m(k) * & |
---|
[75] | 665 | ( u(k,-1,i) - u(k,0,i) ) * ddy |
---|
| 666 | |
---|
[978] | 667 | v_p(k,0,i) = v(k,0,i) - dt_3d * tsc(2) * c_v_m(k) * & |
---|
[106] | 668 | ( v(k,0,i) - v(k,1,i) ) * ddy |
---|
[75] | 669 | |
---|
[978] | 670 | w_p(k,-1,i) = w(k,-1,i) - dt_3d * tsc(2) * c_w_m(k) * & |
---|
[75] | 671 | ( w(k,-1,i) - w(k,0,i) ) * ddy |
---|
[978] | 672 | ENDDO |
---|
[75] | 673 | ENDDO |
---|
| 674 | |
---|
| 675 | ! |
---|
[978] | 676 | !-- Bottom boundary at the outflow |
---|
| 677 | IF ( ibc_uv_b == 0 ) THEN |
---|
[1353] | 678 | u_p(nzb,-1,:) = 0.0_wp |
---|
| 679 | v_p(nzb,0,:) = 0.0_wp |
---|
[978] | 680 | ELSE |
---|
| 681 | u_p(nzb,-1,:) = u_p(nzb+1,-1,:) |
---|
| 682 | v_p(nzb,0,:) = v_p(nzb+1,0,:) |
---|
| 683 | ENDIF |
---|
[1353] | 684 | w_p(nzb,-1,:) = 0.0_wp |
---|
[73] | 685 | |
---|
[75] | 686 | ! |
---|
[978] | 687 | !-- Top boundary at the outflow |
---|
| 688 | IF ( ibc_uv_t == 0 ) THEN |
---|
| 689 | u_p(nzt+1,-1,:) = u_init(nzt+1) |
---|
| 690 | v_p(nzt+1,0,:) = v_init(nzt+1) |
---|
| 691 | ELSE |
---|
[1742] | 692 | u_p(nzt+1,-1,:) = u_p(nzt,-1,:) |
---|
| 693 | v_p(nzt+1,0,:) = v_p(nzt,0,:) |
---|
[978] | 694 | ENDIF |
---|
[1353] | 695 | w_p(nzt:nzt+1,-1,:) = 0.0_wp |
---|
[978] | 696 | |
---|
[75] | 697 | ENDIF |
---|
[73] | 698 | |
---|
[75] | 699 | ENDIF |
---|
[73] | 700 | |
---|
[106] | 701 | IF ( outflow_n ) THEN |
---|
[73] | 702 | |
---|
[1159] | 703 | IF ( use_cmax ) THEN |
---|
| 704 | u_p(:,ny+1,:) = u(:,ny,:) |
---|
| 705 | v_p(:,ny+1,:) = v(:,ny,:) |
---|
| 706 | w_p(:,ny+1,:) = w(:,ny,:) |
---|
| 707 | ELSEIF ( .NOT. use_cmax ) THEN |
---|
[75] | 708 | |
---|
[978] | 709 | c_max = dy / dt_3d |
---|
[75] | 710 | |
---|
[1353] | 711 | c_u_m_l = 0.0_wp |
---|
| 712 | c_v_m_l = 0.0_wp |
---|
| 713 | c_w_m_l = 0.0_wp |
---|
[978] | 714 | |
---|
[1353] | 715 | c_u_m = 0.0_wp |
---|
| 716 | c_v_m = 0.0_wp |
---|
| 717 | c_w_m = 0.0_wp |
---|
[978] | 718 | |
---|
[1] | 719 | ! |
---|
[996] | 720 | !-- Calculate the phase speeds for u, v, and w, first local and then |
---|
| 721 | !-- average along the outflow boundary. |
---|
| 722 | DO k = nzb+1, nzt+1 |
---|
| 723 | DO i = nxl, nxr |
---|
[73] | 724 | |
---|
[106] | 725 | denom = u_m_n(k,ny,i) - u_m_n(k,ny-1,i) |
---|
| 726 | |
---|
[1353] | 727 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 728 | c_u(k,i) = -c_max * ( u(k,ny,i) - u_m_n(k,ny,i) ) / ( denom * tsc(2) ) |
---|
[1353] | 729 | IF ( c_u(k,i) < 0.0_wp ) THEN |
---|
| 730 | c_u(k,i) = 0.0_wp |
---|
[106] | 731 | ELSEIF ( c_u(k,i) > c_max ) THEN |
---|
| 732 | c_u(k,i) = c_max |
---|
| 733 | ENDIF |
---|
| 734 | ELSE |
---|
| 735 | c_u(k,i) = c_max |
---|
[73] | 736 | ENDIF |
---|
| 737 | |
---|
[106] | 738 | denom = v_m_n(k,ny,i) - v_m_n(k,ny-1,i) |
---|
[73] | 739 | |
---|
[1353] | 740 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 741 | c_v(k,i) = -c_max * ( v(k,ny,i) - v_m_n(k,ny,i) ) / ( denom * tsc(2) ) |
---|
[1353] | 742 | IF ( c_v(k,i) < 0.0_wp ) THEN |
---|
| 743 | c_v(k,i) = 0.0_wp |
---|
[106] | 744 | ELSEIF ( c_v(k,i) > c_max ) THEN |
---|
| 745 | c_v(k,i) = c_max |
---|
| 746 | ENDIF |
---|
| 747 | ELSE |
---|
| 748 | c_v(k,i) = c_max |
---|
[73] | 749 | ENDIF |
---|
| 750 | |
---|
[106] | 751 | denom = w_m_n(k,ny,i) - w_m_n(k,ny-1,i) |
---|
[73] | 752 | |
---|
[1353] | 753 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 754 | c_w(k,i) = -c_max * ( w(k,ny,i) - w_m_n(k,ny,i) ) / ( denom * tsc(2) ) |
---|
[1353] | 755 | IF ( c_w(k,i) < 0.0_wp ) THEN |
---|
| 756 | c_w(k,i) = 0.0_wp |
---|
[106] | 757 | ELSEIF ( c_w(k,i) > c_max ) THEN |
---|
| 758 | c_w(k,i) = c_max |
---|
| 759 | ENDIF |
---|
| 760 | ELSE |
---|
| 761 | c_w(k,i) = c_max |
---|
[73] | 762 | ENDIF |
---|
[106] | 763 | |
---|
[978] | 764 | c_u_m_l(k) = c_u_m_l(k) + c_u(k,i) |
---|
| 765 | c_v_m_l(k) = c_v_m_l(k) + c_v(k,i) |
---|
| 766 | c_w_m_l(k) = c_w_m_l(k) + c_w(k,i) |
---|
[106] | 767 | |
---|
[978] | 768 | ENDDO |
---|
| 769 | ENDDO |
---|
[73] | 770 | |
---|
[978] | 771 | #if defined( __parallel ) |
---|
| 772 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dx, ierr ) |
---|
| 773 | CALL MPI_ALLREDUCE( c_u_m_l(nzb+1), c_u_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 774 | MPI_SUM, comm1dx, ierr ) |
---|
| 775 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dx, ierr ) |
---|
| 776 | CALL MPI_ALLREDUCE( c_v_m_l(nzb+1), c_v_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 777 | MPI_SUM, comm1dx, ierr ) |
---|
| 778 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dx, ierr ) |
---|
| 779 | CALL MPI_ALLREDUCE( c_w_m_l(nzb+1), c_w_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 780 | MPI_SUM, comm1dx, ierr ) |
---|
| 781 | #else |
---|
| 782 | c_u_m = c_u_m_l |
---|
| 783 | c_v_m = c_v_m_l |
---|
| 784 | c_w_m = c_w_m_l |
---|
| 785 | #endif |
---|
| 786 | |
---|
| 787 | c_u_m = c_u_m / (nx+1) |
---|
| 788 | c_v_m = c_v_m / (nx+1) |
---|
| 789 | c_w_m = c_w_m / (nx+1) |
---|
| 790 | |
---|
[73] | 791 | ! |
---|
[978] | 792 | !-- Save old timelevels for the next timestep |
---|
| 793 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
| 794 | u_m_n(:,:,:) = u(:,ny-1:ny,:) |
---|
| 795 | v_m_n(:,:,:) = v(:,ny-1:ny,:) |
---|
| 796 | w_m_n(:,:,:) = w(:,ny-1:ny,:) |
---|
| 797 | ENDIF |
---|
[73] | 798 | |
---|
[978] | 799 | ! |
---|
| 800 | !-- Calculate the new velocities |
---|
[996] | 801 | DO k = nzb+1, nzt+1 |
---|
| 802 | DO i = nxlg, nxrg |
---|
[978] | 803 | u_p(k,ny+1,i) = u(k,ny+1,i) - dt_3d * tsc(2) * c_u_m(k) * & |
---|
| 804 | ( u(k,ny+1,i) - u(k,ny,i) ) * ddy |
---|
[73] | 805 | |
---|
[978] | 806 | v_p(k,ny+1,i) = v(k,ny+1,i) - dt_3d * tsc(2) * c_v_m(k) * & |
---|
| 807 | ( v(k,ny+1,i) - v(k,ny,i) ) * ddy |
---|
[73] | 808 | |
---|
[978] | 809 | w_p(k,ny+1,i) = w(k,ny+1,i) - dt_3d * tsc(2) * c_w_m(k) * & |
---|
| 810 | ( w(k,ny+1,i) - w(k,ny,i) ) * ddy |
---|
| 811 | ENDDO |
---|
[1] | 812 | ENDDO |
---|
| 813 | |
---|
| 814 | ! |
---|
[978] | 815 | !-- Bottom boundary at the outflow |
---|
| 816 | IF ( ibc_uv_b == 0 ) THEN |
---|
[1353] | 817 | u_p(nzb,ny+1,:) = 0.0_wp |
---|
| 818 | v_p(nzb,ny+1,:) = 0.0_wp |
---|
[978] | 819 | ELSE |
---|
| 820 | u_p(nzb,ny+1,:) = u_p(nzb+1,ny+1,:) |
---|
| 821 | v_p(nzb,ny+1,:) = v_p(nzb+1,ny+1,:) |
---|
| 822 | ENDIF |
---|
[1353] | 823 | w_p(nzb,ny+1,:) = 0.0_wp |
---|
[73] | 824 | |
---|
| 825 | ! |
---|
[978] | 826 | !-- Top boundary at the outflow |
---|
| 827 | IF ( ibc_uv_t == 0 ) THEN |
---|
| 828 | u_p(nzt+1,ny+1,:) = u_init(nzt+1) |
---|
| 829 | v_p(nzt+1,ny+1,:) = v_init(nzt+1) |
---|
| 830 | ELSE |
---|
| 831 | u_p(nzt+1,ny+1,:) = u_p(nzt,nyn+1,:) |
---|
| 832 | v_p(nzt+1,ny+1,:) = v_p(nzt,nyn+1,:) |
---|
| 833 | ENDIF |
---|
[1353] | 834 | w_p(nzt:nzt+1,ny+1,:) = 0.0_wp |
---|
[978] | 835 | |
---|
[1] | 836 | ENDIF |
---|
| 837 | |
---|
[75] | 838 | ENDIF |
---|
| 839 | |
---|
[106] | 840 | IF ( outflow_l ) THEN |
---|
[75] | 841 | |
---|
[1159] | 842 | IF ( use_cmax ) THEN |
---|
[1717] | 843 | u_p(:,:,0) = u(:,:,1) |
---|
| 844 | v_p(:,:,-1) = v(:,:,0) |
---|
[1159] | 845 | w_p(:,:,-1) = w(:,:,0) |
---|
| 846 | ELSEIF ( .NOT. use_cmax ) THEN |
---|
[75] | 847 | |
---|
[978] | 848 | c_max = dx / dt_3d |
---|
[75] | 849 | |
---|
[1353] | 850 | c_u_m_l = 0.0_wp |
---|
| 851 | c_v_m_l = 0.0_wp |
---|
| 852 | c_w_m_l = 0.0_wp |
---|
[978] | 853 | |
---|
[1353] | 854 | c_u_m = 0.0_wp |
---|
| 855 | c_v_m = 0.0_wp |
---|
| 856 | c_w_m = 0.0_wp |
---|
[978] | 857 | |
---|
[1] | 858 | ! |
---|
[996] | 859 | !-- Calculate the phase speeds for u, v, and w, first local and then |
---|
| 860 | !-- average along the outflow boundary. |
---|
| 861 | DO k = nzb+1, nzt+1 |
---|
| 862 | DO j = nys, nyn |
---|
[75] | 863 | |
---|
[106] | 864 | denom = u_m_l(k,j,1) - u_m_l(k,j,2) |
---|
| 865 | |
---|
[1353] | 866 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 867 | c_u(k,j) = -c_max * ( u(k,j,1) - u_m_l(k,j,1) ) / ( denom * tsc(2) ) |
---|
[1353] | 868 | IF ( c_u(k,j) < 0.0_wp ) THEN |
---|
| 869 | c_u(k,j) = 0.0_wp |
---|
[107] | 870 | ELSEIF ( c_u(k,j) > c_max ) THEN |
---|
| 871 | c_u(k,j) = c_max |
---|
[106] | 872 | ENDIF |
---|
| 873 | ELSE |
---|
[107] | 874 | c_u(k,j) = c_max |
---|
[75] | 875 | ENDIF |
---|
| 876 | |
---|
[106] | 877 | denom = v_m_l(k,j,0) - v_m_l(k,j,1) |
---|
[75] | 878 | |
---|
[1353] | 879 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 880 | c_v(k,j) = -c_max * ( v(k,j,0) - v_m_l(k,j,0) ) / ( denom * tsc(2) ) |
---|
[1353] | 881 | IF ( c_v(k,j) < 0.0_wp ) THEN |
---|
| 882 | c_v(k,j) = 0.0_wp |
---|
[106] | 883 | ELSEIF ( c_v(k,j) > c_max ) THEN |
---|
| 884 | c_v(k,j) = c_max |
---|
| 885 | ENDIF |
---|
| 886 | ELSE |
---|
| 887 | c_v(k,j) = c_max |
---|
[75] | 888 | ENDIF |
---|
| 889 | |
---|
[106] | 890 | denom = w_m_l(k,j,0) - w_m_l(k,j,1) |
---|
[75] | 891 | |
---|
[1353] | 892 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 893 | c_w(k,j) = -c_max * ( w(k,j,0) - w_m_l(k,j,0) ) / ( denom * tsc(2) ) |
---|
[1353] | 894 | IF ( c_w(k,j) < 0.0_wp ) THEN |
---|
| 895 | c_w(k,j) = 0.0_wp |
---|
[106] | 896 | ELSEIF ( c_w(k,j) > c_max ) THEN |
---|
| 897 | c_w(k,j) = c_max |
---|
| 898 | ENDIF |
---|
| 899 | ELSE |
---|
| 900 | c_w(k,j) = c_max |
---|
[75] | 901 | ENDIF |
---|
[106] | 902 | |
---|
[978] | 903 | c_u_m_l(k) = c_u_m_l(k) + c_u(k,j) |
---|
| 904 | c_v_m_l(k) = c_v_m_l(k) + c_v(k,j) |
---|
| 905 | c_w_m_l(k) = c_w_m_l(k) + c_w(k,j) |
---|
[106] | 906 | |
---|
[978] | 907 | ENDDO |
---|
| 908 | ENDDO |
---|
[75] | 909 | |
---|
[978] | 910 | #if defined( __parallel ) |
---|
| 911 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dy, ierr ) |
---|
| 912 | CALL MPI_ALLREDUCE( c_u_m_l(nzb+1), c_u_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 913 | MPI_SUM, comm1dy, ierr ) |
---|
| 914 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dy, ierr ) |
---|
| 915 | CALL MPI_ALLREDUCE( c_v_m_l(nzb+1), c_v_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 916 | MPI_SUM, comm1dy, ierr ) |
---|
| 917 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dy, ierr ) |
---|
| 918 | CALL MPI_ALLREDUCE( c_w_m_l(nzb+1), c_w_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 919 | MPI_SUM, comm1dy, ierr ) |
---|
| 920 | #else |
---|
| 921 | c_u_m = c_u_m_l |
---|
| 922 | c_v_m = c_v_m_l |
---|
| 923 | c_w_m = c_w_m_l |
---|
| 924 | #endif |
---|
| 925 | |
---|
| 926 | c_u_m = c_u_m / (ny+1) |
---|
| 927 | c_v_m = c_v_m / (ny+1) |
---|
| 928 | c_w_m = c_w_m / (ny+1) |
---|
| 929 | |
---|
[73] | 930 | ! |
---|
[978] | 931 | !-- Save old timelevels for the next timestep |
---|
| 932 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
| 933 | u_m_l(:,:,:) = u(:,:,1:2) |
---|
| 934 | v_m_l(:,:,:) = v(:,:,0:1) |
---|
| 935 | w_m_l(:,:,:) = w(:,:,0:1) |
---|
| 936 | ENDIF |
---|
| 937 | |
---|
| 938 | ! |
---|
| 939 | !-- Calculate the new velocities |
---|
[996] | 940 | DO k = nzb+1, nzt+1 |
---|
[1113] | 941 | DO j = nysg, nyng |
---|
[978] | 942 | u_p(k,j,0) = u(k,j,0) - dt_3d * tsc(2) * c_u_m(k) * & |
---|
[106] | 943 | ( u(k,j,0) - u(k,j,1) ) * ddx |
---|
[75] | 944 | |
---|
[978] | 945 | v_p(k,j,-1) = v(k,j,-1) - dt_3d * tsc(2) * c_v_m(k) * & |
---|
[75] | 946 | ( v(k,j,-1) - v(k,j,0) ) * ddx |
---|
| 947 | |
---|
[978] | 948 | w_p(k,j,-1) = w(k,j,-1) - dt_3d * tsc(2) * c_w_m(k) * & |
---|
[75] | 949 | ( w(k,j,-1) - w(k,j,0) ) * ddx |
---|
[978] | 950 | ENDDO |
---|
[75] | 951 | ENDDO |
---|
| 952 | |
---|
| 953 | ! |
---|
[978] | 954 | !-- Bottom boundary at the outflow |
---|
| 955 | IF ( ibc_uv_b == 0 ) THEN |
---|
[1353] | 956 | u_p(nzb,:,0) = 0.0_wp |
---|
| 957 | v_p(nzb,:,-1) = 0.0_wp |
---|
[978] | 958 | ELSE |
---|
| 959 | u_p(nzb,:,0) = u_p(nzb+1,:,0) |
---|
| 960 | v_p(nzb,:,-1) = v_p(nzb+1,:,-1) |
---|
| 961 | ENDIF |
---|
[1353] | 962 | w_p(nzb,:,-1) = 0.0_wp |
---|
[1] | 963 | |
---|
[75] | 964 | ! |
---|
[978] | 965 | !-- Top boundary at the outflow |
---|
| 966 | IF ( ibc_uv_t == 0 ) THEN |
---|
[1764] | 967 | u_p(nzt+1,:,0) = u_init(nzt+1) |
---|
[978] | 968 | v_p(nzt+1,:,-1) = v_init(nzt+1) |
---|
| 969 | ELSE |
---|
[1764] | 970 | u_p(nzt+1,:,0) = u_p(nzt,:,0) |
---|
[978] | 971 | v_p(nzt+1,:,-1) = v_p(nzt,:,-1) |
---|
| 972 | ENDIF |
---|
[1353] | 973 | w_p(nzt:nzt+1,:,-1) = 0.0_wp |
---|
[978] | 974 | |
---|
[75] | 975 | ENDIF |
---|
[73] | 976 | |
---|
[75] | 977 | ENDIF |
---|
[73] | 978 | |
---|
[106] | 979 | IF ( outflow_r ) THEN |
---|
[73] | 980 | |
---|
[1159] | 981 | IF ( use_cmax ) THEN |
---|
| 982 | u_p(:,:,nx+1) = u(:,:,nx) |
---|
| 983 | v_p(:,:,nx+1) = v(:,:,nx) |
---|
| 984 | w_p(:,:,nx+1) = w(:,:,nx) |
---|
| 985 | ELSEIF ( .NOT. use_cmax ) THEN |
---|
[75] | 986 | |
---|
[978] | 987 | c_max = dx / dt_3d |
---|
[75] | 988 | |
---|
[1353] | 989 | c_u_m_l = 0.0_wp |
---|
| 990 | c_v_m_l = 0.0_wp |
---|
| 991 | c_w_m_l = 0.0_wp |
---|
[978] | 992 | |
---|
[1353] | 993 | c_u_m = 0.0_wp |
---|
| 994 | c_v_m = 0.0_wp |
---|
| 995 | c_w_m = 0.0_wp |
---|
[978] | 996 | |
---|
[1] | 997 | ! |
---|
[996] | 998 | !-- Calculate the phase speeds for u, v, and w, first local and then |
---|
| 999 | !-- average along the outflow boundary. |
---|
| 1000 | DO k = nzb+1, nzt+1 |
---|
| 1001 | DO j = nys, nyn |
---|
[73] | 1002 | |
---|
[106] | 1003 | denom = u_m_r(k,j,nx) - u_m_r(k,j,nx-1) |
---|
| 1004 | |
---|
[1353] | 1005 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 1006 | c_u(k,j) = -c_max * ( u(k,j,nx) - u_m_r(k,j,nx) ) / ( denom * tsc(2) ) |
---|
[1353] | 1007 | IF ( c_u(k,j) < 0.0_wp ) THEN |
---|
| 1008 | c_u(k,j) = 0.0_wp |
---|
[106] | 1009 | ELSEIF ( c_u(k,j) > c_max ) THEN |
---|
| 1010 | c_u(k,j) = c_max |
---|
| 1011 | ENDIF |
---|
| 1012 | ELSE |
---|
| 1013 | c_u(k,j) = c_max |
---|
[73] | 1014 | ENDIF |
---|
| 1015 | |
---|
[106] | 1016 | denom = v_m_r(k,j,nx) - v_m_r(k,j,nx-1) |
---|
[73] | 1017 | |
---|
[1353] | 1018 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 1019 | c_v(k,j) = -c_max * ( v(k,j,nx) - v_m_r(k,j,nx) ) / ( denom * tsc(2) ) |
---|
[1353] | 1020 | IF ( c_v(k,j) < 0.0_wp ) THEN |
---|
| 1021 | c_v(k,j) = 0.0_wp |
---|
[106] | 1022 | ELSEIF ( c_v(k,j) > c_max ) THEN |
---|
| 1023 | c_v(k,j) = c_max |
---|
| 1024 | ENDIF |
---|
| 1025 | ELSE |
---|
| 1026 | c_v(k,j) = c_max |
---|
[73] | 1027 | ENDIF |
---|
| 1028 | |
---|
[106] | 1029 | denom = w_m_r(k,j,nx) - w_m_r(k,j,nx-1) |
---|
[73] | 1030 | |
---|
[1353] | 1031 | IF ( denom /= 0.0_wp ) THEN |
---|
[996] | 1032 | c_w(k,j) = -c_max * ( w(k,j,nx) - w_m_r(k,j,nx) ) / ( denom * tsc(2) ) |
---|
[1353] | 1033 | IF ( c_w(k,j) < 0.0_wp ) THEN |
---|
| 1034 | c_w(k,j) = 0.0_wp |
---|
[106] | 1035 | ELSEIF ( c_w(k,j) > c_max ) THEN |
---|
| 1036 | c_w(k,j) = c_max |
---|
| 1037 | ENDIF |
---|
| 1038 | ELSE |
---|
| 1039 | c_w(k,j) = c_max |
---|
[73] | 1040 | ENDIF |
---|
[106] | 1041 | |
---|
[978] | 1042 | c_u_m_l(k) = c_u_m_l(k) + c_u(k,j) |
---|
| 1043 | c_v_m_l(k) = c_v_m_l(k) + c_v(k,j) |
---|
| 1044 | c_w_m_l(k) = c_w_m_l(k) + c_w(k,j) |
---|
[106] | 1045 | |
---|
[978] | 1046 | ENDDO |
---|
| 1047 | ENDDO |
---|
[73] | 1048 | |
---|
[978] | 1049 | #if defined( __parallel ) |
---|
| 1050 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dy, ierr ) |
---|
| 1051 | CALL MPI_ALLREDUCE( c_u_m_l(nzb+1), c_u_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 1052 | MPI_SUM, comm1dy, ierr ) |
---|
| 1053 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dy, ierr ) |
---|
| 1054 | CALL MPI_ALLREDUCE( c_v_m_l(nzb+1), c_v_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 1055 | MPI_SUM, comm1dy, ierr ) |
---|
| 1056 | IF ( collective_wait ) CALL MPI_BARRIER( comm1dy, ierr ) |
---|
| 1057 | CALL MPI_ALLREDUCE( c_w_m_l(nzb+1), c_w_m(nzb+1), nzt-nzb, MPI_REAL, & |
---|
| 1058 | MPI_SUM, comm1dy, ierr ) |
---|
| 1059 | #else |
---|
| 1060 | c_u_m = c_u_m_l |
---|
| 1061 | c_v_m = c_v_m_l |
---|
| 1062 | c_w_m = c_w_m_l |
---|
| 1063 | #endif |
---|
| 1064 | |
---|
| 1065 | c_u_m = c_u_m / (ny+1) |
---|
| 1066 | c_v_m = c_v_m / (ny+1) |
---|
| 1067 | c_w_m = c_w_m / (ny+1) |
---|
| 1068 | |
---|
[73] | 1069 | ! |
---|
[978] | 1070 | !-- Save old timelevels for the next timestep |
---|
| 1071 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
| 1072 | u_m_r(:,:,:) = u(:,:,nx-1:nx) |
---|
| 1073 | v_m_r(:,:,:) = v(:,:,nx-1:nx) |
---|
| 1074 | w_m_r(:,:,:) = w(:,:,nx-1:nx) |
---|
| 1075 | ENDIF |
---|
[73] | 1076 | |
---|
[978] | 1077 | ! |
---|
| 1078 | !-- Calculate the new velocities |
---|
[996] | 1079 | DO k = nzb+1, nzt+1 |
---|
[1113] | 1080 | DO j = nysg, nyng |
---|
[978] | 1081 | u_p(k,j,nx+1) = u(k,j,nx+1) - dt_3d * tsc(2) * c_u_m(k) * & |
---|
| 1082 | ( u(k,j,nx+1) - u(k,j,nx) ) * ddx |
---|
[73] | 1083 | |
---|
[978] | 1084 | v_p(k,j,nx+1) = v(k,j,nx+1) - dt_3d * tsc(2) * c_v_m(k) * & |
---|
| 1085 | ( v(k,j,nx+1) - v(k,j,nx) ) * ddx |
---|
[73] | 1086 | |
---|
[978] | 1087 | w_p(k,j,nx+1) = w(k,j,nx+1) - dt_3d * tsc(2) * c_w_m(k) * & |
---|
| 1088 | ( w(k,j,nx+1) - w(k,j,nx) ) * ddx |
---|
| 1089 | ENDDO |
---|
[73] | 1090 | ENDDO |
---|
| 1091 | |
---|
| 1092 | ! |
---|
[978] | 1093 | !-- Bottom boundary at the outflow |
---|
| 1094 | IF ( ibc_uv_b == 0 ) THEN |
---|
[1353] | 1095 | u_p(nzb,:,nx+1) = 0.0_wp |
---|
| 1096 | v_p(nzb,:,nx+1) = 0.0_wp |
---|
[978] | 1097 | ELSE |
---|
| 1098 | u_p(nzb,:,nx+1) = u_p(nzb+1,:,nx+1) |
---|
| 1099 | v_p(nzb,:,nx+1) = v_p(nzb+1,:,nx+1) |
---|
| 1100 | ENDIF |
---|
[1353] | 1101 | w_p(nzb,:,nx+1) = 0.0_wp |
---|
[73] | 1102 | |
---|
| 1103 | ! |
---|
[978] | 1104 | !-- Top boundary at the outflow |
---|
| 1105 | IF ( ibc_uv_t == 0 ) THEN |
---|
| 1106 | u_p(nzt+1,:,nx+1) = u_init(nzt+1) |
---|
| 1107 | v_p(nzt+1,:,nx+1) = v_init(nzt+1) |
---|
| 1108 | ELSE |
---|
| 1109 | u_p(nzt+1,:,nx+1) = u_p(nzt,:,nx+1) |
---|
| 1110 | v_p(nzt+1,:,nx+1) = v_p(nzt,:,nx+1) |
---|
| 1111 | ENDIF |
---|
[1742] | 1112 | w_p(nzt:nzt+1,:,nx+1) = 0.0_wp |
---|
[978] | 1113 | |
---|
[1] | 1114 | ENDIF |
---|
| 1115 | |
---|
| 1116 | ENDIF |
---|
| 1117 | |
---|
| 1118 | END SUBROUTINE boundary_conds |
---|