1 | MODULE sbcblk_algo_ncar |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE sbcblk_algo_ncar *** |
---|
4 | !! Computes: |
---|
5 | !! * bulk transfer coefficients C_D, C_E and C_H |
---|
6 | !! * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed |
---|
7 | !! * the effective bulk wind speed at 10m U_blk |
---|
8 | !! => all these are used in bulk formulas in sbcblk.F90 |
---|
9 | !! |
---|
10 | !! Using the bulk formulation/param. of Large & Yeager 2008 |
---|
11 | !! |
---|
12 | !! Routine turb_ncar maintained and developed in AeroBulk |
---|
13 | !! (https://github.com/brodeau/aerobulk/) |
---|
14 | !! |
---|
15 | !! L. Brodeau, 2015 |
---|
16 | !!===================================================================== |
---|
17 | !! History : 3.6 ! 2016-02 (L.Brodeau) successor of old turb_ncar of former sbcblk_core.F90 |
---|
18 | !!---------------------------------------------------------------------- |
---|
19 | |
---|
20 | !!---------------------------------------------------------------------- |
---|
21 | !! turb_ncar : computes the bulk turbulent transfer coefficients |
---|
22 | !! adjusts t_air and q_air from zt to zu m |
---|
23 | !! returns the effective bulk wind speed at 10m |
---|
24 | !!---------------------------------------------------------------------- |
---|
25 | USE oce ! ocean dynamics and tracers |
---|
26 | USE dom_oce ! ocean space and time domain |
---|
27 | USE phycst ! physical constants |
---|
28 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
29 | USE sbcwave, ONLY : cdn_wave ! wave module |
---|
30 | #if defined key_si3 || defined key_cice |
---|
31 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
32 | #endif |
---|
33 | ! |
---|
34 | USE iom ! I/O manager library |
---|
35 | USE lib_mpp ! distribued memory computing library |
---|
36 | USE in_out_manager ! I/O manager |
---|
37 | USE prtctl ! Print control |
---|
38 | USE lib_fortran ! to use key_nosignedzero |
---|
39 | |
---|
40 | USE sbcblk_phy !LB: all thermodynamics functions, rho_air, q_sat, etc... #LB |
---|
41 | |
---|
42 | IMPLICIT NONE |
---|
43 | PRIVATE |
---|
44 | |
---|
45 | PUBLIC :: TURB_NCAR ! called by sbcblk.F90 |
---|
46 | |
---|
47 | !!---------------------------------------------------------------------- |
---|
48 | CONTAINS |
---|
49 | |
---|
50 | SUBROUTINE turb_ncar( zt, zu, sst, t_zt, ssq, q_zt, U_zu, & |
---|
51 | & Cd, Ch, Ce, t_zu, q_zu, U_blk, & |
---|
52 | & Cdn, Chn, Cen ) |
---|
53 | !!---------------------------------------------------------------------------------- |
---|
54 | !! *** ROUTINE turb_ncar *** |
---|
55 | !! |
---|
56 | !! ** Purpose : Computes turbulent transfert coefficients of surface |
---|
57 | !! fluxes according to Large & Yeager (2004) and Large & Yeager (2008) |
---|
58 | !! If relevant (zt /= zu), adjust temperature and humidity from height zt to zu |
---|
59 | !! Returns the effective bulk wind speed at 10m to be used in the bulk formulas |
---|
60 | !! |
---|
61 | !! ** Method : Monin Obukhov Similarity Theory |
---|
62 | !! + Large & Yeager (2004,2008) closure: CD_n10 = f(U_n10) |
---|
63 | !! |
---|
64 | !! ** References : Large & Yeager, 2004 / Large & Yeager, 2008 |
---|
65 | !! |
---|
66 | !! ** Last update: Laurent Brodeau, June 2014: |
---|
67 | !! - handles both cases zt=zu and zt/=zu |
---|
68 | !! - optimized: less 2D arrays allocated and less operations |
---|
69 | !! - better first guess of stability by checking air-sea difference of virtual temperature |
---|
70 | !! rather than temperature difference only... |
---|
71 | !! - added function "cd_neutral_10m" that uses the improved parametrization of |
---|
72 | !! Large & Yeager 2008. Drag-coefficient reduction for Cyclone conditions! |
---|
73 | !! - using code-wide physical constants defined into "phycst.mod" rather than redifining them |
---|
74 | !! => 'vkarmn' and 'grav' |
---|
75 | !! |
---|
76 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/) |
---|
77 | !! |
---|
78 | !! INPUT : |
---|
79 | !! ------- |
---|
80 | !! * zt : height for temperature and spec. hum. of air [m] |
---|
81 | !! * zu : height for wind speed (generally 10m) [m] |
---|
82 | !! * U_zu : scalar wind speed at 10m [m/s] |
---|
83 | !! * sst : SST [K] |
---|
84 | !! * t_zt : potential air temperature at zt [K] |
---|
85 | !! * ssq : specific humidity at saturation at SST [kg/kg] |
---|
86 | !! * q_zt : specific humidity of air at zt [kg/kg] |
---|
87 | !! |
---|
88 | !! |
---|
89 | !! OUTPUT : |
---|
90 | !! -------- |
---|
91 | !! * Cd : drag coefficient |
---|
92 | !! * Ch : sensible heat coefficient |
---|
93 | !! * Ce : evaporation coefficient |
---|
94 | !! * t_zu : pot. air temperature adjusted at wind height zu [K] |
---|
95 | !! * q_zu : specific humidity of air // [kg/kg] |
---|
96 | !! * U_blk : bulk wind speed at 10m [m/s] |
---|
97 | !!---------------------------------------------------------------------------------- |
---|
98 | REAL(wp), INTENT(in ) :: zt ! height for t_zt and q_zt [m] |
---|
99 | REAL(wp), INTENT(in ) :: zu ! height for U_zu [m] |
---|
100 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: sst ! sea surface temperature [Kelvin] |
---|
101 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: t_zt ! potential air temperature [Kelvin] |
---|
102 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: ssq ! sea surface specific humidity [kg/kg] |
---|
103 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt ! specific air humidity [kg/kg] |
---|
104 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: U_zu ! relative wind module at zu [m/s] |
---|
105 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Cd ! transfer coefficient for momentum (tau) |
---|
106 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ch ! transfer coefficient for sensible heat (Q_sens) |
---|
107 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ce ! transfert coefficient for evaporation (Q_lat) |
---|
108 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: t_zu ! pot. air temp. adjusted at zu [K] |
---|
109 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: q_zu ! spec. humidity adjusted at zu [kg/kg] |
---|
110 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: U_blk ! bulk wind at 10m [m/s] |
---|
111 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Cdn, Chn, Cen ! neutral transfer coefficients |
---|
112 | ! |
---|
113 | INTEGER :: j_itt |
---|
114 | LOGICAL :: l_zt_equal_zu = .FALSE. ! if q and t are given at same height as U |
---|
115 | INTEGER , PARAMETER :: nb_itt = 4 ! number of itterations |
---|
116 | ! |
---|
117 | REAL(wp), DIMENSION(jpi,jpj) :: Cx_n10 ! 10m neutral latent/sensible coefficient |
---|
118 | REAL(wp), DIMENSION(jpi,jpj) :: sqrt_Cd_n10 ! root square of Cd_n10 |
---|
119 | REAL(wp), DIMENSION(jpi,jpj) :: zeta_u ! stability parameter at height zu |
---|
120 | REAL(wp), DIMENSION(jpi,jpj) :: zpsi_h_u |
---|
121 | REAL(wp), DIMENSION(jpi,jpj) :: ztmp0, ztmp1, ztmp2 |
---|
122 | REAL(wp), DIMENSION(jpi,jpj) :: stab ! stability test integer |
---|
123 | !!---------------------------------------------------------------------------------- |
---|
124 | ! |
---|
125 | l_zt_equal_zu = .FALSE. |
---|
126 | IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE. ! testing "zu == zt" is risky with double precision |
---|
127 | |
---|
128 | U_blk = MAX( 0.5_wp , U_zu ) ! relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s |
---|
129 | |
---|
130 | !! First guess of stability: |
---|
131 | ztmp0 = virt_temp(t_zt, q_zt) - virt_temp(sst, ssq) ! air-sea difference of virtual pot. temp. at zt |
---|
132 | stab = 0.5_wp + sign(0.5_wp,ztmp0) ! stab = 1 if dTv > 0 => STABLE, 0 if unstable |
---|
133 | |
---|
134 | !! Neutral coefficients at 10m: |
---|
135 | IF( ln_cdgw ) THEN ! wave drag case |
---|
136 | cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) ) |
---|
137 | ztmp0 (:,:) = cdn_wave(:,:) |
---|
138 | ELSE |
---|
139 | ztmp0 = cd_neutral_10m( U_blk ) |
---|
140 | ENDIF |
---|
141 | |
---|
142 | sqrt_Cd_n10 = SQRT( ztmp0 ) |
---|
143 | |
---|
144 | !! Initializing transf. coeff. with their first guess neutral equivalents : |
---|
145 | Cd = ztmp0 |
---|
146 | Ce = 1.e-3*( 34.6 * sqrt_Cd_n10 ) |
---|
147 | Ch = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab)) |
---|
148 | stab = sqrt_Cd_n10 ! Temporaty array !!! stab == SQRT(Cd) |
---|
149 | |
---|
150 | IF( ln_cdgw ) Cen = Ce ; Chn = Ch |
---|
151 | |
---|
152 | !! Initializing values at z_u with z_t values: |
---|
153 | t_zu = t_zt ; q_zu = q_zt |
---|
154 | |
---|
155 | !! * Now starting iteration loop |
---|
156 | DO j_itt=1, nb_itt |
---|
157 | ! |
---|
158 | ztmp1 = t_zu - sst ! Updating air/sea differences |
---|
159 | ztmp2 = q_zu - ssq |
---|
160 | |
---|
161 | ! Updating turbulent scales : (L&Y 2004 eq. (7)) |
---|
162 | ztmp0 = stab*U_blk ! u* (stab == SQRT(Cd)) |
---|
163 | ztmp1 = Ch/stab*ztmp1 ! theta* (stab == SQRT(Cd)) |
---|
164 | ztmp2 = Ce/stab*ztmp2 ! q* (stab == SQRT(Cd)) |
---|
165 | |
---|
166 | ! Estimate the inverse of Monin-Obukov length (1/L) at height zu: |
---|
167 | ztmp0 = One_on_L( t_zu, q_zu, ztmp0, ztmp1, ztmp2 ) |
---|
168 | |
---|
169 | !! Stability parameters : |
---|
170 | zeta_u = zu*ztmp0 |
---|
171 | zeta_u = sign( min(abs(zeta_u),10.0_wp), zeta_u ) |
---|
172 | zpsi_h_u = psi_h( zeta_u ) |
---|
173 | |
---|
174 | !! Shifting temperature and humidity at zu (L&Y 2004 eq. (9b-9c)) |
---|
175 | IF( .NOT. l_zt_equal_zu ) THEN |
---|
176 | !! Array 'stab' is free for the moment so using it to store 'zeta_t' |
---|
177 | stab = zt*ztmp0 |
---|
178 | stab = SIGN( MIN(ABS(stab),10.0_wp), stab ) ! Temporaty array stab == zeta_t !!! |
---|
179 | stab = LOG(zt/zu) + zpsi_h_u - psi_h(stab) ! stab just used as temp array again! |
---|
180 | t_zu = t_zt - ztmp1/vkarmn*stab ! ztmp1 is still theta* L&Y 2004 eq.(9b) |
---|
181 | q_zu = q_zt - ztmp2/vkarmn*stab ! ztmp2 is still q* L&Y 2004 eq.(9c) |
---|
182 | q_zu = max(0._wp, q_zu) |
---|
183 | END IF |
---|
184 | |
---|
185 | ztmp2 = psi_m(zeta_u) |
---|
186 | IF( ln_cdgw ) THEN ! surface wave case |
---|
187 | stab = vkarmn / ( vkarmn / sqrt_Cd_n10 - ztmp2 ) ! (stab == SQRT(Cd)) |
---|
188 | Cd = stab * stab |
---|
189 | ztmp0 = (LOG(zu/10.) - zpsi_h_u) / vkarmn / sqrt_Cd_n10 |
---|
190 | ztmp2 = stab / sqrt_Cd_n10 ! (stab == SQRT(Cd)) |
---|
191 | ztmp1 = 1. + Chn * ztmp0 |
---|
192 | Ch = Chn * ztmp2 / ztmp1 ! L&Y 2004 eq. (10b) |
---|
193 | ztmp1 = 1. + Cen * ztmp0 |
---|
194 | Ce = Cen * ztmp2 / ztmp1 ! L&Y 2004 eq. (10c) |
---|
195 | |
---|
196 | ELSE |
---|
197 | ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)... |
---|
198 | ! In very rare low-wind conditions, the old way of estimating the |
---|
199 | ! neutral wind speed at 10m leads to a negative value that causes the code |
---|
200 | ! to crash. To prevent this a threshold of 0.25m/s is imposed. |
---|
201 | ztmp0 = MAX( 0.25_wp , U_blk/(1._wp + sqrt_Cd_n10/vkarmn*(LOG(zu/10._wp) - ztmp2)) ) ! U_n10 (ztmp2 == psi_m(zeta_u)) |
---|
202 | ztmp0 = cd_neutral_10m(ztmp0) ! Cd_n10 |
---|
203 | Cdn(:,:) = ztmp0 |
---|
204 | sqrt_Cd_n10 = sqrt(ztmp0) |
---|
205 | |
---|
206 | stab = 0.5_wp + sign(0.5_wp,zeta_u) ! update stability |
---|
207 | Cx_n10 = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab)) ! L&Y 2004 eq. (6c-6d) (Cx_n10 == Ch_n10) |
---|
208 | Chn(:,:) = Cx_n10 |
---|
209 | |
---|
210 | !! Update of transfer coefficients: |
---|
211 | ztmp1 = 1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - ztmp2) ! L&Y 2004 eq. (10a) (ztmp2 == psi_m(zeta_u)) |
---|
212 | Cd = ztmp0 / ( ztmp1*ztmp1 ) |
---|
213 | stab = SQRT( Cd ) ! Temporary array !!! (stab == SQRT(Cd)) |
---|
214 | |
---|
215 | ztmp0 = (LOG(zu/10.) - zpsi_h_u) / vkarmn / sqrt_Cd_n10 |
---|
216 | ztmp2 = stab / sqrt_Cd_n10 ! (stab == SQRT(Cd)) |
---|
217 | ztmp1 = 1. + Cx_n10*ztmp0 ! (Cx_n10 == Ch_n10) |
---|
218 | Ch = Cx_n10*ztmp2 / ztmp1 ! L&Y 2004 eq. (10b) |
---|
219 | |
---|
220 | Cx_n10 = 1.e-3 * (34.6 * sqrt_Cd_n10) ! L&Y 2004 eq. (6b) ! Cx_n10 == Ce_n10 |
---|
221 | Cen(:,:) = Cx_n10 |
---|
222 | ztmp1 = 1. + Cx_n10*ztmp0 |
---|
223 | Ce = Cx_n10*ztmp2 / ztmp1 ! L&Y 2004 eq. (10c) |
---|
224 | ENDIF |
---|
225 | ! |
---|
226 | END DO |
---|
227 | ! |
---|
228 | END SUBROUTINE turb_ncar |
---|
229 | |
---|
230 | |
---|
231 | FUNCTION cd_neutral_10m( pw10 ) |
---|
232 | !!---------------------------------------------------------------------------------- |
---|
233 | !! Estimate of the neutral drag coefficient at 10m as a function |
---|
234 | !! of neutral wind speed at 10m |
---|
235 | !! |
---|
236 | !! Origin: Large & Yeager 2008 eq.(11a) and eq.(11b) |
---|
237 | !! |
---|
238 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/) |
---|
239 | !!---------------------------------------------------------------------------------- |
---|
240 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pw10 ! scalar wind speed at 10m (m/s) |
---|
241 | REAL(wp), DIMENSION(jpi,jpj) :: cd_neutral_10m |
---|
242 | ! |
---|
243 | INTEGER :: ji, jj ! dummy loop indices |
---|
244 | REAL(wp) :: zgt33, zw, zw6 ! local scalars |
---|
245 | !!---------------------------------------------------------------------------------- |
---|
246 | ! |
---|
247 | DO jj = 1, jpj |
---|
248 | DO ji = 1, jpi |
---|
249 | ! |
---|
250 | zw = pw10(ji,jj) |
---|
251 | zw6 = zw*zw*zw |
---|
252 | zw6 = zw6*zw6 |
---|
253 | ! |
---|
254 | ! When wind speed > 33 m/s => Cyclone conditions => special treatment |
---|
255 | zgt33 = 0.5_wp + SIGN( 0.5_wp, (zw - 33._wp) ) ! If pw10 < 33. => 0, else => 1 |
---|
256 | ! |
---|
257 | cd_neutral_10m(ji,jj) = 1.e-3 * ( & |
---|
258 | & (1. - zgt33)*( 2.7/zw + 0.142 + zw/13.09 - 3.14807E-10*zw6) & ! wind < 33 m/s |
---|
259 | & + zgt33 * 2.34 ) ! wind >= 33 m/s |
---|
260 | ! |
---|
261 | cd_neutral_10m(ji,jj) = MAX(cd_neutral_10m(ji,jj), 1.E-6_wp) |
---|
262 | ! |
---|
263 | END DO |
---|
264 | END DO |
---|
265 | ! |
---|
266 | END FUNCTION cd_neutral_10m |
---|
267 | |
---|
268 | |
---|
269 | FUNCTION psi_m( pzeta ) |
---|
270 | !!---------------------------------------------------------------------------------- |
---|
271 | !! Universal profile stability function for momentum |
---|
272 | !! !! Psis, L&Y 2004 eq. (8c), (8d), (8e) |
---|
273 | !! |
---|
274 | !! pzet0 : stability paramenter, z/L where z is altitude measurement |
---|
275 | !! and L is M-O length |
---|
276 | !! |
---|
277 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/) |
---|
278 | !!---------------------------------------------------------------------------------- |
---|
279 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta |
---|
280 | REAL(wp), DIMENSION(jpi,jpj) :: psi_m |
---|
281 | ! |
---|
282 | INTEGER :: ji, jj ! dummy loop indices |
---|
283 | REAL(wp) :: zx2, zx, zstab ! local scalars |
---|
284 | !!---------------------------------------------------------------------------------- |
---|
285 | ! |
---|
286 | DO jj = 1, jpj |
---|
287 | DO ji = 1, jpi |
---|
288 | zx2 = SQRT( ABS( 1._wp - 16._wp*pzeta(ji,jj) ) ) |
---|
289 | zx2 = MAX( zx2 , 1._wp ) |
---|
290 | zx = SQRT( zx2 ) |
---|
291 | zstab = 0.5_wp + SIGN( 0.5_wp , pzeta(ji,jj) ) |
---|
292 | ! |
---|
293 | psi_m(ji,jj) = zstab * (-5._wp*pzeta(ji,jj)) & ! Stable |
---|
294 | & + (1._wp - zstab) * (2._wp*LOG((1._wp + zx)*0.5_wp) & ! Unstable |
---|
295 | & + LOG((1._wp + zx2)*0.5_wp) - 2._wp*ATAN(zx) + rpi*0.5_wp) ! " |
---|
296 | ! |
---|
297 | END DO |
---|
298 | END DO |
---|
299 | ! |
---|
300 | END FUNCTION psi_m |
---|
301 | |
---|
302 | |
---|
303 | FUNCTION psi_h( pzeta ) |
---|
304 | !!---------------------------------------------------------------------------------- |
---|
305 | !! Universal profile stability function for temperature and humidity |
---|
306 | !! !! Psis, L&Y 2004 eq. (8c), (8d), (8e) |
---|
307 | !! |
---|
308 | !! pzet0 : stability paramenter, z/L where z is altitude measurement |
---|
309 | !! and L is M-O length |
---|
310 | !! |
---|
311 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/) |
---|
312 | !!---------------------------------------------------------------------------------- |
---|
313 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta |
---|
314 | REAL(wp), DIMENSION(jpi,jpj) :: psi_h |
---|
315 | ! |
---|
316 | INTEGER :: ji, jj ! dummy loop indices |
---|
317 | REAL(wp) :: zx2, zstab ! local scalars |
---|
318 | !!---------------------------------------------------------------------------------- |
---|
319 | ! |
---|
320 | DO jj = 1, jpj |
---|
321 | DO ji = 1, jpi |
---|
322 | zx2 = SQRT( ABS( 1._wp - 16._wp*pzeta(ji,jj) ) ) |
---|
323 | zx2 = MAX( zx2 , 1._wp ) |
---|
324 | zstab = 0.5_wp + SIGN( 0.5_wp , pzeta(ji,jj) ) |
---|
325 | ! |
---|
326 | psi_h(ji,jj) = zstab * (-5._wp*pzeta(ji,jj)) & ! Stable |
---|
327 | & + (1._wp - zstab) * (2._wp*LOG( (1._wp + zx2)*0.5_wp )) ! Unstable |
---|
328 | ! |
---|
329 | END DO |
---|
330 | END DO |
---|
331 | ! |
---|
332 | END FUNCTION psi_h |
---|
333 | |
---|
334 | !!====================================================================== |
---|
335 | END MODULE sbcblk_algo_ncar |
---|