1 | SUBROUTINE vdif_cd(ngrid,nlay,pz0, |
---|
2 | & pg,pz,pu,pv,wstar,pts,ph,pcdv,pcdh) |
---|
3 | USE comcstfi_h |
---|
4 | use turb_mod, only: turb_resolved |
---|
5 | IMPLICIT NONE |
---|
6 | c======================================================================= |
---|
7 | c |
---|
8 | c Subject: computation of the surface drag coefficient using the |
---|
9 | c ------- approch developed by Loui for ECMWF. |
---|
10 | c |
---|
11 | c Author: Frederic Hourdin 15 /10 /93 |
---|
12 | c Modified by : Arnaud Colaitis 03/08/11 |
---|
13 | c ------- |
---|
14 | c |
---|
15 | c Arguments: |
---|
16 | c ---------- |
---|
17 | c |
---|
18 | c inputs: |
---|
19 | c ------ |
---|
20 | c ngrid size of the horizontal grid |
---|
21 | c pg gravity (m s -2) |
---|
22 | c pz(ngrid,nlay) height of layers |
---|
23 | c pu(ngrid,nlay) u component of the wind |
---|
24 | c pv(ngrid,nlay) v component of the wind |
---|
25 | c pts(ngrid) surface temperature |
---|
26 | c ph(ngrid) potential temperature T*(p/ps)^kappa |
---|
27 | c |
---|
28 | c outputs: |
---|
29 | c -------- |
---|
30 | c pcdv(ngrid) Cd for the wind |
---|
31 | c pcdh(ngrid) Cd for potential temperature |
---|
32 | c |
---|
33 | c======================================================================= |
---|
34 | c |
---|
35 | c----------------------------------------------------------------------- |
---|
36 | c Declarations: |
---|
37 | c ------------- |
---|
38 | |
---|
39 | #include "callkeys.h" |
---|
40 | |
---|
41 | c Arguments: |
---|
42 | c ---------- |
---|
43 | |
---|
44 | INTEGER, INTENT(IN) :: ngrid,nlay |
---|
45 | REAL, INTENT(IN) :: pz0(ngrid) |
---|
46 | REAL, INTENT(IN) :: pg,pz(ngrid,nlay) |
---|
47 | REAL, INTENT(IN) :: pu(ngrid,nlay),pv(ngrid,nlay) |
---|
48 | REAL, INTENT(IN) :: pts(ngrid),ph(ngrid,nlay) |
---|
49 | REAL, INTENT(IN) :: wstar(ngrid) |
---|
50 | REAL, INTENT(OUT) :: pcdv(ngrid),pcdh(ngrid) ! momentum and heat drag coefficient |
---|
51 | |
---|
52 | c Local: |
---|
53 | c ------ |
---|
54 | |
---|
55 | INTEGER ig |
---|
56 | |
---|
57 | REAL karman,nu ! Von Karman constant and fluid kinematic viscosity |
---|
58 | |
---|
59 | LOGICAL firstcal |
---|
60 | DATA karman,nu/.41,0.001/ |
---|
61 | DATA firstcal/.true./ |
---|
62 | SAVE karman,nu |
---|
63 | |
---|
64 | !$OMP THREADPRIVATE(karman,nu) |
---|
65 | |
---|
66 | c Local(2): |
---|
67 | c --------- |
---|
68 | REAL z1,zcd0 |
---|
69 | |
---|
70 | REAL rib(ngrid) ! Bulk Richardson number |
---|
71 | REAL rig(ngrid) ! Gradient Richardson number |
---|
72 | REAL fm(ngrid) ! stability function for momentum |
---|
73 | REAL fh(ngrid) ! stability function for heat |
---|
74 | REAL z1z0,z1z0t ! ratios z1/z0 and z1/z0T |
---|
75 | |
---|
76 | c phim = 1+betam*zeta or (1-bm*zeta)**am |
---|
77 | c phih = alphah + betah*zeta or alphah(1.-bh*zeta)**ah |
---|
78 | REAL betam, betah, alphah, bm, bh, lambda |
---|
79 | c ah and am are assumed to be -0.25 and -0.5 respectively |
---|
80 | |
---|
81 | REAL cdn(ngrid),chn(ngrid) ! neutral momentum and heat drag coefficient |
---|
82 | REAL pz0t ! initial thermal roughness length. (local) |
---|
83 | REAL ric ! critical richardson number |
---|
84 | REAL reynolds(ngrid) ! reynolds number for UBL |
---|
85 | REAL prandtl(ngrid) ! prandtl number for UBL |
---|
86 | REAL pz0tcomp(ngrid) ! computed z0t |
---|
87 | REAL ite |
---|
88 | REAL residual |
---|
89 | REAL zu2(ngrid) |
---|
90 | c----------------------------------------------------------------------- |
---|
91 | c couche de surface: |
---|
92 | c ------------------ |
---|
93 | |
---|
94 | c Original formulation : |
---|
95 | |
---|
96 | if(.not.callrichsl) then |
---|
97 | |
---|
98 | DO ig=1,ngrid |
---|
99 | z1=1.E+0 + pz(ig,1)/pz0(ig) |
---|
100 | zcd0=karman/log(z1) |
---|
101 | zcd0=zcd0*zcd0 |
---|
102 | pcdv(ig)=zcd0 |
---|
103 | pcdh(ig)=zcd0 |
---|
104 | ENDDO |
---|
105 | |
---|
106 | ! print*,'old : cd,ch; ',pcdv,pcdh |
---|
107 | else |
---|
108 | |
---|
109 | reynolds(:)=0. |
---|
110 | |
---|
111 | c New formulation (AC) : |
---|
112 | |
---|
113 | c phim = 1+betam*zeta or (1-bm*zeta)**am |
---|
114 | c phih = alphah + betah*zeta or alphah(1.-bh*zeta)**ah |
---|
115 | c am=-0.25, ah=-0.5 |
---|
116 | |
---|
117 | pz0t = 0. ! for the sake of simplicity |
---|
118 | pz0tcomp(:) = 0.1*pz0(:) |
---|
119 | rib(:)=0. |
---|
120 | |
---|
121 | pcdv(:)=0. |
---|
122 | pcdh(:)=0. |
---|
123 | |
---|
124 | c this formulation assumes alphah=1., implying betah=betam |
---|
125 | c We use Dyer et al. parameters, as they cover a broad range of Richardson numbers : |
---|
126 | bm=16. !UBL |
---|
127 | bh=16. !UBL |
---|
128 | alphah=1. |
---|
129 | betam=5. !SBL |
---|
130 | betah=5. !SBL |
---|
131 | lambda=(sqrt(bh/bm))/alphah |
---|
132 | ric=betah/(betam**2) |
---|
133 | |
---|
134 | DO ig=1,ngrid |
---|
135 | |
---|
136 | ite=0. |
---|
137 | residual=abs(pz0tcomp(ig)-pz0t) |
---|
138 | |
---|
139 | do while((residual .gt. 0.01*pz0(ig)) .and. (ite .lt. 10.)) |
---|
140 | |
---|
141 | pz0t=pz0tcomp(ig) |
---|
142 | |
---|
143 | if ((pu(ig,1) .ne. 0.) .or. (pv(ig,1) .ne. 0.)) then |
---|
144 | |
---|
145 | c Classical Richardson number formulation |
---|
146 | |
---|
147 | c rib(ig) = (pg/ph(ig,1))*pz(ig,1)*(ph(ig,1)-pts(ig)) |
---|
148 | c & /(pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1)) |
---|
149 | |
---|
150 | c Richardson number formulation proposed by D.E. England et al. (1995) |
---|
151 | |
---|
152 | ! zu2=MAX(pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1),0.25*wstar(ig)**2) |
---|
153 | ! zu2=pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) |
---|
154 | ! zu2(ig)=MAX(pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1), & |
---|
155 | ! & (0.3*wstar(ig))**2) |
---|
156 | zu2(ig)=pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) |
---|
157 | & + (log(1.+0.7*wstar(ig) + 2.3*wstar(ig)**2))**2 |
---|
158 | if(turb_resolved) then |
---|
159 | zu2(ig)=MAX(zu2(ig),1.) |
---|
160 | endif |
---|
161 | ! zu2(ig)=pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) + (0.5*wstar(ig))**2 |
---|
162 | |
---|
163 | ! we add the wstar to simulate |
---|
164 | ! bulk Ri changes due to subgrid wind feeding the thermals |
---|
165 | |
---|
166 | ! rig(ig) = (pg/ph(ig,1))*((pz(ig,1)-pz0(ig))**2 |
---|
167 | ! & /(pz(ig,1)-pz0t))*(ph(ig,1)-pts(ig)) |
---|
168 | ! & /zu2 |
---|
169 | |
---|
170 | rib(ig) = (pg/pts(ig)) |
---|
171 | ! & *pz(ig,1)*pz0(ig)/sqrt(pz(ig,1)*pz0t) |
---|
172 | & *sqrt(pz(ig,1)*pz0(ig)) |
---|
173 | & *(((log(pz(ig,1)/pz0(ig)))**2)/(log(pz(ig,1)/pz0t))) |
---|
174 | & *(ph(ig,1)-pts(ig)) |
---|
175 | & /zu2(ig) |
---|
176 | |
---|
177 | else |
---|
178 | print*,'warning, infinite Richardson at surface' |
---|
179 | print*,pu(ig,1),pv(ig,1) |
---|
180 | rib(ig) = ric ! traiter ce cas ! |
---|
181 | endif |
---|
182 | |
---|
183 | z1z0=pz(ig,1)/pz0(ig) |
---|
184 | z1z0t=pz(ig,1)/pz0t |
---|
185 | |
---|
186 | cdn(ig)=karman/log(z1z0) |
---|
187 | cdn(ig)=cdn(ig)*cdn(ig) |
---|
188 | chn(ig)=cdn(ig)*log(z1z0)/log(z1z0t) |
---|
189 | |
---|
190 | c Stable case : |
---|
191 | if (rib(ig) .gt. 0.) then |
---|
192 | c From D.E. England et al. (95) |
---|
193 | prandtl(ig)=1. |
---|
194 | if(rib(ig) .lt. ric) then |
---|
195 | c Assuming alphah=1. and bh=bm for stable conditions : |
---|
196 | fm(ig)=((ric-rib(ig))/ric)**2 |
---|
197 | fh(ig)=((ric-rib(ig))/ric)**2 |
---|
198 | else |
---|
199 | c For Ri>Ric, we consider Ri->Infinity => no turbulent mixing at surface |
---|
200 | ! fm(ig)=0. |
---|
201 | ! fh(ig)=0. |
---|
202 | fm(ig)=1. |
---|
203 | fh(ig)=1. |
---|
204 | endif |
---|
205 | c Unstable case : |
---|
206 | else |
---|
207 | c From D.E. England et al. (95) |
---|
208 | fm(ig)=sqrt(1.-lambda*bm*rib(ig)) |
---|
209 | fh(ig)=(1./alphah)*((1.-lambda*bh*rib(ig))**0.5)* |
---|
210 | & (1.-lambda*bm*rib(ig))**0.25 |
---|
211 | prandtl(ig)=alphah*((1.-lambda*bm*rib(ig))**0.25)/ |
---|
212 | & ((1.-lambda*bh*rib(ig))**0.5) |
---|
213 | endif |
---|
214 | |
---|
215 | reynolds(ig)=karman*sqrt(fm(ig)) |
---|
216 | & *sqrt(zu2(ig)) |
---|
217 | c & *sqrt(pu(ig,1)**2 + pv(ig,1)**2) |
---|
218 | & *pz0(ig)/(log(z1z0)*nu) |
---|
219 | pz0tcomp(ig)=pz0(ig)*exp(-karman*7.3* |
---|
220 | & (reynolds(ig)**0.25)*(prandtl(ig)**0.5)) |
---|
221 | |
---|
222 | |
---|
223 | residual = abs(pz0t-pz0tcomp(ig)) |
---|
224 | ite = ite+1 |
---|
225 | ! print*, "iteration nnumber, residual",ite,residual |
---|
226 | |
---|
227 | enddo ! of while |
---|
228 | |
---|
229 | pz0t=0. |
---|
230 | |
---|
231 | c Drag computation : |
---|
232 | |
---|
233 | pcdv(ig)=cdn(ig)*fm(ig) |
---|
234 | pcdh(ig)=chn(ig)*fh(ig) |
---|
235 | |
---|
236 | ENDDO |
---|
237 | ! |
---|
238 | ! print*,'new : cd,ch; ',pcdv,pcdh |
---|
239 | |
---|
240 | ! Some useful diagnostics : |
---|
241 | |
---|
242 | ! call WRITEDIAGFI(ngrid,'RiB', |
---|
243 | ! & 'Bulk Richardson nb','no units', |
---|
244 | ! & 2,rib) |
---|
245 | ! call WRITEDIAGFI(ngrid,'RiG', |
---|
246 | ! & 'Grad Richardson nb','no units', |
---|
247 | ! & 2,rig) |
---|
248 | ! call WRITEDIAGFI(ngrid,'Pr', |
---|
249 | ! & 'Prandtl nb','no units', |
---|
250 | ! & 0,prandtl) |
---|
251 | ! call WRITEDIAGFI(ngrid,'Re', |
---|
252 | ! & 'Reynolds nb','no units', |
---|
253 | ! & 0,reynolds) |
---|
254 | ! call WRITEDIAGFI(ngrid,'z0tcomp', |
---|
255 | ! & 'computed z0t','m', |
---|
256 | ! & 2,pz0tcomp) |
---|
257 | |
---|
258 | |
---|
259 | endif !of if call richardson surface layer |
---|
260 | |
---|
261 | RETURN |
---|
262 | END |
---|