1 !WRF:MODEL_LAYER: PHYSICS
3 ! note: this module really belongs in the dyn_em directory since it is
4 ! specific only to the EM core. Leaving here for now, with an
5 ! #if ( EM_CORE == 1 ) directive. JM 20031201
8 ! This MODULE holds the routines which are used to perform updates of the
9 ! model C-grid tendencies with physics A-grid tendencies
10 ! The module consolidates code that was (up to v1.2) duplicated in
11 ! module_em and module_rk and in
12 ! module_big_step_utilities.F and module_big_step_utilities_em.F
14 ! This MODULE CONTAINS the following routines:
15 ! update_phy_ten, phy_ra_ten, phy_bl_ten, phy_cu_ten, advance_ppt,
16 ! add_a2a, add_a2c_u, and add_a2c_v
19 MODULE module_physics_addtendc
23 USE module_state_description
28 SUBROUTINE update_phy_ten(rph_tendf,rt_tendf,ru_tendf,rv_tendf,moist_tendf, &
29 scalar_tendf,mu_tendf, &
30 RTHRATEN,RTHBLTEN,RTHCUTEN,RTHSHTEN, &
31 RUBLTEN,RUCUTEN,RUSHTEN, &
32 RVBLTEN,RVCUTEN,RVSHTEN, &
33 RQVBLTEN,RQCBLTEN,RQIBLTEN,RQNIBLTEN,&!RQNCBLTEN, & !JOE
34 RQVCUTEN,RQCCUTEN,RQRCUTEN,RQICUTEN,RQSCUTEN, &
35 RQCNCUTEN,RQINCUTEN, &
36 RQVSHTEN,RQCSHTEN,RQRSHTEN,RQISHTEN,RQSSHTEN,RQGSHTEN,&
37 RQCNSHTEN,RQINSHTEN, &
38 RUNDGDTEN,RVNDGDTEN,RTHNDGDTEN,RPHNDGDTEN, &
39 RQVNDGDTEN,RMUNDGDTEN, &
40 rthfrten,rqvfrten, & !fire
41 n_moist,n_scalar,config_flags,rk_step,adv_moist_cond, &
42 ids, ide, jds, jde, kds, kde, &
43 ims, ime, jms, jme, kms, kme, &
44 its, ite, jts, jte, kts, kte )
45 !-------------------------------------------------------------------
47 !-------------------------------------------------------------------
49 TYPE(grid_config_rec_type ) , INTENT(IN ) :: config_flags
51 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
52 ims, ime, jms, jme, kms, kme, &
53 its, ite, jts, jte, kts, kte, &
54 n_moist,n_scalar,rk_step
56 LOGICAL , INTENT(IN) :: adv_moist_cond
58 REAL , DIMENSION(ims:ime , kms:kme, jms:jme),INTENT(INOUT) :: &
64 REAL , DIMENSION(ims:ime , jms:jme),INTENT(INOUT) :: mu_tendf
66 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_moist), &
67 INTENT(INOUT) :: moist_tendf
69 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_scalar), &
70 INTENT(INOUT) :: scalar_tendf
72 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
86 RQNIBLTEN, & !For CAMUWPBL
108 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN ) :: RMUNDGDTEN
110 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: & ! fire
113 !------------------------------------------------------------------
114 ! set up loop bounds for this grid's boundary conditions
116 if (config_flags%ra_lw_physics .gt. 0 .or. &
117 config_flags%ra_sw_physics .gt. 0) &
118 CALL phy_ra_ten(config_flags,rt_tendf,RTHRATEN, &
119 ids, ide, jds, jde, kds, kde, &
120 ims, ime, jms, jme, kms, kme, &
121 its, ite, jts, jte, kts, kte )
123 if (config_flags%bl_pbl_physics .gt. 0) &
124 CALL phy_bl_ten(config_flags,rk_step,n_moist,n_scalar, &
125 rt_tendf,ru_tendf,rv_tendf,moist_tendf, &
126 scalar_tendf,adv_moist_cond, &
127 RTHBLTEN,RUBLTEN,RVBLTEN, &
128 RQVBLTEN,RQCBLTEN,RQIBLTEN, &
129 RQNIBLTEN, &! For CAMUWPBL
130 ids, ide, jds, jde, kds, kde, &
131 ims, ime, jms, jme, kms, kme, &
132 its, ite, jts, jte, kts, kte )
134 if (config_flags%cu_physics .gt. 0) &
135 CALL phy_cu_ten(config_flags,rk_step,n_moist,n_scalar, &
136 rt_tendf,ru_tendf,rv_tendf, &
137 RUCUTEN,RVCUTEN,RTHCUTEN, &
138 RQVCUTEN,RQCCUTEN,RQRCUTEN, &
139 RQICUTEN,RQSCUTEN,RQCNCUTEN,RQINCUTEN, &
141 scalar_tendf,adv_moist_cond, &
142 ids, ide, jds, jde, kds, kde, &
143 ims, ime, jms, jme, kms, kme, &
144 its, ite, jts, jte, kts, kte )
146 if (config_flags%shcu_physics .gt. 0) &
147 CALL phy_shcu_ten(config_flags,rk_step,n_moist,n_scalar, &
148 rt_tendf,ru_tendf,rv_tendf, &
149 RUSHTEN,RVSHTEN,RTHSHTEN, &
150 RQVSHTEN,RQCSHTEN,RQRSHTEN, &
151 RQISHTEN,RQSSHTEN,RQGSHTEN,RQCNSHTEN, &
152 RQINSHTEN,moist_tendf,scalar_tendf, &
153 ids, ide, jds, jde, kds, kde, &
154 ims, ime, jms, jme, kms, kme, &
155 its, ite, jts, jte, kts, kte )
157 if (config_flags%grid_fdda .gt. 0) &
158 CALL phy_fg_ten(config_flags,rk_step,n_moist, &
159 rph_tendf,rt_tendf,ru_tendf,rv_tendf, &
160 mu_tendf, moist_tendf, &
161 RUNDGDTEN,RVNDGDTEN,RTHNDGDTEN, &
162 RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, &
163 ids, ide, jds, jde, kds, kde, &
164 ims, ime, jms, jme, kms, kme, &
165 its, ite, jts, jte, kts, kte )
167 if (config_flags%ifire .gt. 0) & ! fire
168 CALL phy_fr_ten(config_flags,rk_step,n_moist, &
169 rt_tendf,ru_tendf,rv_tendf, &
170 mu_tendf, moist_tendf, &
172 ids, ide, jds, jde, kds, kde, &
173 ims, ime, jms, jme, kms, kme, &
174 its, ite, jts, jte, kts, kte )
176 END SUBROUTINE update_phy_ten
178 !=================================================================
179 SUBROUTINE phy_ra_ten(config_flags,rt_tendf,RTHRATEN, &
180 ids, ide, jds, jde, kds, kde, &
181 ims, ime, jms, jme, kms, kme, &
182 its, ite, jts, jte, kts, kte )
183 !-----------------------------------------------------------------
185 !-----------------------------------------------------------------
186 TYPE(grid_config_rec_type ) , INTENT(IN ) :: config_flags
188 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
189 ims, ime, jms, jme, kms, kme, &
190 its, ite, jts, jte, kts, kte
192 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
195 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
202 CALL add_a2a(rt_tendf,RTHRATEN,config_flags, &
203 ids,ide, jds, jde, kds, kde, &
204 ims, ime, jms, jme, kms, kme, &
205 its, ite, jts, jte, kts, kte )
207 END SUBROUTINE phy_ra_ten
209 !=================================================================
210 SUBROUTINE phy_bl_ten(config_flags,rk_step,n_moist,n_scalar, &
211 rt_tendf,ru_tendf,rv_tendf,moist_tendf, &
212 scalar_tendf,adv_moist_cond, &
213 RTHBLTEN,RUBLTEN,RVBLTEN, &
214 RQVBLTEN,RQCBLTEN,RQIBLTEN,RQNIBLTEN, &
215 ids, ide, jds, jde, kds, kde, &
216 ims, ime, jms, jme, kms, kme, &
217 its, ite, jts, jte, kts, kte )
218 !-----------------------------------------------------------------
220 !-----------------------------------------------------------------
221 TYPE(grid_config_rec_type) , INTENT(IN ) :: config_flags
223 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
224 ims, ime, jms, jme, kms, kme, &
225 its, ite, jts, jte, kts, kte, &
226 n_moist, n_scalar, rk_step
228 LOGICAL , INTENT(IN) :: adv_moist_cond
230 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_moist), &
231 INTENT(INOUT) :: moist_tendf
233 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_scalar), &
234 INTENT(INOUT) :: scalar_tendf
236 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
245 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
251 INTEGER :: i,j,k,IBGN,IEND,JBGN,JEND
253 !-----------------------------------------------------------------
255 SELECT CASE(config_flags%bl_pbl_physics)
259 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
260 ids,ide, jds, jde, kds, kde, &
261 ims, ime, jms, jme, kms, kme, &
262 its, ite, jts, jte, kts, kte )
264 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
265 ids,ide, jds, jde, kds, kde, &
266 ims, ime, jms, jme, kms, kme, &
267 its, ite, jts, jte, kts, kte )
269 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
270 ids,ide, jds, jde, kds, kde, &
271 ims, ime, jms, jme, kms, kme, &
272 its, ite, jts, jte, kts, kte )
274 if (P_QV .ge. PARAM_FIRST_SCALAR) &
275 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
277 ids,ide, jds, jde, kds, kde, &
278 ims, ime, jms, jme, kms, kme, &
279 its, ite, jts, jte, kts, kte )
281 if (P_QC .ge. PARAM_FIRST_SCALAR) &
282 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
284 ids,ide, jds, jde, kds, kde, &
285 ims, ime, jms, jme, kms, kme, &
286 its, ite, jts, jte, kts, kte )
288 if (P_QI .ge. PARAM_FIRST_SCALAR) &
289 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
291 ids,ide, jds, jde, kds, kde, &
292 ims, ime, jms, jme, kms, kme, &
293 its, ite, jts, jte, kts, kte )
295 IF(.not. adv_moist_cond)THEN
297 if (P_QT .ge. PARAM_FIRST_SCALAR) &
298 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
300 ids,ide, jds, jde, kds, kde, &
301 ims, ime, jms, jme, kms, kme, &
302 its, ite, jts, jte, kts, kte )
304 if (P_QT .ge. PARAM_FIRST_SCALAR) &
305 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
307 ids,ide, jds, jde, kds, kde, &
308 ims, ime, jms, jme, kms, kme, &
309 its, ite, jts, jte, kts, kte )
312 CASE (SHINHONGSCHEME)
314 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
315 ids,ide, jds, jde, kds, kde, &
316 ims, ime, jms, jme, kms, kme, &
317 its, ite, jts, jte, kts, kte )
319 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
320 ids,ide, jds, jde, kds, kde, &
321 ims, ime, jms, jme, kms, kme, &
322 its, ite, jts, jte, kts, kte )
324 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
325 ids,ide, jds, jde, kds, kde, &
326 ims, ime, jms, jme, kms, kme, &
327 its, ite, jts, jte, kts, kte )
329 if (P_QV .ge. PARAM_FIRST_SCALAR) &
330 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
332 ids,ide, jds, jde, kds, kde, &
333 ims, ime, jms, jme, kms, kme, &
334 its, ite, jts, jte, kts, kte )
336 if (P_QC .ge. PARAM_FIRST_SCALAR) &
337 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
339 ids,ide, jds, jde, kds, kde, &
340 ims, ime, jms, jme, kms, kme, &
341 its, ite, jts, jte, kts, kte )
343 if (P_QI .ge. PARAM_FIRST_SCALAR) &
344 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
346 ids,ide, jds, jde, kds, kde, &
347 ims, ime, jms, jme, kms, kme, &
348 its, ite, jts, jte, kts, kte )
350 IF(.not. adv_moist_cond)THEN
352 if (P_QT .ge. PARAM_FIRST_SCALAR) &
353 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
355 ids,ide, jds, jde, kds, kde, &
356 ims, ime, jms, jme, kms, kme, &
357 its, ite, jts, jte, kts, kte )
359 if (P_QT .ge. PARAM_FIRST_SCALAR) &
360 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
362 ids,ide, jds, jde, kds, kde, &
363 ims, ime, jms, jme, kms, kme, &
364 its, ite, jts, jte, kts, kte )
369 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
370 ids,ide, jds, jde, kds, kde, &
371 ims, ime, jms, jme, kms, kme, &
372 its, ite, jts, jte, kts, kte )
374 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
375 ids,ide, jds, jde, kds, kde, &
376 ims, ime, jms, jme, kms, kme, &
377 its, ite, jts, jte, kts, kte )
379 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
380 ids,ide, jds, jde, kds, kde, &
381 ims, ime, jms, jme, kms, kme, &
382 its, ite, jts, jte, kts, kte )
384 if (P_QV .ge. PARAM_FIRST_SCALAR) &
385 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
387 ids,ide, jds, jde, kds, kde, &
388 ims, ime, jms, jme, kms, kme, &
389 its, ite, jts, jte, kts, kte )
391 if (P_QC .ge. PARAM_FIRST_SCALAR) &
392 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
394 ids,ide, jds, jde, kds, kde, &
395 ims, ime, jms, jme, kms, kme, &
396 its, ite, jts, jte, kts, kte )
398 if (P_QI .ge. PARAM_FIRST_SCALAR) &
399 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
401 ids,ide, jds, jde, kds, kde, &
402 ims, ime, jms, jme, kms, kme, &
403 its, ite, jts, jte, kts, kte )
405 IF(.not. adv_moist_cond)THEN
407 if (P_QT .ge. PARAM_FIRST_SCALAR) &
408 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
410 ids,ide, jds, jde, kds, kde, &
411 ims, ime, jms, jme, kms, kme, &
412 its, ite, jts, jte, kts, kte )
414 if (P_QT .ge. PARAM_FIRST_SCALAR) &
415 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
417 ids,ide, jds, jde, kds, kde, &
418 ims, ime, jms, jme, kms, kme, &
419 its, ite, jts, jte, kts, kte )
424 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
425 ids,ide, jds, jde, kds, kde, &
426 ims, ime, jms, jme, kms, kme, &
427 its, ite, jts, jte, kts, kte )
429 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
430 ids,ide, jds, jde, kds, kde, &
431 ims, ime, jms, jme, kms, kme, &
432 its, ite, jts, jte, kts, kte )
434 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
435 ids,ide, jds, jde, kds, kde, &
436 ims, ime, jms, jme, kms, kme, &
437 its, ite, jts, jte, kts, kte )
439 if (P_QV .ge. PARAM_FIRST_SCALAR) &
440 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
442 ids,ide, jds, jde, kds, kde, &
443 ims, ime, jms, jme, kms, kme, &
444 its, ite, jts, jte, kts, kte )
446 if (P_QC .ge. PARAM_FIRST_SCALAR) &
447 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
449 ids,ide, jds, jde, kds, kde, &
450 ims, ime, jms, jme, kms, kme, &
451 its, ite, jts, jte, kts, kte )
453 if (P_QI .ge. PARAM_FIRST_SCALAR) &
454 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
456 ids,ide, jds, jde, kds, kde, &
457 ims, ime, jms, jme, kms, kme, &
458 its, ite, jts, jte, kts, kte )
460 IF(.not. adv_moist_cond)THEN
462 if (P_QT .ge. PARAM_FIRST_SCALAR)THEN
463 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
465 ids,ide, jds, jde, kds, kde, &
466 ims, ime, jms, jme, kms, kme, &
467 its, ite, jts, jte, kts, kte )
469 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
471 ids,ide, jds, jde, kds, kde, &
472 ims, ime, jms, jme, kms, kme, &
473 its, ite, jts, jte, kts, kte )
480 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
481 ids,ide, jds, jde, kds, kde, &
482 ims, ime, jms, jme, kms, kme, &
483 its, ite, jts, jte, kts, kte )
485 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
486 ids,ide, jds, jde, kds, kde, &
487 ims, ime, jms, jme, kms, kme, &
488 its, ite, jts, jte, kts, kte )
490 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
491 ids,ide, jds, jde, kds, kde, &
492 ims, ime, jms, jme, kms, kme, &
493 its, ite, jts, jte, kts, kte )
495 if (P_QV .ge. PARAM_FIRST_SCALAR) &
496 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
498 ids,ide, jds, jde, kds, kde, &
499 ims, ime, jms, jme, kms, kme, &
500 its, ite, jts, jte, kts, kte )
502 IF(.not. adv_moist_cond)THEN
504 if (P_QT .ge. PARAM_FIRST_SCALAR) &
505 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
507 ids,ide, jds, jde, kds, kde, &
508 ims, ime, jms, jme, kms, kme, &
509 its, ite, jts, jte, kts, kte )
511 if (P_QT .ge. PARAM_FIRST_SCALAR) &
512 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
514 ids,ide, jds, jde, kds, kde, &
515 ims, ime, jms, jme, kms, kme, &
516 its, ite, jts, jte, kts, kte )
518 ! if (P_QT .ge. PARAM_FIRST_SCALAR) &
519 ! CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQSBLTEN, &
521 ! ids,ide, jds, jde, kds, kde, &
522 ! ims, ime, jms, jme, kms, kme, &
523 ! its, ite, jts, jte, kts, kte )
525 ! if (P_QT .ge. PARAM_FIRST_SCALAR) &
526 ! CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQRBLTEN, &
528 ! ids,ide, jds, jde, kds, kde, &
529 ! ims, ime, jms, jme, kms, kme, &
530 ! its, ite, jts, jte, kts, kte )
532 ! if (P_QT .ge. PARAM_FIRST_SCALAR) &
533 ! CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQGBLTEN, &
535 ! ids,ide, jds, jde, kds, kde, &
536 ! ims, ime, jms, jme, kms, kme, &
537 ! its, ite, jts, jte, kts, kte )
541 if (P_QC .ge. PARAM_FIRST_SCALAR) &
542 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
544 ids,ide, jds, jde, kds, kde, &
545 ims, ime, jms, jme, kms, kme, &
546 its, ite, jts, jte, kts, kte )
548 if (P_QI .ge. PARAM_FIRST_SCALAR) &
549 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
551 ids,ide, jds, jde, kds, kde, &
552 ims, ime, jms, jme, kms, kme, &
553 its, ite, jts, jte, kts, kte )
555 ! if (P_QS .ge. PARAM_FIRST_SCALAR) &
556 ! CALL add_a2a(moist_tendf(ims,kms,jms,P_QS),RQSBLTEN, &
558 ! ids,ide, jds, jde, kds, kde, &
559 ! ims, ime, jms, jme, kms, kme, &
560 ! its, ite, jts, jte, kts, kte )
562 ! if (P_QR .ge. PARAM_FIRST_SCALAR) &
563 ! CALL add_a2a(moist_tendf(ims,kms,jms,P_QR),RQRBLTEN, &
565 ! ids,ide, jds, jde, kds, kde, &
566 ! ims, ime, jms, jme, kms, kme, &
567 ! its, ite, jts, jte, kts, kte )
569 ! if (P_QG .ge. PARAM_FIRST_SCALAR) &
570 ! CALL add_a2a(moist_tendf(ims,kms,jms,P_QG),RQGBLTEN, &
572 ! ids,ide, jds, jde, kds, kde, &
573 ! ims, ime, jms, jme, kms, kme, &
574 ! its, ite, jts, jte, kts, kte )
580 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
581 ids,ide, jds, jde, kds, kde, &
582 ims, ime, jms, jme, kms, kme, &
583 its, ite, jts, jte, kts, kte )
585 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
586 ids,ide, jds, jde, kds, kde, &
587 ims, ime, jms, jme, kms, kme, &
588 its, ite, jts, jte, kts, kte )
590 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
591 ids,ide, jds, jde, kds, kde, &
592 ims, ime, jms, jme, kms, kme, &
593 its, ite, jts, jte, kts, kte )
595 if (P_QV .ge. PARAM_FIRST_SCALAR) &
596 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
598 ids,ide, jds, jde, kds, kde, &
599 ims, ime, jms, jme, kms, kme, &
600 its, ite, jts, jte, kts, kte )
602 IF(.not. adv_moist_cond)THEN
604 if (P_QT .ge. PARAM_FIRST_SCALAR) &
605 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
607 ids,ide, jds, jde, kds, kde, &
608 ims, ime, jms, jme, kms, kme, &
609 its, ite, jts, jte, kts, kte )
613 if (P_QC .ge. PARAM_FIRST_SCALAR) &
614 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
616 ids,ide, jds, jde, kds, kde, &
617 ims, ime, jms, jme, kms, kme, &
618 its, ite, jts, jte, kts, kte )
624 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
625 ids,ide, jds, jde, kds, kde, &
626 ims, ime, jms, jme, kms, kme, &
627 its, ite, jts, jte, kts, kte )
629 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
630 ids,ide, jds, jde, kds, kde, &
631 ims, ime, jms, jme, kms, kme, &
632 its, ite, jts, jte, kts, kte )
634 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
635 ids,ide, jds, jde, kds, kde, &
636 ims, ime, jms, jme, kms, kme, &
637 its, ite, jts, jte, kts, kte )
639 if (P_QV .ge. PARAM_FIRST_SCALAR) &
640 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
642 ids,ide, jds, jde, kds, kde, &
643 ims, ime, jms, jme, kms, kme, &
644 its, ite, jts, jte, kts, kte )
646 if (P_QC .ge. PARAM_FIRST_SCALAR) &
647 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
649 ids,ide, jds, jde, kds, kde, &
650 ims, ime, jms, jme, kms, kme, &
651 its, ite, jts, jte, kts, kte )
653 if (P_QI .ge. PARAM_FIRST_SCALAR) &
654 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
656 ids,ide, jds, jde, kds, kde, &
657 ims, ime, jms, jme, kms, kme, &
658 its, ite, jts, jte, kts, kte )
660 IF(.not. adv_moist_cond)THEN
662 if (P_QT .ge. PARAM_FIRST_SCALAR) &
663 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
665 ids,ide, jds, jde, kds, kde, &
666 ims, ime, jms, jme, kms, kme, &
667 its, ite, jts, jte, kts, kte )
669 if (P_QT .ge. PARAM_FIRST_SCALAR) &
670 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
672 ids,ide, jds, jde, kds, kde, &
673 ims, ime, jms, jme, kms, kme, &
674 its, ite, jts, jte, kts, kte )
679 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
680 ids,ide, jds, jde, kds, kde, &
681 ims, ime, jms, jme, kms, kme, &
682 its, ite, jts, jte, kts, kte )
684 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
685 ids,ide, jds, jde, kds, kde, &
686 ims, ime, jms, jme, kms, kme, &
687 its, ite, jts, jte, kts, kte )
689 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
690 ids,ide, jds, jde, kds, kde, &
691 ims, ime, jms, jme, kms, kme, &
692 its, ite, jts, jte, kts, kte )
694 if (P_QV .ge. PARAM_FIRST_SCALAR) &
695 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
697 ids,ide, jds, jde, kds, kde, &
698 ims, ime, jms, jme, kms, kme, &
699 its, ite, jts, jte, kts, kte )
701 IF(.not. adv_moist_cond)THEN
703 if (P_QT .ge. PARAM_FIRST_SCALAR) &
704 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
706 ids,ide, jds, jde, kds, kde, &
707 ims, ime, jms, jme, kms, kme, &
708 its, ite, jts, jte, kts, kte )
710 if (P_QT .ge. PARAM_FIRST_SCALAR) &
711 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
713 ids,ide, jds, jde, kds, kde, &
714 ims, ime, jms, jme, kms, kme, &
715 its, ite, jts, jte, kts, kte )
719 if (P_QC .ge. PARAM_FIRST_SCALAR) &
720 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
722 ids,ide, jds, jde, kds, kde, &
723 ims, ime, jms, jme, kms, kme, &
724 its, ite, jts, jte, kts, kte )
726 if (P_QI .ge. PARAM_FIRST_SCALAR) &
727 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
729 ids,ide, jds, jde, kds, kde, &
730 ims, ime, jms, jme, kms, kme, &
731 its, ite, jts, jte, kts, kte )
737 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
738 ids,ide, jds, jde, kds, kde, &
739 ims, ime, jms, jme, kms, kme, &
740 its, ite, jts, jte, kts, kte )
742 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
743 ids,ide, jds, jde, kds, kde, &
744 ims, ime, jms, jme, kms, kme, &
745 its, ite, jts, jte, kts, kte )
747 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
748 ids,ide, jds, jde, kds, kde, &
749 ims, ime, jms, jme, kms, kme, &
750 its, ite, jts, jte, kts, kte )
752 if (P_QV .ge. PARAM_FIRST_SCALAR)&
753 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
755 ids,ide, jds, jde, kds, kde, &
756 ims, ime, jms, jme, kms, kme, &
757 its, ite, jts, jte, kts, kte )
759 if (P_QC .ge. PARAM_FIRST_SCALAR)&
760 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
762 ids,ide, jds, jde, kds, kde, &
763 ims, ime, jms, jme, kms, kme, &
764 its, ite, jts, jte, kts, kte )
766 if (P_QI .ge. PARAM_FIRST_SCALAR)&
767 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
769 ids,ide, jds, jde, kds, kde, &
770 ims, ime, jms, jme, kms, kme, &
771 its, ite, jts, jte, kts, kte )
772 IF(.not. adv_moist_cond)THEN
774 if (P_QT .ge. PARAM_FIRST_SCALAR)&
775 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
777 ids,ide, jds, jde, kds, kde, &
778 ims, ime, jms, jme, kms, kme, &
779 its, ite, jts, jte, kts, kte )
781 if (P_QT .ge. PARAM_FIRST_SCALAR)&
782 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
784 ids,ide, jds, jde, kds, kde, &
785 ims, ime, jms, jme, kms, kme, &
786 its, ite, jts, jte, kts, kte )
791 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
792 ids,ide, jds, jde, kds, kde, &
793 ims, ime, jms, jme, kms, kme, &
794 its, ite, jts, jte, kts, kte )
796 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
797 ids,ide, jds, jde, kds, kde, &
798 ims, ime, jms, jme, kms, kme, &
799 its, ite, jts, jte, kts, kte )
801 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
802 ids,ide, jds, jde, kds, kde, &
803 ims, ime, jms, jme, kms, kme, &
804 its, ite, jts, jte, kts, kte )
806 if (P_QV .ge. PARAM_FIRST_SCALAR) &
807 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
809 ids,ide, jds, jde, kds, kde, &
810 ims, ime, jms, jme, kms, kme, &
811 its, ite, jts, jte, kts, kte )
813 IF(.not. adv_moist_cond)THEN
815 if (P_QT .ge. PARAM_FIRST_SCALAR) &
816 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
818 ids,ide, jds, jde, kds, kde, &
819 ims, ime, jms, jme, kms, kme, &
820 its, ite, jts, jte, kts, kte )
824 if (P_QC .ge. PARAM_FIRST_SCALAR) &
825 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
827 ids,ide, jds, jde, kds, kde, &
828 ims, ime, jms, jme, kms, kme, &
829 its, ite, jts, jte, kts, kte )
835 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
836 ids,ide, jds, jde, kds, kde, &
837 ims, ime, jms, jme, kms, kme, &
838 its, ite, jts, jte, kts, kte )
840 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
841 ids,ide, jds, jde, kds, kde, &
842 ims, ime, jms, jme, kms, kme, &
843 its, ite, jts, jte, kts, kte )
845 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
846 ids,ide, jds, jde, kds, kde, &
847 ims, ime, jms, jme, kms, kme, &
848 its, ite, jts, jte, kts, kte )
850 if (P_QV .ge. PARAM_FIRST_SCALAR) &
851 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
853 ids,ide, jds, jde, kds, kde, &
854 ims, ime, jms, jme, kms, kme, &
855 its, ite, jts, jte, kts, kte )
857 IF(.not. adv_moist_cond)THEN
859 if (P_QT .ge. PARAM_FIRST_SCALAR) &
860 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
862 ids,ide, jds, jde, kds, kde, &
863 ims, ime, jms, jme, kms, kme, &
864 its, ite, jts, jte, kts, kte )
868 if (P_QC .ge. PARAM_FIRST_SCALAR) &
869 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
871 ids,ide, jds, jde, kds, kde, &
872 ims, ime, jms, jme, kms, kme, &
873 its, ite, jts, jte, kts, kte )
876 CASE (CAMUWPBLSCHEME)
877 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
878 ids,ide, jds, jde, kds, kde, &
879 ims, ime, jms, jme, kms, kme, &
880 its, ite, jts, jte, kts, kte )
882 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
883 ids,ide, jds, jde, kds, kde, &
884 ims, ime, jms, jme, kms, kme, &
885 its, ite, jts, jte, kts, kte )
887 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
888 ids,ide, jds, jde, kds, kde, &
889 ims, ime, jms, jme, kms, kme, &
890 its, ite, jts, jte, kts, kte )
892 if (P_QV .ge. PARAM_FIRST_SCALAR) &
893 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
895 ids,ide, jds, jde, kds, kde, &
896 ims, ime, jms, jme, kms, kme, &
897 its, ite, jts, jte, kts, kte )
899 IF(.not. adv_moist_cond)THEN
901 if (P_QT .ge. PARAM_FIRST_SCALAR) &
902 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCBLTEN, &
904 ids,ide, jds, jde, kds, kde, &
905 ims, ime, jms, jme, kms, kme, &
906 its, ite, jts, jte, kts, kte )
908 if (P_QT .ge. PARAM_FIRST_SCALAR) &
909 !Balwinder.Singh@pnnl.gov : Diffuse or mix cloud ice mass mixing ratio
910 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQIBLTEN, &
912 ids,ide, jds, jde, kds, kde, &
913 ims, ime, jms, jme, kms, kme, &
914 its, ite, jts, jte, kts, kte )
915 if (P_QT .ge. PARAM_FIRST_SCALAR) &
916 !Balwinder.Singh@pnnl.gov : Diffuse or mix cloud ice number mixing ratio
917 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQNIBLTEN,&
919 ids,ide, jds, jde, kds, kde, &
920 ims, ime, jms, jme, kms, kme, &
921 its, ite, jts, jte, kts, kte )
924 if (P_QC .ge. PARAM_FIRST_SCALAR) &
925 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
927 ids,ide, jds, jde, kds, kde, &
928 ims, ime, jms, jme, kms, kme, &
929 its, ite, jts, jte, kts, kte )
930 if (P_QI .ge. PARAM_FIRST_SCALAR) &
931 !Balwinder.Singh@pnnl.gov : Diffuse or mix cloud ice mass mixing ratio
932 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
934 ids,ide, jds, jde, kds, kde, &
935 ims, ime, jms, jme, kms, kme, &
936 its, ite, jts, jte, kts, kte )
937 if (P_QNI .ge. PARAM_FIRST_SCALAR) &
938 !Balwinder.Singh@pnnl.gov : Diffuse or mix cloud ice number mixing ratio
939 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QNI),RQNIBLTEN,&
941 ids,ide, jds, jde, kds, kde, &
942 ims, ime, jms, jme, kms, kme, &
943 its, ite, jts, jte, kts, kte )
948 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
949 ids,ide, jds, jde, kds, kde, &
950 ims, ime, jms, jme, kms, kme, &
951 its, ite, jts, jte, kts, kte )
953 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
954 ids,ide, jds, jde, kds, kde, &
955 ims, ime, jms, jme, kms, kme, &
956 its, ite, jts, jte, kts, kte )
958 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
959 ids,ide, jds, jde, kds, kde, &
960 ims, ime, jms, jme, kms, kme, &
961 its, ite, jts, jte, kts, kte )
963 if (P_QV .ge. PARAM_FIRST_SCALAR) &
964 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
966 ids,ide, jds, jde, kds, kde, &
967 ims, ime, jms, jme, kms, kme, &
968 its, ite, jts, jte, kts, kte )
970 if (P_QC .ge. PARAM_FIRST_SCALAR) &
971 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
973 ids,ide, jds, jde, kds, kde, &
974 ims, ime, jms, jme, kms, kme, &
975 its, ite, jts, jte, kts, kte )
977 if (P_QI .ge. PARAM_FIRST_SCALAR) &
978 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
980 ids,ide, jds, jde, kds, kde, &
981 ims, ime, jms, jme, kms, kme, &
982 its, ite, jts, jte, kts, kte )
985 CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, &
986 ids,ide, jds, jde, kds, kde, &
987 ims, ime, jms, jme, kms, kme, &
988 its, ite, jts, jte, kts, kte )
990 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
991 ids,ide, jds, jde, kds, kde, &
992 ims, ime, jms, jme, kms, kme, &
993 its, ite, jts, jte, kts, kte )
995 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
996 ids,ide, jds, jde, kds, kde, &
997 ims, ime, jms, jme, kms, kme, &
998 its, ite, jts, jte, kts, kte )
1000 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1001 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVBLTEN, &
1003 ids,ide, jds, jde, kds, kde, &
1004 ims, ime, jms, jme, kms, kme, &
1005 its, ite, jts, jte, kts, kte )
1007 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1008 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCBLTEN, &
1010 ids,ide, jds, jde, kds, kde, &
1011 ims, ime, jms, jme, kms, kme, &
1012 its, ite, jts, jte, kts, kte )
1014 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1015 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQIBLTEN, &
1017 ids,ide, jds, jde, kds, kde, &
1018 ims, ime, jms, jme, kms, kme, &
1019 its, ite, jts, jte, kts, kte )
1021 #if ( WRFPLUS == 1 )
1022 ! this is for WRFPlus only
1023 !---------------------------
1024 CASE (SURFDRAGSCHEME)
1026 CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, &
1027 ids,ide, jds, jde, kds, kde, &
1028 ims, ime, jms, jme, kms, kme, &
1029 its, ite, jts, jte, kts, kte )
1031 CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, &
1032 ids,ide, jds, jde, kds, kde, &
1033 ims, ime, jms, jme, kms, kme, &
1034 its, ite, jts, jte, kts, kte )
1039 print*,'phy_bl_ten: The pbl scheme does not exist'
1043 END SUBROUTINE phy_bl_ten
1045 !=================================================================
1046 SUBROUTINE phy_cu_ten(config_flags,rk_step,n_moist,n_scalar, &
1047 rt_tendf,ru_tendf,rv_tendf, &
1048 RUCUTEN,RVCUTEN,RTHCUTEN, &
1049 RQVCUTEN,RQCCUTEN,RQRCUTEN, &
1050 RQICUTEN,RQSCUTEN,RQCNCUTEN,RQINCUTEN, &
1052 scalar_tendf,adv_moist_cond, &
1053 ids, ide, jds, jde, kds, kde, &
1054 ims, ime, jms, jme, kms, kme, &
1055 its, ite, jts, jte, kts, kte )
1056 !-----------------------------------------------------------------
1058 !-----------------------------------------------------------------
1059 TYPE(grid_config_rec_type ) , INTENT(IN ) :: config_flags
1061 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
1062 ims, ime, jms, jme, kms, kme, &
1063 its, ite, jts, jte, kts, kte, &
1064 n_moist, n_scalar, rk_step
1066 LOGICAL , INTENT(IN) :: adv_moist_cond
1068 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_moist), &
1069 INTENT(INOUT) :: moist_tendf
1071 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_scalar), &
1072 INTENT(INOUT) :: scalar_tendf
1074 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
1086 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
1096 SELECT CASE (config_flags%cu_physics)
1099 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1100 ids,ide, jds, jde, kds, kde, &
1101 ims, ime, jms, jme, kms, kme, &
1102 its, ite, jts, jte, kts, kte )
1104 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1105 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1107 ids,ide, jds, jde, kds, kde, &
1108 ims, ime, jms, jme, kms, kme, &
1109 its, ite, jts, jte, kts, kte )
1111 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1112 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1114 ids,ide, jds, jde, kds, kde, &
1115 ims, ime, jms, jme, kms, kme, &
1116 its, ite, jts, jte, kts, kte )
1118 if (P_QR .ge. PARAM_FIRST_SCALAR) &
1119 CALL add_a2a(moist_tendf(ims,kms,jms,P_QR),RQRCUTEN, &
1121 ids,ide, jds, jde, kds, kde, &
1122 ims, ime, jms, jme, kms, kme, &
1123 its, ite, jts, jte, kts, kte )
1125 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1126 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1128 ids,ide, jds, jde, kds, kde, &
1129 ims, ime, jms, jme, kms, kme, &
1130 its, ite, jts, jte, kts, kte )
1132 if (P_QS .ge. PARAM_FIRST_SCALAR) &
1133 CALL add_a2a(moist_tendf(ims,kms,jms,P_QS),RQSCUTEN, &
1135 ids,ide, jds, jde, kds, kde, &
1136 ims, ime, jms, jme, kms, kme, &
1137 its, ite, jts, jte, kts, kte )
1139 IF(.not. adv_moist_cond)THEN
1141 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1142 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1144 ids,ide, jds, jde, kds, kde, &
1145 ims, ime, jms, jme, kms, kme, &
1146 its, ite, jts, jte, kts, kte )
1148 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1149 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQRCUTEN, &
1151 ids,ide, jds, jde, kds, kde, &
1152 ims, ime, jms, jme, kms, kme, &
1153 its, ite, jts, jte, kts, kte )
1155 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1156 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1158 ids,ide, jds, jde, kds, kde, &
1159 ims, ime, jms, jme, kms, kme, &
1160 its, ite, jts, jte, kts, kte )
1162 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1163 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQSCUTEN, &
1165 ids,ide, jds, jde, kds, kde, &
1166 ims, ime, jms, jme, kms, kme, &
1167 its, ite, jts, jte, kts, kte )
1172 CALL add_a2a(rt_tendf,RTHCUTEN, &
1174 ids,ide, jds, jde, kds, kde, &
1175 ims, ime, jms, jme, kms, kme, &
1176 its, ite, jts, jte, kts, kte )
1178 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1179 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1181 ids,ide, jds, jde, kds, kde, &
1182 ims, ime, jms, jme, kms, kme, &
1183 its, ite, jts, jte, kts, kte )
1185 CASE (KFETASCHEME, KFCUPSCHEME)!BSINGH - Added KFCUPSCHEME for CuP
1186 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1187 ids,ide, jds, jde, kds, kde, &
1188 ims, ime, jms, jme, kms, kme, &
1189 its, ite, jts, jte, kts, kte )
1191 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1192 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1194 ids,ide, jds, jde, kds, kde, &
1195 ims, ime, jms, jme, kms, kme, &
1196 its, ite, jts, jte, kts, kte )
1198 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1199 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1201 ids,ide, jds, jde, kds, kde, &
1202 ims, ime, jms, jme, kms, kme, &
1203 its, ite, jts, jte, kts, kte )
1205 if (P_QR .ge. PARAM_FIRST_SCALAR) &
1206 CALL add_a2a(moist_tendf(ims,kms,jms,P_QR),RQRCUTEN, &
1208 ids,ide, jds, jde, kds, kde, &
1209 ims, ime, jms, jme, kms, kme, &
1210 its, ite, jts, jte, kts, kte )
1212 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1213 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1215 ids,ide, jds, jde, kds, kde, &
1216 ims, ime, jms, jme, kms, kme, &
1217 its, ite, jts, jte, kts, kte )
1219 if (P_QS .ge. PARAM_FIRST_SCALAR) &
1220 CALL add_a2a(moist_tendf(ims,kms,jms,P_QS),RQSCUTEN, &
1222 ids,ide, jds, jde, kds, kde, &
1223 ims, ime, jms, jme, kms, kme, &
1224 its, ite, jts, jte, kts, kte )
1226 IF(.not. adv_moist_cond)THEN
1228 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1229 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1231 ids,ide, jds, jde, kds, kde, &
1232 ims, ime, jms, jme, kms, kme, &
1233 its, ite, jts, jte, kts, kte )
1235 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1236 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQRCUTEN, &
1238 ids,ide, jds, jde, kds, kde, &
1239 ims, ime, jms, jme, kms, kme, &
1240 its, ite, jts, jte, kts, kte )
1242 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1243 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1245 ids,ide, jds, jde, kds, kde, &
1246 ims, ime, jms, jme, kms, kme, &
1247 its, ite, jts, jte, kts, kte )
1249 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1250 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQSCUTEN, &
1252 ids,ide, jds, jde, kds, kde, &
1253 ims, ime, jms, jme, kms, kme, &
1254 its, ite, jts, jte, kts, kte )
1258 CASE (MSKFSCHEME)!JTR: Separate MSKF for cmt
1259 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1260 ids,ide, jds, jde, kds, kde, &
1261 ims, ime, jms, jme, kms, kme, &
1262 its, ite, jts, jte, kts, kte )
1264 CALL add_a2c_u(ru_tendf,RUCUTEN,config_flags, &
1265 ids,ide, jds, jde, kds, kde, &
1266 ims, ime, jms, jme, kms, kme, &
1267 its, ite, jts, jte, kts, kte )
1269 CALL add_a2c_v(rv_tendf,RVCUTEN,config_flags, &
1270 ids,ide, jds, jde, kds, kde, &
1271 ims, ime, jms, jme, kms, kme, &
1272 its, ite, jts, jte, kts, kte )
1274 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1275 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1277 ids,ide, jds, jde, kds, kde, &
1278 ims, ime, jms, jme, kms, kme, &
1279 its, ite, jts, jte, kts, kte )
1281 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1282 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1284 ids,ide, jds, jde, kds, kde, &
1285 ims, ime, jms, jme, kms, kme, &
1286 its, ite, jts, jte, kts, kte )
1288 if (P_QR .ge. PARAM_FIRST_SCALAR) &
1289 CALL add_a2a(moist_tendf(ims,kms,jms,P_QR),RQRCUTEN, &
1291 ids,ide, jds, jde, kds, kde, &
1292 ims, ime, jms, jme, kms, kme, &
1293 its, ite, jts, jte, kts, kte )
1295 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1296 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1298 ids,ide, jds, jde, kds, kde, &
1299 ims, ime, jms, jme, kms, kme, &
1300 its, ite, jts, jte, kts, kte )
1302 if (P_QS .ge. PARAM_FIRST_SCALAR) &
1303 CALL add_a2a(moist_tendf(ims,kms,jms,P_QS),RQSCUTEN, &
1305 ids,ide, jds, jde, kds, kde, &
1306 ims, ime, jms, jme, kms, kme, &
1307 its, ite, jts, jte, kts, kte )
1309 IF(.not. adv_moist_cond)THEN
1311 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1312 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1314 ids,ide, jds, jde, kds, kde, &
1315 ims, ime, jms, jme, kms, kme, &
1316 its, ite, jts, jte, kts, kte )
1318 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1319 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQRCUTEN, &
1321 ids,ide, jds, jde, kds, kde, &
1322 ims, ime, jms, jme, kms, kme, &
1323 its, ite, jts, jte, kts, kte )
1325 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1326 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1328 ids,ide, jds, jde, kds, kde, &
1329 ims, ime, jms, jme, kms, kme, &
1330 its, ite, jts, jte, kts, kte )
1332 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1333 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQSCUTEN, &
1335 ids,ide, jds, jde, kds, kde, &
1336 ims, ime, jms, jme, kms, kme, &
1337 its, ite, jts, jte, kts, kte )
1342 CASE (GDSCHEME, G3SCHEME, GFSCHEME)
1343 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1344 ids,ide, jds, jde, kds, kde, &
1345 ims, ime, jms, jme, kms, kme, &
1346 its, ite, jts, jte, kts, kte )
1348 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1349 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1351 ids,ide, jds, jde, kds, kde, &
1352 ims, ime, jms, jme, kms, kme, &
1353 its, ite, jts, jte, kts, kte )
1355 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1356 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1358 ids,ide, jds, jde, kds, kde, &
1359 ims, ime, jms, jme, kms, kme, &
1360 its, ite, jts, jte, kts, kte )
1362 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1363 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1365 ids,ide, jds, jde, kds, kde, &
1366 ims, ime, jms, jme, kms, kme, &
1367 its, ite, jts, jte, kts, kte )
1369 IF(.not. adv_moist_cond)THEN
1371 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1372 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1374 ids,ide, jds, jde, kds, kde, &
1375 ims, ime, jms, jme, kms, kme, &
1376 its, ite, jts, jte, kts, kte )
1378 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1379 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1381 ids,ide, jds, jde, kds, kde, &
1382 ims, ime, jms, jme, kms, kme, &
1383 its, ite, jts, jte, kts, kte )
1387 CASE (KSASSCHEME,NSASSCHEME)
1388 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1389 ids,ide, jds, jde, kds, kde, &
1390 ims, ime, jms, jme, kms, kme, &
1391 its, ite, jts, jte, kts, kte )
1393 CALL add_a2c_u(ru_tendf,RUCUTEN,config_flags, &
1394 ids,ide, jds, jde, kds, kde, &
1395 ims, ime, jms, jme, kms, kme, &
1396 its, ite, jts, jte, kts, kte )
1398 CALL add_a2c_v(rv_tendf,RVCUTEN,config_flags, &
1399 ids,ide, jds, jde, kds, kde, &
1400 ims, ime, jms, jme, kms, kme, &
1401 its, ite, jts, jte, kts, kte )
1403 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1404 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1406 ids,ide, jds, jde, kds, kde, &
1407 ims, ime, jms, jme, kms, kme, &
1408 its, ite, jts, jte, kts, kte )
1410 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1411 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1413 ids,ide, jds, jde, kds, kde, &
1414 ims, ime, jms, jme, kms, kme, &
1415 its, ite, jts, jte, kts, kte )
1417 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1418 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1420 ids,ide, jds, jde, kds, kde, &
1421 ims, ime, jms, jme, kms, kme, &
1422 its, ite, jts, jte, kts, kte )
1424 IF(.not. adv_moist_cond)THEN
1426 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1427 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1429 ids,ide, jds, jde, kds, kde, &
1430 ims, ime, jms, jme, kms, kme, &
1431 its, ite, jts, jte, kts, kte )
1433 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1434 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1436 ids,ide, jds, jde, kds, kde, &
1437 ims, ime, jms, jme, kms, kme, &
1438 its, ite, jts, jte, kts, kte )
1442 CASE (SASSCHEME,OSASSCHEME,SCALESASSCHEME)
1443 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1444 ids,ide, jds, jde, kds, kde, &
1445 ims, ime, jms, jme, kms, kme, &
1446 its, ite, jts, jte, kts, kte )
1448 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1449 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1451 ids,ide, jds, jde, kds, kde, &
1452 ims, ime, jms, jme, kms, kme, &
1453 its, ite, jts, jte, kts, kte )
1455 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1456 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1458 ids,ide, jds, jde, kds, kde, &
1459 ims, ime, jms, jme, kms, kme, &
1460 its, ite, jts, jte, kts, kte )
1462 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1463 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1465 ids,ide, jds, jde, kds, kde, &
1466 ims, ime, jms, jme, kms, kme, &
1467 its, ite, jts, jte, kts, kte )
1469 IF(.not. adv_moist_cond)THEN
1471 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1472 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1474 ids,ide, jds, jde, kds, kde, &
1475 ims, ime, jms, jme, kms, kme, &
1476 its, ite, jts, jte, kts, kte )
1478 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1479 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1481 ids,ide, jds, jde, kds, kde, &
1482 ims, ime, jms, jme, kms, kme, &
1483 its, ite, jts, jte, kts, kte )
1488 CALL add_a2c_u(ru_tendf,RUCUTEN,config_flags, &
1489 ids,ide, jds, jde, kds, kde, &
1490 ims, ime, jms, jme, kms, kme, &
1491 its, ite, jts, jte, kts, kte )
1493 CALL add_a2c_v(rv_tendf,RVCUTEN,config_flags, &
1494 ids,ide, jds, jde, kds, kde, &
1495 ims, ime, jms, jme, kms, kme, &
1496 its, ite, jts, jte, kts, kte )
1498 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1499 ids,ide, jds, jde, kds, kde, &
1500 ims, ime, jms, jme, kms, kme, &
1501 its, ite, jts, jte, kts, kte )
1503 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1504 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1506 ids,ide, jds, jde, kds, kde, &
1507 ims, ime, jms, jme, kms, kme, &
1508 its, ite, jts, jte, kts, kte )
1510 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1511 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1513 ids,ide, jds, jde, kds, kde, &
1514 ims, ime, jms, jme, kms, kme, &
1515 its, ite, jts, jte, kts, kte )
1517 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1518 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1520 ids,ide, jds, jde, kds, kde, &
1521 ims, ime, jms, jme, kms, kme, &
1522 its, ite, jts, jte, kts, kte )
1524 if (P_QNC .ge. PARAM_FIRST_SCALAR) &!BSINGH - QNC scalar
1525 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QNC),RQCNCUTEN, &
1527 ids,ide, jds, jde, kds, kde, &
1528 ims, ime, jms, jme, kms, kme, &
1529 its, ite, jts, jte, kts, kte )
1530 if (P_QNI .ge. PARAM_FIRST_SCALAR) &!BSINGH - QNI scalar
1531 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QNI),RQINCUTEN, &
1533 ids,ide, jds, jde, kds, kde, &
1534 ims, ime, jms, jme, kms, kme, &
1535 its, ite, jts, jte, kts, kte )
1538 IF(.not. adv_moist_cond)THEN
1540 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1541 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1543 ids,ide, jds, jde, kds, kde, &
1544 ims, ime, jms, jme, kms, kme, &
1545 its, ite, jts, jte, kts, kte )
1547 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1548 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1550 ids,ide, jds, jde, kds, kde, &
1551 ims, ime, jms, jme, kms, kme, &
1552 its, ite, jts, jte, kts, kte )
1556 CASE (TIEDTKESCHEME, NTIEDTKESCHEME)
1557 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1558 ids,ide, jds, jde, kds, kde, &
1559 ims, ime, jms, jme, kms, kme, &
1560 its, ite, jts, jte, kts, kte )
1562 CALL add_a2c_u(ru_tendf,RUCUTEN,config_flags, &
1563 ids,ide, jds, jde, kds, kde, &
1564 ims, ime, jms, jme, kms, kme, &
1565 its, ite, jts, jte, kts, kte )
1567 CALL add_a2c_v(rv_tendf,RVCUTEN,config_flags, &
1568 ids,ide, jds, jde, kds, kde, &
1569 ims, ime, jms, jme, kms, kme, &
1570 its, ite, jts, jte, kts, kte )
1572 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1573 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1575 ids,ide, jds, jde, kds, kde, &
1576 ims, ime, jms, jme, kms, kme, &
1577 its, ite, jts, jte, kts, kte )
1579 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1580 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCCUTEN, &
1582 ids,ide, jds, jde, kds, kde, &
1583 ims, ime, jms, jme, kms, kme, &
1584 its, ite, jts, jte, kts, kte )
1586 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1587 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQICUTEN, &
1589 ids,ide, jds, jde, kds, kde, &
1590 ims, ime, jms, jme, kms, kme, &
1591 its, ite, jts, jte, kts, kte )
1593 IF(.not. adv_moist_cond)THEN
1595 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1596 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1598 ids,ide, jds, jde, kds, kde, &
1599 ims, ime, jms, jme, kms, kme, &
1600 its, ite, jts, jte, kts, kte )
1602 if (P_QT .ge. PARAM_FIRST_SCALAR) &
1603 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1605 ids,ide, jds, jde, kds, kde, &
1606 ims, ime, jms, jme, kms, kme, &
1607 its, ite, jts, jte, kts, kte )
1611 #if ( WRFPLUS == 1 )
1612 ! this is for WRFPlus only
1613 !-------------------------------
1615 CALL add_a2a(rt_tendf,RTHCUTEN,config_flags, &
1616 ids,ide, jds, jde, kds, kde, &
1617 ims, ime, jms, jme, kms, kme, &
1618 its, ite, jts, jte, kts, kte )
1620 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1621 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVCUTEN, &
1623 ids,ide, jds, jde, kds, kde, &
1624 ims, ime, jms, jme, kms, kme, &
1625 its, ite, jts, jte, kts, kte )
1627 IF(.not. adv_moist_cond)THEN
1629 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1630 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQCCUTEN, &
1632 ids,ide, jds, jde, kds, kde, &
1633 ims, ime, jms, jme, kms, kme, &
1634 its, ite, jts, jte, kts, kte )
1636 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1637 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QT),RQICUTEN, &
1639 ids,ide, jds, jde, kds, kde, &
1640 ims, ime, jms, jme, kms, kme, &
1641 its, ite, jts, jte, kts, kte )
1650 END SUBROUTINE phy_cu_ten
1652 !=================================================================
1653 SUBROUTINE phy_shcu_ten(config_flags,rk_step,n_moist,n_scalar, &
1654 rt_tendf,ru_tendf,rv_tendf, &
1655 RUSHTEN,RVSHTEN,RTHSHTEN, &
1656 RQVSHTEN,RQCSHTEN,RQRSHTEN, &
1657 RQISHTEN,RQSSHTEN,RQGSHTEN,RQCNSHTEN, &
1658 RQINSHTEN,moist_tendf,scalar_tendf, &
1659 ids, ide, jds, jde, kds, kde, &
1660 ims, ime, jms, jme, kms, kme, &
1661 its, ite, jts, jte, kts, kte )
1662 !-----------------------------------------------------------------
1664 !-----------------------------------------------------------------
1665 TYPE(grid_config_rec_type ) , INTENT(IN ) :: config_flags
1667 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
1668 ims, ime, jms, jme, kms, kme, &
1669 its, ite, jts, jte, kts, kte, &
1670 n_moist, n_scalar, rk_step
1672 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_moist), &
1673 INTENT(INOUT) :: moist_tendf
1675 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_scalar), &
1676 INTENT(INOUT) :: scalar_tendf
1678 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
1691 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
1700 SELECT CASE (config_flags%shcu_physics)
1702 CASE (CAMUWSHCUSCHEME)
1703 CALL add_a2c_u(ru_tendf,RUSHTEN,config_flags, &
1704 ids,ide, jds, jde, kds, kde, &
1705 ims, ime, jms, jme, kms, kme, &
1706 its, ite, jts, jte, kts, kte )
1708 CALL add_a2c_v(rv_tendf,RVSHTEN,config_flags, &
1709 ids,ide, jds, jde, kds, kde, &
1710 ims, ime, jms, jme, kms, kme, &
1711 its, ite, jts, jte, kts, kte )
1713 CALL add_a2a(rt_tendf,RTHSHTEN,config_flags, &
1714 ids,ide, jds, jde, kds, kde, &
1715 ims, ime, jms, jme, kms, kme, &
1716 its, ite, jts, jte, kts, kte )
1718 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1719 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVSHTEN, &
1721 ids,ide, jds, jde, kds, kde, &
1722 ims, ime, jms, jme, kms, kme, &
1723 its, ite, jts, jte, kts, kte )
1725 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1726 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCSHTEN, &
1728 ids,ide, jds, jde, kds, kde, &
1729 ims, ime, jms, jme, kms, kme, &
1730 its, ite, jts, jte, kts, kte )
1732 if (P_QR .ge. PARAM_FIRST_SCALAR) &
1733 CALL add_a2a(moist_tendf(ims,kms,jms,P_QR),RQRSHTEN, &
1735 ids,ide, jds, jde, kds, kde, &
1736 ims, ime, jms, jme, kms, kme, &
1737 its, ite, jts, jte, kts, kte )
1739 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1740 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQISHTEN, &
1742 ids,ide, jds, jde, kds, kde, &
1743 ims, ime, jms, jme, kms, kme, &
1744 its, ite, jts, jte, kts, kte )
1746 if (P_QS .ge. PARAM_FIRST_SCALAR) &
1747 CALL add_a2a(moist_tendf(ims,kms,jms,P_QS),RQSSHTEN, &
1749 ids,ide, jds, jde, kds, kde, &
1750 ims, ime, jms, jme, kms, kme, &
1751 its, ite, jts, jte, kts, kte )
1753 if (P_QG .ge. PARAM_FIRST_SCALAR) &
1754 CALL add_a2a(moist_tendf(ims,kms,jms,P_QG),RQGSHTEN, &
1756 ids,ide, jds, jde, kds, kde, &
1757 ims, ime, jms, jme, kms, kme, &
1758 its, ite, jts, jte, kts, kte )
1759 if (P_QNC .ge. PARAM_FIRST_SCALAR) &
1760 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QNC),RQCNSHTEN, &
1762 ids,ide, jds, jde, kds, kde, &
1763 ims, ime, jms, jme, kms, kme, &
1764 its, ite, jts, jte, kts, kte )
1765 if (P_QNI .ge. PARAM_FIRST_SCALAR) &
1766 CALL add_a2a(scalar_tendf(ims,kms,jms,P_QNI),RQINSHTEN, &
1768 ids,ide, jds, jde, kds, kde, &
1769 ims, ime, jms, jme, kms, kme, &
1770 its, ite, jts, jte, kts, kte )
1773 CASE (GRIMSSHCUSCHEME)
1774 CALL add_a2a(rt_tendf,RTHSHTEN,config_flags, &
1775 ids,ide, jds, jde, kds, kde, &
1776 ims, ime, jms, jme, kms, kme, &
1777 its, ite, jts, jte, kts, kte )
1779 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1780 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVSHTEN, &
1782 ids,ide, jds, jde, kds, kde, &
1783 ims, ime, jms, jme, kms, kme, &
1784 its, ite, jts, jte, kts, kte )
1786 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1787 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCSHTEN, &
1789 ids,ide, jds, jde, kds, kde, &
1790 ims, ime, jms, jme, kms, kme, &
1791 its, ite, jts, jte, kts, kte )
1793 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1794 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQISHTEN, &
1796 ids,ide, jds, jde, kds, kde, &
1797 ims, ime, jms, jme, kms, kme, &
1798 its, ite, jts, jte, kts, kte )
1800 CASE (NSCVSHCUSCHEME)
1801 CALL add_a2a(rt_tendf,RTHSHTEN,config_flags, &
1802 ids,ide, jds, jde, kds, kde, &
1803 ims, ime, jms, jme, kms, kme, &
1804 its, ite, jts, jte, kts, kte )
1806 CALL add_a2c_u(ru_tendf,RUSHTEN,config_flags, &
1807 ids,ide, jds, jde, kds, kde, &
1808 ims, ime, jms, jme, kms, kme, &
1809 its, ite, jts, jte, kts, kte )
1811 CALL add_a2c_v(rv_tendf,RVSHTEN,config_flags, &
1812 ids,ide, jds, jde, kds, kde, &
1813 ims, ime, jms, jme, kms, kme, &
1814 its, ite, jts, jte, kts, kte )
1816 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1817 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVSHTEN, &
1819 ids,ide, jds, jde, kds, kde, &
1820 ims, ime, jms, jme, kms, kme, &
1821 its, ite, jts, jte, kts, kte )
1823 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1824 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCSHTEN, &
1826 ids,ide, jds, jde, kds, kde, &
1827 ims, ime, jms, jme, kms, kme, &
1828 its, ite, jts, jte, kts, kte )
1830 if (P_QI .ge. PARAM_FIRST_SCALAR) &
1831 CALL add_a2a(moist_tendf(ims,kms,jms,P_QI),RQISHTEN, &
1833 ids,ide, jds, jde, kds, kde, &
1834 ims, ime, jms, jme, kms, kme, &
1835 its, ite, jts, jte, kts, kte )
1837 CASE (DENGSHCUSCHEME)
1838 CALL add_a2c_u(ru_tendf,RUSHTEN,config_flags, &
1839 ids,ide, jds, jde, kds, kde, &
1840 ims, ime, jms, jme, kms, kme, &
1841 its, ite, jts, jte, kts, kte )
1843 CALL add_a2c_v(rv_tendf,RVSHTEN,config_flags, &
1844 ids,ide, jds, jde, kds, kde, &
1845 ims, ime, jms, jme, kms, kme, &
1846 its, ite, jts, jte, kts, kte )
1848 CALL add_a2a(rt_tendf,RTHSHTEN,config_flags, &
1849 ids,ide, jds, jde, kds, kde, &
1850 ims, ime, jms, jme, kms, kme, &
1851 its, ite, jts, jte, kts, kte )
1853 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1854 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVSHTEN, &
1856 ids,ide, jds, jde, kds, kde, &
1857 ims, ime, jms, jme, kms, kme, &
1858 its, ite, jts, jte, kts, kte )
1860 if (P_QC .ge. PARAM_FIRST_SCALAR) &
1861 CALL add_a2a(moist_tendf(ims,kms,jms,P_QC),RQCSHTEN, &
1863 ids,ide, jds, jde, kds, kde, &
1864 ims, ime, jms, jme, kms, kme, &
1865 its, ite, jts, jte, kts, kte )
1867 if (P_QR .ge. PARAM_FIRST_SCALAR) &
1868 CALL add_a2a(moist_tendf(ims,kms,jms,P_QR),RQRSHTEN, &
1870 ids,ide, jds, jde, kds, kde, &
1871 ims, ime, jms, jme, kms, kme, &
1872 its, ite, jts, jte, kts, kte )
1880 END SUBROUTINE phy_shcu_ten
1882 !=================================================================
1883 SUBROUTINE phy_fg_ten(config_flags,rk_step,n_moist, &
1884 rph_tendf,rt_tendf,ru_tendf,rv_tendf, &
1885 mu_tendf, moist_tendf, &
1886 RUNDGDTEN,RVNDGDTEN,RTHNDGDTEN, &
1887 RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, &
1888 ids, ide, jds, jde, kds, kde, &
1889 ims, ime, jms, jme, kms, kme, &
1890 its, ite, jts, jte, kts, kte )
1891 !-----------------------------------------------------------------
1893 !-----------------------------------------------------------------
1894 TYPE(grid_config_rec_type) , INTENT(IN ) :: config_flags
1896 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
1897 ims, ime, jms, jme, kms, kme, &
1898 its, ite, jts, jte, kts, kte, &
1901 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_moist), &
1902 INTENT(INOUT) :: moist_tendf
1904 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
1911 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN ) :: RMUNDGDTEN
1913 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
1919 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT):: mu_tendf
1923 INTEGER :: i,j,k,IBGN,IEND,JBGN,JEND
1925 !-----------------------------------------------------------------
1927 SELECT CASE(config_flags%grid_fdda)
1931 CALL add_a2a(rt_tendf,RTHNDGDTEN,config_flags, &
1932 ids,ide, jds, jde, kds, kde, &
1933 ims, ime, jms, jme, kms, kme, &
1934 its, ite, jts, jte, kts, kte )
1936 ! note fdda u and v tendencies are staggered
1937 CALL add_c2c_u(ru_tendf,RUNDGDTEN,config_flags, &
1938 ids,ide, jds, jde, kds, kde, &
1939 ims, ime, jms, jme, kms, kme, &
1940 its, ite, jts, jte, kts, kte )
1942 CALL add_c2c_v(rv_tendf,RVNDGDTEN,config_flags, &
1943 ids,ide, jds, jde, kds, kde, &
1944 ims, ime, jms, jme, kms, kme, &
1945 its, ite, jts, jte, kts, kte )
1947 CALL add_a2a(mu_tendf,RMUNDGDTEN,config_flags, &
1948 ids,ide, jds, jde, kds, kds, &
1949 ims, ime, jms, jme, kms, kms, &
1950 its, ite, jts, jte, kts, kts )
1952 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1953 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVNDGDTEN, &
1955 ids,ide, jds, jde, kds, kde, &
1956 ims, ime, jms, jme, kms, kme, &
1957 its, ite, jts, jte, kts, kte )
1961 ! note fdda u and v tendencies are staggered
1962 CALL add_c2c_u(ru_tendf,RUNDGDTEN,config_flags, &
1963 ids,ide, jds, jde, kds, kde, &
1964 ims, ime, jms, jme, kms, kme, &
1965 its, ite, jts, jte, kts, kte )
1967 CALL add_c2c_v(rv_tendf,RVNDGDTEN,config_flags, &
1968 ids,ide, jds, jde, kds, kde, &
1969 ims, ime, jms, jme, kms, kme, &
1970 its, ite, jts, jte, kts, kte )
1972 CALL add_a2a(rt_tendf,RTHNDGDTEN,config_flags, &
1973 ids,ide, jds, jde, kds, kde, &
1974 ims, ime, jms, jme, kms, kme, &
1975 its, ite, jts, jte, kts, kte )
1977 CALL add_a2a_ph(rph_tendf,RPHNDGDTEN,config_flags, &
1978 ids,ide, jds, jde, kds, kde, &
1979 ims, ime, jms, jme, kms, kme, &
1980 its, ite, jts, jte, kts, kte )
1982 if (P_QV .ge. PARAM_FIRST_SCALAR) &
1983 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),RQVNDGDTEN,&
1985 ids,ide, jds, jde, kds, kde, &
1986 ims, ime, jms, jme, kms, kme, &
1987 its, ite, jts, jte, kts, kte )
1993 END SUBROUTINE phy_fg_ten
1995 !=================================================================
1996 SUBROUTINE phy_fr_ten(config_flags,rk_step,n_moist, &
1997 rt_tendf,ru_tendf,rv_tendf, &
1998 mu_tendf, moist_tendf, &
1999 rthfrten,rqvfrten, &
2000 ids, ide, jds, jde, kds, kde, &
2001 ims, ime, jms, jme, kms, kme, &
2002 its, ite, jts, jte, kts, kte )
2003 !-----------------------------------------------------------------
2004 USE module_state_description, ONLY : &
2006 !-----------------------------------------------------------------
2008 !-----------------------------------------------------------------
2009 TYPE(grid_config_rec_type) , INTENT(IN ) :: config_flags
2011 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
2012 ims, ime, jms, jme, kms, kme, &
2013 its, ite, jts, jte, kts, kte, &
2016 REAL , DIMENSION(ims:ime, kms:kme, jms:jme, n_moist), &
2017 INTENT(INOUT) :: moist_tendf
2019 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN ) :: &
2023 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
2028 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT):: mu_tendf
2032 INTEGER :: i,j,k,IBGN,IEND,JBGN,JEND
2034 !-----------------------------------------------------------------
2036 SELECT CASE(config_flags%ifire)
2040 CALL add_a2a(rt_tendf,rthfrten, &
2042 ids,ide, jds, jde, kds, kde, &
2043 ims, ime, jms, jme, kms, kme, &
2044 its, ite, jts, jte, kts, kte )
2046 CALL add_a2a(moist_tendf(ims,kms,jms,P_QV),rqvfrten, &
2048 ids,ide, jds, jde, kds, kde, &
2049 ims, ime, jms, jme, kms, kme, &
2050 its, ite, jts, jte, kts, kte )
2056 END SUBROUTINE phy_fr_ten
2058 !----------------------------------------------------------------------
2059 SUBROUTINE advance_ppt(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
2060 CLDFRA_CUP, & ! add LD 01/11/2012 !BSINGH - Added for CuP
2061 RQICUTEN,RQSCUTEN, &
2062 RAINC,RAINCV,RAINSH,PRATEC,PRATESH, &
2063 NCA, HTOP,HBOT,CUTOP,CUBOT, &
2064 CUPPT, DT, config_flags, &
2065 ids,ide, jds,jde, kds,kde, &
2066 ims,ime, jms,jme, kms,kme, &
2067 its,ite, jts,jte, kts,kte )
2068 !----------------------------------------------------------------------
2069 USE module_state_description
2072 #if ( WRFPLUS == 1 )
2073 USE module_cu_du ! Added by Zhuxiao
2075 !----------------------------------------------------------------------
2077 !----------------------------------------------------------------------
2078 TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags
2080 INTEGER, INTENT(IN ) :: &
2081 ids,ide, jds,jde, kds,kde, &
2082 ims,ime, jms,jme, kms,kme, &
2083 its,ite, jts,jte, kts,kte
2086 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), &
2087 INTENT(INOUT) :: RTHCUTEN, &
2093 CLDFRA_CUP ! add LD 01/11/2012 !BSINGH - For CuP
2095 REAL, DIMENSION( ims:ime , jms:jme ), &
2096 INTENT(INOUT) :: RAINC, &
2107 REAL, INTENT(IN) :: DT
2111 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,k_start,k_end
2112 INTEGER :: NCUTOP, NCUBOT
2114 !-----------------------------------------------------------------
2116 IF (config_flags%cu_physics .eq. 0) return
2118 ! SET START AND END POINTS FOR TILES
2121 i_end = min( ite,ide-1 )
2123 j_end = min( jte,jde-1 )
2125 ! IF( config_flags%nested .or. config_flags%specified ) THEN
2126 ! i_start = max( its,ids+1 )
2127 ! i_end = min( ite,ide-2 )
2128 ! j_start = max( jts,jds+1 )
2129 ! j_end = min( jte,jde-2 )
2133 k_end = min( kte, kde-1 )
2135 ! Update total cumulus scheme precipitation
2139 DO J = j_start,j_end
2140 DO i = i_start,i_end
2141 RAINC(I,J) = RAINC(I,J) + PRATEC(I,J)*DT
2142 RAINSH(I,J) = RAINSH(I,J) + PRATESH(I,J)*DT
2143 CUPPT(I,J) = CUPPT(I,J) + (PRATEC(I,J)+PRATESH(I,J))*DT/1000.
2147 SELECT CASE (config_flags%cu_physics)
2151 DO J = j_start,j_end
2152 DO i = i_start,i_end
2154 IF ( NCA(I,J) .GT. 0 ) THEN
2156 IF ( NINT(NCA(I,J) / DT) .le. 0 ) THEN
2158 ! set tendency to zero
2161 DO k = k_start,k_end
2166 if (P_QI .ge. PARAM_FIRST_SCALAR) RQICUTEN(i,k,j)=0.
2167 if (P_QS .ge. PARAM_FIRST_SCALAR) RQSCUTEN(i,k,j)=0.
2171 NCA(I,J)=NCA(I,J)-DT ! Decrease NCA
2178 CASE (BMJSCHEME, CAMZMSCHEME)
2180 DO J = j_start,j_end
2181 DO i = i_start,i_end
2183 ! HTOP, HBOT FOR GFDL RADIATION
2184 NCUTOP=NINT(CUTOP(I,J))
2185 NCUBOT=NINT(CUBOT(I,J))
2186 IF(NCUTOP>1.AND.NCUTOP<KDE)THEN
2187 HTOP(I,J)=MAX(CUTOP(I,J),HTOP(I,J))
2189 IF(NCUBOT>0.AND.NCUBOT<KDE)THEN
2190 HBOT(I,J)=MIN(CUBOT(I,J),HBOT(I,J))
2196 CASE (KFETASCHEME, MSKFSCHEME, KFCUPSCHEME)!BSINGH - added KFCUPSCHEME for CuP
2198 DO J = j_start,j_end
2199 DO i = i_start,i_end
2201 ! HTOP, HBOT FOR GFDL RADIATION
2202 NCUTOP=NINT(CUTOP(I,J))
2203 NCUBOT=NINT(CUBOT(I,J))
2204 IF(NCUTOP>1.AND.NCUTOP<KDE)THEN
2205 HTOP(I,J)=MAX(CUTOP(I,J),HTOP(I,J))
2207 IF(NCUBOT>0.AND.NCUBOT<KDE)THEN
2208 HBOT(I,J)=MIN(CUBOT(I,J),HBOT(I,J))
2211 IF ( NCA(I,J) .GT. 0 ) THEN
2213 IF ( NINT(NCA(I,J) / DT) .LE. 1 ) THEN
2215 ! set tendency to zero
2218 DO k = k_start,k_end
2223 if (P_QI .ge. PARAM_FIRST_SCALAR) RQICUTEN(i,k,j)=0.
2224 if (P_QS .ge. PARAM_FIRST_SCALAR) RQSCUTEN(i,k,j)=0.
2228 NCA(I,J)=NCA(I,J)-DT ! Decrease NCA
2229 ! NCA(I,J)=NCA(I,J)-1. ! Decrease NCA
2236 IF ( config_flags%cu_physics == kfcupscheme ) THEN
2237 DO J = j_start,j_end
2238 DO i = i_start,i_end
2239 IF ( NCA(I,J) .GT. 0 ) THEN
2240 IF ( NINT(NCA(I,J) / DT) .LE. 1 ) THEN
2241 DO k = k_start,k_end
2242 CLDFRA_CUP(i,k,j)=0. ! By LKB 12/22/11 01/11/2012 !BSINGH - For CuP
2250 #if ( WRFPLUS == 1 )
2251 ! this is for WRFPlus only
2252 !---------------------------
2255 DO J = j_start,j_end
2256 DO i = i_start,i_end
2258 IF ( NCA(I,J) .GT. 0 ) THEN
2260 IF ( NINT(NCA(I,J) / DT) .le. 0 ) THEN
2262 ! set tendency to zero
2265 DO k = k_start,k_end
2271 NCA(I,J)=NCA(I,J)-DT ! Decrease NCA
2283 END SUBROUTINE advance_ppt
2285 SUBROUTINE add_a2a(lvar,rvar,config_flags, &
2286 ids,ide, jds, jde, kds, kde, &
2287 ims, ime, jms, jme, kms, kme, &
2288 its, ite, jts, jte, kts, kte )
2289 !------------------------------------------------------------
2291 !------------------------------------------------------------
2292 TYPE(grid_config_rec_type), INTENT(IN) :: config_flags
2294 INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, &
2295 ims, ime, jms, jme, kms, kme, &
2296 its, ite, jts, jte, kts, kte
2298 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(IN ) ::&
2300 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(INOUT) ::&
2304 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,ktf
2307 i_end = MIN(ite,ide-1)
2309 j_end = MIN(jte,jde-1)
2310 ktf = min(kte,kde-1)
2312 IF ( config_flags%specified .or. &
2313 config_flags%nested) i_start = MAX(ids+1,its)
2314 IF ( config_flags%specified .or. &
2315 config_flags%nested) i_end = MIN(ide-2,ite)
2316 IF ( config_flags%specified .or. &
2317 config_flags%nested) j_start = MAX(jds+1,jts)
2318 IF ( config_flags%specified .or. &
2319 config_flags%nested) j_end = MIN(jde-2,jte)
2320 IF ( config_flags%periodic_x ) i_start = its
2321 IF ( config_flags%periodic_x ) i_end = MIN( ite, ide-1 )
2323 DO j = j_start,j_end
2325 DO i = i_start,i_end
2326 lvar(i,k,j) = lvar(i,k,j) + rvar(i,k,j)
2331 END SUBROUTINE add_a2a
2333 SUBROUTINE add_a2a_ph(lvar,rvar,config_flags, &
2334 ids,ide, jds, jde, kds, kde, &
2335 ims, ime, jms, jme, kms, kme, &
2336 its, ite, jts, jte, kts, kte )
2337 !------------------------------------------------------------
2339 !------------------------------------------------------------
2340 TYPE(grid_config_rec_type), INTENT(IN) :: config_flags
2342 INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, &
2343 ims, ime, jms, jme, kms, kme, &
2344 its, ite, jts, jte, kts, kte
2346 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(IN ) ::&
2348 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(INOUT) ::&
2352 INTEGER :: i,j,k,i_start,i_end,j_start,j_end
2355 i_end = MIN(ite,ide-1)
2357 j_end = MIN(jte,jde-1)
2359 IF ( config_flags%specified .or. &
2360 config_flags%nested) i_start = MAX(ids+1,its)
2361 IF ( config_flags%specified .or. &
2362 config_flags%nested) i_end = MIN(ide-2,ite)
2363 IF ( config_flags%specified .or. &
2364 config_flags%nested) j_start = MAX(jds+1,jts)
2365 IF ( config_flags%specified .or. &
2366 config_flags%nested) j_end = MIN(jde-2,jte)
2367 IF ( config_flags%periodic_x ) i_start = its
2368 IF ( config_flags%periodic_x ) i_end = MIN( ite, ide-1 )
2370 DO j = j_start,j_end
2372 DO i = i_start,i_end
2373 lvar(i,k,j) = lvar(i,k,j) + rvar(i,k,j)
2378 END SUBROUTINE add_a2a_ph
2380 !------------------------------------------------------------
2381 SUBROUTINE add_a2c_u(lvar,rvar,config_flags, &
2382 ids,ide, jds, jde, kds, kde, &
2383 ims, ime, jms, jme, kms, kme, &
2384 its, ite, jts, jte, kts, kte )
2385 !------------------------------------------------------------
2386 !------------------------------------------------------------
2388 !------------------------------------------------------------
2390 TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags
2392 INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, &
2393 ims, ime, jms, jme, kms, kme, &
2394 its, ite, jts, jte, kts, kte
2396 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(IN ) ::&
2398 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(INOUT) ::&
2403 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,ktf
2410 j_end = MIN(jte,jde-1)
2412 IF ( config_flags%specified .or. &
2413 config_flags%nested) i_start = MAX(ids+1,its)
2414 IF ( config_flags%specified .or. &
2415 config_flags%nested) i_end = MIN(ide-1,ite)
2416 IF ( config_flags%specified .or. &
2417 config_flags%nested) j_start = MAX(jds+1,jts)
2418 IF ( config_flags%specified .or. &
2419 config_flags%nested) j_end = MIN(jde-2,jte)
2420 IF ( config_flags%periodic_x ) i_start = its
2421 IF ( config_flags%periodic_x ) i_end = ite
2423 DO j = j_start,j_end
2425 DO i = i_start,i_end
2426 lvar(i,k,j) = lvar(i,k,j) + &
2427 0.5*(rvar(i,k,j)+rvar(i-1,k,j))
2432 END SUBROUTINE add_a2c_u
2434 !------------------------------------------------------------
2435 SUBROUTINE add_a2c_v(lvar,rvar,config_flags, &
2436 ids,ide, jds, jde, kds, kde, &
2437 ims, ime, jms, jme, kms, kme, &
2438 its, ite, jts, jte, kts, kte )
2439 !------------------------------------------------------------
2440 !------------------------------------------------------------
2442 !------------------------------------------------------------
2444 TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags
2446 INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, &
2447 ims, ime, jms, jme, kms, kme, &
2448 its, ite, jts, jte, kts, kte
2450 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(IN ) ::&
2452 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(INOUT) ::&
2457 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,ktf
2462 i_end = MIN(ite,ide-1)
2466 IF ( config_flags%specified .or. &
2467 config_flags%nested) i_start = MAX(ids+1,its)
2468 IF ( config_flags%specified .or. &
2469 config_flags%nested) i_end = MIN(ide-2,ite)
2470 IF ( config_flags%specified .or. &
2471 config_flags%nested) j_start = MAX(jds+1,jts)
2472 IF ( config_flags%specified .or. &
2473 config_flags%nested) j_end = MIN(jde-1,jte)
2474 IF ( config_flags%periodic_x ) i_start = its
2475 IF ( config_flags%periodic_x ) i_end = MIN( ite, ide-1 )
2477 DO j = j_start,j_end
2479 DO i = i_start,i_end
2480 lvar(i,k,j) = lvar(i,k,j) + &
2481 0.5*(rvar(i,k,j)+rvar(i,k,j-1))
2486 END SUBROUTINE add_a2c_v
2488 !------------------------------------------------------------
2489 SUBROUTINE add_c2c_u(lvar,rvar,config_flags, &
2490 ids,ide, jds, jde, kds, kde, &
2491 ims, ime, jms, jme, kms, kme, &
2492 its, ite, jts, jte, kts, kte )
2493 !------------------------------------------------------------
2494 !------------------------------------------------------------
2496 !------------------------------------------------------------
2498 TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags
2500 INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, &
2501 ims, ime, jms, jme, kms, kme, &
2502 its, ite, jts, jte, kts, kte
2504 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(IN ) ::&
2506 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(INOUT) ::&
2511 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,ktf
2518 j_end = MIN(jte,jde-1)
2521 IF ( config_flags%specified .or. &
2522 config_flags%nested) i_start = MAX(ids+1,its)
2523 IF ( config_flags%specified .or. &
2524 config_flags%nested) i_end = MIN(ide-1,ite)
2525 IF ( config_flags%specified .or. &
2526 config_flags%nested) j_start = MAX(jds+1,jts)
2527 IF ( config_flags%specified .or. &
2528 config_flags%nested) j_end = MIN(jde-2,jte)
2530 ! write(*,'(a,6i4)') 'call c2cu, i_start, i_end, j_start, j_end=', i_start, i_end, j_start, j_end
2532 DO j = j_start,j_end
2534 DO i = i_start,i_end
2535 lvar(i,k,j) = lvar(i,k,j) + rvar(i,k,j)
2540 END SUBROUTINE add_c2c_u
2542 SUBROUTINE add_c2c_v(lvar,rvar,config_flags, &
2543 ids,ide, jds, jde, kds, kde, &
2544 ims, ime, jms, jme, kms, kme, &
2545 its, ite, jts, jte, kts, kte )
2546 !------------------------------------------------------------
2547 !------------------------------------------------------------
2549 !------------------------------------------------------------
2551 TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags
2553 INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, &
2554 ims, ime, jms, jme, kms, kme, &
2555 its, ite, jts, jte, kts, kte
2557 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(IN ) ::&
2559 REAL, DIMENSION(ims:ime,kms:kme,jms:jme),INTENT(INOUT) ::&
2564 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,ktf
2569 i_end = MIN(ite,ide-1)
2573 IF ( config_flags%specified .or. &
2574 config_flags%nested) i_start = MAX(ids+1,its)
2575 IF ( config_flags%specified .or. &
2576 config_flags%nested) i_end = MIN(ide-2,ite)
2577 IF ( config_flags%specified .or. &
2578 config_flags%nested) j_start = MAX(jds+1,jts)
2579 IF ( config_flags%specified .or. &
2580 config_flags%nested) j_end = MIN(jde-1,jte)
2582 ! write(*,'(a,6i4)') 'call c2cv, i_start, i_end, j_start, j_end=', i_start, i_end, j_start, j_end
2584 DO j = j_start,j_end
2586 DO i = i_start,i_end
2587 lvar(i,k,j) = lvar(i,k,j) + rvar(i,k,j)
2592 END SUBROUTINE add_c2c_v
2596 END MODULE module_physics_addtendc