UPP (develop)
Loading...
Searching...
No Matches
CALDRG.f
Go to the documentation of this file.
1
3!
21 SUBROUTINE caldrg(DRAGCO)
22
23!
24!
25 use vrbls3d, only: uh, vh
26 use vrbls2d, only: uz0, vz0, ustar, u10, v10
27 use masks, only: lmh
28 use params_mod, only: d00, d50, d25
29 use ctlblk_mod, only: jsta, jend, jsta_m, jend_m, modelname, spval, im, jm, &
30 jsta_2l, jend_2u, ista, iend, ista_m, iend_m, ista_2l, iend_2u
31 use gridspec_mod, only: gridtype
32!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33 implicit none
34!
35! INCLUDE/SET PARAMETERS.
36!
37! DECLARE VARIABLES.
38 REAL,intent(inout) :: DRAGCO(ista_2l:iend_2u,jsta_2l:jend_2u)
39 INTEGER IHE(JM),IHW(JM)
40 integer I,J,LHMK,IE,IW,LMHK
41 real UBAR,VBAR,WSPDSQ,USTRSQ,SUMU,SUMV,ULMH,VLMH,UZ0H,VZ0H
42!
43!********************************************************************
44! START CALDRG HERE.
45!
46! INITIALIZE DRAG COEFFICIENT ARRAY TO ZERO.
47!
48!$omp parallel do private(i,j)
49 DO j=jsta,jend
50 DO i=ista,iend
51! DRAGCO(I,J) = D00
52 dragco(i,j) = 0.0
53
54 ENDDO
55 ENDDO
56!
57
58 IF(gridtype=='A')THEN
59 DO j=jsta,jend
60 DO i=ista,iend
61!
62
63 IF (ustar(i,j) /= spval) THEN
64
65! LMHK=NINT(LMH(I,J))
66!
67! COMPUTE A MEAN MASS POINT WIND SPEED BETWEEN THE
68! FIRST ATMOSPHERIC ETA LAYER AND Z0. ACCORDING TO
69! NETCDF OUTPUT, UZ0 AND VZ0 ARE AT MASS POINTS. (MEB 6/11/02)
70!
71! UBAR=D50*(UH(I,J,LMHK)+UZ0(I,J))
72! VBAR=D50*(VH(I,J,LMHK)+VZ0(I,J))
73! WSPDSQ=UBAR*UBAR+VBAR*VBAR
74
75! dong use 10m wind
76 wspdsq=u10(i,j)*u10(i,j)+v10(i,j)*v10(i,j)
77!
78! COMPUTE A DRAG COEFFICIENT.
79!
80 ustrsq=ustar(i,j)*ustar(i,j)
81 IF(wspdsq > 1.0) dragco(i,j)=ustrsq/wspdsq
82
83 END IF
84 ENDDO
85 ENDDO
86 ELSE IF(gridtype=='E')THEN
87
88 DO j=jsta_m,jend_m
89 ihe(j)=mod(j+1,2)
90 ihw(j)=ihe(j)-1
91 ENDDO
92
93 DO j=jsta_m,jend_m
94 DO i=ista_m,iend_m
95!
96! COMPUTE A MEAN MASS POINT WIND IN THE
97! FIRST ATMOSPHERIC ETA LAYER.
98!
99 lmhk=nint(lmh(i,j))
100 ie=i+ihe(j)
101 iw=i+ihw(j)
102 sumu=uh(ie,j,lmhk)+uh(iw,j,lmhk)+uh(i,j-1,lmhk) &
103 +uh(i,j+1,lmhk)
104 sumv=vh(ie,j,lmhk)+vh(iw,j,lmhk)+vh(i,j-1,lmhk) &
105 +vh(i,j+1,lmhk)
106 ulmh=d25*sumu
107 vlmh=d25*sumv
108!
109! COMPUTE A MEAN MASS POINT WIND AT HEIGHT Z0.
110!
111 uz0h=d25*(uz0(ie,j)+uz0(iw,j)+uz0(i,j-1)+uz0(i,j+1))
112 vz0h=d25*(vz0(ie,j)+vz0(iw,j)+vz0(i,j-1)+vz0(i,j+1))
113!
114! COMPUTE A MEAN MASS POINT WIND SPEED BETWEEN THE
115! FIRST ATMOSPHERIC ETA LAYER AND Z0.
116!
117 ubar=d50*(ulmh+uz0h)
118 vbar=d50*(vlmh+vz0h)
119 wspdsq=ubar*ubar+vbar*vbar
120!jjt WSPDSQ=MIN(WSPDSQ,0.1)
121!
122! COMPUTE A DRAG COEFFICIENT.
123!
124 ustrsq=ustar(i,j)*ustar(i,j)
125 IF(wspdsq > 1.0e-6)dragco(i,j)=ustrsq/wspdsq
126!
127 END DO
128 END DO
129 ELSE IF(gridtype=='B')THEN
130 DO j=jsta_m,jend_m
131 DO i=ista_m,iend_m
132!
133! COMPUTE A MEAN MASS POINT WIND IN THE
134! FIRST ATMOSPHERIC ETA LAYER.
135!
136 lmhk=nint(lmh(i,j))
137 ie=i
138 iw=i-1
139 sumu=uh(ie,j,lmhk)+uh(iw,j,lmhk)+uh(i,j-1,lmhk) &
140 +uh(iw,j-1,lmhk)
141 sumv=vh(ie,j,lmhk)+vh(iw,j,lmhk)+vh(i,j-1,lmhk) &
142 +vh(iw,j-1,lmhk)
143 ulmh=d25*sumu
144 vlmh=d25*sumv
145!
146! COMPUTE A MEAN MASS POINT WIND AT HEIGHT Z0.
147!
148! NEMS-NMMB is now putting uz0 and vz0 on mass points to save double interpolation time in
149! the model
150 IF(modelname == 'NMM')THEN
151 uz0h=uz0(i,j)
152 vz0h=vz0(i,j)
153 ELSE
154 uz0h=d25*(uz0(ie,j)+uz0(iw,j)+uz0(i,j-1)+uz0(iw,j-1))
155 vz0h=d25*(vz0(ie,j)+vz0(iw,j)+vz0(i,j-1)+vz0(iw,j-1))
156 END IF
157!
158! COMPUTE A MEAN MASS POINT WIND SPEED BETWEEN THE
159! FIRST ATMOSPHERIC ETA LAYER AND Z0.
160!
161 ubar=d50*(ulmh+uz0h)
162 vbar=d50*(vlmh+vz0h)
163 wspdsq=ubar*ubar+vbar*vbar
164!jjt WSPDSQ=MIN(WSPDSQ,0.1)
165!
166! COMPUTE A DRAG COEFFICIENT.
167!
168 ustrsq=ustar(i,j)*ustar(i,j)
169 IF(wspdsq > 1.0e-6)dragco(i,j)=ustrsq/wspdsq
170!
171 END DO
172 END DO
173 ELSE
174
175!$omp parallel do private(i,j)
176 DO j=jsta,jend
177 DO i=ista,iend
178 dragco(i,j) = spval
179 ENDDO
180 ENDDO
181
182 END IF
183!
184! END OF ROUTINE.
185!
186 RETURN
187 END
subroutine caldrg(dragco)
This rountine computes a surface layer drag coefficient using equation (7.4.1A) in ["An introduction ...
Definition CALDRG.f:22