1 !WRF:MEDIATION_LAYER:SOLVER
6 MODULE module_first_rk_step_part2
10 SUBROUTINE first_rk_step_part2 ( grid , config_flags &
11 , moist , moist_old , moist_tend &
13 , tracer, tracer_tend &
14 , scalar , scalar_tend &
16 , ru_tendf, rv_tendf &
18 , ph_tendf, mu_tendf &
20 , adapt_step_flag , curr_secs &
21 , psim , psih , gz1oz0 , chklowq &
22 , cu_act_flag , hol , th_phy &
23 , pi_phy , p_phy , t_phy &
25 , nba_mij, n_nba_mij & !JDM
26 , nba_rij, n_nba_rij & !JDM
27 , ids, ide, jds, jde, kds, kde &
28 , ims, ime, jms, jme, kms, kme &
29 , ips, ipe, jps, jpe, kps, kpe &
30 , imsx,imex,jmsx,jmex,kmsx,kmex &
31 , ipsx,ipex,jpsx,jpex,kpsx,kpex &
32 , imsy,imey,jmsy,jmey,kmsy,kmey &
33 , ipsy,ipey,jpsy,jpey,kpsy,kpey &
36 USE module_state_description
37 USE module_model_constants
38 USE module_domain, ONLY : domain
39 USE module_configure, ONLY : grid_config_rec_type, model_config_rec
40 USE module_big_step_utilities_em, ONLY : conv_t_tendf_to_moist
42 USE module_dm, ONLY : local_communicator, mytask, ntasks, ntasks_x, ntasks_y, local_communicator_periodic, &
43 wrf_dm_maxval, wrf_err_message, local_communicator_x, local_communicator_y
44 USE module_comm_dm, ONLY : halo_em_tke_c_sub,halo_em_tke_d_sub,halo_em_tke_e_sub &
45 ,halo_em_phys_pbl_sub,halo_em_phys_shcu_sub &
46 ,halo_em_fdda_sub,halo_em_phys_diffusion_sub,halo_em_tke_3_sub &
47 ,halo_em_tke_5_sub,halo_obs_nudge_sub,period_bdy_em_a1_sub,period_bdy_em_phy_bc_sub &
48 ,period_bdy_em_fdda_bc_sub,period_bdy_em_chem_sub,halo_em_phys_cu_sub,halo_em_helicity_sub
51 USE module_driver_constants
52 USE module_diffusion_em, ONLY : phy_bc, cal_deform_and_div, compute_diff_metrics, &
53 vertical_diffusion_2, horizontal_diffusion_2, calculate_km_kh, &
54 tke_rhs, cal_helicity, &
55 nonlocal_flux,meso_length_scale,free_atmos_length, &
56 vertical_diffusion_implicit !XZ
57 USE module_em, ONLY : calculate_phy_tend
58 USE module_fddaobs_driver, ONLY : fddaobs_driver
59 USE module_bc, ONLY : set_physical_bc3d, set_physical_bc2d
60 USE module_physics_addtendc, ONLY : update_phy_ten
62 USE module_sfs_driver !JDM
63 USE module_stoch, ONLY : update_stoch_ten, perturb_physics_tend, RAND_PERT_UPDATE, contiguize_2d
68 TYPE ( domain ), INTENT(INOUT) :: grid
69 TYPE ( grid_config_rec_type ), INTENT(IN) :: config_flags
71 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
72 ims, ime, jms, jme, kms, kme, &
73 ips, ipe, jps, jpe, kps, kpe, &
74 imsx,imex,jmsx,jmex,kmsx,kmex, &
75 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
76 imsy,imey,jmsy,jmey,kmsy,kmey, &
77 ipsy,ipey,jpsy,jpey,kpsy,kpey
81 LOGICAL ,INTENT(IN) :: adapt_step_flag
82 REAL, INTENT(IN) :: curr_secs
84 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_moist),INTENT(INOUT) :: moist
85 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_moist),INTENT(IN) :: moist_old
86 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_moist),INTENT(INOUT) :: moist_tend
87 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_chem),INTENT(INOUT) :: chem
88 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_chem),INTENT(INOUT) :: chem_tend
89 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_tracer),INTENT(INOUT) :: tracer
90 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_tracer),INTENT(INOUT) :: tracer_tend
91 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_scalar),INTENT(INOUT) :: scalar
92 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_scalar),INTENT(INOUT) :: scalar_tend
93 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme,num_fdda3d),INTENT(INOUT) :: fdda3d
94 REAL ,DIMENSION(ims:ime,1:1,jms:jme,num_fdda2d),INTENT(INOUT) :: fdda2d
95 REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: psim
96 REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: psih
97 REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: gz1oz0
98 REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: chklowq
99 LOGICAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: cu_act_flag
100 REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: hol
102 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: th_phy
103 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: pi_phy
104 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: p_phy
105 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: t_phy
106 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: dz8w
107 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: p8w
108 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: t8w
110 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: ru_tendf
111 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: rv_tendf
112 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: rw_tendf
113 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: ph_tendf
114 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: t_tendf
115 REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: tke_tend
117 REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: mu_tendf
119 INTEGER , INTENT(IN) :: k_start, k_end
122 INTEGER, INTENT( IN ) :: n_nba_mij, n_nba_rij
124 REAL ,DIMENSION(grid%sm31:grid%em31,grid%sm32:grid%em32,grid%sm33:grid%em33,n_nba_mij) &
127 REAL ,DIMENSION(grid%sm31:grid%em31,grid%sm32:grid%em32,grid%sm33:grid%em33,n_nba_rij) &
132 REAL, DIMENSION( ims:ime, jms:jme ) :: ht_loc
134 INTEGER, DIMENSION( ims:ime, jms:jme ) :: shadowmask
136 INTEGER num_roof_layers
137 INTEGER num_wall_layers
138 INTEGER num_road_layers
142 LOGICAL :: stepsp_test
144 #if ( WRF_DFI_RADAR == 1 )
145 INTEGER i_start,i_end,j_start,j_end,i,j,k
148 REAL, DIMENSION(ims:ime,jms:jme) :: SPFORCS3d_loc, SPFORCC3d_loc, SP_AMP3d_loc
150 ! initialize all tendencies to zero in order to update physics
151 ! tendencies first (separate from dry dynamics).
155 IF ((grid%skebs_on==1).and.(grid%id .EQ. 1 )) then
156 ! update and backtransform T
157 CALL RAND_PERT_UPDATE(grid,'T', &
158 grid%SPTFORCS,grid%SPTFORCC, &
159 grid%SPT_AMP,grid%ALPH_T, &
160 ips, ipe, jps, jpe, kps, kpe, &
161 ids, ide, jds, jde, kds, kde, &
162 ims, ime, jms, jme, kms, kme, &
164 imsx,imex,jmsx,jmex,kmsx,kmex, &
165 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
166 imsy,imey,jmsy,jmey,kmsy,kmey, &
167 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
168 grid%num_stoch_levels,grid%num_stoch_levels, &
169 grid%num_stoch_levels,grid%num_stoch_levels, &
170 config_flags%restart, grid%iseedarr_skebs, &
171 config_flags%seed_dim, &
172 grid%DX,grid%DY,grid%skebs_vertstruc, &
173 grid%rt_tendf_stoch, &
174 grid%stddev_cutoff_sppt,grid%gridpt_stddev_sppt, &
175 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPUV )
176 ! Update streamfunction, backtransform U
177 CALL RAND_PERT_UPDATE(grid,'U', &
178 grid%SPSTREAMFORCS,grid%SPSTREAMFORCC, &
179 grid%SPSTREAM_AMP,grid%ALPH_PSI, &
180 ips, ipe, jps, jpe, kps, kpe, &
181 ids, ide, jds, jde, kds, kde, &
182 ims, ime, jms, jme, kms, kme, &
184 imsx,imex,jmsx,jmex,kmsx,kmex, &
185 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
186 imsy,imey,jmsy,jmey,kmsy,kmey, &
187 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
188 grid% num_stoch_levels,grid% num_stoch_levels, &
189 grid% num_stoch_levels,grid% num_stoch_levels, &
190 config_flags%restart, grid%iseedarr_skebs, &
191 config_flags%seed_dim, &
192 grid%DX,grid%DY,grid%skebs_vertstruc, &
193 grid%ru_tendf_stoch, &
194 grid%stddev_cutoff_sppt,grid%gridpt_stddev_sppt, &
195 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPUV )
196 ! Don't update streamfunction, backtransform V
197 CALL RAND_PERT_UPDATE(grid,'V', &
198 grid%SPSTREAMFORCS,grid%SPSTREAMFORCC, &
199 grid%SPSTREAM_AMP,grid%ALPH_PSI, &
200 ips, ipe, jps, jpe, kps, kpe, &
201 ids, ide, jds, jde, kds, kde, &
202 ims, ime, jms, jme, kms, kme, &
204 imsx,imex,jmsx,jmex,kmsx,kmex, &
205 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
206 imsy,imey,jmsy,jmey,kmsy,kmey, &
207 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
208 grid% num_stoch_levels,grid% num_stoch_levels, &
209 grid% num_stoch_levels,grid% num_stoch_levels, &
210 config_flags%restart, grid%iseedarr_skebs, &
211 config_flags%seed_dim, &
212 grid%DX,grid%DY,grid%skebs_vertstruc, &
213 grid%rv_tendf_stoch, &
214 grid%stddev_cutoff_sppt,grid%gridpt_stddev_sppt, &
215 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPT )
218 if ((grid%sppt_on==1).and.(grid%id .EQ. 1 )) then
219 CALL RAND_PERT_UPDATE(grid,'T', &
220 grid%SPPTFORCS,grid%SPPTFORCC, &
221 grid%SPPT_AMP,grid%ALPH_SPPT, &
222 ips, ipe, jps, jpe, kps, kpe, &
223 ids, ide, jds, jde, kds, kde, &
224 ims, ime, jms, jme, kms, kme, &
226 imsx,imex,jmsx,jmex,kmsx,kmex, &
227 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
228 imsy,imey,jmsy,jmey,kmsy,kmey, &
229 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
230 grid%num_stoch_levels,grid%num_stoch_levels, &
231 grid%num_stoch_levels,grid%num_stoch_levels, &
232 config_flags%restart, grid%iseedarr_sppt, &
233 config_flags%seed_dim, &
234 grid%DX,grid%DY,grid%sppt_vertstruc, &
236 grid%stddev_cutoff_sppt,grid%gridpt_stddev_sppt, &
237 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPT )
240 if ((grid%rand_perturb_on==1).and.(grid%id .EQ. 1 )) then
241 CALL RAND_PERT_UPDATE(grid,'T', &
242 grid%SPFORCS,grid%SPFORCC, &
243 grid%SP_AMP,grid%ALPH_RAND, &
244 ips, ipe, jps, jpe, kps, kpe, &
245 ids, ide, jds, jde, kds, kde, &
246 ims, ime, jms, jme, kms, kme, &
248 imsx,imex,jmsx,jmex,kmsx,kmex, &
249 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
250 imsy,imey,jmsy,jmey,kmsy,kmey, &
251 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
252 grid%num_stoch_levels,grid%num_stoch_levels, &
253 grid%num_stoch_levels,grid%num_stoch_levels, &
254 config_flags%restart, grid%iseedarr_rand_pert, &
255 config_flags%seed_dim, &
256 grid%DX,grid%DY,grid%rand_pert_vertstruc, &
258 grid%stddev_cutoff_rand_pert,grid%gridpt_stddev_rand_pert, &
259 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPT )
260 ENDIF !rand_perturb_on
262 IF ( grid%stepsp > 0 ) THEN
263 stepsp_test = ( MOD(grid%itimestep, grid%stepsp) == 0 )
265 stepsp_test = .FALSE.
267 If_multi_perturb: if ((config_flags%multi_perturb==1).and.(grid%id == 1) .and. &
268 (stepsp_test .or. grid%itimestep == 1)) then
269 Loop_multi_perturb: DO n = 2, config_flags%num_pert_3d
270 CALL contiguize_2d ( .TRUE. , grid%SPFORCS3d, SPFORCS3d_loc, n, &
271 ips, ipe, jps, jpe, 1, config_flags%num_pert_3d, &
272 ids, ide, jds, jde, 1, config_flags%num_pert_3d, &
273 ims, ime, jms, jme, 1, config_flags%num_pert_3d )
274 CALL contiguize_2d ( .TRUE. , grid%SPFORCC3d, SPFORCC3d_loc, n, &
275 ips, ipe, jps, jpe, 1, config_flags%num_pert_3d, &
276 ids, ide, jds, jde, 1, config_flags%num_pert_3d, &
277 ims, ime, jms, jme, 1, config_flags%num_pert_3d )
278 CALL contiguize_2d ( .TRUE. , grid%SP_AMP3d, SP_AMP3d_loc, n, &
279 ips, ipe, jps, jpe, 1, config_flags%num_pert_3d, &
280 ids, ide, jds, jde, 1, config_flags%num_pert_3d, &
281 ims, ime, jms, jme, 1, config_flags%num_pert_3d )
282 CALL RAND_PERT_UPDATE(grid,'T', &
283 SPFORCS3d_loc, SPFORCC3d_loc, SP_AMP3d_loc, &
284 grid%ALPH_RAND3d(n), &
285 ips, ipe, jps, jpe, kps, kpe, &
286 ids, ide, jds, jde, kds, kde, &
287 ims, ime, jms, jme, kms, kme, &
289 imsx,imex,jmsx,jmex,kmsx,kmex, &
290 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
291 imsy,imey,jmsy,jmey,kmsy,kmey, &
292 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
293 grid%num_stoch_levels,grid%num_stoch_levels, &
294 grid%num_stoch_levels,grid%num_stoch_levels, &
295 config_flags%restart, grid%iseedarr_mult3d(:,n), &
296 config_flags%seed_dim, &
297 grid%DX,grid%DY,grid%mult3d_vertstruc(n), &
298 grid%PERT3D(:,:,:,n), &
299 grid%stddev_cutoff_mult3d(n), &
300 grid%gridpt_stddev_mult3d(n), &
301 grid%VERTSTRUCC3d(:,:,:,n), &
302 grid%VERTSTRUCS3d(:,:,:,n), &
303 grid%VERTAMPT3d(:,n) )
304 CALL contiguize_2d ( .FALSE., grid%SPFORCS3d, SPFORCS3d_loc, n, &
305 ips, ipe, jps, jpe, 1, config_flags%num_pert_3d, &
306 ids, ide, jds, jde, 1, config_flags%num_pert_3d, &
307 ims, ime, jms, jme, 1, config_flags%num_pert_3d )
308 CALL contiguize_2d ( .FALSE., grid%SPFORCC3d, SPFORCC3d_loc, n, &
309 ips, ipe, jps, jpe, 1, config_flags%num_pert_3d, &
310 ids, ide, jds, jde, 1, config_flags%num_pert_3d, &
311 ims, ime, jms, jme, 1, config_flags%num_pert_3d )
312 CALL contiguize_2d ( .FALSE., grid%SP_AMP3d, SP_AMP3d_loc, n, &
313 ips, ipe, jps, jpe, 1, config_flags%num_pert_3d, &
314 ids, ide, jds, jde, 1, config_flags%num_pert_3d, &
315 ims, ime, jms, jme, 1, config_flags%num_pert_3d )
316 END DO Loop_multi_perturb
317 ENDIF If_multi_perturb
319 if ((grid%spp_conv==1).and.(grid%id .EQ. 1 )) then
320 CALL RAND_PERT_UPDATE(grid,'T', &
321 grid%SPFORCS2,grid%SPFORCC2, &
322 grid%SP_AMP2,grid%ALPH_RAND2, &
323 ips, ipe, jps, jpe, kps, kpe, &
324 ids, ide, jds, jde, kds, kde, &
325 ims, ime, jms, jme, kms, kme, &
327 imsx,imex,jmsx,jmex,kmsx,kmex, &
328 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
329 imsy,imey,jmsy,jmey,kmsy,kmey, &
330 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
331 grid%num_stoch_levels,grid%num_stoch_levels, &
332 grid%num_stoch_levels,grid%num_stoch_levels, &
333 config_flags%restart, grid%iseedarr_spp_conv, &
334 config_flags%seed_dim, &
335 grid%DX,grid%DY,grid%vertstruc_spp_conv, &
336 grid%pattern_spp_conv, &
337 grid%stddev_cutoff_spp_conv,grid%gridpt_stddev_spp_conv, &
338 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPT )
340 if ((grid%spp_pbl==1).and.(grid%id .EQ. 1 )) then
341 CALL RAND_PERT_UPDATE(grid,'T', &
342 grid%SPFORCS3,grid%SPFORCC3, &
343 grid%SP_AMP3,grid%ALPH_RAND3, &
344 ips, ipe, jps, jpe, kps, kpe, &
345 ids, ide, jds, jde, kds, kde, &
346 ims, ime, jms, jme, kms, kme, &
348 imsx,imex,jmsx,jmex,kmsx,kmex, &
349 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
350 imsy,imey,jmsy,jmey,kmsy,kmey, &
351 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
352 grid%num_stoch_levels,grid%num_stoch_levels, &
353 grid%num_stoch_levels,grid%num_stoch_levels, &
354 config_flags%restart, grid%iseedarr_spp_pbl, &
355 config_flags%seed_dim, &
356 grid%DX,grid%DY,grid%vertstruc_spp_pbl, &
357 grid%pattern_spp_pbl, &
358 grid%stddev_cutoff_spp_pbl,grid%gridpt_stddev_spp_pbl, &
359 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPT )
361 if ((grid%spp_lsm==1).and.(grid%id .EQ. 1 )) then
362 CALL RAND_PERT_UPDATE(grid,'T', &
363 grid%SPFORCS4,grid%SPFORCC4, &
364 grid%SP_AMP4,grid%ALPH_RAND4, &
365 ips, ipe, jps, jpe, kps, kpe, &
366 ids, ide, jds, jde, kds, kde, &
367 ims, ime, jms, jme, kms, kme, &
369 imsx,imex,jmsx,jmex,kmsx,kmex, &
370 ipsx,ipex,jpsx,jpex,kpsx,kpex, &
371 imsy,imey,jmsy,jmey,kmsy,kmey, &
372 ipsy,ipey,jpsy,jpey,kpsy,kpey, &
373 grid%num_stoch_levels,grid%num_stoch_levels, &
374 grid%num_stoch_levels,grid%num_stoch_levels, &
375 config_flags%restart, grid%iseedarr_spp_lsm, &
376 config_flags%seed_dim, &
377 grid%DX,grid%DY,grid%vertstruc_spp_lsm, &
378 grid%pattern_spp_lsm, &
379 grid%stddev_cutoff_spp_lsm,grid%gridpt_stddev_spp_lsm, &
380 grid%VERTSTRUCC,grid%VERTSTRUCS,grid%VERTAMPT )
385 BENCH_START(cal_phy_tend)
389 DO ij = 1 , grid%num_tiles
391 CALL wrf_debug ( 200 , ' call calculate_phy_tend' )
392 CALL calculate_phy_tend (config_flags,grid%c1h,grid%c2h, &
393 grid%mut,grid%muu,grid%muv,pi_phy, &
395 grid%rublten,grid%rvblten,grid%rthblten, &
396 grid%rqvblten,grid%rqcblten,grid%rqiblten, &
397 grid%rucuten,grid%rvcuten,grid%rthcuten, &
398 grid%rqvcuten,grid%rqccuten,grid%rqrcuten, &
399 grid%rqicuten,grid%rqscuten, &
400 grid%rushten,grid%rvshten,grid%rthshten, &
401 grid%rqvshten,grid%rqcshten,grid%rqrshten, &
402 grid%rqishten,grid%rqsshten,grid%rqgshten, &
403 grid%RUNDGDTEN,grid%RVNDGDTEN,grid%RTHNDGDTEN,grid%RQVNDGDTEN, &
405 scalar, scalar_tend, num_scalar, &
406 tracer, tracer_tend, num_tracer, &
407 ids,ide, jds,jde, kds,kde, &
408 ims,ime, jms,jme, kms,kme, &
409 grid%i_start(ij), min(grid%i_end(ij),ide-1), &
410 grid%j_start(ij), min(grid%j_end(ij),jde-1), &
411 k_start , min(k_end,kde-1) )
414 !$OMP END PARALLEL DO
415 BENCH_END(cal_phy_tend)
419 IF(config_flags%diff_opt .eq. 2 .OR. config_flags%diff_opt .eq. 1) THEN
421 BENCH_START(comp_diff_metrics_tim)
424 DO ij = 1 , grid%num_tiles
425 CALL wrf_debug ( 200 , ' call compute_diff_metrics ' )
426 CALL compute_diff_metrics ( config_flags, grid%ph_2, grid%phb, grid%z, grid%rdz, grid%rdzw, &
427 grid%zx, grid%zy, grid%rdx, grid%rdy, &
428 ids, ide, jds, jde, kds, kde, &
429 ims, ime, jms, jme, kms, kme, &
430 grid%i_start(ij), grid%i_end(ij), &
431 grid%j_start(ij), grid%j_end(ij), &
434 !$OMP END PARALLEL DO
435 BENCH_END(comp_diff_metrics_tim)
438 # include "HALO_EM_TKE_C.inc"
439 # include "PERIOD_BDY_EM_A1.inc"
442 BENCH_START(tke_diff_bc_tim)
446 DO ij = 1 , grid%num_tiles
448 CALL wrf_debug ( 200 , ' call bc for diffusion_metrics ' )
449 CALL set_physical_bc3d( grid%rdzw , 'w', config_flags, &
450 ids, ide, jds, jde, kds, kde, &
451 ims, ime, jms, jme, kms, kme, &
452 ips, ipe, jps, jpe, kps, kpe, &
453 grid%i_start(ij), grid%i_end(ij), &
454 grid%j_start(ij), grid%j_end(ij), &
456 CALL set_physical_bc3d( grid%rdz , 'w', config_flags, &
457 ids, ide, jds, jde, kds, kde, &
458 ims, ime, jms, jme, kms, kme, &
459 ips, ipe, jps, jpe, kps, kpe, &
460 grid%i_start(ij), grid%i_end(ij), &
461 grid%j_start(ij), grid%j_end(ij), &
463 CALL set_physical_bc3d( grid%z , 'w', config_flags, &
464 ids, ide, jds, jde, kds, kde, &
465 ims, ime, jms, jme, kms, kme, &
466 ips, ipe, jps, jpe, kps, kpe, &
467 grid%i_start(ij), grid%i_end(ij), &
468 grid%j_start(ij), grid%j_end(ij), &
470 CALL set_physical_bc3d( grid%zx , 'e', config_flags, &
471 ids, ide, jds, jde, kds, kde, &
472 ims, ime, jms, jme, kms, kme, &
473 ips, ipe, jps, jpe, kps, kpe, &
474 grid%i_start(ij), grid%i_end(ij), &
475 grid%j_start(ij), grid%j_end(ij), &
477 CALL set_physical_bc3d( grid%zy , 'f', config_flags, &
478 ids, ide, jds, jde, kds, kde, &
479 ims, ime, jms, jme, kms, kme, &
480 ips, ipe, jps, jpe, kps, kpe, &
481 grid%i_start(ij), grid%i_end(ij), &
482 grid%j_start(ij), grid%j_end(ij), &
484 CALL set_physical_bc2d( grid%ustm, 't', config_flags, &
485 ids, ide, jds, jde, &
486 ims, ime, jms, jme, &
487 ips, ipe, jps, jpe, &
488 grid%i_start(ij), grid%i_end(ij), &
489 grid%j_start(ij), grid%j_end(ij) )
490 CALL set_physical_bc2d( grid%ust, 't', config_flags, &
491 ids, ide, jds, jde, &
492 ims, ime, jms, jme, &
493 ips, ipe, jps, jpe, &
494 grid%i_start(ij), grid%i_end(ij), &
495 grid%j_start(ij), grid%j_end(ij) )
498 !$OMP END PARALLEL DO
499 BENCH_END(tke_diff_bc_tim)
501 BENCH_START(deform_div_tim)
506 DO ij = 1 , grid%num_tiles
508 CALL wrf_debug ( 200 , ' call cal_deform_and_div' )
509 CALL cal_deform_and_div ( config_flags,grid%u_2,grid%v_2,grid%w_2,grid%div, &
510 grid%defor11,grid%defor22,grid%defor33, &
511 grid%defor12,grid%defor13,grid%defor23, &
512 nba_rij, n_nba_rij, & !JDM
513 grid%u_base, grid%v_base,grid%msfux,grid%msfuy, &
514 grid%msfvx,grid%msfvy,grid%msftx,grid%msfty, &
515 grid%rdx, grid%rdy, grid%dn, grid%dnw, grid%rdz, &
516 grid%rdzw,grid%fnm,grid%fnp,grid%cf1,grid%cf2, &
517 grid%cf3,grid%zx,grid%zy, &
518 ids, ide, jds, jde, kds, kde, &
519 ims, ime, jms, jme, kms, kme, &
520 grid%i_start(ij), grid%i_end(ij), &
521 grid%j_start(ij), grid%j_end(ij), &
524 !$OMP END PARALLEL DO
525 BENCH_END(deform_div_tim)
527 ! Updraft helicity between output times
530 # include "HALO_EM_HELICITY.inc"
533 IF ( ( config_flags%nwp_diagnostics .eq. 1 ) .OR. &
534 ( ( config_flags%afwa_diag_opt .eq. 1 ) .AND. ( config_flags%afwa_severe_opt .EQ. 1 ) ) ) THEN
535 BENCH_START(helicity_tim)
540 DO ij = 1 , grid%num_tiles
542 CALL wrf_debug ( 200 , ' call cal_helicity' )
543 CALL cal_helicity ( config_flags,grid%u_2,grid%v_2,grid%w_2, &
546 grid%ph_2,grid%phb, &
547 grid%msfux,grid%msfuy, &
548 grid%msfvx,grid%msfvy, &
550 grid%rdx, grid%rdy, grid%dn, grid%dnw, grid%rdz, grid%rdzw, &
551 grid%fnm,grid%fnp,grid%cf1,grid%cf2,grid%cf3,grid%zx,grid%zy, &
552 ids, ide, jds, jde, kds, kde, &
553 ims, ime, jms, jme, kms, kme, &
554 grid%i_start(ij), grid%i_end(ij), &
555 grid%j_start(ij), grid%j_end(ij), &
558 !$OMP END PARALLEL DO
559 BENCH_END(helicity_tim)
563 # include "HALO_EM_TKE_D.inc"
566 ! calculate tke, kmh, and kmv
568 BENCH_START(calc_tke_tim)
571 DO ij = 1 , grid%num_tiles
574 IF( config_flags%diff_opt .eq. 2 .and. config_flags%km_opt .eq. 5 ) THEN
575 CALL nonlocal_flux(config_flags,grid%nlflux,grid%gamu,grid%gamv, &
576 grid%pblh,grid%kpbl,grid%dx,grid%dy,grid%dt, &
577 grid%ust,grid%hfx,grid%qfx,grid%br,ep_1,ep_2, &
578 karman,grid%u_phy,grid%v_phy,th_phy,grid%rho, &
580 grid%msftx,grid%msfty,grid%rdzw, &
581 grid%u10,grid%v10,grid%wspd, &
582 ids, ide, jds, jde, kds, kde, &
583 ims, ime, jms, jme, kms, kme, &
584 grid%i_start(ij), grid%i_end(ij), &
585 grid%j_start(ij), grid%j_end(ij), &
588 CALL free_atmos_length(config_flags,grid%dx,grid%dy,grid%rdzw, &
589 grid%rdz,grid%tke_2,th_phy,grid%elmin, &
590 grid%hfx,grid%qfx,moist,num_moist, &
591 ids, ide, jds, jde, kds, kde, &
592 ims, ime, jms, jme, kms, kme, &
593 grid%i_start(ij),grid%i_end(ij), &
594 grid%j_start(ij), grid%j_end(ij), &
597 CALL meso_length_scale(config_flags,grid%dx,grid%dy,grid%rdzw, &
598 grid%rdz,grid%tke_2,p8w,t8w,th_phy, &
599 grid%dlk,grid%pblh,grid%elmin, &
600 grid%rmol,grid%rho,grid%hfx,grid%qfx, &
602 ids, ide, jds, jde, kds, kde, &
603 ims, ime, jms, jme, kms, kme, &
604 grid%i_start(ij), grid%i_end(ij), &
605 grid%j_start(ij), grid%j_end(ij), &
610 CALL wrf_debug ( 200 , ' call calculate_km_kh' )
611 CALL calculate_km_kh( config_flags,grid%dt,grid%dampcoef,grid%zdamp, &
612 config_flags%damp_opt, &
613 grid%xkmh,grid%xkmv,grid%xkhh,grid%xkhv,grid%bn2, &
614 grid%khdif,grid%kvdif,grid%div, &
615 grid%defor11,grid%defor22,grid%defor33,grid%defor12, &
616 grid%defor13,grid%defor23, &
617 grid%tke_2,p8w,t8w,th_phy, &
618 t_phy,p_phy,moist,grid%dn,grid%dnw, &
619 grid%dx,grid%dy,grid%rdz,grid%rdzw, &
620 config_flags%mix_isotropic,num_moist, &
621 grid%cf1, grid%cf2, grid%cf3, grid%warm_rain, &
622 grid%mix_upper_bound, &
623 grid%msftx, grid%msfty, &
625 grid%pblh, grid%dlk, grid%xkmv_meso, &
626 ids,ide, jds,jde, kds,kde, &
627 ims,ime, jms,jme, kms,kme, &
628 grid%i_start(ij), grid%i_end(ij), &
629 grid%j_start(ij), grid%j_end(ij), &
632 !$OMP END PARALLEL DO
633 BENCH_END(calc_tke_tim)
636 # include "HALO_EM_TKE_E.inc"
642 # include "PERIOD_BDY_EM_PHY_BC.inc"
643 IF ( config_flags%grid_fdda .eq. 1) THEN
644 # include "PERIOD_BDY_EM_FDDA_BC.inc"
646 # include "PERIOD_BDY_EM_CHEM.inc"
649 BENCH_START(phy_bc_tim)
653 DO ij = 1 , grid%num_tiles
655 CALL wrf_debug ( 200 , ' call phy_bc' )
656 CALL phy_bc (config_flags,grid%div,grid%defor11,grid%defor22,grid%defor33, &
657 grid%defor12,grid%defor13,grid%defor23, &
658 grid%xkmh,grid%xkmv,grid%xkhh,grid%xkhv, &
659 grid%tke_2,grid%rho, &
660 grid%rublten, grid%rvblten, &
661 grid%rucuten, grid%rvcuten, &
662 grid%rushten, grid%rvshten, &
663 grid%gamu, grid%gamv, grid%xkmv_meso, & ! XZ
664 ids, ide, jds, jde, kds, kde, &
665 ims, ime, jms, jme, kms, kme, &
666 ips, ipe, jps, jpe, kps, kpe, &
667 grid%i_start(ij), grid%i_end(ij), &
668 grid%j_start(ij), grid%j_end(ij), &
671 !$OMP END PARALLEL DO
672 BENCH_END(phy_bc_tim)
675 IF ( ( config_flags%sfs_opt .GT. 0 ) .AND. ( config_flags%diff_opt .eq. 2 ) ) THEN
677 CALL sfs_driver( grid, config_flags, &
678 nba_mij, n_nba_mij, &
684 !-----------------------------------------------------------------------
686 ! MPP for some physics tendency, km, kh, deformation, and divergence
689 ! * * * * * * * * * * * *
690 ! * * * * * * * * * * * * * *
691 ! * + * * + * + * * + * * * * * + * * *
692 ! * * * * * * * * * * * * * *
693 ! * * * * * * * * * * * *
704 ! (for Shallow Cumulus)
717 ! (for diff_opt >= 1)
730 !-----------------------------------------------------------------------
731 IF ( config_flags%bl_pbl_physics .ge. 1 ) THEN
732 # include "HALO_EM_PHYS_PBL.inc"
734 IF ( config_flags%shcu_physics .gt. 1 ) THEN
735 # include "HALO_EM_PHYS_SHCU.inc"
737 IF ( config_flags%cu_physics == SASSCHEME .or. &
738 config_flags%cu_physics == TIEDTKESCHEME .or. &
739 config_flags%cu_physics == NTIEDTKESCHEME .or. &
740 config_flags%cu_physics == MSKFSCHEME .or. &
741 config_flags%cu_physics == CAMZMSCHEME .or. &
742 config_flags%cu_physics == SCALESASSCHEME .or. &
743 config_flags%cu_physics == NSASSCHEME .or. &
744 config_flags%cu_physics == KSASSCHEME ) THEN
745 # include "HALO_EM_PHYS_CU.inc"
747 IF ( config_flags%grid_fdda .ge. 1) THEN
748 # include "HALO_EM_FDDA.inc"
750 IF ( config_flags%diff_opt .ge. 1 ) THEN
751 # include "HALO_EM_PHYS_DIFFUSION.inc"
754 IF ( config_flags%h_sca_adv_order <= 4 ) THEN
755 # include "HALO_EM_TKE_3.inc"
756 ELSE IF ( config_flags%h_sca_adv_order <= 6 ) THEN
757 # include "HALO_EM_TKE_5.inc"
759 WRITE(wrf_err_message,*)'solve_em: invalid h_sca_adv_order = ',config_flags%h_sca_adv_order
760 CALL wrf_error_fatal(TRIM(wrf_err_message))
764 BENCH_START(update_phy_ten_tim)
768 DO ij = 1 , grid%num_tiles
770 CALL wrf_debug ( 200 , ' call update_phy_ten' )
771 #if ( WRF_DFI_RADAR == 1 )
772 if (config_flags%cu_physics .gt. 0) then
773 i_start = grid%i_start(ij)
774 i_end = min( grid%i_end(ij),ide-1 )
775 j_start = grid%j_start(ij)
776 j_end = min( grid%j_end(ij),jde-1 )
777 if (grid%dfi_stage == DFI_FWD ) &
778 CALL wrf_debug ( 200 , ' Zero out cu_physics' )
779 DO j = j_start, j_end
780 DO k = k_start, min( k_end,kde-1 ) - 1
781 DO i = i_start, i_end
782 if (grid%dfi_stage ==DFI_FWD &
783 .and. grid%dfi_tten_rad(i,k,j) >= 1.0e-7 .and. &
784 grid%dfi_tten_rad(i,k,j) <= 10.) then
785 ! zero out cu-param temp tendency
786 grid%rthcuten(i,k,j) = 0.0
793 CALL update_phy_ten(ph_tendf,t_tendf, ru_tendf, rv_tendf,moist_tend ,&
794 scalar_tend, mu_tendf, &
795 grid%rthraten,grid%rthblten,grid%rthcuten,grid%rthshten, &
796 grid%rublten,grid%rucuten,grid%rushten, &
797 grid%rvblten,grid%rvcuten,grid%rvshten, &
798 grid%rqvblten,grid%rqcblten,grid%rqiblten, &
799 grid%rqniblten, & !CAMUWPBL scheme
800 grid%rqvcuten,grid%rqccuten,grid%rqrcuten, &
801 grid%rqicuten,grid%rqscuten, &
802 grid%rqcncuten,grid%rqincuten, & !BSINGH - Added two CU tends
803 grid%rqvshten,grid%rqcshten,grid%rqrshten, &
804 grid%rqishten,grid%rqsshten,grid%rqgshten, &
805 grid%rqcnshten,grid%rqinshten, &!BSINGH - Added two SHCU tends
807 grid%RVNDGDTEN,grid%RTHNDGDTEN,grid%RPHNDGDTEN, &
808 grid%RQVNDGDTEN,grid%RMUNDGDTEN, &
809 grid%rthfrten,grid%rqvfrten, & ! fire
810 num_moist,num_scalar,config_flags,rk_step, &
811 grid%adv_moist_cond, &
812 ids, ide, jds, jde, kds, kde, &
813 ims, ime, jms, jme, kms, kme, &
814 grid%i_start(ij), grid%i_end(ij), &
815 grid%j_start(ij), grid%j_end(ij), &
819 !$OMP END PARALLEL DO
820 BENCH_END(update_phy_ten_tim)
822 IF (grid%skebs_on==1) then
825 DO ij = 1 , grid%num_tiles
826 CALL wrf_debug ( 200 , ' call update_stoch_ten' )
827 CALL update_stoch_ten(ru_tendf, rv_tendf, t_tendf,&
828 grid%ru_tendf_stoch, &
829 grid%rv_tendf_stoch, &
830 grid%rt_tendf_stoch, &
831 grid%mu_2, grid%mub, grid%c1h, grid%c2h, &
832 ids, ide, jds, jde, kds, kde, &
833 ims, ime, jms, jme, kms, kme, &
834 grid%i_start(ij), grid%i_end(ij), &
835 grid%j_start(ij), grid%j_end(ij), &
837 grid%num_stoch_levels,grid%num_stoch_levels )
840 !$OMP END PARALLEL DO
843 IF (grid%sppt_on==1) then
846 DO ij = 1 , grid%num_tiles
847 call perturb_physics_tend(grid%gridpt_stddev_sppt, &
848 grid%stddev_cutoff_sppt,grid%rstoch, &
849 ru_tendf,rv_tendf,t_tendf, &
850 moist_tend(ims,kms,jms,p_qv), &
851 ids, ide, jds, jde, kds, kde, &
852 ims, ime, jms, jme, kms, kme, &
853 grid%i_start(ij), grid%i_end(ij), &
854 grid%j_start(ij), grid%j_end(ij), &
856 grid%num_stoch_levels,grid%num_stoch_levels )
858 !$OMP END PARALLEL DO
862 ! do rayleigh (and zonal-average newtonian) damping during
863 ! first iteration of RK loop only
865 =============================================================
866 INTENTIONALLY PLACED HERE TO BREAK COMPILE
867 1. The DAMPTOP routine needs to have 1d column arrays c1 and c2
868 to correctly use the column pressures mut, muu, and muv.
869 2. The DAMPTOP routine needs to have the grid%t_2 evaluated
870 to see if perturbation of moist potential temperature is OK.
871 =============================================================
873 IF ( (config_flags%damp_opt == 101) .OR. &
874 (config_flags%damp_opt == 103) ) THEN
877 DO ij = 1 , grid%num_tiles
878 CALL damptop( grid%u_2, grid%v_2, grid%t_2, &
879 grid%mut, grid%muu, grid%muv, &
881 t_tendf, ru_tendf, rv_tendf, P2SI, &
882 ids, ide, jds, jde, kds, kde, &
883 ims, ime, jms, jme, kms, kme, &
884 grid%i_start(ij), grid%i_end(ij), &
885 grid%j_start(ij), grid%j_end(ij), &
888 !$OMP END PARALLEL DO
892 IF( config_flags%diff_opt .eq. 2 .and. ( config_flags%km_opt .eq. 2 .or. &
893 config_flags%km_opt .eq. 5 ) ) THEN ! XZ
895 BENCH_START(tke_rhs_tim)
898 DO ij = 1 , grid%num_tiles
900 CALL tke_rhs ( tke_tend,grid%bn2, &
901 config_flags,grid%defor11,grid%defor22, &
903 grid%defor12,grid%defor13,grid%defor23, &
904 grid%u_2,grid%v_2,grid%w_2,grid%div, &
905 grid%tke_2,grid%mut,grid%c1h,grid%c2h, &
906 th_phy,p_phy,p8w,t8w,grid%z,grid%fnm, &
907 grid%fnp,grid%cf1,grid%cf2,grid%cf3, &
908 grid%msftx,grid%msfty,grid%xkmh, &
909 grid%xkmv,grid%xkhv,grid%rdx,grid%rdy, &
910 grid%dx,grid%dy,grid%dt,grid%zx,grid%zy, &
911 grid%rdz,grid%rdzw,grid%dn, &
912 grid%dnw,config_flags%mix_isotropic, &
913 grid%hfx, grid%qfx, moist(ims,kms,jms,P_QV), &
914 grid%ustm, grid%rho, &
915 grid%l_diss, grid%nlflux, & !XZ
916 grid%pblh, grid%dlk, & !XZ
917 ids, ide, jds, jde, kds, kde, &
918 ims, ime, jms, jme, kms, kme, &
919 grid%i_start(ij), grid%i_end(ij), &
920 grid%j_start(ij), grid%j_end(ij), &
924 !$OMP END PARALLEL DO
925 BENCH_END(tke_rhs_tim)
929 IF ( grid%obs_nudge_opt .EQ. 1 .AND. grid%xtime <= grid%fdda_end ) THEN
931 # include "HALO_OBS_NUDGE.inc"
933 !***********************************************************************
934 ! This section for obs nudging
938 DO ij = 1 , grid%num_tiles
940 CALL fddaobs_driver (grid%grid_id, model_config_rec%grid_id, &
941 model_config_rec%parent_id, config_flags%restart, &
943 grid%obs_nudge_opt, &
944 grid%obs_ipf_errob, &
945 grid%obs_ipf_nudob, &
948 grid%obs_nudge_wind, &
949 grid%obs_nudge_temp, &
950 grid%obs_nudge_mois, &
951 grid%obs_nudge_pstr, &
952 grid%obs_coef_wind, &
953 grid%obs_coef_temp, &
954 grid%obs_coef_mois, &
955 grid%obs_coef_pstr, &
964 grid%parent_grid_ratio, &
965 grid%max_dom, grid%itimestep, &
967 grid%dt, grid%gmt, grid%julday, grid%fdob, &
969 model_config_rec%nobs_ndg_vars, &
970 model_config_rec%nobs_err_flds, &
971 grid%fdob%nstat, grid%fdob%varobs, grid%fdob%errf, &
972 grid%dx, grid%KPBL,grid%HT, &
973 grid%mut, grid%muu, grid%muv, grid%c1h, grid%c2h, &
974 grid%msftx, grid%msfty, grid%msfux, grid%msfuy, grid%msfvx, grid%msfvy, &
975 p_phy, t_tendf, t0, &
976 grid%u_2, grid%v_2, grid%th_phy_m_t0, &
977 moist(ims,kms,jms,P_QV), &
978 grid%pb, grid%p_top, grid%p, grid%phb, grid%ph_2, &
979 grid%uratx, grid%vratx, grid%tratx, &
980 ru_tendf, rv_tendf, &
981 moist_tend(ims,kms,jms,P_QV), grid%obs_savwt, &
982 grid%regime, grid%pblh, grid%z_at_w, grid%z, &
983 ids,ide, jds,jde, kds,kde, &
984 ims,ime, jms,jme, kms,kme, &
985 grid%i_start(ij), min(grid%i_end(ij),ide-1), &
986 grid%j_start(ij), min(grid%j_end(ij),jde-1), &
987 k_start , min(k_end,kde-1) )
990 !$OMP END PARALLEL DO
991 ENDIF ! obs_nudge_opt .eq. 1
993 IF ( config_flags%use_theta_m .EQ. 1 ) THEN
996 DO ij = 1 , grid%num_tiles
997 CALL conv_t_tendf_to_moist ( grid%t_1 , moist_old(ims,kms,jms,P_qv) , &
998 t_tendf , moist_tend(ims,kms,jms,P_qv) , &
999 ids, ide, jds, jde, kds, kde , &
1000 ims, ime, jms, jme, kms, kme , &
1001 grid%i_start(ij), grid%i_end(ij), &
1002 grid%j_start(ij), grid%j_end(ij), &
1005 !$OMP END PARALLEL DO
1006 END IF ! use moist theta
1008 ! calculate vertical diffusion first and then horizontal
1011 IF(config_flags%diff_opt .eq. 2) THEN
1013 IF (config_flags%bl_pbl_physics .eq. 0) THEN
1015 !XZ implicit solver for vertical diffusion tendency
1016 IF( config_flags%km_opt .eq. 5 ) THEN
1018 !$OMP PRIVATE ( ij )
1019 DO ij = 1 , grid%num_tiles
1020 CALL vertical_diffusion_implicit(ru_tendf, rv_tendf, rw_tendf, &
1021 t_tendf, tke_tend, &
1022 moist_tend, num_moist, &
1023 chem_tend, num_chem, &
1024 scalar_tend, num_scalar, &
1025 tracer_tend, num_tracer, &
1026 grid%u_2, grid%v_2,grid%w_2,grid%dt, &
1027 grid%t_2,grid%u_base,grid%v_base,grid%t_base,grid%qv_base, &
1028 grid%mut,grid%tke_2,th_phy,config_flags, &
1029 moist, chem, scalar, tracer, &
1030 grid%xkmv, grid%xkhv, grid%xkmh, config_flags%km_opt, &
1031 grid%fnm, grid%fnp, grid%dn, grid%dnw, grid%rdz, grid%rdzw,&
1032 grid%hfx, grid%qfx, grid%ustm, grid%rho, &
1033 grid%nlflux, grid%gamu, grid%gamv, &
1034 grid%xkmv_meso, grid%l_diss, &
1035 grid%c1h, grid%c2h, grid%c1f, grid%c2f, &
1036 ids, ide, jds, jde, kds, kde, &
1037 ims, ime, jms, jme, kms, kme, &
1038 grid%i_start(ij), grid%i_end(ij), &
1039 grid%j_start(ij), grid%j_end(ij), &
1042 !$OMP END PARALLEL DO
1044 ELSE ! original explicit
1046 BENCH_START(vert_diff_tim)
1048 !$OMP PRIVATE ( ij )
1049 DO ij = 1 , grid%num_tiles
1051 CALL wrf_debug ( 200 , ' call vertical_diffusion_2 ' )
1052 CALL vertical_diffusion_2( ru_tendf, rv_tendf, rw_tendf, &
1053 t_tendf, tke_tend, &
1054 moist_tend, num_moist, &
1055 chem_tend, num_chem, &
1056 scalar_tend, num_scalar, &
1057 tracer_tend, num_tracer, &
1058 grid%u_2, grid%v_2, &
1059 grid%t_2,grid%u_base,grid%v_base,grid%t_base,grid%qv_base, &
1060 grid%tke_2, th_phy, config_flags, &
1061 grid%defor13,grid%defor23,grid%defor33, &
1062 nba_mij, num_nba_mij, & !JDM
1063 grid%div, moist, chem, scalar,tracer, &
1064 grid%xkmv, grid%xkhv, grid%xkmh, config_flags%km_opt, & ! xkmh added Oct2013
1065 grid%fnm, grid%fnp, grid%dn, grid%dnw, grid%rdz, grid%rdzw, &
1066 grid%hfx, grid%qfx, grid%ustm, grid%rho, &
1067 ids, ide, jds, jde, kds, kde, &
1068 ims, ime, jms, jme, kms, kme, &
1069 grid%i_start(ij), grid%i_end(ij), &
1070 grid%j_start(ij), grid%j_end(ij), &
1074 !$OMP END PARALLEL DO
1075 BENCH_END(vert_diff_tim)
1080 BENCH_START(hor_diff_tim)
1082 !$OMP PRIVATE ( ij )
1083 DO ij = 1 , grid%num_tiles
1085 CALL wrf_debug ( 200 , ' call horizontal_diffusion_2' )
1086 CALL horizontal_diffusion_2( t_tendf, ru_tendf, rv_tendf, rw_tendf, &
1088 moist_tend, num_moist, &
1089 chem_tend, num_chem, &
1090 scalar_tend, num_scalar, &
1091 tracer_tend, num_tracer, &
1093 grid%tke_2, config_flags, &
1094 grid%defor11, grid%defor22, grid%defor12, &
1095 grid%defor13, grid%defor23, &
1096 nba_mij, num_nba_mij, & !JDM
1098 moist, chem, scalar,tracer, &
1099 grid%msfux,grid%msfuy, grid%msfvx,grid%msfvy, grid%msftx, &
1100 grid%msfty, grid%xkmh, grid%xkmv, grid%xkhh, config_flags%km_opt, &
1101 grid%rdx, grid%rdy, grid%rdz, grid%rdzw, &
1102 grid%fnm, grid%fnp, grid%cf1, grid%cf2, grid%cf3, &
1103 grid%zx, grid%zy, grid%dn, grid%dnw, grid%rho, &
1104 ids, ide, jds, jde, kds, kde, &
1105 ims, ime, jms, jme, kms, kme, &
1106 grid%i_start(ij), grid%i_end(ij), &
1107 grid%j_start(ij), grid%j_end(ij), &
1110 !$OMP END PARALLEL DO
1111 BENCH_END(hor_diff_tim)
1115 !***********************************************************************
1117 END SUBROUTINE first_rk_step_part2
1119 END MODULE module_first_rk_step_part2