19 SUBROUTINE calgust(LPBL,ZPBL,GUST)
23 use vrbls3d, only: uh, vh, zint, zmid
24 use vrbls2d , only: u10h, v10h, u10,v10, fis
26 use ctlblk_mod
, only: jsta, jend, spval, jsta_m, jend_m, num_procs, mpi_comm_comp, lm,&
27 modelname, im, jm, jsta_2l, jend_2u
28 use gridspec_mod
, only: gridtype
38 INTEGER,
intent(in) :: lpbl(im,jsta_2l:jend_2u)
39 REAL,
intent(in) :: zpbl(im,jsta_2l:jend_2u)
40 REAL,
intent(inout) :: gust(im,jsta_2l:jend_2u)
42 integer i,j,ie,iw, l, k, istart, istop, jstart, jstop
43 integer lmin,lxxx,ierr
44 real zsfc,delwind,usfc,vsfc,sfcwind,wind,u0,v0,dz
59 IF(gridtype ==
'A')
THEN
69 if ( num_procs > 1 )
then
72 lmin = max(1, minval(lpbl(1:im,jsta:jend)))
73 CALL mpi_allreduce(lmin,lxxx,1,mpi_integer,mpi_min,mpi_comm_comp,ierr)
75 CALL exch(uh(1,jsta_2l,l))
76 CALL exch(vh(1,jsta_2l,l))
87 IF(gridtype ==
'E')
THEN
91 if(u10h(i,j)<spval.and.uh(i,j+1,l)<spval.and.uh(ie,j,l)<spval.and.uh(iw,j,l)<spval.and.uh(i,j-1,l)<spval)
then
97 sfcwind = sqrt(usfc*usfc + vsfc*vsfc)
98 u0 = d25*(uh(i,j-1,l)+uh(iw,j,l)+uh(ie,j,l)+uh(i,j+1,l))
99 v0 = d25*(vh(i,j-1,l)+vh(iw,j,l)+vh(ie,j,l)+vh(i,j+1,l))
100 wind = sqrt(u0*u0 + v0*v0)
106 ELSE IF(gridtype ==
'B')
THEN
113 if(u10h(i,j)<spval.and.uh(iw,j-1,l)<spval)
then
117 sfcwind = sqrt(usfc*usfc + vsfc*vsfc)
118 u0 = d25*(uh(i,j-1,l)+uh(iw,j,l)+uh(ie,j,l)+uh(iw,j-1,l))
119 v0 = d25*(vh(i,j-1,l)+vh(iw,j,l)+vh(ie,j,l)+vh(iw,j-1,l))
120 wind = sqrt(u0*u0 + v0*v0)
124 ELSE IF(gridtype ==
'A')
THEN
128 if (usfc < spval .and. vsfc < spval)
then
129 sfcwind = sqrt(usfc*usfc + vsfc*vsfc)
133 if(modelname ==
'RAPR')
then
134 zsfc = zint(i,j,lm+1)
140 if(uh(i,j,l)<spval)
then
143 wind = sqrt(u0*u0 + v0*v0)
144 delwind = wind - sfcwind
145 dz = zmid(i,j,k)-zsfc
146 delwind = delwind*(1.0-min(0.5,dz/2000.))
147 gust(i,j) = max(gust(i,j),sfcwind+delwind)
153 if(uh(i,j,l)<spval)
then
156 wind = sqrt(u0*u0 + v0*v0 )
167 if(modelname /=
'RAPR')
then
168 if (sfcwind < spval)
then
169 delwind = wind - sfcwind
171 delwind = delwind*(1.0-min(0.5,zpbl(i,j)/2000.))
172 gust(i,j) = sfcwind + delwind