UPP v11.0.0
Loading...
Searching...
No Matches
CALGUST.f
Go to the documentation of this file.
1
3!
19
20 SUBROUTINE calgust(LPBL,ZPBL,GUST)
21
22!
23!
24 use vrbls3d, only: uh, vh, zint, zmid
25 use vrbls2d , only: u10h, v10h, u10,v10, fis
26 use params_mod, only: d25, gi
27 use ctlblk_mod, only: jsta, jend, spval, jsta_m, jend_m, num_procs, mpi_comm_comp, lm,&
28 modelname, im, jm, jsta_2l, jend_2u, ista, iend, ista_m, iend_m, ista_2l, iend_2u
29 use gridspec_mod, only: gridtype
30
31 implicit none
32
33 include "mpif.h"
34!
35! INCLUDE ETA GRID DIMENSIONS. SET/DERIVE PARAMETERS.
36!
37! DECLARE VARIABLES.
38!
39 INTEGER,intent(in) :: LPBL(ista_2l:iend_2u,jsta_2l:jend_2u)
40 REAL,intent(in) :: ZPBL(ista_2l:iend_2u,jsta_2l:jend_2u)
41 REAL,intent(inout) :: GUST(ista_2l:iend_2u,jsta_2l:jend_2u)
42
43 integer I,J,IE,IW, L, K, ISTART, ISTOP, JSTART, JSTOP
44 integer LMIN,LXXX,IERR
45 real ZSFC,DELWIND,USFC,VSFC,SFCWIND,WIND,U0,V0,DZ
46!
47!
48!*****************************************************************************
49! START CALMXW HERE.
50!
51! LOOP OVER THE GRID.
52!
53!$omp parallel do private(i,j)
54 DO j=jsta,jend
55 DO i=ista,iend
56 gust(i,j) = spval
57 ENDDO
58 ENDDO
59
60 IF(gridtype == 'A') THEN
61 istart = ista
62 istop = iend
63 jstart = jsta
64 jstop = jend
65 ELSE
66 istart = ista_m
67 istop = iend_m
68 jstart = jsta_m
69 jstop = jend_m
70 if ( num_procs > 1 ) then
71 !CALL EXCH(U10(1,jsta_2l))
72 !CALL EXCH(V10(1,jsta_2l))
73 lmin = max(1, minval(lpbl(ista:iend,jsta:jend)))
74 CALL mpi_allreduce(lmin,lxxx,1,mpi_integer,mpi_min,mpi_comm_comp,ierr)
75 DO l=lxxx,lm
76 CALL exch(uh(1,jsta_2l,l))
77 CALL exch(vh(1,jsta_2l,l))
78 END DO
79 END IF
80 END IF
81!
82! ASSUME THAT U AND V HAVE UPDATED HALOS
83!
84!!$omp parallel do private(i,j,ie,iw,mxww,u0,v0,wind)
85 DO j=jstart,jstop
86 DO i=istart,istop
87 l=lpbl(i,j)
88 IF(gridtype == 'E') THEN
89 ie = i + mod(j+1,2)
90 iw = i + mod(j+1,2)-1
91
92 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
93
94! USFC=D25*(U10(I,J-1)+U10(IW,J)+U10(IE,J)+U10(I,J+1))
95! VSFC=D25*(V10(I,J-1)+V10(IW,J)+V10(IE,J)+V10(I,J+1))
96 usfc = u10h(i,j)
97 vsfc = v10h(i,j)
98 sfcwind = sqrt(usfc*usfc + vsfc*vsfc)
99 u0 = d25*(uh(i,j-1,l)+uh(iw,j,l)+uh(ie,j,l)+uh(i,j+1,l))
100 v0 = d25*(vh(i,j-1,l)+vh(iw,j,l)+vh(ie,j,l)+vh(i,j+1,l))
101 wind = sqrt(u0*u0 + v0*v0)
102
103 else
104 wind = spval
105 endif
106
107 ELSE IF(gridtype == 'B') THEN
108 ie = i
109 iw = i-1
110
111! USFC=D25*(U10(I,J-1)+U10(IW,J)+U10(IE,J)+U10(IW,J-1))
112! VSFC=D25*(V10(I,J-1)+V10(IW,J)+V10(IE,J)+V10(IW,J-1))
113
114 if(u10h(i,j)<spval.and.uh(iw,j-1,l)<spval) then
115
116 usfc = u10h(i,j)
117 vsfc = v10h(i,j)
118 sfcwind = sqrt(usfc*usfc + vsfc*vsfc)
119 u0 = d25*(uh(i,j-1,l)+uh(iw,j,l)+uh(ie,j,l)+uh(iw,j-1,l))
120 v0 = d25*(vh(i,j-1,l)+vh(iw,j,l)+vh(ie,j,l)+vh(iw,j-1,l))
121 wind = sqrt(u0*u0 + v0*v0)
122 else
123 wind = spval
124 endif
125 ELSE IF(gridtype == 'A') THEN
126
127 usfc = u10(i,j)
128 vsfc = v10(i,j)
129 if (usfc < spval .and. vsfc < spval) then
130 sfcwind = sqrt(usfc*usfc + vsfc*vsfc)
131 else
132 sfcwind = spval
133 endif
134 if(modelname == 'RAPR') then
135 zsfc = zint(i,j,lm+1)
136 l = lpbl(i,j)
137! in RUC do 342 k=2,k1-1, where k1 - first level above PBLH
138 gust(i,j) = sfcwind
139 do k=lm-1,l-1,-1
140
141 if(uh(i,j,l)<spval) then
142 u0 = uh(i,j,k)
143 v0 = vh(i,j,k)
144 wind = sqrt(u0*u0 + v0*v0)
145 delwind = wind - sfcwind
146 dz = zmid(i,j,k)-zsfc
147 delwind = delwind*(1.0-min(0.5,dz/2000.))
148 gust(i,j) = max(gust(i,j),sfcwind+delwind)
149 else
150 gust(i,j) = spval
151 endif
152 enddo
153 else
154 if(uh(i,j,l)<spval) then
155 u0 = uh(i,j,l)
156 v0 = vh(i,j,l)
157 wind = sqrt(u0*u0 + v0*v0 )
158 else
159 wind = spval
160 endif
161 endif ! endif RAPR
162
163 ELSE
164! print*,'unknown grid type, not computing wind gust'
165 return
166 END IF
167
168 if(modelname /= 'RAPR')then
169 if (sfcwind < spval) then
170 delwind = wind - sfcwind
171 zsfc = fis(i,j)*gi
172 delwind = delwind*(1.0-min(0.5,zpbl(i,j)/2000.))
173 gust(i,j) = sfcwind + delwind
174 else
175 gust(i,j) = wind
176 endif
177 endif
178 enddo
179 enddo
180
181! END OF ROUTINE.
182!
183 RETURN
184 END
subroutine calgust(lpbl, zpbl, gust)
This routine computes surface wind gust by mixing down momentum from the level at the height of the P...
Definition CALGUST.f:21