33 SUBROUTINE calmcvg(Q1D,U1D,V1D,QCNVG)
38 use masks, only: dx, dy, hbm2
40 use ctlblk_mod
, only: jsta_2l, jend_2u, spval, jsta_m, jend_m, &
41 jsta_m2, jend_m2, im, jm
42 use gridspec_mod
, only: gridtype
48 REAL,
dimension(IM,jsta_2l:jend_2u),
intent(in) :: q1d, u1d, v1d
49 REAL,
dimension(IM,jsta_2l:jend_2u),
intent(inout) :: qcnvg
52 REAL,
dimension(im,jsta_2l:jend_2u) :: uwnd, vwnd, qv
53 INTEGER ihe(jm),ihw(jm),ive(jm),ivw(jm)
66 IF(u1d(i,j)<spval)
THEN
73 IF (uwnd(i,j) == spval) uwnd(i,j) = d00
74 IF (vwnd(i,j) == spval) vwnd(i,j) = d00
81 IF(gridtype ==
'A')
THEN
85 IF(q1d(i,j+1)<spval.AND.q1d(i,j-1)<spval.AND. &
86 q1d(i+1,j)<spval.AND.q1d(i-1,j)<spval.AND. &
88 r2dx = 1./(2.*dx(i,j))
89 r2dy = 1./(2.*dy(i,j))
90 qudx = (q1d(i+1,j)*uwnd(i+1,j)-q1d(i-1,j)*uwnd(i-1,j))*r2dx
91 qvdy = (q1d(i,j+1)*vwnd(i,j+1)-q1d(i,j-1)*vwnd(i,j-1))*r2dy
92 qcnvg(i,j) = -(qudx + qvdy)
98 ELSE IF(gridtype ==
'E')
THEN
112 IF(q1d(i,j-1)<spval.AND.q1d(i+ivw(j),j)<spval.AND.&
113 q1d(i+ive(j),j)<spval.AND.q1d(i,j+1)<spval)
THEN
114 qv(i,j) = d25*(q1d(i,j-1)+q1d(i+ivw(j),j) &
115 +q1d(i+ive(j),j)+q1d(i,j+1))
130 IF(qv(i+ihe(j),j)<spval.AND.uwnd(i+ihe(j),j)<spval.AND.&
131 qv(i+ihw(j),j)<spval.AND.uwnd(i+ihw(j),j)<spval.AND.&
132 qv(i,j)<spval.AND.qv(i,j-1)<spval.AND.qv(i,j+1)<spval)
THEN
133 r2dx = 1./(2.*dx(i,j))
134 r2dy = 1./(2.*dy(i,j))
135 qudx = (qv(i+ihe(j),j)*uwnd(i+ihe(j),j) &
136 -qv(i+ihw(j),j)*uwnd(i+ihw(j),j))*r2dx
137 qvdy = (qv(i,j+1)*vwnd(i,j+1)-qv(i,j-1)*vwnd(i,j-1))*r2dy
139 qcnvg(i,j) = -(qudx + qvdy) * hbm2(i,j)
145 ELSE IF(gridtype==
'B')
THEN
152 IF(uwnd(i,j)<spval.AND.uwnd(i,j-1)<spval.AND.&
153 uwnd(i-1,j)<spval.AND.uwnd(i-1,j-1)<spval.AND.&
154 q1d(i,j)<spval.AND.q1d(i+1,j)<spval.AND.q1d(i-1,j)<spval.AND.&
155 vwnd(i,j)<spval.AND.vwnd(i-1,j)<spval.AND.&
156 vwnd(i,j-1)<spval.AND.vwnd(i-1,j-1)<spval.AND.&
157 q1d(i,j+1)<spval.AND.q1d(i,j-1)<spval)
THEN
160 qudx=(0.5*(uwnd(i,j)+uwnd(i,j-1))*0.5*(q1d(i,j)+q1d(i+1,j)) &
161 -0.5*(uwnd(i-1,j)+uwnd(i-1,j-1))*0.5*(q1d(i,j)+q1d(i-1,j)))*r2dx
162 qvdy=(0.5*(vwnd(i,j)+vwnd(i-1,j))*0.5*(q1d(i,j)+q1d(i,j+1)) &
163 -0.5*(vwnd(i,j-1)+vwnd(i-1,j-1))*0.5*(q1d(i,j)+q1d(i,j-1)))*r2dy
165 qcnvg(i,j) = -(qudx + qvdy)