1 !WRF:MODEL_LAYER:DYNAMICS
3 MODULE module_avgflx_em
6 USE module_model_constants
11 !-------------------------------------------------------------------------------
14 subroutine zero_avgflx(avgflx_rum,avgflx_rvm,avgflx_wwm, &
15 & ids, ide, jds, jde, kds, kde, &
16 & ims, ime, jms, jme, kms, kme, &
17 & its, ite, jts, jte, kts, kte, do_cu, &
18 & avgflx_cfu1,avgflx_cfd1,avgflx_dfu1,avgflx_efu1,avgflx_dfd1,avgflx_efd1 )
22 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
23 ims, ime, jms, jme, kms, kme, &
24 its, ite, jts, jte, kts, kte
26 LOGICAL, INTENT(IN) :: do_cu
28 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
29 avgflx_rum,avgflx_rvm,avgflx_wwm
31 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
32 avgflx_cfu1,avgflx_cfd1,avgflx_dfu1,avgflx_efu1,avgflx_dfd1,avgflx_efd1
39 avgflx_rum(i,k,j) = 0.
40 avgflx_rvm(i,k,j) = 0.
41 avgflx_wwm(i,k,j) = 0.
47 & present(avgflx_cfu1) .and. present(avgflx_cfd1) .and. present(avgflx_dfu1) &
48 & .and. present(avgflx_efu1) .and. present(avgflx_dfd1) .and. present(avgflx_efd1) ) then
52 avgflx_cfu1(i,k,j) = 0.
53 avgflx_cfd1(i,k,j) = 0.
54 avgflx_dfu1(i,k,j) = 0.
55 avgflx_efu1(i,k,j) = 0.
56 avgflx_dfd1(i,k,j) = 0.
57 avgflx_efd1(i,k,j) = 0.
64 end subroutine zero_avgflx
66 subroutine upd_avgflx(avgflx_count,avgflx_rum,avgflx_rvm,avgflx_wwm, &
68 & ids, ide, jds, jde, kds, kde, &
69 & ims, ime, jms, jme, kms, kme, &
70 & its, ite, jts, jte, kts, kte, do_cu, &
71 & cfu1,cfd1,dfu1,efu1,dfd1,efd1, &
72 & avgflx_cfu1,avgflx_cfd1,avgflx_dfu1,avgflx_efu1,avgflx_dfd1,avgflx_efd1 )
76 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
77 ims, ime, jms, jme, kms, kme, &
78 its, ite, jts, jte, kts, kte
80 INTEGER , INTENT(IN) :: avgflx_count
81 LOGICAL, INTENT(IN) :: do_cu
82 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) , INTENT(IN) :: ru_m, &
86 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
87 avgflx_rum,avgflx_rvm,avgflx_wwm
89 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(IN) :: &
90 cfu1,cfd1,dfu1,efu1,dfd1,efd1
91 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
92 avgflx_cfu1,avgflx_cfd1,avgflx_dfu1,avgflx_efu1,avgflx_dfd1,avgflx_efd1
97 local_count = real(avgflx_count)
101 avgflx_rum(i,k,j) = (local_count*avgflx_rum(i,k,j) + ru_m(i,k,j))/(local_count+1.)
102 avgflx_rvm(i,k,j) = (local_count*avgflx_rvm(i,k,j) + rv_m(i,k,j))/(local_count+1.)
103 avgflx_wwm(i,k,j) = (local_count*avgflx_wwm(i,k,j) + ww_m(i,k,j))/(local_count+1.)
109 & present(avgflx_cfu1) .and. present(avgflx_cfd1) .and. present(avgflx_dfu1) &
110 & .and. present(avgflx_efu1) .and. present(avgflx_dfd1) .and. present(avgflx_efd1) &
111 & .and. present(cfu1) .and. present(cfd1) .and. present(dfu1) &
112 & .and. present(efu1) .and. present(dfd1) .and. present(efd1) ) then
116 avgflx_cfu1(i,k,j) = (local_count*avgflx_cfu1(i,k,j) + &
117 & cfu1(i,k,j)) / (local_count+1.)
118 avgflx_cfd1(i,k,j) = (local_count*avgflx_cfd1(i,k,j) + &
119 & cfd1(i,k,j)) / (local_count+1.)
120 avgflx_dfu1(i,k,j) = (local_count*avgflx_dfu1(i,k,j) + &
121 & dfu1(i,k,j)) / (local_count+1.)
122 avgflx_efu1(i,k,j) = (local_count*avgflx_efu1(i,k,j) + &
123 & efu1(i,k,j)) / (local_count+1.)
124 avgflx_dfd1(i,k,j) = (local_count*avgflx_dfd1(i,k,j) + &
125 & dfd1(i,k,j)) / (local_count+1.)
126 avgflx_efd1(i,k,j) = (local_count*avgflx_efd1(i,k,j) + &
127 & efd1(i,k,j)) / (local_count+1.)
134 end subroutine upd_avgflx
135 end MODULE module_avgflx_em