Changeset 1380
- Timestamp:
- Apr 28, 2014 12:40:45 PM (11 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r1375 r1380 20 20 # Current revisions: 21 21 # ------------------ 22 # 23 # 22 # bugfix: mod_particle_attributes added to check_open 23 # nudging added to time_integration 24 # 24 25 # Former revisions: 25 26 # ----------------- … … 28 29 # 1374 2014-04-25 12:55:07Z raasch 29 30 # bugfix: missing dependency added for check_open 30 # 31 # 31 32 # 1365 2014-04-22 15:03:56Z boeske 32 33 # Added new module calc_mean_profile, previously in module buoyancy, … … 393 394 time_integration.o: modules.o advec_ws.o buoyancy.o calc_mean_profile.o \ 394 395 cpulog.o interaction_droplets_ptq.o ls_forcing.o mod_kinds.o \ 395 production_e.o prognostic_equations.o user_actions.o396 nudging.o production_e.o prognostic_equations.o user_actions.o 396 397 time_to_string.o: mod_kinds.o 397 398 timestep.o: modules.o cpulog.o mod_kinds.o -
palm/trunk/SOURCE/boundary_conds.f90
r1362 r1380 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Adjust Dirichlet-condition at the top for pt in case of nudging 23 23 ! 24 24 ! Former revisions: … … 101 101 u, ug, u_init, u_m_l, u_m_n, u_m_r, u_m_s, u_p, & 102 102 v, vg, v_init, v_m_l, v_m_n, v_m_r, v_m_s, v_p, & 103 w, w_p, w_m_l, w_m_n, w_m_r, w_m_s 103 w, w_p, w_m_l, w_m_n, w_m_r, w_m_s,& 104 pt_init 104 105 105 106 USE control_parameters, & … … 110 111 intermediate_timestep_count, large_scale_forcing, ocean, & 111 112 outflow_l, outflow_n, outflow_r, outflow_s, passive_scalar, & 112 precipitation, tsc, use_cmax 113 precipitation, tsc, use_cmax, & 114 nudging 113 115 114 116 USE grid_variables, & … … 203 205 !$acc kernels present( pt, pt_p ) 204 206 pt_p(nzt+1,:,:) = pt(nzt+1,:,:) 207 ! 208 !-- In case of nudging adjust top boundary to pt which is 209 !-- read in from NUDGING-DATA 210 IF ( nudging ) THEN 211 pt_p(nzt+1,:,:) = pt_init(nzt+1) 212 ENDIF 205 213 !$acc end kernels 206 214 ELSEIF ( ibc_pt_t == 1 ) THEN -
palm/trunk/SOURCE/nudging.f90
r1366 r1380 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Subroutine nudge_ref added to account for proper upper scalar boundary 23 ! conditions in case of nudging 23 24 ! 24 25 ! Former revisions: … … 72 73 73 74 PRIVATE 74 PUBLIC init_nudge, calc_tnudge, nudge 75 PUBLIC init_nudge, calc_tnudge, nudge, nudge_ref 75 76 SAVE 76 77 … … 515 516 END SUBROUTINE nudge_ij 516 517 518 519 SUBROUTINE nudge_ref ( time ) 520 521 USE arrays_3d, & 522 ONLY: time_vert, ptnudge, pt_init, qnudge, q_init 523 524 USE kinds 525 526 527 IMPLICIT NONE 528 529 INTEGER(iwp) :: nt !: 530 531 REAL(wp) :: fac !: 532 REAL(wp), INTENT(in) :: time !: 533 534 ! 535 !-- Interpolation in time of NUDGING_DATA for pt_init and q_init. This is 536 !-- needed for correct upper boundary conditions for pt and q and in case that 537 ! large scale subsidence as well as scalar Rayleigh-damping are used 538 nt = 1 539 DO WHILE ( time > time_vert(nt) ) 540 nt = nt + 1 541 ENDDO 542 IF ( time /= time_vert(nt) ) THEN 543 nt = nt - 1 544 ENDIF 545 546 fac = ( time-time_vert(nt) ) / ( time_vert(nt+1)-time_vert(nt) ) 547 548 pt_init = ptnudge(:,nt) + fac * ( ptnudge(:,nt+1) - ptnudge(:,nt) ) 549 q_init = qnudge(:,nt) + fac * ( qnudge(:,nt+1) - qnudge(:,nt) ) 550 551 END SUBROUTINE nudge_ref 552 553 517 554 END MODULE nudge_mod -
palm/trunk/SOURCE/prognostic_equations.f90
r1375 r1380 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Change order of calls for scalar prognostic quantities: 23 ! ls_advec -> nudging -> subsidence since initial profiles 23 24 ! 24 25 ! Former revisions: … … 559 560 560 561 ! 562 !-- Nudging 563 IF ( nudging ) CALL nudge( i, j, simulated_time, 'pt' ) 564 565 ! 561 566 !-- If required, compute effect of large-scale subsidence/ascent 562 567 IF ( large_scale_subsidence .AND. & … … 564 569 CALL subsidence( i, j, tend, pt, pt_init, 2 ) 565 570 ENDIF 566 567 !568 !-- Nudging569 IF ( nudging ) CALL nudge( i, j, simulated_time, 'pt' )570 571 571 572 CALL user_actions( i, j, 'pt-tendency' ) … … 691 692 692 693 ! 694 !-- Nudging 695 IF ( nudging ) CALL nudge( i, j, simulated_time, 'q' ) 696 697 ! 693 698 !-- If required compute influence of large-scale subsidence/ascent 694 699 IF ( large_scale_subsidence .AND. & … … 696 701 CALL subsidence( i, j, tend, q, q_init, 3 ) 697 702 ENDIF 698 699 !700 !-- Nudging701 IF ( nudging ) CALL nudge( i, j, simulated_time, 'q' )702 703 703 704 CALL user_actions( i, j, 'q-tendency' ) … … 1213 1214 1214 1215 ! 1216 !-- Nudging 1217 IF ( nudging ) CALL nudge( simulated_time, 'pt' ) 1218 1219 ! 1215 1220 !-- If required compute influence of large-scale subsidence/ascent 1216 1221 IF ( large_scale_subsidence .AND. & … … 1218 1223 CALL subsidence( tend, pt, pt_init, 2 ) 1219 1224 ENDIF 1220 1221 !1222 !-- Nudging1223 IF ( nudging ) CALL nudge( simulated_time, 'pt' )1224 1225 1225 1226 CALL user_actions( 'pt-tendency' ) … … 1410 1411 1411 1412 ! 1413 !-- Nudging 1414 IF ( nudging ) CALL nudge( simulated_time, 'q' ) 1415 1416 ! 1412 1417 !-- If required compute influence of large-scale subsidence/ascent 1413 1418 IF ( large_scale_subsidence .AND. & … … 1415 1420 CALL subsidence( tend, q, q_init, 3 ) 1416 1421 ENDIF 1417 1418 !1419 !-- Nudging1420 IF ( nudging ) CALL nudge( simulated_time, 'q' )1421 1422 1422 1423 CALL user_actions( 'q-tendency' ) … … 2028 2029 2029 2030 ! 2031 !-- Nudging 2032 IF ( nudging ) CALL nudge( simulated_time, 'pt' ) 2033 2034 ! 2030 2035 !-- If required compute influence of large-scale subsidence/ascent 2031 2036 IF ( large_scale_subsidence .AND. & … … 2033 2038 CALL subsidence( tend, pt, pt_init, 2 ) 2034 2039 ENDIF 2035 2036 !2037 !-- Nudging2038 IF ( nudging ) CALL nudge( simulated_time, 'pt' )2039 2040 2040 2041 CALL user_actions( 'pt-tendency' ) … … 2199 2200 2200 2201 ! 2202 !-- Nudging 2203 IF ( nudging ) CALL nudge( simulated_time, 'q' ) 2204 2205 ! 2201 2206 !-- If required compute influence of large-scale subsidence/ascent 2202 2207 IF ( large_scale_subsidence .AND. & … … 2204 2209 CALL subsidence( tend, q, q_init, 3 ) 2205 2210 ENDIF 2206 2207 !2208 !-- Nudging2209 IF ( nudging ) CALL nudge( simulated_time, 'q' )2210 2211 2211 2212 CALL user_actions( 'q-tendency' ) -
palm/trunk/SOURCE/subsidence.f90
r1366 r1380 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Shifting only necessary in case of scalar Rayleigh damping 23 23 ! 24 24 ! Former revisions: … … 150 150 151 151 USE control_parameters, & 152 ONLY: dt_3d, intermediate_timestep_count, large_scale_forcing 152 ONLY: dt_3d, intermediate_timestep_count, large_scale_forcing, & 153 scalar_rayleigh_damping 153 154 154 155 USE indices, & … … 204 205 !-- Shifting of the initial profile is especially necessary with Rayleigh 205 206 !-- damping switched on 206 207 DO k = nzb, nzt 208 IF ( w_subs(k) < 0.0_wp ) THEN ! large-scale subsidence 209 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * & 210 ( var_init(k+1) - var_init(k) ) * ddzu(k+1) 211 ENDIF 212 ENDDO 213 ! 214 !-- At the upper boundary, the initial profile is shifted with aid of 215 !-- the gradient tmp_grad. (This is ok if the gradients are linear.) 216 IF ( w_subs(nzt) < 0.0_wp ) THEN 217 tmp_grad = ( var_init(nzt+1) - var_init(nzt) ) * ddzu(nzt+1) 218 var_mod(nzt+1) = var_init(nzt+1) - & 219 dt_3d * w_subs(nzt+1) * tmp_grad 207 IF ( scalar_rayleigh_damping ) THEN 208 DO k = nzb, nzt 209 IF ( w_subs(k) < 0.0_wp ) THEN ! large-scale subsidence 210 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * & 211 ( var_init(k+1) - var_init(k) ) * ddzu(k+1) 212 ENDIF 213 ENDDO 214 ! 215 !-- At the upper boundary, the initial profile is shifted with aid of 216 !-- the gradient tmp_grad. (This is ok if the gradients are linear.) 217 IF ( w_subs(nzt) < 0.0_wp ) THEN 218 tmp_grad = ( var_init(nzt+1) - var_init(nzt) ) * ddzu(nzt+1) 219 var_mod(nzt+1) = var_init(nzt+1) - & 220 dt_3d * w_subs(nzt+1) * tmp_grad 221 ENDIF 222 223 224 DO k = nzt+1, nzb+1, -1 225 IF ( w_subs(k) >= 0.0_wp ) THEN ! large-scale ascent 226 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * & 227 ( var_init(k) - var_init(k-1) ) * ddzu(k) 228 ENDIF 229 ENDDO 230 ! 231 !-- At the lower boundary shifting is not necessary because the 232 !-- subsidence velocity w_subs(nzb) vanishes. 233 IF ( w_subs(nzb+1) >= 0.0_wp ) THEN 234 var_mod(nzb) = var_init(nzb) 235 ENDIF 236 237 var_init = var_mod 220 238 ENDIF 221 222 223 DO k = nzt+1, nzb+1, -1224 IF ( w_subs(k) >= 0.0_wp ) THEN ! large-scale ascent225 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * &226 ( var_init(k) - var_init(k-1) ) * ddzu(k)227 ENDIF228 ENDDO229 !230 !-- At the lower boundary shifting is not necessary because the231 !-- subsidence velocity w_subs(nzb) vanishes.232 IF ( w_subs(nzb+1) >= 0.0_wp ) THEN233 var_mod(nzb) = var_init(nzb)234 ENDIF235 236 var_init = var_mod237 239 238 240 … … 245 247 246 248 USE control_parameters, & 247 ONLY: dt_3d, intermediate_timestep_count, large_scale_forcing 249 ONLY: dt_3d, intermediate_timestep_count, large_scale_forcing, & 250 scalar_rayleigh_damping 248 251 249 252 USE indices, & … … 293 296 !-- Shifting of the initial profile is especially necessary with Rayleigh 294 297 !-- damping switched on 295 IF ( i == nxl .AND. j == nys ) THEN ! shifting only once per PE 296 297 DO k = nzb, nzt 298 IF ( w_subs(k) < 0.0_wp ) THEN ! large-scale subsidence 299 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * & 300 ( var_init(k+1) - var_init(k) ) * ddzu(k+1) 298 IF ( scalar_rayleigh_damping ) THEN 299 IF ( i == nxl .AND. j == nys ) THEN ! shifting only once per PE 300 301 DO k = nzb, nzt 302 IF ( w_subs(k) < 0.0_wp ) THEN ! large-scale subsidence 303 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * & 304 ( var_init(k+1) - var_init(k) ) * ddzu(k+1) 305 ENDIF 306 ENDDO 307 ! 308 !-- At the upper boundary, the initial profile is shifted with aid of 309 !-- the gradient tmp_grad. (This is ok if the gradients are linear.) 310 IF ( w_subs(nzt) < 0.0_wp ) THEN 311 tmp_grad = ( var_init(nzt+1) - var_init(nzt) ) * ddzu(nzt+1) 312 var_mod(nzt+1) = var_init(nzt+1) - & 313 dt_3d * w_subs(nzt+1) * tmp_grad 301 314 ENDIF 302 ENDDO 303 ! 304 !-- At the upper boundary, the initial profile is shifted with aid of 305 !-- the gradient tmp_grad. (This is ok if the gradients are linear.) 306 IF ( w_subs(nzt) < 0.0_wp ) THEN 307 tmp_grad = ( var_init(nzt+1) - var_init(nzt) ) * ddzu(nzt+1) 308 var_mod(nzt+1) = var_init(nzt+1) - & 309 dt_3d * w_subs(nzt+1) * tmp_grad 315 316 317 DO k = nzt+1, nzb+1, -1 318 IF ( w_subs(k) >= 0.0_wp ) THEN ! large-scale ascent 319 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * & 320 ( var_init(k) - var_init(k-1) ) * ddzu(k) 321 ENDIF 322 ENDDO 323 ! 324 !-- At the lower boundary shifting is not necessary because the 325 !-- subsidence velocity w_subs(nzb) vanishes. 326 IF ( w_subs(nzb+1) >= 0.0_wp ) THEN 327 var_mod(nzb) = var_init(nzb) 328 ENDIF 329 330 var_init = var_mod 331 310 332 ENDIF 311 312 313 DO k = nzt+1, nzb+1, -1314 IF ( w_subs(k) >= 0.0_wp ) THEN ! large-scale ascent315 var_mod(k) = var_init(k) - dt_3d * w_subs(k) * &316 ( var_init(k) - var_init(k-1) ) * ddzu(k)317 ENDIF318 ENDDO319 !320 !-- At the lower boundary shifting is not necessary because the321 !-- subsidence velocity w_subs(nzb) vanishes.322 IF ( w_subs(nzb+1) >= 0.0_wp ) THEN323 var_mod(nzb) = var_init(nzb)324 ENDIF325 326 var_init = var_mod327 328 333 ENDIF 329 334 -
palm/trunk/SOURCE/time_integration.f90
r1366 r1380 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! CALL of nudge_ref added 23 ! bc_pt_t_val and bc_q_t_val are updated in case nudging is used 23 24 ! 24 25 ! Former revisions: … … 131 132 132 133 USE arrays_3d, & 133 ONLY: diss, e_p, nr_p, prho, pt, pt_p, q, ql, ql_c, ql_v, ql_vp, qr_p,& 134 q_p, ref_state, rho, sa_p, tend, u, u_p, v, vpt, v_p, w_p 134 ONLY: diss, dzu, e_p, nr_p, prho, pt, pt_p, pt_init, q_init, q, ql, & 135 ql_c, ql_v, ql_vp, qr_p, q_p, ref_state, rho, sa_p, tend, u, & 136 u_p, v, vpt, v_p, w_p 135 137 136 138 USE calc_mean_profile_mod, & … … 140 142 ONLY: advected_distance_x, advected_distance_y, average_count_3d, & 141 143 average_count_sp, averaging_interval, averaging_interval_pr, & 142 averaging_interval_sp, bc_lr_cyc, bc_ns_cyc, 143 call_psolver_at_all_substeps, cloud_droplets, cloud_physics,&144 c onstant_heatflux, create_disturbances, dopr_n,&144 averaging_interval_sp, bc_lr_cyc, bc_ns_cyc, bc_pt_t_val, & 145 bc_q_t_val, call_psolver_at_all_substeps, cloud_droplets, & 146 cloud_physics, constant_heatflux, create_disturbances, dopr_n, & 145 147 constant_diffusion, coupling_mode, coupling_start_time, & 146 148 current_timestep_number, disturbance_created, & … … 176 178 USE indices, & 177 179 ONLY: i_left, i_right, j_north, j_south, nbgp, nx, nxl, nxlg, nxr, & 178 nxrg, nyn, nys, nzb, nz b_u_inner, nzb_v_inner180 nxrg, nyn, nys, nzb, nzt, nzb_u_inner, nzb_v_inner 179 181 180 182 USE interaction_droplets_ptq_mod, & … … 187 189 188 190 USE nudge_mod, & 189 ONLY: calc_tnudge 191 ONLY: calc_tnudge, nudge_ref 190 192 191 193 USE particle_attributes, & … … 267 269 268 270 ! 271 !-- Set pt_init and q_init to the current profiles taken from 272 !-- NUDGING_DATA 273 IF ( nudging ) THEN 274 CALL nudge_ref ( simulated_time ) 275 ! 276 !-- Store temperature gradient at the top boundary for possible Neumann 277 !-- boundary condition 278 bc_pt_t_val = ( pt_init(nzt+1) - pt_init(nzt) ) / dzu(nzt+1) 279 bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) 280 ENDIF 281 282 ! 269 283 !-- Execute the user-defined actions 270 284 CALL user_actions( 'before_timestep' ) … … 312 326 ! 313 327 !-- In case of nudging calculate current nudging time scale and horizontal 314 !-- means of u, v,pt and q328 !-- means of u, v, pt and q 315 329 IF ( nudging ) THEN 316 330 CALL calc_tnudge( simulated_time )
Note: See TracChangeset
for help on using the changeset viewer.