[644] | 1 | SUBROUTINE HBTM(knon, paprs, pplay, |
---|
| 2 | . t2m,t10m,q2m,q10m,ustar, |
---|
| 3 | . flux_t,flux_q,u,v,t,q, |
---|
| 4 | . pblh,cape,EauLiq,ctei,pblT, |
---|
| 5 | . therm,trmb1,trmb2,trmb3,plcl) |
---|
[704] | 6 | USE dimphy |
---|
[644] | 7 | IMPLICIT none |
---|
| 8 | |
---|
| 9 | c*************************************************************** |
---|
| 10 | c* * |
---|
| 11 | c* HBTM2 D'apres Holstag&Boville et Troen&Mahrt * |
---|
| 12 | c* JAS 47 BLM * |
---|
| 13 | c* Algorithme These Anne Mathieu * |
---|
| 14 | c* Critere d'Entrainement Peter Duynkerke (JAS 50) * |
---|
| 15 | c* written by : Anne MATHIEU & Alain LAHELLEC, 22/11/99 * |
---|
| 16 | c* features : implem. exces Mathieu * |
---|
| 17 | c*************************************************************** |
---|
| 18 | c* mods : decembre 99 passage th a niveau plus bas. voir fixer * |
---|
| 19 | c* la prise du th a z/Lambda = -.2 (max Ray) * |
---|
| 20 | c* Autre algo : entrainement ~ Theta+v =cste mais comment=>The?* |
---|
| 21 | c* on peut fixer q a .7qsat(cf non adiab)=>T2 et The2 * |
---|
| 22 | c* voir aussi //KE pblh = niveau The_e ou l = env. * |
---|
| 23 | c*************************************************************** |
---|
| 24 | c* fin therm a la HBTM passage a forme Mathieu 12/09/2001 * |
---|
| 25 | c*************************************************************** |
---|
| 26 | c* |
---|
| 27 | c |
---|
| 28 | c |
---|
| 29 | cAM Fev 2003 |
---|
| 30 | c Adaptation a LMDZ version couplee |
---|
| 31 | c |
---|
| 32 | c Pour le moment on fait passer en argument les grdeurs de surface : |
---|
| 33 | c flux, t,q2m, t,q10m, on va utiliser systematiquement les grdeurs a 2m ms |
---|
| 34 | c on garde la possibilite de changer si besoin est (jusqu'a present la |
---|
| 35 | c forme de HB avec le 1er niveau modele etait conservee) |
---|
| 36 | c |
---|
| 37 | c |
---|
| 38 | c |
---|
| 39 | c |
---|
| 40 | c |
---|
[704] | 41 | cym#include "dimensions.h" |
---|
| 42 | cym#include "dimphy.h" |
---|
[644] | 43 | #include "YOMCST.h" |
---|
| 44 | REAL RLvCp, REPS |
---|
| 45 | c Arguments: |
---|
| 46 | c |
---|
| 47 | INTEGER knon ! nombre de points a calculer |
---|
| 48 | cAM |
---|
| 49 | REAL t2m(klon), t10m(klon) ! temperature a 2 et 10m |
---|
| 50 | REAL q2m(klon), q10m(klon) ! q a 2 et 10m |
---|
| 51 | REAL ustar(klon) |
---|
| 52 | REAL paprs(klon,klev+1) ! pression a inter-couche (Pa) |
---|
| 53 | REAL pplay(klon,klev) ! pression au milieu de couche (Pa) |
---|
| 54 | REAL flux_t(klon,klev), flux_q(klon,klev) ! Flux |
---|
| 55 | REAL u(klon,klev) ! vitesse U (m/s) |
---|
| 56 | REAL v(klon,klev) ! vitesse V (m/s) |
---|
| 57 | REAL t(klon,klev) ! temperature (K) |
---|
| 58 | REAL q(klon,klev) ! vapeur d'eau (kg/kg) |
---|
| 59 | cAM REAL cd_h(klon) ! coefficient de friction au sol pour chaleur |
---|
| 60 | cAM REAL cd_m(klon) ! coefficient de friction au sol pour vitesse |
---|
| 61 | c |
---|
| 62 | INTEGER isommet |
---|
[704] | 63 | cum PARAMETER (isommet=klev) ! limite max sommet pbl |
---|
[644] | 64 | REAL vk |
---|
| 65 | PARAMETER (vk=0.35) ! Von Karman => passer a .41 ! cf U.Olgstrom |
---|
| 66 | REAL ricr |
---|
| 67 | PARAMETER (ricr=0.4) |
---|
| 68 | REAL fak |
---|
| 69 | PARAMETER (fak=8.5) ! b calcul du Prandtl et de dTetas |
---|
| 70 | REAL fakn |
---|
| 71 | PARAMETER (fakn=7.2) ! a |
---|
| 72 | REAL onet |
---|
| 73 | PARAMETER (onet=1.0/3.0) |
---|
| 74 | REAL t_coup |
---|
| 75 | PARAMETER(t_coup=273.15) |
---|
| 76 | REAL zkmin |
---|
| 77 | PARAMETER (zkmin=0.01) |
---|
| 78 | REAL betam |
---|
| 79 | PARAMETER (betam=15.0) ! pour Phim / h dans la S.L stable |
---|
| 80 | REAL betah |
---|
| 81 | PARAMETER (betah=15.0) |
---|
| 82 | REAL betas |
---|
| 83 | PARAMETER (betas=5.0) ! Phit dans la S.L. stable (mais 2 formes / z/OBL<>1 |
---|
| 84 | REAL sffrac |
---|
| 85 | PARAMETER (sffrac=0.1) ! S.L. = z/h < .1 |
---|
| 86 | REAL binm |
---|
| 87 | PARAMETER (binm=betam*sffrac) |
---|
| 88 | REAL binh |
---|
| 89 | PARAMETER (binh=betah*sffrac) |
---|
| 90 | REAL ccon |
---|
| 91 | PARAMETER (ccon=fak*sffrac*vk) |
---|
| 92 | c |
---|
| 93 | REAL q_star,t_star |
---|
| 94 | REAL b1,b2,b212,b2sr ! Lambert correlations T' q' avec T* q* |
---|
| 95 | PARAMETER (b1=70.,b2=20.) |
---|
| 96 | c |
---|
| 97 | REAL z(klon,klev) |
---|
| 98 | cAM REAL pcfm(klon,klev), pcfh(klon,klev) |
---|
| 99 | cAM |
---|
| 100 | REAL zref |
---|
| 101 | PARAMETER (zref=2.) ! Niveau de ref a 2m peut eventuellement |
---|
| 102 | c etre choisi a 10m |
---|
| 103 | cMA |
---|
| 104 | c |
---|
| 105 | INTEGER i, k, j |
---|
| 106 | REAL zxt |
---|
| 107 | cAM REAL zxt, zxq, zxu, zxv, zxmod, taux, tauy |
---|
| 108 | cAM REAL zx_alf1, zx_alf2 ! parametres pour extrapolation |
---|
| 109 | REAL khfs(klon) ! surface kinematic heat flux [mK/s] |
---|
| 110 | REAL kqfs(klon) ! sfc kinematic constituent flux [m/s] |
---|
| 111 | REAL heatv(klon) ! surface virtual heat flux |
---|
| 112 | REAL rhino(klon,klev) ! bulk Richardon no. mais en Theta_v |
---|
| 113 | LOGICAL unstbl(klon) ! pts w/unstbl pbl (positive virtual ht flx) |
---|
| 114 | LOGICAL stblev(klon) ! stable pbl with levels within pbl |
---|
| 115 | LOGICAL unslev(klon) ! unstbl pbl with levels within pbl |
---|
| 116 | LOGICAL unssrf(klon) ! unstb pbl w/lvls within srf pbl lyr |
---|
| 117 | LOGICAL unsout(klon) ! unstb pbl w/lvls in outer pbl lyr |
---|
| 118 | LOGICAL check(klon) ! True=>chk if Richardson no.>critcal |
---|
| 119 | LOGICAL omegafl(klon) ! flag de prolongerment cape pour pt Omega |
---|
| 120 | REAL pblh(klon) |
---|
| 121 | REAL pblT(klon) |
---|
| 122 | REAL plcl(klon) |
---|
| 123 | cAM REAL cgh(klon,2:klev) ! counter-gradient term for heat [K/m] |
---|
| 124 | cAM REAL cgq(klon,2:klev) ! counter-gradient term for constituents |
---|
| 125 | cAM REAL cgs(klon,2:klev) ! counter-gradient star (cg/flux) |
---|
| 126 | REAL obklen(klon) ! Monin-Obukhov lengh |
---|
| 127 | cAM REAL ztvd, ztvu, |
---|
| 128 | REAL zdu2 |
---|
| 129 | REAL therm(klon) ! thermal virtual temperature excess |
---|
| 130 | REAL trmb1(klon),trmb2(klon),trmb3(klon) |
---|
| 131 | C Algorithme thermique |
---|
| 132 | REAL s(klon,klev) ! [P/Po]^Kappa milieux couches |
---|
| 133 | REAL Th_th(klon) ! potential temperature of thermal |
---|
| 134 | REAL The_th(klon) ! equivalent potential temperature of thermal |
---|
| 135 | REAL qT_th(klon) ! total water of thermal |
---|
| 136 | REAL Tbef(klon) ! T thermique niveau precedent |
---|
| 137 | REAL qsatbef(klon) |
---|
| 138 | LOGICAL Zsat(klon) ! le thermique est sature |
---|
| 139 | REAL Cape(klon) ! Cape du thermique |
---|
| 140 | REAL Kape(klon) ! Cape locale |
---|
| 141 | REAL EauLiq(klon) ! Eau liqu integr du thermique |
---|
| 142 | REAL ctei(klon) ! Critere d'instab d'entrainmt des nuages de CL |
---|
| 143 | REAL the1,the2,aa,bb,zthvd,zthvu,xintpos,qqsat |
---|
| 144 | cIM 091204 BEG |
---|
| 145 | REAL a1,a2,a3 |
---|
| 146 | cIM 091204 END |
---|
| 147 | REAL xhis,rnum,denom,th1,th2,thv1,thv2,ql2 |
---|
| 148 | REAL dqsat_dt,qsat2,qT1,q2,t1,t2,xnull,delt_the |
---|
| 149 | REAL delt_qt,delt_2,quadsat,spblh,reduc |
---|
| 150 | c |
---|
| 151 | REAL phiminv(klon) ! inverse phi function for momentum |
---|
| 152 | REAL phihinv(klon) ! inverse phi function for heat |
---|
| 153 | REAL wm(klon) ! turbulent velocity scale for momentum |
---|
| 154 | REAL fak1(klon) ! k*ustar*pblh |
---|
| 155 | REAL fak2(klon) ! k*wm*pblh |
---|
| 156 | REAL fak3(klon) ! fakn*wstr/wm |
---|
| 157 | REAL pblk(klon) ! level eddy diffusivity for momentum |
---|
| 158 | REAL pr(klon) ! Prandtl number for eddy diffusivities |
---|
| 159 | REAL zl(klon) ! zmzp / Obukhov length |
---|
| 160 | REAL zh(klon) ! zmzp / pblh |
---|
| 161 | REAL zzh(klon) ! (1-(zmzp/pblh))**2 |
---|
| 162 | REAL wstr(klon) ! w*, convective velocity scale |
---|
| 163 | REAL zm(klon) ! current level height |
---|
| 164 | REAL zp(klon) ! current level height + one level up |
---|
| 165 | REAL zcor, zdelta, zcvm5 |
---|
| 166 | cAM REAL zxqs |
---|
| 167 | REAL fac, pblmin, zmzp, term |
---|
| 168 | c |
---|
| 169 | #include "YOETHF.h" |
---|
| 170 | #include "FCTTRE.h" |
---|
[674] | 171 | |
---|
| 172 | |
---|
| 173 | |
---|
| 174 | ! initialisations (Anne) |
---|
[704] | 175 | isommet=klev |
---|
[674] | 176 | th_th(:) = 0. |
---|
| 177 | q_star = 0 |
---|
| 178 | t_star = 0 |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | b212=sqrt(b1*b2) |
---|
| 182 | b2sr=sqrt(b2) |
---|
[644] | 183 | c |
---|
| 184 | C ============================================================ |
---|
| 185 | C Fonctions thermo implicites |
---|
| 186 | C ============================================================ |
---|
| 187 | c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 188 | c Tetens : pression partielle de vap d'eau e_sat(T) |
---|
| 189 | c ================================================= |
---|
| 190 | C++ e_sat(T) = r2*exp( r3*(T-Tf)/(T-r4) ) id a r2*FOEWE |
---|
| 191 | C++ avec : |
---|
| 192 | C++ Tf = 273.16 K (Temp de fusion de la glace) |
---|
| 193 | C++ r2 = 611.14 Pa |
---|
| 194 | C++ r3 = 17.269 (liquide) 21.875 (solide) adim |
---|
| 195 | C++ r4 = 35.86 7.66 Kelvin |
---|
| 196 | C++ q_sat = eps*e_sat/(p-(1-eps)*e_sat) |
---|
[704] | 197 | C++ deriv� : |
---|
[644] | 198 | C++ ========= |
---|
| 199 | C++ r3*(Tf-r4)*q_sat(T,p) |
---|
| 200 | C++ d_qsat_dT = -------------------------------- |
---|
| 201 | C++ (T-r4)^2*( 1-(1-eps)*e_sat(T)/p ) |
---|
| 202 | c++ pour zcvm5=Lv, c'est FOEDE |
---|
| 203 | c++ Rq :(1.-REPS)*esarg/Parg id a RETV*Qsat |
---|
| 204 | C ------------------------------------------------------------------ |
---|
| 205 | c |
---|
| 206 | c Initialisation |
---|
| 207 | RLvCp = RLVTT/RCPD |
---|
| 208 | REPS = RD/RV |
---|
| 209 | |
---|
| 210 | c |
---|
| 211 | c DO i = 1, klon |
---|
| 212 | c pcfh(i,1) = cd_h(i) |
---|
| 213 | c pcfm(i,1) = cd_m(i) |
---|
| 214 | c ENDDO |
---|
| 215 | c DO k = 2, klev |
---|
| 216 | c DO i = 1, klon |
---|
| 217 | c pcfh(i,k) = zkmin |
---|
| 218 | c pcfm(i,k) = zkmin |
---|
| 219 | c cgs(i,k) = 0.0 |
---|
| 220 | c cgh(i,k) = 0.0 |
---|
| 221 | c cgq(i,k) = 0.0 |
---|
| 222 | c ENDDO |
---|
| 223 | c ENDDO |
---|
| 224 | c |
---|
| 225 | c Calculer les hauteurs de chaque couche |
---|
| 226 | c (geopotentielle Int_dp/ro = Int_[Rd.T.dp/p] z = geop/g) |
---|
| 227 | c pourquoi ne pas utiliser Phi/RG ? |
---|
| 228 | DO i = 1, knon |
---|
| 229 | z(i,1) = RD * t(i,1) / (0.5*(paprs(i,1)+pplay(i,1))) |
---|
| 230 | . * (paprs(i,1)-pplay(i,1)) / RG |
---|
| 231 | s(i,1) = (pplay(i,1)/paprs(i,1))**RKappa |
---|
| 232 | ENDDO |
---|
| 233 | c s(k) = [pplay(k)/ps]^kappa |
---|
| 234 | c + + + + + + + + + pplay <-> s(k) t dp=pplay(k-1)-pplay(k) |
---|
| 235 | c |
---|
| 236 | c ----------------- paprs <-> sig(k) |
---|
| 237 | c |
---|
| 238 | c + + + + + + + + + pplay <-> s(k-1) |
---|
| 239 | c |
---|
| 240 | c |
---|
| 241 | c + + + + + + + + + pplay <-> s(1) t dp=paprs-pplay z(1) |
---|
| 242 | c |
---|
| 243 | c ----------------- paprs <-> sig(1) |
---|
| 244 | c |
---|
| 245 | DO k = 2, klev |
---|
| 246 | DO i = 1, knon |
---|
| 247 | z(i,k) = z(i,k-1) |
---|
| 248 | . + RD * 0.5*(t(i,k-1)+t(i,k)) / paprs(i,k) |
---|
| 249 | . * (pplay(i,k-1)-pplay(i,k)) / RG |
---|
| 250 | s(i,k) = (pplay(i,k)/paprs(i,1))**RKappa |
---|
| 251 | ENDDO |
---|
| 252 | ENDDO |
---|
| 253 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 254 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 255 | c +++ Determination des grandeurs de surface +++++++++++++++++++++ |
---|
| 256 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 257 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 258 | DO i = 1, knon |
---|
| 259 | cAM IF (thermcep) THEN |
---|
| 260 | cAM zdelta=MAX(0.,SIGN(1.,RTT-tsol(i))) |
---|
| 261 | c zcvm5 = R5LES*RLVTT*(1.-zdelta) + R5IES*RLSTT*zdelta |
---|
| 262 | c zcvm5 = zcvm5 / RCPD / (1.0+RVTMP2*q(i,1)) |
---|
| 263 | cAM zxqs= r2es * FOEEW(tsol(i),zdelta)/paprs(i,1) |
---|
| 264 | cAM zxqs=MIN(0.5,zxqs) |
---|
| 265 | cAM zcor=1./(1.-retv*zxqs) |
---|
| 266 | cAM zxqs=zxqs*zcor |
---|
| 267 | cAM ELSE |
---|
| 268 | cAM IF (tsol(i).LT.t_coup) THEN |
---|
| 269 | cAM zxqs = qsats(tsol(i)) / paprs(i,1) |
---|
| 270 | cAM ELSE |
---|
| 271 | cAM zxqs = qsatl(tsol(i)) / paprs(i,1) |
---|
| 272 | cAM ENDIF |
---|
| 273 | cAM ENDIF |
---|
| 274 | c niveau de reference bulk; mais ici, c,a pourrait etre le niveau de ref du thermique |
---|
| 275 | cAM zx_alf1 = 1.0 |
---|
| 276 | cAM zx_alf2 = 1.0 - zx_alf1 |
---|
| 277 | cAM zxt = (t(i,1)+z(i,1)*RG/RCPD/(1.+RVTMP2*q(i,1))) |
---|
| 278 | cAM . *(1.+RETV*q(i,1))*zx_alf1 |
---|
| 279 | cAM . + (t(i,2)+z(i,2)*RG/RCPD/(1.+RVTMP2*q(i,2))) |
---|
| 280 | cAM . *(1.+RETV*q(i,2))*zx_alf2 |
---|
| 281 | cAM zxu = u(i,1)*zx_alf1+u(i,2)*zx_alf2 |
---|
| 282 | cAM zxv = v(i,1)*zx_alf1+v(i,2)*zx_alf2 |
---|
| 283 | cAM zxq = q(i,1)*zx_alf1+q(i,2)*zx_alf2 |
---|
| 284 | cAM |
---|
| 285 | cAMAM zxu = u10m(i) |
---|
| 286 | cAMAM zxv = v10m(i) |
---|
| 287 | cAMAM zxmod = 1.0+SQRT(zxu**2+zxv**2) |
---|
| 288 | cAM Niveau de ref choisi a 2m |
---|
| 289 | zxt = t2m(i) |
---|
| 290 | |
---|
| 291 | c *************************************************** |
---|
| 292 | c attention, il doit s'agir de <w'theta'> |
---|
| 293 | c ;Calcul de tcls virtuel et de w'theta'virtuel |
---|
| 294 | c ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 295 | c tcls=tcls*(1+.608*qcls) |
---|
| 296 | c |
---|
| 297 | c ;Pour avoir w'theta', |
---|
| 298 | c ; il faut diviser par ro.Cp |
---|
| 299 | c Cp=Cpd*(1+0.84*qcls) |
---|
| 300 | c fcs=fcs/(ro_surf*Cp) |
---|
| 301 | c ;On transforme w'theta' en w'thetav' |
---|
| 302 | c Lv=(2.501-0.00237*(tcls-273.15))*1.E6 |
---|
| 303 | c xle=xle/(ro_surf*Lv) |
---|
| 304 | c fcsv=fcs+.608*xle*tcls |
---|
| 305 | c *************************************************** |
---|
| 306 | cAM khfs(i) = (tsol(i)*(1.+RETV*q(i,1))-zxt) *zxmod*cd_h(i) |
---|
| 307 | cAM kqfs(i) = (zxqs-zxq) *zxmod*cd_h(i) * beta(i) |
---|
| 308 | cAM |
---|
| 309 | cdif khfs est deja w't'_v / heatv(i) = khfs(i) + RETV*zxt*kqfs(i) |
---|
| 310 | cAM calcule de Ro = paprs(i,1)/Rd zxt |
---|
| 311 | cAM convention >0 vers le bas ds lmdz |
---|
| 312 | khfs(i) = - flux_t(i,1)*zxt*Rd / (RCPD*paprs(i,1)) |
---|
| 313 | kqfs(i) = - flux_q(i,1)*zxt*Rd / (paprs(i,1)) |
---|
| 314 | cAM verifier que khfs et kqfs sont bien de la forme w'l' |
---|
| 315 | heatv(i) = khfs(i) + 0.608*zxt*kqfs(i) |
---|
| 316 | c a comparer aussi aux sorties de clqh : flux_T/RoCp et flux_q/RoLv |
---|
| 317 | cAM heatv(i) = khfs(i) |
---|
| 318 | cAM ustar est en entree |
---|
| 319 | cAM taux = zxu *zxmod*cd_m(i) |
---|
| 320 | cAM tauy = zxv *zxmod*cd_m(i) |
---|
| 321 | cAM ustar(i) = SQRT(taux**2+tauy**2) |
---|
| 322 | cAM ustar(i) = MAX(SQRT(ustar(i)),0.01) |
---|
| 323 | c Theta et qT du thermique sans exces (interpolin vers surf) |
---|
| 324 | c chgt de niveau du thermique (jeudi 30/12/1999) |
---|
| 325 | c (interpolation lineaire avant integration phi_h) |
---|
| 326 | cAM qT_th(i) = zxqs*beta(i) + 4./z(i,1)*(q(i,1)-zxqs*beta(i)) |
---|
| 327 | cAM qT_th(i) = max(qT_th(i),q(i,1)) |
---|
| 328 | qT_th(i) = q2m(i) |
---|
| 329 | cn The_th restera la Theta du thermique sans exces jusqu'a 2eme calcul |
---|
| 330 | cn reste a regler convention P) pour Theta |
---|
| 331 | c The_th(i) = tsol(i) + 4./z(i,1)*(t(i,1)-tsol(i)) |
---|
| 332 | c - + RLvCp*qT_th(i) |
---|
| 333 | cAM Th_th(i) = tsol(i) + 4./z(i,1)*(t(i,1)-tsol(i)) |
---|
| 334 | Th_th(i) = t2m(i) |
---|
| 335 | ENDDO |
---|
| 336 | c |
---|
| 337 | DO i = 1, knon |
---|
| 338 | rhino(i,1) = 0.0 ! Global Richardson |
---|
| 339 | check(i) = .TRUE. |
---|
| 340 | pblh(i) = z(i,1) ! on initialise pblh a l'altitude du 1er niveau |
---|
| 341 | plcl(i) = 6000. |
---|
| 342 | c Lambda = -u*^3 / (alpha.g.kvon.<w'Theta'v> |
---|
| 343 | obklen(i) = -t(i,1)*ustar(i)**3/(RG*vk*heatv(i)) |
---|
| 344 | trmb1(i) = 0. |
---|
| 345 | trmb2(i) = 0. |
---|
| 346 | trmb3(i) = 0. |
---|
| 347 | ENDDO |
---|
| 348 | |
---|
| 349 | C |
---|
| 350 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 351 | C PBL height calculation: |
---|
| 352 | C Search for level of pbl. Scan upward until the Richardson number between |
---|
| 353 | C the first level and the current level exceeds the "critical" value. |
---|
| 354 | C (bonne idee Nu de separer le Ric et l'exces de temp du thermique) |
---|
| 355 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 356 | fac = 100.0 |
---|
| 357 | DO k = 2, isommet |
---|
| 358 | DO i = 1, knon |
---|
| 359 | IF (check(i)) THEN |
---|
| 360 | ! pourquoi / niveau 1 (au lieu du sol) et le terme en u*^2 ? |
---|
| 361 | ctest zdu2 = (u(i,k)-u(i,1))**2+(v(i,k)-v(i,1))**2+fac*ustar(i)**2 |
---|
| 362 | zdu2 = u(i,k)**2+v(i,k)**2 |
---|
| 363 | zdu2 = max(zdu2,1.0e-20) |
---|
| 364 | c Theta_v environnement |
---|
| 365 | zthvd=t(i,k)/s(i,k)*(1.+RETV*q(i,k)) |
---|
| 366 | c |
---|
| 367 | c therm Theta_v sans exces (avec hypothese fausse de H&B, sinon, |
---|
| 368 | c passer par Theta_e et virpot) |
---|
| 369 | c zthvu=t(i,1)/s(i,1)*(1.+RETV*q(i,1)) |
---|
| 370 | cAM zthvu = Th_th(i)*(1.+RETV*q(i,1)) |
---|
| 371 | zthvu = Th_th(i)*(1.+RETV*qT_th(i)) |
---|
| 372 | c Le Ri par Theta_v |
---|
| 373 | cAM rhino(i,k) = (z(i,k)-z(i,1))*RG*(zthvd-zthvu) |
---|
| 374 | cAM . /(zdu2*0.5*(zthvd+zthvu)) |
---|
| 375 | cAM On a nveau de ref a 2m ??? |
---|
| 376 | rhino(i,k) = (z(i,k)-zref)*RG*(zthvd-zthvu) |
---|
| 377 | . /(zdu2*0.5*(zthvd+zthvu)) |
---|
| 378 | c |
---|
| 379 | IF (rhino(i,k).GE.ricr) THEN |
---|
| 380 | pblh(i) = z(i,k-1) + (z(i,k-1)-z(i,k)) * |
---|
| 381 | . (ricr-rhino(i,k-1))/(rhino(i,k-1)-rhino(i,k)) |
---|
| 382 | c test04 |
---|
| 383 | pblh(i) = pblh(i) + 100. |
---|
| 384 | pblT(i) = t(i,k-1) + (t(i,k)-t(i,k-1)) * |
---|
| 385 | . (pblh(i)-z(i,k-1))/(z(i,k)-z(i,k-1)) |
---|
| 386 | check(i) = .FALSE. |
---|
| 387 | ENDIF |
---|
| 388 | ENDIF |
---|
| 389 | ENDDO |
---|
| 390 | ENDDO |
---|
| 391 | |
---|
| 392 | C |
---|
| 393 | C Set pbl height to maximum value where computation exceeds number of |
---|
| 394 | C layers allowed |
---|
| 395 | C |
---|
| 396 | DO i = 1, knon |
---|
| 397 | if (check(i)) pblh(i) = z(i,isommet) |
---|
| 398 | ENDDO |
---|
| 399 | C |
---|
| 400 | C Improve estimate of pbl height for the unstable points. |
---|
| 401 | C Find unstable points (sensible heat flux is upward): |
---|
| 402 | C |
---|
| 403 | DO i = 1, knon |
---|
| 404 | IF (heatv(i) .GT. 0.) THEN |
---|
| 405 | unstbl(i) = .TRUE. |
---|
| 406 | check(i) = .TRUE. |
---|
| 407 | ELSE |
---|
| 408 | unstbl(i) = .FALSE. |
---|
| 409 | check(i) = .FALSE. |
---|
| 410 | ENDIF |
---|
| 411 | ENDDO |
---|
| 412 | C |
---|
| 413 | C For the unstable case, compute velocity scale and the |
---|
| 414 | C convective temperature excess: |
---|
| 415 | C |
---|
| 416 | DO i = 1, knon |
---|
| 417 | IF (check(i)) THEN |
---|
| 418 | phiminv(i) = (1.-binm*pblh(i)/obklen(i))**onet |
---|
| 419 | c *************************************************** |
---|
| 420 | c Wm ? et W* ? c'est la formule pour z/h < .1 |
---|
| 421 | c ;Calcul de w* ;; |
---|
| 422 | c ;;;;;;;;;;;;;;;; |
---|
| 423 | c w_star=((g/tcls)*fcsv*z(ind))^(1/3.) [ou prendre la premiere approx de h) |
---|
| 424 | c ;; CALCUL DE wm ;; |
---|
| 425 | c ;;;;;;;;;;;;;;;;;; |
---|
| 426 | c ; Ici on considerera que l'on est dans la couche de surf jusqu'a 100m |
---|
| 427 | c ; On prend svt couche de surface=0.1*h mais on ne connait pas h |
---|
| 428 | c ;;;;;;;;;;;Dans la couche de surface |
---|
| 429 | c if (z(ind) le 20) then begin |
---|
| 430 | c Phim=(1.-15.*(z(ind)/L))^(-1/3.) |
---|
| 431 | c wm=u_star/Phim |
---|
| 432 | c ;;;;;;;;;;;En dehors de la couche de surface |
---|
| 433 | c endif else if (z(ind) gt 20) then begin |
---|
| 434 | c wm=(u_star^3+c1*w_star^3)^(1/3.) |
---|
| 435 | c endif |
---|
| 436 | c *************************************************** |
---|
| 437 | wm(i)= ustar(i)*phiminv(i) |
---|
| 438 | c====================================================================== |
---|
| 439 | cvaleurs de Dominique Lambert de la campagne SEMAPHORE : |
---|
| 440 | c <T'^2> = 100.T*^2; <q'^2> = 20.q*^2 a 10m |
---|
| 441 | c <Tv'^2> = (1+1.2q).100.T* + 1.2Tv.sqrt(20*100).T*.q* + (.608*Tv)^2*20.q*^2; |
---|
| 442 | c et dTetavS = sqrt(<Tv'^2>) ainsi calculee. |
---|
| 443 | c avec : T*=<w'T'>_s/w* et q*=<w'q'>/w* |
---|
| 444 | c !!! on peut donc utiliser w* pour les fluctuations <-> Lambert |
---|
| 445 | c(leur corellation pourrait dependre de beta par ex) |
---|
| 446 | c if fcsv(i,j) gt 0 then begin |
---|
| 447 | c dTetavs=b1*(1.+2.*.608*q_10(i,j))*(fcs(i,j)/wm(i,j))^2+$ |
---|
| 448 | c (.608*Thetav_10(i,j))^2*b2*(xle(i,j)/wm(i,j))^2+$ |
---|
| 449 | c 2.*.608*thetav_10(i,j)*sqrt(b1*b2)*(xle(i,j)/wm(i,j))*(fcs(i,j)/wm(i,j)) |
---|
| 450 | c dqs=b2*(xle(i,j)/wm(i,j))^2 |
---|
| 451 | c theta_s(i,j)=thetav_10(i,j)+sqrt(dTetavs) |
---|
| 452 | c q_s(i,j)=q_10(i,j)+sqrt(dqs) |
---|
| 453 | c endif else begin |
---|
| 454 | c Theta_s(i,j)=thetav_10(i,j) |
---|
| 455 | c q_s(i,j)=q_10(i,j) |
---|
| 456 | c endelse |
---|
| 457 | c====================================================================== |
---|
| 458 | c |
---|
| 459 | cHBTM therm(i) = heatv(i)*fak/wm(i) |
---|
| 460 | c forme Mathieu : |
---|
| 461 | q_star = kqfs(i)/wm(i) |
---|
| 462 | t_star = khfs(i)/wm(i) |
---|
| 463 | cIM 091204 BEG |
---|
| 464 | IF(1.EQ.0) THEN |
---|
| 465 | IF(t_star.LT.0..OR.q_star.LT.0.) THEN |
---|
| 466 | print*,'i t_star q_star khfs kqfs wm',i,t_star,q_star, |
---|
| 467 | $ khfs(i),kqfs(i),wm(i) |
---|
| 468 | ENDIF |
---|
| 469 | ENDIF |
---|
| 470 | cIM 091204 END |
---|
| 471 | cAM Nveau cde ref 2m => |
---|
| 472 | cAM therm(i) = sqrt( b1*(1.+2.*RETV*q(i,1))*t_star**2 |
---|
| 473 | cAM + + (RETV*T(i,1))**2*b2*q_star**2 |
---|
| 474 | cAM + + 2.*RETV*T(i,1)*b212*q_star*t_star |
---|
| 475 | cAM + ) |
---|
| 476 | cIM 091204 BEG |
---|
| 477 | a1=b1*(1.+2.*RETV*qT_th(i))*t_star**2 |
---|
[704] | 478 | a2=(RETV*Th_th(i))**2*b2*q_star*q_star |
---|
[644] | 479 | a3=2.*RETV*Th_th(i)*b212*q_star*t_star |
---|
| 480 | aa=a1+a2+a3 |
---|
| 481 | IF(1.EQ.0) THEN |
---|
| 482 | IF (aa.LT.0.) THEN |
---|
| 483 | print*,'i a1 a2 a3 aa',i,a1,a2,a3,aa |
---|
| 484 | print*,'i qT_th Th_th t_star q_star RETV b1 b2 b212', |
---|
| 485 | $ i,qT_th(i),Th_th(i),t_star,q_star,RETV,b1,b2,b212 |
---|
| 486 | ENDIF |
---|
| 487 | ENDIF |
---|
| 488 | cIM 091204 END |
---|
| 489 | therm(i) = sqrt( b1*(1.+2.*RETV*qT_th(i))*t_star**2 |
---|
[704] | 490 | + + (RETV*Th_th(i))**2*b2*q_star*q_star |
---|
[644] | 491 | cIM 101204 + + 2.*RETV*Th_th(i)*b212*q_star*t_star |
---|
| 492 | + + max(0.,2.*RETV*Th_th(i)*b212*q_star*t_star) |
---|
| 493 | + ) |
---|
| 494 | c |
---|
| 495 | c Theta et qT du thermique (forme H&B) avec exces |
---|
| 496 | c (attention, on ajoute therm(i) qui est virtuelle ...) |
---|
| 497 | c pourquoi pas sqrt(b1)*t_star ? |
---|
| 498 | c dqs = b2sr*kqfs(i)/wm(i) |
---|
| 499 | qT_th(i) = qT_th(i) + b2sr*q_star |
---|
| 500 | cnew on differre le calcul de Theta_e |
---|
| 501 | c The_th(i) = The_th(i) + therm(i) + RLvCp*qT_th(i) |
---|
| 502 | c ou: The_th(i) = The_th(i) + sqrt(b1)*khfs(i)/wm(i) + RLvCp*qT_th(i) |
---|
| 503 | rhino(i,1) = 0.0 |
---|
| 504 | ENDIF |
---|
| 505 | ENDDO |
---|
| 506 | C |
---|
| 507 | c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 508 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 509 | C ++ Improve pblh estimate for unstable conditions using the +++++++ |
---|
| 510 | C ++ convective temperature excess : +++++++ |
---|
| 511 | c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 512 | c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
| 513 | C |
---|
| 514 | DO k = 2, isommet |
---|
| 515 | DO i = 1, knon |
---|
| 516 | IF (check(i)) THEN |
---|
| 517 | ctest zdu2 = (u(i,k)-u(i,1))**2+(v(i,k)-v(i,1))**2+fac*ustar(i)**2 |
---|
| 518 | zdu2 = u(i,k)**2+v(i,k)**2 |
---|
| 519 | zdu2 = max(zdu2,1.0e-20) |
---|
| 520 | c Theta_v environnement |
---|
| 521 | zthvd=t(i,k)/s(i,k)*(1.+RETV*q(i,k)) |
---|
| 522 | c |
---|
| 523 | c et therm Theta_v (avec hypothese de constance de H&B, |
---|
| 524 | c zthvu=(t(i,1)+therm(i))/s(i,1)*(1.+RETV*q(i,1)) |
---|
| 525 | zthvu = Th_th(i)*(1.+RETV*qT_th(i)) + therm(i) |
---|
| 526 | |
---|
| 527 | c |
---|
| 528 | c Le Ri par Theta_v |
---|
| 529 | cAM Niveau de ref 2m |
---|
| 530 | cAM rhino(i,k) = (z(i,k)-z(i,1))*RG*(zthvd-zthvu) |
---|
| 531 | cAM . /(zdu2*0.5*(zthvd+zthvu)) |
---|
| 532 | rhino(i,k) = (z(i,k)-zref)*RG*(zthvd-zthvu) |
---|
| 533 | . /(zdu2*0.5*(zthvd+zthvu)) |
---|
| 534 | c |
---|
| 535 | c |
---|
| 536 | IF (rhino(i,k).GE.ricr) THEN |
---|
| 537 | pblh(i) = z(i,k-1) + (z(i,k-1)-z(i,k)) * |
---|
| 538 | . (ricr-rhino(i,k-1))/(rhino(i,k-1)-rhino(i,k)) |
---|
| 539 | c test04 |
---|
| 540 | pblh(i) = pblh(i) + 100. |
---|
| 541 | pblT(i) = t(i,k-1) + (t(i,k)-t(i,k-1)) * |
---|
| 542 | . (pblh(i)-z(i,k-1))/(z(i,k)-z(i,k-1)) |
---|
| 543 | check(i) = .FALSE. |
---|
| 544 | cIM 170305 BEG |
---|
| 545 | IF(1.EQ.0) THEN |
---|
| 546 | c debug print -120;34 -34- 58 et 0;26 wamp |
---|
| 547 | if (i.eq.950.or.i.eq.192.or.i.eq.624.or.i.eq.118) then |
---|
| 548 | print*,' i,Th_th,Therm,qT :',i,Th_th(i),therm(i),qT_th(i) |
---|
| 549 | q_star = kqfs(i)/wm(i) |
---|
| 550 | t_star = khfs(i)/wm(i) |
---|
| 551 | print*,'q* t*, b1,b2,b212 ',q_star,t_star |
---|
| 552 | - , b1*(1.+2.*RETV*qT_th(i))*t_star**2 |
---|
| 553 | - , (RETV*Th_th(i))**2*b2*q_star**2 |
---|
| 554 | - , 2.*RETV*Th_th(i)*b212*q_star*t_star |
---|
| 555 | print*,'zdu2 ,100.*ustar(i)**2',zdu2 ,fac*ustar(i)**2 |
---|
| 556 | endif |
---|
| 557 | ENDIF !(1.EQ.0) THEN |
---|
| 558 | cIM 170305 END |
---|
| 559 | c q_star = kqfs(i)/wm(i) |
---|
| 560 | c t_star = khfs(i)/wm(i) |
---|
| 561 | c trmb1(i) = b1*(1.+2.*RETV*q(i,1))*t_star**2 |
---|
| 562 | c trmb2(i) = (RETV*T(i,1))**2*b2*q_star**2 |
---|
| 563 | c Omega now trmb3(i) = 2.*RETV*T(i,1)*b212*q_star*t_star |
---|
| 564 | ENDIF |
---|
| 565 | ENDIF |
---|
| 566 | ENDDO |
---|
| 567 | ENDDO |
---|
| 568 | C |
---|
| 569 | C Set pbl height to maximum value where computation exceeds number of |
---|
| 570 | C layers allowed |
---|
| 571 | C |
---|
| 572 | DO i = 1, knon |
---|
| 573 | if (check(i)) pblh(i) = z(i,isommet) |
---|
| 574 | ENDDO |
---|
| 575 | C |
---|
| 576 | C PBL height must be greater than some minimum mechanical mixing depth |
---|
| 577 | C Several investigators have proposed minimum mechanical mixing depth |
---|
| 578 | C relationships as a function of the local friction velocity, u*. We |
---|
| 579 | C make use of a linear relationship of the form h = c u* where c=700. |
---|
| 580 | C The scaling arguments that give rise to this relationship most often |
---|
| 581 | C represent the coefficient c as some constant over the local coriolis |
---|
| 582 | C parameter. Here we make use of the experimental results of Koracin |
---|
| 583 | C and Berkowicz (1988) [BLM, Vol 43] for wich they recommend 0.07/f |
---|
| 584 | C where f was evaluated at 39.5 N and 52 N. Thus we use a typical mid |
---|
| 585 | C latitude value for f so that c = 0.07/f = 700. |
---|
| 586 | C |
---|
| 587 | DO i = 1, knon |
---|
| 588 | pblmin = 700.0*ustar(i) |
---|
| 589 | pblh(i) = MAX(pblh(i),pblmin) |
---|
| 590 | c par exemple : |
---|
| 591 | pblT(i) = t(i,2) + (t(i,3)-t(i,2)) * |
---|
| 592 | . (pblh(i)-z(i,2))/(z(i,3)-z(i,2)) |
---|
| 593 | ENDDO |
---|
| 594 | |
---|
| 595 | C ******************************************************************** |
---|
| 596 | C pblh is now available; do preparation for diffusivity calculation : |
---|
| 597 | C ******************************************************************** |
---|
| 598 | DO i = 1, knon |
---|
| 599 | check(i) = .TRUE. |
---|
| 600 | Zsat(i) = .FALSE. |
---|
| 601 | c omegafl utilise pour prolongement CAPE |
---|
| 602 | omegafl(i) = .FALSE. |
---|
| 603 | Cape(i) = 0. |
---|
| 604 | Kape(i) = 0. |
---|
| 605 | EauLiq(i) = 0. |
---|
| 606 | CTEI(i) = 0. |
---|
| 607 | pblk(i) = 0.0 |
---|
| 608 | fak1(i) = ustar(i)*pblh(i)*vk |
---|
| 609 | C |
---|
| 610 | C Do additional preparation for unstable cases only, set temperature |
---|
| 611 | C and moisture perturbations depending on stability. |
---|
| 612 | C *** Rq: les formule sont prises dans leur forme CS *** |
---|
| 613 | IF (unstbl(i)) THEN |
---|
| 614 | cAM Niveau de ref du thermique |
---|
| 615 | cAM zxt=(t(i,1)-z(i,1)*0.5*RG/RCPD/(1.+RVTMP2*q(i,1))) |
---|
| 616 | cAM . *(1.+RETV*q(i,1)) |
---|
| 617 | zxt=(Th_th(i)-zref*0.5*RG/RCPD/(1.+RVTMP2*qT_th(i))) |
---|
| 618 | . *(1.+RETV*qT_th(i)) |
---|
| 619 | phiminv(i) = (1. - binm*pblh(i)/obklen(i))**onet |
---|
| 620 | phihinv(i) = sqrt(1. - binh*pblh(i)/obklen(i)) |
---|
| 621 | wm(i) = ustar(i)*phiminv(i) |
---|
| 622 | fak2(i) = wm(i)*pblh(i)*vk |
---|
| 623 | wstr(i) = (heatv(i)*RG*pblh(i)/zxt)**onet |
---|
| 624 | fak3(i) = fakn*wstr(i)/wm(i) |
---|
| 625 | ENDIF |
---|
| 626 | c Computes Theta_e for thermal (all cases : to be modified) |
---|
| 627 | c attention ajout therm(i) = virtuelle |
---|
| 628 | The_th(i) = Th_th(i) + therm(i) + RLvCp*qT_th(i) |
---|
| 629 | c ou: The_th(i) = Th_th(i) + sqrt(b1)*khfs(i)/wm(i) + RLvCp*qT_th(i) |
---|
| 630 | ENDDO |
---|
| 631 | |
---|
| 632 | C Main level loop to compute the diffusivities and |
---|
| 633 | C counter-gradient terms: |
---|
| 634 | C |
---|
| 635 | DO 1000 k = 2, isommet |
---|
| 636 | C |
---|
| 637 | C Find levels within boundary layer: |
---|
| 638 | C |
---|
| 639 | DO i = 1, knon |
---|
| 640 | unslev(i) = .FALSE. |
---|
| 641 | stblev(i) = .FALSE. |
---|
| 642 | zm(i) = z(i,k-1) |
---|
| 643 | zp(i) = z(i,k) |
---|
| 644 | IF (zkmin.EQ.0.0 .AND. zp(i).GT.pblh(i)) zp(i) = pblh(i) |
---|
| 645 | IF (zm(i) .LT. pblh(i)) THEN |
---|
| 646 | zmzp = 0.5*(zm(i) + zp(i)) |
---|
| 647 | C debug |
---|
| 648 | c if (i.EQ.1864) then |
---|
| 649 | c print*,'i,pblh(1864),obklen(1864)',i,pblh(i),obklen(i) |
---|
| 650 | c endif |
---|
| 651 | |
---|
| 652 | zh(i) = zmzp/pblh(i) |
---|
| 653 | zl(i) = zmzp/obklen(i) |
---|
| 654 | zzh(i) = 0. |
---|
| 655 | IF (zh(i).LE.1.0) zzh(i) = (1. - zh(i))**2 |
---|
| 656 | C |
---|
| 657 | C stblev for points zm < plbh and stable and neutral |
---|
| 658 | C unslev for points zm < plbh and unstable |
---|
| 659 | C |
---|
| 660 | IF (unstbl(i)) THEN |
---|
| 661 | unslev(i) = .TRUE. |
---|
| 662 | ELSE |
---|
| 663 | stblev(i) = .TRUE. |
---|
| 664 | ENDIF |
---|
| 665 | ENDIF |
---|
| 666 | ENDDO |
---|
| 667 | c print*,'fin calcul niveaux' |
---|
| 668 | C |
---|
| 669 | C Stable and neutral points; set diffusivities; counter-gradient |
---|
| 670 | C terms zero for stable case: |
---|
| 671 | C |
---|
| 672 | DO i = 1, knon |
---|
| 673 | IF (stblev(i)) THEN |
---|
| 674 | IF (zl(i).LE.1.) THEN |
---|
| 675 | pblk(i) = fak1(i)*zh(i)*zzh(i)/(1. + betas*zl(i)) |
---|
| 676 | ELSE |
---|
| 677 | pblk(i) = fak1(i)*zh(i)*zzh(i)/(betas + zl(i)) |
---|
| 678 | ENDIF |
---|
| 679 | c pcfm(i,k) = pblk(i) |
---|
| 680 | c pcfh(i,k) = pcfm(i,k) |
---|
| 681 | ENDIF |
---|
| 682 | ENDDO |
---|
| 683 | C |
---|
| 684 | C unssrf, unstable within surface layer of pbl |
---|
| 685 | C unsout, unstable within outer layer of pbl |
---|
| 686 | C |
---|
| 687 | DO i = 1, knon |
---|
| 688 | unssrf(i) = .FALSE. |
---|
| 689 | unsout(i) = .FALSE. |
---|
| 690 | IF (unslev(i)) THEN |
---|
| 691 | IF (zh(i).lt.sffrac) THEN |
---|
| 692 | unssrf(i) = .TRUE. |
---|
| 693 | ELSE |
---|
| 694 | unsout(i) = .TRUE. |
---|
| 695 | ENDIF |
---|
| 696 | ENDIF |
---|
| 697 | ENDDO |
---|
| 698 | C |
---|
| 699 | C Unstable for surface layer; counter-gradient terms zero |
---|
| 700 | C |
---|
| 701 | DO i = 1, knon |
---|
| 702 | IF (unssrf(i)) THEN |
---|
| 703 | term = (1. - betam*zl(i))**onet |
---|
| 704 | pblk(i) = fak1(i)*zh(i)*zzh(i)*term |
---|
| 705 | pr(i) = term/sqrt(1. - betah*zl(i)) |
---|
| 706 | ENDIF |
---|
| 707 | ENDDO |
---|
| 708 | c print*,'fin counter-gradient terms zero' |
---|
| 709 | C |
---|
| 710 | C Unstable for outer layer; counter-gradient terms non-zero: |
---|
| 711 | C |
---|
| 712 | DO i = 1, knon |
---|
| 713 | IF (unsout(i)) THEN |
---|
| 714 | pblk(i) = fak2(i)*zh(i)*zzh(i) |
---|
| 715 | c cgs(i,k) = fak3(i)/(pblh(i)*wm(i)) |
---|
| 716 | c cgh(i,k) = khfs(i)*cgs(i,k) |
---|
| 717 | pr(i) = phiminv(i)/phihinv(i) + ccon*fak3(i)/fak |
---|
| 718 | c cgq(i,k) = kqfs(i)*cgs(i,k) |
---|
| 719 | ENDIF |
---|
| 720 | ENDDO |
---|
| 721 | c print*,'fin counter-gradient terms non zero' |
---|
| 722 | C |
---|
| 723 | C For all unstable layers, compute diffusivities and ctrgrad ter m |
---|
| 724 | C |
---|
| 725 | c DO i = 1, knon |
---|
| 726 | c IF (unslev(i)) THEN |
---|
| 727 | c pcfm(i,k) = pblk(i) |
---|
| 728 | c pcfh(i,k) = pblk(i)/pr(i) |
---|
| 729 | c etc cf original |
---|
| 730 | c ENDIF |
---|
| 731 | c ENDDO |
---|
| 732 | C |
---|
| 733 | C For all layers, compute integral info and CTEI |
---|
| 734 | C |
---|
| 735 | DO i = 1, knon |
---|
| 736 | if (check(i).or.omegafl(i)) then |
---|
| 737 | if (.not.Zsat(i)) then |
---|
| 738 | c Th2 = The_th(i) - RLvCp*qT_th(i) |
---|
| 739 | Th2 = Th_th(i) |
---|
| 740 | T2 = Th2*s(i,k) |
---|
| 741 | c thermodyn functions |
---|
| 742 | zdelta=MAX(0.,SIGN(1.,RTT-T2)) |
---|
| 743 | qqsat= r2es * FOEEW(T2,zdelta)/pplay(i,k) |
---|
| 744 | qqsat=MIN(0.5,qqsat) |
---|
| 745 | zcor=1./(1.-retv*qqsat) |
---|
| 746 | qqsat=qqsat*zcor |
---|
| 747 | c |
---|
| 748 | if (qqsat.lt.qT_th(i)) then |
---|
| 749 | c on calcule lcl |
---|
| 750 | if (k.eq.2) then |
---|
| 751 | plcl(i) = z(i,k) |
---|
| 752 | else |
---|
| 753 | plcl(i) = z(i,k-1) + (z(i,k-1)-z(i,k)) * |
---|
| 754 | . (qT_th(i)-qsatbef(i))/(qsatbef(i)-qqsat) |
---|
| 755 | endif |
---|
| 756 | Zsat(i) = .true. |
---|
| 757 | Tbef(i) = T2 |
---|
| 758 | endif |
---|
| 759 | c |
---|
| 760 | endif |
---|
| 761 | qsatbef(i) = qqsat |
---|
| 762 | camn ???? cette ligne a deja ete faite normalement ? |
---|
| 763 | endif |
---|
| 764 | c print*,'hbtm2 i,k=',i,k |
---|
| 765 | ENDDO |
---|
| 766 | 1000 continue ! end of level loop |
---|
| 767 | cIM 170305 BEG |
---|
| 768 | IF(1.EQ.0) THEN |
---|
| 769 | print*,'hbtm2 ok' |
---|
| 770 | ENDIF !(1.EQ.0) THEN |
---|
| 771 | cIM 170305 END |
---|
| 772 | RETURN |
---|
| 773 | END |
---|