[6723] | 1 | MODULE sbcblk_algo_ecmwf |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE sbcblk_algo_ecmwf *** |
---|
| 4 | !! Computes turbulent components of surface fluxes |
---|
| 5 | !! according to the method in IFS of the ECMWF model |
---|
| 6 | !! |
---|
| 7 | !! * bulk transfer coefficients C_D, C_E and C_H |
---|
| 8 | !! * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed |
---|
| 9 | !! * the effective bulk wind speed at 10m U_blk |
---|
| 10 | !! => all these are used in bulk formulas in sbcblk.F90 |
---|
| 11 | !! |
---|
| 12 | !! Using the bulk formulation/param. of IFS of ECMWF (cycle 31r2) |
---|
| 13 | !! based on IFS doc (avaible online on the ECMWF's website) |
---|
| 14 | !! |
---|
| 15 | !! |
---|
| 16 | !! Routine turb_ecmwf maintained and developed in AeroBulk |
---|
| 17 | !! (http://aerobulk.sourceforge.net/) |
---|
| 18 | !! |
---|
| 19 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) |
---|
| 20 | !!---------------------------------------------------------------------- |
---|
[6727] | 21 | !! History : 4.0 ! 2016-02 (L.Brodeau) Original code |
---|
[6723] | 22 | !!---------------------------------------------------------------------- |
---|
[6727] | 23 | |
---|
| 24 | !!---------------------------------------------------------------------- |
---|
[6723] | 25 | !! turb_ecmwf : computes the bulk turbulent transfer coefficients |
---|
| 26 | !! adjusts t_air and q_air from zt to zu m |
---|
| 27 | !! returns the effective bulk wind speed at 10m |
---|
| 28 | !!---------------------------------------------------------------------- |
---|
| 29 | USE oce ! ocean dynamics and tracers |
---|
| 30 | USE dom_oce ! ocean space and time domain |
---|
| 31 | USE phycst ! physical constants |
---|
| 32 | USE iom ! I/O manager library |
---|
| 33 | USE lib_mpp ! distribued memory computing library |
---|
| 34 | USE timing ! Timing |
---|
| 35 | USE in_out_manager ! I/O manager |
---|
| 36 | USE prtctl ! Print control |
---|
| 37 | USE sbcwave, ONLY : cdn_wave ! wave module |
---|
| 38 | #if defined key_lim3 || defined key_cice |
---|
| 39 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
| 40 | #endif |
---|
| 41 | USE lib_fortran ! to use key_nosignedzero |
---|
| 42 | |
---|
| 43 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
| 44 | |
---|
| 45 | IMPLICIT NONE |
---|
| 46 | PRIVATE |
---|
| 47 | |
---|
[6727] | 48 | PUBLIC :: TURB_ECMWF ! called by sbcblk.F90 |
---|
[6723] | 49 | |
---|
| 50 | ! !! ECMWF own values for given constants, taken form IFS documentation... |
---|
| 51 | REAL(wp), PARAMETER :: charn0 = 0.018 ! Charnock constant (pretty high value here !!! |
---|
| 52 | ! ! => Usually 0.011 for moderate winds) |
---|
| 53 | REAL(wp), PARAMETER :: zi0 = 1000. ! scale height of the atmospheric boundary layer...1 |
---|
| 54 | REAL(wp), PARAMETER :: Beta0 = 1. ! gustiness parameter ( = 1.25 in COAREv3) |
---|
| 55 | REAL(wp), PARAMETER :: rctv0 = 0.608 ! constant to obtain virtual temperature... |
---|
| 56 | REAL(wp), PARAMETER :: Cp_dry = 1005.0 ! Specic heat of dry air, constant pressure [J/K/kg] |
---|
| 57 | REAL(wp), PARAMETER :: Cp_vap = 1860.0 ! Specic heat of water vapor, constant pressure [J/K/kg] |
---|
| 58 | REAL(wp), PARAMETER :: alpha_M = 0.11 ! For roughness length (smooth surface term) |
---|
| 59 | REAL(wp), PARAMETER :: alpha_H = 0.40 ! (Chapter 3, p.34, IFS doc Cy31r1) |
---|
| 60 | REAL(wp), PARAMETER :: alpha_Q = 0.62 ! |
---|
| 61 | !!---------------------------------------------------------------------- |
---|
| 62 | CONTAINS |
---|
| 63 | |
---|
| 64 | SUBROUTINE TURB_ECMWF( zt, zu, sst, t_zt, ssq , q_zt , U_zu, & |
---|
| 65 | & Cd, Ch, Ce , t_zu, q_zu, U_blk ) |
---|
| 66 | !!---------------------------------------------------------------------------------- |
---|
| 67 | !! *** ROUTINE turb_ecmwf *** |
---|
| 68 | !! |
---|
| 69 | !! 2015: L. Brodeau (brodeau@gmail.com) |
---|
| 70 | !! |
---|
| 71 | !! ** Purpose : Computes turbulent transfert coefficients of surface |
---|
| 72 | !! fluxes according to IFS doc. (cycle 31) |
---|
| 73 | !! If relevant (zt /= zu), adjust temperature and humidity from height zt to zu |
---|
| 74 | !! |
---|
| 75 | !! ** Method : Monin Obukhov Similarity Theory |
---|
| 76 | !! |
---|
| 77 | !! INPUT : |
---|
| 78 | !! ------- |
---|
| 79 | !! * zt : height for temperature and spec. hum. of air [m] |
---|
| 80 | !! * zu : height for wind speed (generally 10m) [m] |
---|
| 81 | !! * U_zu : scalar wind speed at 10m [m/s] |
---|
| 82 | !! * sst : SST [K] |
---|
| 83 | !! * t_zt : potential air temperature at zt [K] |
---|
| 84 | !! * ssq : specific humidity at saturation at SST [kg/kg] |
---|
| 85 | !! * q_zt : specific humidity of air at zt [kg/kg] |
---|
| 86 | !! |
---|
| 87 | !! |
---|
| 88 | !! OUTPUT : |
---|
| 89 | !! -------- |
---|
| 90 | !! * Cd : drag coefficient |
---|
| 91 | !! * Ch : sensible heat coefficient |
---|
| 92 | !! * Ce : evaporation coefficient |
---|
| 93 | !! * t_zu : pot. air temperature adjusted at wind height zu [K] |
---|
| 94 | !! * q_zu : specific humidity of air // [kg/kg] |
---|
| 95 | !! * U_blk : bulk wind at 10m [m/s] |
---|
| 96 | !! |
---|
| 97 | !! |
---|
| 98 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) |
---|
| 99 | !!---------------------------------------------------------------------------------- |
---|
| 100 | REAL(wp), INTENT(in ) :: zt ! height for t_zt and q_zt [m] |
---|
| 101 | REAL(wp), INTENT(in ) :: zu ! height for U_zu [m] |
---|
| 102 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: sst ! sea surface temperature [Kelvin] |
---|
| 103 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: t_zt ! potential air temperature [Kelvin] |
---|
| 104 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: ssq ! sea surface specific humidity [kg/kg] |
---|
| 105 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt ! specific air humidity [kg/kg] |
---|
| 106 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: U_zu ! relative wind module at zu [m/s] |
---|
| 107 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Cd ! transfer coefficient for momentum (tau) |
---|
| 108 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ch ! transfer coefficient for sensible heat (Q_sens) |
---|
| 109 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ce ! transfert coefficient for evaporation (Q_lat) |
---|
| 110 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: t_zu ! pot. air temp. adjusted at zu [K] |
---|
| 111 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: q_zu ! spec. humidity adjusted at zu [kg/kg] |
---|
| 112 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: U_blk ! bulk wind at 10m [m/s] |
---|
| 113 | ! |
---|
| 114 | INTEGER :: j_itt |
---|
| 115 | LOGICAL :: l_zt_equal_zu = .FALSE. ! if q and t are given at same height as U |
---|
| 116 | INTEGER , PARAMETER :: nb_itt = 4 ! number of itterations |
---|
| 117 | ! |
---|
[7910] | 118 | REAL(wp), DIMENSION(jpi,jpj) :: u_star, t_star, q_star |
---|
| 119 | REAL(wp), DIMENSION(jpi,jpj) :: dt_zu, dq_zu |
---|
| 120 | REAL(wp), DIMENSION(jpi,jpj) :: znu_a !: Nu_air, Viscosity of air |
---|
| 121 | REAL(wp), DIMENSION(jpi,jpj) :: Linv !: 1/L (inverse of Monin Obukhov length... |
---|
| 122 | REAL(wp), DIMENSION(jpi,jpj) :: z0, z0t, z0q |
---|
| 123 | REAL(wp), DIMENSION(jpi,jpj) :: func_m, func_h |
---|
| 124 | REAL(wp), DIMENSION(jpi,jpj) :: ztmp0, ztmp1, ztmp2 |
---|
[6723] | 125 | !!---------------------------------------------------------------------------------- |
---|
| 126 | ! |
---|
| 127 | IF( nn_timing == 1 ) CALL timing_start('turb_ecmwf') |
---|
| 128 | ! |
---|
| 129 | ! |
---|
| 130 | ! Identical first gess as in COARE, with IFS parameter values though |
---|
| 131 | ! |
---|
| 132 | l_zt_equal_zu = .FALSE. |
---|
| 133 | IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE. ! testing "zu == zt" is risky with double precision |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | !! First guess of temperature and humidity at height zu: |
---|
| 137 | t_zu = MAX( t_zt , 0.0 ) ! who knows what's given on masked-continental regions... |
---|
| 138 | q_zu = MAX( q_zt , 1.e-6) ! " |
---|
| 139 | |
---|
| 140 | !! Pot. temp. difference (and we don't want it to be 0!) |
---|
| 141 | dt_zu = t_zu - sst ; dt_zu = SIGN( MAX(ABS(dt_zu),1.e-6), dt_zu ) |
---|
| 142 | dq_zu = q_zu - ssq ; dq_zu = SIGN( MAX(ABS(dq_zu),1.e-9), dq_zu ) |
---|
| 143 | |
---|
| 144 | znu_a = visc_air(t_zt) ! Air viscosity (m^2/s) at zt given from temperature in (K) |
---|
| 145 | |
---|
| 146 | ztmp2 = 0.5 * 0.5 ! initial guess for wind gustiness contribution |
---|
| 147 | U_blk = SQRT(U_zu*U_zu + ztmp2) |
---|
| 148 | |
---|
| 149 | ! z0 = 0.0001 |
---|
| 150 | ztmp2 = 10000. ! optimization: ztmp2 == 1/z0 |
---|
| 151 | ztmp0 = LOG(zu*ztmp2) |
---|
| 152 | ztmp1 = LOG(10.*ztmp2) |
---|
| 153 | u_star = 0.035*U_blk*ztmp1/ztmp0 ! (u* = 0.035*Un10) |
---|
| 154 | |
---|
| 155 | z0 = charn0*u_star*u_star/grav + 0.11*znu_a/u_star |
---|
| 156 | z0t = 0.1*EXP(vkarmn/(0.00115/(vkarmn/ztmp1))) ! WARNING: 1/z0t ! |
---|
| 157 | |
---|
| 158 | Cd = (vkarmn/ztmp0)**2 ! first guess of Cd |
---|
| 159 | |
---|
| 160 | ztmp0 = vkarmn*vkarmn/LOG(zt*z0t)/Cd |
---|
| 161 | |
---|
| 162 | ztmp2 = Ri_bulk( zu, t_zu, dt_zu, q_zu, dq_zu, U_blk ) ! Ribu = Bulk Richardson number |
---|
| 163 | |
---|
| 164 | !! First estimate of zeta_u, depending on the stability, ie sign of Ribu (ztmp2): |
---|
| 165 | ztmp1 = 0.5 + SIGN( 0.5 , ztmp2 ) |
---|
| 166 | func_m = ztmp0*ztmp2 ! temporary array !! |
---|
| 167 | !! Ribu < 0 Ribu > 0 Beta = 1.25 |
---|
| 168 | func_h = (1.-ztmp1)*(func_m/(1.+ztmp2/(-zu/(zi0*0.004*Beta0**3)))) & ! temporary array !!! func_h == zeta_u |
---|
| 169 | & + ztmp1*(func_m*(1. + 27./9.*ztmp2/ztmp0)) |
---|
| 170 | |
---|
| 171 | !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L |
---|
| 172 | ztmp0 = vkarmn/(LOG(zu*z0t) - psi_h_ecmwf(func_h)) |
---|
| 173 | |
---|
| 174 | u_star = U_blk*vkarmn/(LOG(zu) - LOG(z0) - psi_m_ecmwf(func_h)) |
---|
| 175 | t_star = dt_zu*ztmp0 |
---|
| 176 | q_star = dq_zu*ztmp0 |
---|
| 177 | |
---|
| 178 | ! What's need to be done if zt /= zu: |
---|
| 179 | IF( .NOT. l_zt_equal_zu ) THEN |
---|
| 180 | ! |
---|
| 181 | !! First update of values at zu (or zt for wind) |
---|
| 182 | ztmp0 = psi_h_ecmwf(func_h) - psi_h_ecmwf(zt*func_h/zu) ! zt*func_h/zu == zeta_t |
---|
| 183 | ztmp1 = log(zt/zu) + ztmp0 |
---|
| 184 | t_zu = t_zt - t_star/vkarmn*ztmp1 |
---|
| 185 | q_zu = q_zt - q_star/vkarmn*ztmp1 |
---|
| 186 | q_zu = (0.5 + sign(0.5,q_zu))*q_zu !Makes it impossible to have negative humidity : |
---|
| 187 | |
---|
| 188 | dt_zu = t_zu - sst ; dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu ) |
---|
| 189 | dq_zu = q_zu - ssq ; dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu ) |
---|
| 190 | ! |
---|
| 191 | ENDIF |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | !! => that was same first guess as in COARE... |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | !! First guess of inverse of Monin-Obukov length (1/L) : |
---|
| 198 | ztmp0 = (1. + rctv0*q_zu) ! the factor to apply to temp. to get virt. temp... |
---|
| 199 | Linv = grav*vkarmn*(t_star*ztmp0 + rctv0*t_zu*q_star) / ( u_star*u_star * t_zu*ztmp0 ) |
---|
| 200 | |
---|
| 201 | !! Functions such as u* = U_blk*vkarmn/func_m |
---|
| 202 | ztmp1 = zu + z0 |
---|
| 203 | ztmp0 = ztmp1*Linv |
---|
| 204 | func_m = LOG(ztmp1) -LOG(z0) - psi_m_ecmwf(ztmp0) + psi_m_ecmwf(z0*Linv) |
---|
| 205 | func_h = LOG(ztmp1*z0t) - psi_h_ecmwf(ztmp0) + psi_h_ecmwf(1./z0t*Linv) |
---|
| 206 | |
---|
| 207 | |
---|
| 208 | !! ITERATION BLOCK |
---|
| 209 | !! *************** |
---|
| 210 | |
---|
| 211 | DO j_itt = 1, nb_itt |
---|
| 212 | |
---|
| 213 | !! Bulk Richardson Number at z=zu (Eq. 3.25) |
---|
| 214 | ztmp0 = Ri_bulk(zu, t_zu, dt_zu, q_zu, dq_zu, U_blk) |
---|
| 215 | |
---|
| 216 | !! New estimate of the inverse of the Monin-Obukhon length (Linv == zeta/zu) : |
---|
| 217 | Linv = ztmp0*func_m*func_m/func_h / zu ! From Eq. 3.23, Chap.3, p.33, IFS doc - Cy31r1 |
---|
| 218 | |
---|
| 219 | !! Update func_m with new Linv: |
---|
| 220 | ztmp1 = zu + z0 |
---|
| 221 | func_m = LOG(ztmp1) -LOG(z0) - psi_m_ecmwf(ztmp1*Linv) + psi_m_ecmwf(z0*Linv) |
---|
| 222 | |
---|
| 223 | !! Need to update roughness lengthes: |
---|
| 224 | u_star = U_blk*vkarmn/func_m |
---|
| 225 | ztmp2 = u_star*u_star |
---|
| 226 | ztmp1 = znu_a/u_star |
---|
| 227 | z0 = alpha_M*ztmp1 + charn0*ztmp2/grav |
---|
| 228 | z0t = alpha_H*ztmp1 ! eq.3.26, Chap.3, p.34, IFS doc - Cy31r1 |
---|
| 229 | z0q = alpha_Q*ztmp1 |
---|
| 230 | |
---|
| 231 | !! Update wind at 10m taking into acount convection-related wind gustiness: |
---|
| 232 | ! Only true when unstable (L<0) => when ztmp0 < 0 => - !!! |
---|
| 233 | ztmp2 = ztmp2 * (MAX(-zi0*Linv/vkarmn,0.))**(2./3.) ! => w*^2 (combining Eq. 3.8 and 3.18, hap.3, IFS doc - Cy31r1) |
---|
| 234 | !! => equivalent using Beta=1 (gustiness parameter, 1.25 for COARE, also zi0=600 in COARE..) |
---|
| 235 | U_blk = MAX(sqrt(U_zu*U_zu + ztmp2), 0.2) ! eq.3.17, Chap.3, p.32, IFS doc - Cy31r1 |
---|
| 236 | ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0. |
---|
| 237 | |
---|
| 238 | |
---|
| 239 | !! Need to update "theta" and "q" at zu in case they are given at different heights |
---|
| 240 | !! as well the air-sea differences: |
---|
| 241 | IF( .NOT. l_zt_equal_zu ) THEN |
---|
| 242 | |
---|
| 243 | !! Arrays func_m and func_h are free for a while so using them as temporary arrays... |
---|
| 244 | func_h = psi_h_ecmwf((zu+z0)*Linv) ! temporary array !!! |
---|
| 245 | func_m = psi_h_ecmwf((zt+z0)*Linv) ! temporary array !!! |
---|
| 246 | |
---|
| 247 | ztmp2 = psi_h_ecmwf(z0t*Linv) |
---|
| 248 | ztmp0 = func_h - ztmp2 |
---|
| 249 | ztmp1 = vkarmn/(LOG(zu+z0) - LOG(z0t) - ztmp0) |
---|
| 250 | t_star = dt_zu*ztmp1 |
---|
| 251 | ztmp2 = ztmp0 - func_m + ztmp2 |
---|
| 252 | ztmp1 = LOG(zt/zu) + ztmp2 |
---|
| 253 | t_zu = t_zt - t_star/vkarmn*ztmp1 |
---|
| 254 | |
---|
| 255 | ztmp2 = psi_h_ecmwf(z0q*Linv) |
---|
| 256 | ztmp0 = func_h - ztmp2 |
---|
| 257 | ztmp1 = vkarmn/(LOG(zu+z0) - LOG(z0q) - ztmp0) |
---|
| 258 | q_star = dq_zu*ztmp1 |
---|
| 259 | ztmp2 = ztmp0 - func_m + ztmp2 |
---|
| 260 | ztmp1 = log(zt/zu) + ztmp2 |
---|
| 261 | q_zu = q_zt - q_star/vkarmn*ztmp1 |
---|
| 262 | |
---|
| 263 | dt_zu = t_zu - sst ; dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu ) |
---|
| 264 | dq_zu = q_zu - ssq ; dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu ) |
---|
| 265 | END IF |
---|
| 266 | |
---|
| 267 | !! Updating because of updated z0 and z0t and new Linv... |
---|
| 268 | ztmp1 = zu + z0 |
---|
| 269 | ztmp0 = ztmp1*Linv |
---|
| 270 | func_m = log(ztmp1) - LOG(z0) - psi_m_ecmwf(ztmp0) + psi_m_ecmwf(z0*Linv) |
---|
| 271 | func_h = log(ztmp1) - LOG(z0t) - psi_h_ecmwf(ztmp0) + psi_h_ecmwf(z0t*Linv) |
---|
| 272 | |
---|
| 273 | END DO |
---|
| 274 | |
---|
| 275 | Cd = vkarmn*vkarmn/(func_m*func_m) |
---|
| 276 | Ch = vkarmn*vkarmn/(func_m*func_h) |
---|
| 277 | ztmp1 = log((zu + z0)/z0q) - psi_h_ecmwf((zu + z0)*Linv) + psi_h_ecmwf(z0q*Linv) ! func_q |
---|
| 278 | Ce = vkarmn*vkarmn/(func_m*ztmp1) |
---|
| 279 | |
---|
| 280 | ! |
---|
| 281 | IF( nn_timing == 1 ) CALL timing_stop('turb_ecmwf') |
---|
| 282 | ! |
---|
| 283 | END SUBROUTINE TURB_ECMWF |
---|
| 284 | |
---|
| 285 | |
---|
| 286 | FUNCTION psi_m_ecmwf( pzeta ) |
---|
| 287 | !!---------------------------------------------------------------------------------- |
---|
| 288 | !! Universal profile stability function for momentum |
---|
| 289 | !! ECMWF / as in IFS cy31r1 documentation, available online |
---|
| 290 | !! at ecmwf.int |
---|
| 291 | !! |
---|
| 292 | !! pzeta : stability paramenter, z/L where z is altitude measurement |
---|
| 293 | !! and L is M-O length |
---|
| 294 | !! |
---|
| 295 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) |
---|
| 296 | !!---------------------------------------------------------------------------------- |
---|
| 297 | REAL(wp), DIMENSION(jpi,jpj) :: psi_m_ecmwf |
---|
| 298 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta |
---|
| 299 | ! |
---|
| 300 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 301 | REAL(wp) :: zzeta, zx, ztmp, psi_unst, psi_stab, stab |
---|
| 302 | !!---------------------------------------------------------------------------------- |
---|
| 303 | ! |
---|
| 304 | DO jj = 1, jpj |
---|
| 305 | DO ji = 1, jpi |
---|
| 306 | ! |
---|
| 307 | zzeta = MIN( pzeta(ji,jj) , 5. ) !! Very stable conditions (L positif and big!): |
---|
| 308 | ! |
---|
| 309 | ! Unstable (Paulson 1970): |
---|
| 310 | ! eq.3.20, Chap.3, p.33, IFS doc - Cy31r1 |
---|
| 311 | zx = SQRT(ABS(1. - 16.*zzeta)) |
---|
| 312 | ztmp = 1. + SQRT(zx) |
---|
| 313 | ztmp = ztmp*ztmp |
---|
| 314 | psi_unst = LOG( 0.125*ztmp*(1. + zx) ) & |
---|
| 315 | & -2.*ATAN( SQRT(zx) ) + 0.5*rpi |
---|
| 316 | ! |
---|
| 317 | ! Unstable: |
---|
| 318 | ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1 |
---|
| 319 | psi_stab = -2./3.*(zzeta - 5./0.35)*EXP(-0.35*zzeta) & |
---|
| 320 | & - zzeta - 2./3.*5./0.35 |
---|
| 321 | ! |
---|
| 322 | ! Combining: |
---|
| 323 | stab = 0.5 + SIGN(0.5, zzeta) ! zzeta > 0 => stab = 1 |
---|
| 324 | ! |
---|
| 325 | psi_m_ecmwf(ji,jj) = (1. - stab) * psi_unst & ! (zzeta < 0) Unstable |
---|
| 326 | & + stab * psi_stab ! (zzeta > 0) Stable |
---|
| 327 | ! |
---|
| 328 | END DO |
---|
| 329 | END DO |
---|
| 330 | ! |
---|
| 331 | END FUNCTION psi_m_ecmwf |
---|
| 332 | |
---|
| 333 | |
---|
| 334 | FUNCTION psi_h_ecmwf( pzeta ) |
---|
| 335 | !!---------------------------------------------------------------------------------- |
---|
| 336 | !! Universal profile stability function for temperature and humidity |
---|
| 337 | !! ECMWF / as in IFS cy31r1 documentation, available online |
---|
| 338 | !! at ecmwf.int |
---|
| 339 | !! |
---|
| 340 | !! pzeta : stability paramenter, z/L where z is altitude measurement |
---|
| 341 | !! and L is M-O length |
---|
| 342 | !! |
---|
| 343 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) |
---|
| 344 | !!---------------------------------------------------------------------------------- |
---|
| 345 | REAL(wp), DIMENSION(jpi,jpj) :: psi_h_ecmwf |
---|
| 346 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta |
---|
| 347 | ! |
---|
| 348 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 349 | REAL(wp) :: zzeta, zx, psi_unst, psi_stab, stab |
---|
| 350 | !!---------------------------------------------------------------------------------- |
---|
| 351 | ! |
---|
| 352 | DO jj = 1, jpj |
---|
| 353 | DO ji = 1, jpi |
---|
| 354 | ! |
---|
| 355 | zzeta = MIN(pzeta(ji,jj) , 5.) ! Very stable conditions (L positif and big!): |
---|
| 356 | ! |
---|
| 357 | zx = ABS(1. - 16.*zzeta)**.25 ! this is actually (1/phi_m)**2 !!! |
---|
| 358 | ! ! eq.3.19, Chap.3, p.33, IFS doc - Cy31r1 |
---|
| 359 | ! Unstable (Paulson 1970) : |
---|
| 360 | psi_unst = 2.*LOG(0.5*(1. + zx*zx)) ! eq.3.20, Chap.3, p.33, IFS doc - Cy31r1 |
---|
| 361 | ! |
---|
| 362 | ! Stable: |
---|
| 363 | psi_stab = -2./3.*(zzeta - 5./0.35)*EXP(-0.35*zzeta) & ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1 |
---|
| 364 | & - ABS(1. + 2./3.*zzeta)**1.5 - 2./3.*5./0.35 + 1. |
---|
| 365 | ! LB: added ABS() to avoid NaN values when unstable, which contaminates the unstable solution... |
---|
| 366 | ! |
---|
| 367 | stab = 0.5 + SIGN(0.5, zzeta) ! zzeta > 0 => stab = 1 |
---|
| 368 | ! |
---|
| 369 | ! |
---|
| 370 | psi_h_ecmwf(ji,jj) = (1. - stab) * psi_unst & ! (zzeta < 0) Unstable |
---|
| 371 | & + stab * psi_stab ! (zzeta > 0) Stable |
---|
| 372 | ! |
---|
| 373 | END DO |
---|
| 374 | END DO |
---|
| 375 | ! |
---|
| 376 | END FUNCTION psi_h_ecmwf |
---|
| 377 | |
---|
| 378 | |
---|
| 379 | FUNCTION Ri_bulk( pz, ptz, pdt, pqz, pdq, pub ) |
---|
| 380 | !!---------------------------------------------------------------------------------- |
---|
| 381 | !! Bulk Richardson number (Eq. 3.25 IFS doc) |
---|
| 382 | !! |
---|
| 383 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) |
---|
| 384 | !!---------------------------------------------------------------------------------- |
---|
| 385 | REAL(wp), DIMENSION(jpi,jpj) :: Ri_bulk ! |
---|
| 386 | ! |
---|
| 387 | REAL(wp) , INTENT(in) :: pz ! height above the sea [m] |
---|
| 388 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptz ! air temperature at pz m [K] |
---|
| 389 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pdt ! ptz - sst [K] |
---|
| 390 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pqz ! air temperature at pz m [kg/kg] |
---|
| 391 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pdq ! pqz - ssq [kg/kg] |
---|
| 392 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pub ! bulk wind speed [m/s] |
---|
| 393 | !!---------------------------------------------------------------------------------- |
---|
| 394 | ! |
---|
| 395 | Ri_bulk = grav*pz/(pub*pub) & |
---|
| 396 | & * ( pdt/(ptz - 0.5_wp*(pdt + grav*pz/(Cp_dry+Cp_vap*pqz))) & |
---|
| 397 | & + rctv0*pdq ) |
---|
| 398 | ! |
---|
| 399 | END FUNCTION Ri_bulk |
---|
| 400 | |
---|
| 401 | |
---|
| 402 | FUNCTION visc_air(ptak) |
---|
| 403 | !!---------------------------------------------------------------------------------- |
---|
| 404 | !! Air kinetic viscosity (m^2/s) given from temperature in degrees... |
---|
| 405 | !! |
---|
| 406 | !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) |
---|
| 407 | !!---------------------------------------------------------------------------------- |
---|
| 408 | REAL(wp), DIMENSION(jpi,jpj) :: visc_air ! |
---|
| 409 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak ! air temperature in (K) |
---|
| 410 | ! |
---|
| 411 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 412 | REAL(wp) :: ztc, ztc2 ! local scalar |
---|
| 413 | !!---------------------------------------------------------------------------------- |
---|
| 414 | ! |
---|
| 415 | DO jj = 1, jpj |
---|
| 416 | DO ji = 1, jpi |
---|
| 417 | ztc = ptak(ji,jj) - rt0 ! air temp, in deg. C |
---|
| 418 | ztc2 = ztc*ztc |
---|
| 419 | visc_air(ji,jj) = 1.326e-5*(1. + 6.542E-3*ztc + 8.301e-6*ztc2 - 4.84e-9*ztc2*ztc) |
---|
| 420 | END DO |
---|
| 421 | END DO |
---|
| 422 | ! |
---|
| 423 | END FUNCTION visc_air |
---|
| 424 | |
---|
| 425 | !!====================================================================== |
---|
| 426 | END MODULE sbcblk_algo_ecmwf |
---|