[5099] | 1 | |
---|
[1403] | 2 | ! $Id: calltherm.F90 5231 2024-09-25 11:34:49Z evignon $ |
---|
[5099] | 3 | |
---|
[5103] | 4 | SUBROUTINE calltherm(dtime & |
---|
[5087] | 5 | ,pplay,paprs,pphi,weak_inversion & |
---|
| 6 | ,u_seri_,v_seri_,t_seri_,q_seri_,t_env,q_env,zqsat,debut & |
---|
| 7 | ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs & |
---|
| 8 | ,fm_therm,entr_therm,detr_therm,zqasc,clwcon0,lmax,ratqscth,& |
---|
| 9 | ratqsdiff,zqsatth,ale_bl,alp_bl,lalim_conv,wght_th, & |
---|
| 10 | zmax0,f0,zw2,fraca,ztv,zpspsk,ztla,zthl & |
---|
[1638] | 11 | !!! nrlmd le 10/04/2012 |
---|
[5087] | 12 | ,pbl_tke,pctsrf,omega,airephy & |
---|
| 13 | ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 & |
---|
| 14 | ,n2,s2,strig,zcong,ale_bl_stat & |
---|
| 15 | ,therm_tke_max,env_tke_max & |
---|
| 16 | ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke & |
---|
| 17 | ,alp_bl_conv,alp_bl_stat & |
---|
[1638] | 18 | !!! fin nrlmd le 10/04/2012 |
---|
[5087] | 19 | ,zqla,ztva & |
---|
[4089] | 20 | #ifdef ISO |
---|
[5087] | 21 | ,xt_seri,d_xt_ajs & |
---|
[4089] | 22 | #ifdef DIAGISO |
---|
[5087] | 23 | ,q_the,xt_the & |
---|
[4089] | 24 | #endif |
---|
| 25 | #endif |
---|
[5087] | 26 | ) |
---|
[878] | 27 | |
---|
[940] | 28 | USE dimphy |
---|
[1785] | 29 | USE indice_sol_mod |
---|
[5112] | 30 | USE lmdz_print_control, ONLY: prt_level,lunout |
---|
[4590] | 31 | USE lmdz_thermcell_alp, ONLY: thermcell_alp |
---|
| 32 | USE lmdz_thermcell_main, ONLY: thermcell_main |
---|
| 33 | USE lmdz_thermcell_old, ONLY: thermcell, thermcell_2002, thermcell_eau, calcul_sec, thermcell_sec |
---|
[5111] | 34 | USE lmdz_abort_physic, ONLY: abort_physic |
---|
[5137] | 35 | USE lmdz_clesphys |
---|
[5128] | 36 | |
---|
[4089] | 37 | #ifdef ISO |
---|
[5117] | 38 | USE infotrac_phy, ONLY: ntiso |
---|
[4089] | 39 | #ifdef ISOVERIF |
---|
| 40 | USE isotopes_mod, ONLY: iso_eau,iso_HDO |
---|
| 41 | USE isotopes_verif_mod, ONLY: iso_verif_aberrant_enc_vect2D, & |
---|
| 42 | iso_verif_egalite_vect2D |
---|
| 43 | #endif |
---|
| 44 | #endif |
---|
[1790] | 45 | |
---|
[5113] | 46 | IMPLICIT NONE |
---|
[4089] | 47 | include "thermcell_old.h" |
---|
[878] | 48 | |
---|
[1638] | 49 | |
---|
[973] | 50 | !IM 140508 |
---|
[1776] | 51 | INTEGER, SAVE :: itap |
---|
| 52 | !$OMP THREADPRIVATE(itap) |
---|
[878] | 53 | REAL dtime |
---|
| 54 | LOGICAL debut |
---|
[973] | 55 | LOGICAL logexpr0, logexpr2(klon,klev), logexpr1(klon) |
---|
| 56 | REAL fact(klon) |
---|
| 57 | INTEGER nbptspb |
---|
| 58 | |
---|
[4678] | 59 | REAL, DIMENSION(klon,klev), INTENT(IN) :: u_seri_,v_seri_ |
---|
[4837] | 60 | REAL, DIMENSION(klon,klev), INTENT(IN) :: t_seri_,q_seri_ |
---|
| 61 | REAL, DIMENSION(klon,klev), INTENT(IN) :: t_env,q_env |
---|
[4678] | 62 | REAL, DIMENSION(klon,klev) :: u_seri,v_seri |
---|
| 63 | REAL, DIMENSION(klon,klev) :: t_seri,q_seri |
---|
| 64 | REAL, DIMENSION(klon,klev) :: qmemoire |
---|
[878] | 65 | REAL weak_inversion(klon) |
---|
| 66 | REAL paprs(klon,klev+1) |
---|
| 67 | REAL pplay(klon,klev) |
---|
| 68 | REAL pphi(klon,klev) |
---|
[5117] | 69 | REAL zlev(klon,klev+1) |
---|
[879] | 70 | !test: on sort lentr et a* pour alimenter KE |
---|
| 71 | REAL wght_th(klon,klev) |
---|
| 72 | INTEGER lalim_conv(klon) |
---|
[1026] | 73 | REAL zw2(klon,klev+1),fraca(klon,klev+1) |
---|
[878] | 74 | |
---|
| 75 | !FH Update Thermiques |
---|
| 76 | REAL d_t_ajs(klon,klev), d_q_ajs(klon,klev) |
---|
| 77 | REAL d_u_ajs(klon,klev),d_v_ajs(klon,klev) |
---|
[5117] | 78 | REAL fm_therm(klon,klev+1) |
---|
| 79 | REAL entr_therm(klon,klev),detr_therm(klon,klev) |
---|
[878] | 80 | |
---|
| 81 | !******************************************************** |
---|
| 82 | ! declarations |
---|
[1403] | 83 | LOGICAL flag_bidouille_stratocu |
---|
[5117] | 84 | REAL fmc_therm(klon,klev+1),zqasc(klon,klev) |
---|
| 85 | REAL zqla(klon,klev) |
---|
| 86 | REAL ztv(klon,klev),ztva(klon,klev) |
---|
| 87 | REAL zpspsk(klon,klev) |
---|
| 88 | REAL ztla(klon,klev) |
---|
| 89 | REAL zthl(klon,klev) |
---|
| 90 | REAL wmax_sec(klon) |
---|
| 91 | REAL zcong(klon) |
---|
| 92 | REAL zmax_sec(klon) |
---|
| 93 | REAL f_sec(klon) |
---|
| 94 | REAL detrc_therm(klon,klev) |
---|
[973] | 95 | ! FH WARNING : il semble que ces save ne servent a rien |
---|
| 96 | ! save fmc_therm, detrc_therm |
---|
[5117] | 97 | REAL clwcon0(klon,klev) |
---|
| 98 | REAL zqsat(klon,klev) |
---|
| 99 | REAL zw_sec(klon,klev+1) |
---|
| 100 | INTEGER lmix_sec(klon) |
---|
| 101 | INTEGER lmax(klon) |
---|
| 102 | REAL ratqscth(klon,klev) |
---|
| 103 | REAL ratqsdiff(klon,klev) |
---|
| 104 | REAL zqsatth(klon,klev) |
---|
[879] | 105 | !nouvelles variables pour la convection |
---|
[5117] | 106 | REAL ale_bl(klon) |
---|
| 107 | REAL alp_bl(klon) |
---|
| 108 | REAL ale(klon) |
---|
| 109 | REAL alp(klon) |
---|
[879] | 110 | !RC |
---|
[927] | 111 | !on garde le zmax du pas de temps precedent |
---|
[5117] | 112 | REAL zmax0(klon), f0(klon) |
---|
[1638] | 113 | |
---|
| 114 | !!! nrlmd le 10/04/2012 |
---|
[5117] | 115 | REAL pbl_tke(klon,klev+1,nbsrf) |
---|
| 116 | REAL pctsrf(klon,nbsrf) |
---|
| 117 | REAL omega(klon,klev) |
---|
| 118 | REAL airephy(klon) |
---|
| 119 | REAL zlcl_th(klon),fraca0(klon),w0(klon),w_conv(klon) |
---|
| 120 | REAL therm_tke_max0(klon),env_tke_max0(klon) |
---|
| 121 | REAL n2(klon),s2(klon),strig(klon) |
---|
| 122 | REAL ale_bl_stat(klon) |
---|
| 123 | REAL therm_tke_max(klon,klev),env_tke_max(klon,klev) |
---|
| 124 | REAL alp_bl_det(klon),alp_bl_fluct_m(klon),alp_bl_fluct_tke(klon),alp_bl_conv(klon),alp_bl_stat(klon) |
---|
[1638] | 125 | !!! fin nrlmd le 10/04/2012 |
---|
| 126 | |
---|
[878] | 127 | !******************************************************** |
---|
| 128 | |
---|
[5117] | 129 | REAL, DIMENSION(klon) :: pcon |
---|
| 130 | REAL, DIMENSION(klon,klev) :: rhobarz,wth3 |
---|
| 131 | INTEGER,DIMENSION(klon) :: lalim |
---|
| 132 | REAL, DIMENSION(klon,klev+1) :: fm |
---|
| 133 | REAL, DIMENSION(klon,klev) :: alim_star |
---|
| 134 | REAL, DIMENSION(klon) :: zmax |
---|
[878] | 135 | |
---|
[4089] | 136 | |
---|
| 137 | |
---|
| 138 | |
---|
[878] | 139 | ! variables locales |
---|
| 140 | REAL d_t_the(klon,klev), d_q_the(klon,klev) |
---|
| 141 | REAL d_u_the(klon,klev),d_v_the(klon,klev) |
---|
[5099] | 142 | |
---|
[5117] | 143 | REAL zfm_therm(klon,klev+1),zdt |
---|
| 144 | REAL zentr_therm(klon,klev),zdetr_therm(klon,klev) |
---|
[973] | 145 | ! FH A VERIFIER : SAVE INUTILES |
---|
[940] | 146 | ! save zentr_therm,zfm_therm |
---|
[973] | 147 | |
---|
[5117] | 148 | CHARACTER (LEN=20) :: modname='calltherm' |
---|
| 149 | CHARACTER (LEN=80) :: abort_message |
---|
[1403] | 150 | |
---|
[5117] | 151 | INTEGER i,k,isplit |
---|
[5103] | 152 | logical, save :: first=.TRUE. |
---|
[5117] | 153 | LOGICAL :: new_thermcell |
---|
[4089] | 154 | |
---|
| 155 | #ifdef ISO |
---|
[4143] | 156 | REAL xt_seri(ntiso,klon,klev),xtmemoire(ntiso,klon,klev) |
---|
| 157 | REAL d_xt_ajs(ntiso,klon,klev) |
---|
[5117] | 158 | REAL d_xt_the(ntiso,klon,klev) |
---|
[4089] | 159 | #ifdef DIAGISO |
---|
[5117] | 160 | REAL q_the(klon,klev) |
---|
| 161 | REAL xt_the(ntiso,klon,klev) |
---|
[4089] | 162 | #endif |
---|
[5117] | 163 | REAL qprec(klon,klev) |
---|
| 164 | INTEGER ixt |
---|
[4089] | 165 | #endif |
---|
| 166 | |
---|
| 167 | |
---|
[987] | 168 | !$OMP THREADPRIVATE(first) |
---|
[878] | 169 | !******************************************************** |
---|
[5117] | 170 | IF (first) THEN |
---|
[973] | 171 | itap=0 |
---|
[5103] | 172 | first=.FALSE. |
---|
[973] | 173 | endif |
---|
[878] | 174 | |
---|
[4678] | 175 | u_seri(:,:)=u_seri_(:,:) |
---|
| 176 | v_seri(:,:)=v_seri_(:,:) |
---|
| 177 | t_seri(:,:)=t_seri_(:,:) |
---|
| 178 | q_seri(:,:)=q_seri_(:,:) |
---|
| 179 | |
---|
[973] | 180 | ! Incrementer le compteur de la physique |
---|
| 181 | itap = itap + 1 |
---|
| 182 | |
---|
[878] | 183 | ! Modele du thermique |
---|
| 184 | ! =================== |
---|
[5103] | 185 | ! PRINT*,'thermiques: WARNING on passe t au lieu de t_seri' |
---|
[878] | 186 | |
---|
| 187 | |
---|
[973] | 188 | ! On prend comme valeur initiale des thermiques la valeur du pas |
---|
| 189 | ! de temps precedent |
---|
| 190 | zfm_therm(:,:)=fm_therm(:,:) |
---|
| 191 | zdetr_therm(:,:)=detr_therm(:,:) |
---|
| 192 | zentr_therm(:,:)=entr_therm(:,:) |
---|
| 193 | |
---|
| 194 | ! On reinitialise les flux de masse a zero pour le cumul en |
---|
| 195 | ! cas de splitting |
---|
[878] | 196 | fm_therm(:,:)=0. |
---|
| 197 | entr_therm(:,:)=0. |
---|
[973] | 198 | detr_therm(:,:)=0. |
---|
| 199 | |
---|
[4089] | 200 | ale_bl(:)=0. |
---|
| 201 | alp_bl(:)=0. |
---|
[5117] | 202 | IF (prt_level>=10) THEN |
---|
[5103] | 203 | PRINT*,'thermV4 nsplit: ',nsplit_thermals,' weak_inversion' |
---|
[938] | 204 | endif |
---|
[878] | 205 | |
---|
| 206 | ! tests sur les valeurs negatives de l'eau |
---|
[5082] | 207 | logexpr0=prt_level>=10 |
---|
[973] | 208 | nbptspb=0 |
---|
[5158] | 209 | DO k=1,klev |
---|
| 210 | DO i=1,klon |
---|
[1146] | 211 | ! Attention teste abderr 19-03-09 |
---|
[5117] | 212 | ! logexpr2(i,k)=.NOT.q_seri(i,k).ge.0. |
---|
| 213 | logexpr2(i,k)=.NOT.q_seri(i,k)>=1.e-15 |
---|
| 214 | IF (logexpr2(i,k)) THEN |
---|
[4089] | 215 | #ifdef ISO |
---|
| 216 | qprec(i,k)=q_seri(i,k) |
---|
| 217 | #endif |
---|
[938] | 218 | q_seri(i,k)=1.e-15 |
---|
[973] | 219 | nbptspb=nbptspb+1 |
---|
[4089] | 220 | #ifdef ISO |
---|
[5158] | 221 | DO ixt=1,ntiso |
---|
[4089] | 222 | xt_seri(ixt,i,k)=1.e-15*(xt_seri(ixt,i,k)/qprec(i,k)) |
---|
| 223 | ! xt_seri(ixt,i,k)=1.e-15*(Rdefault(index_iso(ixt))) |
---|
| 224 | enddo |
---|
| 225 | #endif |
---|
[878] | 226 | endif |
---|
[973] | 227 | ! if (logexpr0) & |
---|
[5103] | 228 | ! & PRINT*,'WARN eau<0 avant therm i=',i,' k=',k & |
---|
[973] | 229 | ! & ,' dq,q',d_q_the(i,k),q_seri(i,k) |
---|
[878] | 230 | enddo |
---|
| 231 | enddo |
---|
[5116] | 232 | IF(nbptspb>0) PRINT*,'Number of points with q_seri(i,k)<=0 ',nbptspb |
---|
[878] | 233 | |
---|
[4089] | 234 | |
---|
[5117] | 235 | new_thermcell=iflag_thermals>=15.AND.iflag_thermals<=18 |
---|
[4089] | 236 | #ifdef ISO |
---|
[5117] | 237 | IF (.NOT.new_thermcell) THEN |
---|
[5231] | 238 | CALL abort_physic('calltherm 234','isos pas prevus ici',1) |
---|
[4089] | 239 | endif |
---|
| 240 | #ifdef ISOVERIF |
---|
[5117] | 241 | IF (iso_eau.gt.0) THEN |
---|
[5101] | 242 | CALL iso_verif_egalite_vect2D( & |
---|
[5087] | 243 | xt_seri,q_seri, & |
---|
| 244 | 'calltherm 174',ntiso,klon,klev) |
---|
[5116] | 245 | endif !if (iso_eau.gt.0) THEN |
---|
[4089] | 246 | #endif |
---|
| 247 | #endif |
---|
[1403] | 248 | zdt=dtime/REAL(nsplit_thermals) |
---|
[4089] | 249 | |
---|
| 250 | |
---|
[5158] | 251 | DO isplit=1,nsplit_thermals |
---|
[878] | 252 | |
---|
[5117] | 253 | IF (iflag_thermals>=1000) THEN |
---|
[1943] | 254 | CALL thermcell_2002(klon,klev,zdt,iflag_thermals & |
---|
[5087] | 255 | ,pplay,paprs,pphi & |
---|
| 256 | ,u_seri,v_seri,t_seri,q_seri & |
---|
| 257 | ,d_u_the,d_v_the,d_t_the,d_q_the & |
---|
| 258 | ,zfm_therm,zentr_therm,fraca,zw2 & |
---|
| 259 | ,r_aspect_thermals,30.,w2di_thermals & |
---|
| 260 | ,tau_thermals) |
---|
[5117] | 261 | ELSE IF (iflag_thermals==2) THEN |
---|
[878] | 262 | CALL thermcell_sec(klon,klev,zdt & |
---|
[5087] | 263 | ,pplay,paprs,pphi,zlev & |
---|
| 264 | ,u_seri,v_seri,t_seri,q_seri & |
---|
| 265 | ,d_u_the,d_v_the,d_t_the,d_q_the & |
---|
| 266 | ,zfm_therm,zentr_therm & |
---|
| 267 | ,r_aspect_thermals,30.,w2di_thermals & |
---|
| 268 | ,tau_thermals) |
---|
[5117] | 269 | ELSE IF (iflag_thermals==3) THEN |
---|
[878] | 270 | CALL thermcell(klon,klev,zdt & |
---|
[5087] | 271 | ,pplay,paprs,pphi & |
---|
| 272 | ,u_seri,v_seri,t_seri,q_seri & |
---|
| 273 | ,d_u_the,d_v_the,d_t_the,d_q_the & |
---|
| 274 | ,zfm_therm,zentr_therm & |
---|
| 275 | ,r_aspect_thermals,l_mix_thermals,w2di_thermals & |
---|
| 276 | ,tau_thermals) |
---|
[5117] | 277 | ELSE IF (iflag_thermals==10) THEN |
---|
[878] | 278 | CALL thermcell_eau(klon,klev,zdt & |
---|
[5087] | 279 | ,pplay,paprs,pphi & |
---|
| 280 | ,u_seri,v_seri,t_seri,q_seri & |
---|
| 281 | ,d_u_the,d_v_the,d_t_the,d_q_the & |
---|
| 282 | ,zfm_therm,zentr_therm & |
---|
| 283 | ,r_aspect_thermals,l_mix_thermals,w2di_thermals & |
---|
| 284 | ,tau_thermals) |
---|
[5117] | 285 | ELSE IF (iflag_thermals==11) THEN |
---|
[1403] | 286 | abort_message = 'cas non prevu dans calltherm' |
---|
[2311] | 287 | CALL abort_physic (modname,abort_message,1) |
---|
[5117] | 288 | ELSE IF (iflag_thermals==12) THEN |
---|
[878] | 289 | CALL calcul_sec(klon,klev,zdt & |
---|
[5087] | 290 | ,pplay,paprs,pphi,zlev & |
---|
| 291 | ,u_seri,v_seri,t_seri,q_seri & |
---|
| 292 | ,zmax_sec,wmax_sec,zw_sec,lmix_sec & |
---|
| 293 | ,r_aspect_thermals,l_mix_thermals,w2di_thermals & |
---|
| 294 | ,tau_thermals) |
---|
[5117] | 295 | ELSE IF (iflag_thermals==13.OR.iflag_thermals==14) THEN |
---|
[4089] | 296 | abort_message = 'thermcellV0_main enleve svn>2084' |
---|
| 297 | CALL abort_physic (modname,abort_message,1) |
---|
[5117] | 298 | ELSE IF (new_thermcell) THEN |
---|
[1403] | 299 | CALL thermcell_main(itap,klon,klev,zdt & |
---|
[5087] | 300 | ,pplay,paprs,pphi,debut & |
---|
| 301 | ,u_seri,v_seri,t_seri,q_seri,t_env,q_env & |
---|
| 302 | ,d_u_the,d_v_the,d_t_the,d_q_the & |
---|
| 303 | ,zfm_therm,zentr_therm,zdetr_therm,zqasc,zqla,lmax & |
---|
| 304 | ,ratqscth,ratqsdiff,zqsatth & |
---|
| 305 | ,zmax0,f0,zw2,fraca,ztv,zpspsk & |
---|
| 306 | ,ztla,zthl,ztva & |
---|
| 307 | ,pcon,rhobarz,wth3,wmax_sec,lalim,fm,alim_star,zmax,zcong & |
---|
[4089] | 308 | #ifdef ISO |
---|
[5087] | 309 | ,xt_seri,d_xt_the & |
---|
[4089] | 310 | #endif |
---|
[5087] | 311 | ) |
---|
[4089] | 312 | |
---|
| 313 | CALL thermcell_alp(klon,klev,zdt & ! in |
---|
[5087] | 314 | ,pplay,paprs & ! in |
---|
| 315 | ,zfm_therm,zentr_therm,lmax & ! in |
---|
| 316 | ,pbl_tke,pctsrf,omega,airephy & ! in |
---|
| 317 | ,zw2,fraca & ! in |
---|
| 318 | ,pcon,rhobarz,wth3,wmax_sec,lalim,fm,alim_star,zmax & ! in |
---|
| 319 | ,zcong,ale,alp,lalim_conv,wght_th & ! out |
---|
| 320 | ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &! out |
---|
| 321 | ,n2,s2,strig,ale_bl_stat & ! out |
---|
| 322 | ,therm_tke_max,env_tke_max & ! out |
---|
| 323 | ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke & ! out |
---|
| 324 | ,alp_bl_conv,alp_bl_stat & ! out |
---|
| 325 | ) |
---|
[4089] | 326 | |
---|
[5117] | 327 | IF (prt_level>10) WRITE(lunout,*)'Apres thermcell_main OK' |
---|
[1403] | 328 | else |
---|
| 329 | abort_message = 'Cas des thermiques non prevu' |
---|
[2311] | 330 | CALL abort_physic (modname,abort_message,1) |
---|
[878] | 331 | endif |
---|
| 332 | |
---|
[1638] | 333 | ! Attention : les noms sont contre intuitif. |
---|
[5103] | 334 | ! flag_bidouille_stratocu est .TRUE. si on ne fait pas de bidouille. |
---|
[1638] | 335 | ! Il aurait mieux valu avoir un nobidouille_stratocu |
---|
| 336 | ! Et pour simplifier : |
---|
[5117] | 337 | ! nobidouille_stratocu=.NOT.(iflag_thermals==13.OR.iflag_thermals=15) |
---|
[1638] | 338 | ! Ce serait bien de changer, mai en prenant le temps de vérifier que ca |
---|
| 339 | ! fait bien ce qu'on croit. |
---|
[878] | 340 | |
---|
[5117] | 341 | flag_bidouille_stratocu=iflag_thermals<=12.OR.iflag_thermals==14.OR.iflag_thermals==16.OR.iflag_thermals==18 |
---|
[1638] | 342 | |
---|
[1943] | 343 | ! Calcul a posteriori du niveau max des thermiques pour les schémas qui |
---|
| 344 | ! ne la sortent pas. |
---|
[5117] | 345 | IF (iflag_thermals<=12.OR.iflag_thermals>=1000) THEN |
---|
[1943] | 346 | lmax(:)=1 |
---|
[5158] | 347 | DO k=1,klev-1 |
---|
[1638] | 348 | zdetr_therm(:,k)=zentr_therm(:,k)+zfm_therm(:,k)-zfm_therm(:,k+1) |
---|
| 349 | enddo |
---|
[5158] | 350 | DO k=1,klev-1 |
---|
| 351 | DO i=1,klon |
---|
[5117] | 352 | IF (zfm_therm(i,k+1)>0.) lmax(i)=k |
---|
[1943] | 353 | enddo |
---|
| 354 | enddo |
---|
[1638] | 355 | endif |
---|
| 356 | |
---|
[973] | 357 | fact(:)=0. |
---|
[878] | 358 | DO i=1,klon |
---|
[5117] | 359 | logexpr1(i)=flag_bidouille_stratocu.OR.weak_inversion(i)>0.5 |
---|
[1403] | 360 | IF(logexpr1(i)) fact(i)=1./REAL(nsplit_thermals) |
---|
[973] | 361 | ENDDO |
---|
[878] | 362 | |
---|
[973] | 363 | DO k=1,klev |
---|
[878] | 364 | ! transformation de la derivee en tendance |
---|
[973] | 365 | d_t_the(:,k)=d_t_the(:,k)*dtime*fact(:) |
---|
| 366 | d_u_the(:,k)=d_u_the(:,k)*dtime*fact(:) |
---|
| 367 | d_v_the(:,k)=d_v_the(:,k)*dtime*fact(:) |
---|
| 368 | d_q_the(:,k)=d_q_the(:,k)*dtime*fact(:) |
---|
| 369 | fm_therm(:,k)=fm_therm(:,k) & |
---|
[5087] | 370 | +zfm_therm(:,k)*fact(:) |
---|
[973] | 371 | entr_therm(:,k)=entr_therm(:,k) & |
---|
[5087] | 372 | +zentr_therm(:,k)*fact(:) |
---|
[1026] | 373 | detr_therm(:,k)=detr_therm(:,k) & |
---|
[5087] | 374 | +zdetr_therm(:,k)*fact(:) |
---|
[4089] | 375 | #ifdef ISO |
---|
[5158] | 376 | DO ixt=1,ntiso |
---|
[4089] | 377 | d_xt_the(ixt,:,k)=d_xt_the(ixt,:,k)*dtime*fact(:) |
---|
| 378 | enddo |
---|
| 379 | #endif |
---|
[973] | 380 | ENDDO |
---|
| 381 | fm_therm(:,klev+1)=0. |
---|
[878] | 382 | |
---|
| 383 | |
---|
| 384 | |
---|
| 385 | ! accumulation de la tendance |
---|
[973] | 386 | d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:) |
---|
| 387 | d_u_ajs(:,:)=d_u_ajs(:,:)+d_u_the(:,:) |
---|
| 388 | d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:) |
---|
| 389 | d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_the(:,:) |
---|
[4089] | 390 | #ifdef ISO |
---|
| 391 | d_xt_ajs(:,:,:)=d_xt_ajs(:,:,:)+d_xt_the(:,:,:) |
---|
| 392 | #endif |
---|
[878] | 393 | |
---|
| 394 | ! incrementation des variables meteo |
---|
[973] | 395 | t_seri(:,:) = t_seri(:,:) + d_t_the(:,:) |
---|
| 396 | u_seri(:,:) = u_seri(:,:) + d_u_the(:,:) |
---|
| 397 | v_seri(:,:) = v_seri(:,:) + d_v_the(:,:) |
---|
| 398 | qmemoire(:,:)=q_seri(:,:) |
---|
| 399 | q_seri(:,:) = q_seri(:,:) + d_q_the(:,:) |
---|
[4089] | 400 | #ifdef ISO |
---|
| 401 | xtmemoire(:,:,:)=xt_seri(:,:,:) |
---|
| 402 | xt_seri(:,:,:) = xt_seri(:,:,:) + d_xt_the(:,:,:) |
---|
| 403 | #ifdef ISOVERIF |
---|
[5116] | 404 | ! WRITE(*,*) 'calltherm 350 tmp: ajout d_xt_the' |
---|
[5117] | 405 | IF (iso_HDO.gt.0) THEN |
---|
[4089] | 406 | ! i=479 |
---|
| 407 | ! k=4 |
---|
[5116] | 408 | ! WRITE(*,*) 'xt_seri(iso_hdo,i,k),q_seri(i,k)=', & |
---|
[4089] | 409 | ! & xt_seri(iso_hdo,i,k),q_seri(i,k) |
---|
[5116] | 410 | ! WRITE(*,*) 'd_xt_the(iso_hdo,i,k),d_q_the(i,k)=', & |
---|
[4089] | 411 | ! & d_xt_the(iso_hdo,i,k),d_q_the(i,k) |
---|
[5101] | 412 | CALL iso_verif_aberrant_enc_vect2D( & |
---|
[5087] | 413 | xt_seri,q_seri, & |
---|
| 414 | 'calltherm 353, apres ajout d_xt_the',ntiso,klon,klev) |
---|
[4089] | 415 | endif |
---|
| 416 | #endif |
---|
| 417 | #endif |
---|
[5117] | 418 | IF (prt_level>10) WRITE(lunout,*)'Apres apres thermcell_main OK' |
---|
[878] | 419 | |
---|
[879] | 420 | DO i=1,klon |
---|
| 421 | fm_therm(i,klev+1)=0. |
---|
[4089] | 422 | ale_bl(i)=ale_bl(i)+ale(i)/REAL(nsplit_thermals) |
---|
[5116] | 423 | ! WRITE(22,*)'ALE CALLTHERM',ale_bl(i),ale(i) |
---|
[4089] | 424 | alp_bl(i)=alp_bl(i)+alp(i)/REAL(nsplit_thermals) |
---|
[5116] | 425 | ! WRITE(23,*)'ALP CALLTHERM',alp_bl(i),alp(i) |
---|
| 426 | IF(prt_level>=10) PRINT*,'calltherm i alp_bl alp ale_bl ale',i,alp_bl(i),alp(i),ale_bl(i),ale(i) |
---|
[879] | 427 | ENDDO |
---|
| 428 | |
---|
[973] | 429 | !IM 060508 marche pas comme cela !!! enddo ! isplit |
---|
| 430 | |
---|
[878] | 431 | ! tests sur les valeurs negatives de l'eau |
---|
[973] | 432 | nbptspb=0 |
---|
[878] | 433 | DO k = 1, klev |
---|
| 434 | DO i = 1, klon |
---|
[5117] | 435 | logexpr2(i,k)=.NOT.q_seri(i,k)>=0. |
---|
| 436 | IF (logexpr2(i,k)) THEN |
---|
[973] | 437 | q_seri(i,k)=1.e-15 |
---|
| 438 | nbptspb=nbptspb+1 |
---|
[4089] | 439 | #ifdef ISO |
---|
[5158] | 440 | DO ixt=1,ntiso |
---|
[4089] | 441 | xt_seri(ixt,i,k)=1.e-15*(xtmemoire(ixt,i,k)/qmemoire(i,k)) |
---|
| 442 | enddo |
---|
| 443 | #endif |
---|
[5116] | 444 | ! if (prt_level.ge.10) THEN |
---|
[5103] | 445 | ! PRINT*,'WARN eau<0 apres therm i=',i,' k=',k & |
---|
[973] | 446 | ! & ,' dq,q',d_q_the(i,k),q_seri(i,k), & |
---|
| 447 | ! & 'fm=',zfm_therm(i,k),'entr=',entr_therm(i,k) |
---|
[938] | 448 | endif |
---|
[878] | 449 | ENDDO |
---|
| 450 | ENDDO |
---|
[4089] | 451 | #ifdef ISO |
---|
| 452 | #ifdef ISOVERIF |
---|
[5117] | 453 | IF (iso_HDO.gt.0) THEN |
---|
[5101] | 454 | CALL iso_verif_aberrant_enc_vect2D( & |
---|
[5087] | 455 | xt_seri,q_seri, & |
---|
| 456 | 'calltherm 393, apres bidouille q<0',ntiso,klon,klev) |
---|
[4089] | 457 | endif |
---|
| 458 | #endif |
---|
| 459 | #endif |
---|
| 460 | |
---|
[5103] | 461 | IF(nbptspb>0) PRINT*,'Number of points with q_seri(i,k)<=0 ',nbptspb |
---|
[878] | 462 | ! tests sur les valeurs de la temperature |
---|
[973] | 463 | nbptspb=0 |
---|
[878] | 464 | DO k = 1, klev |
---|
| 465 | DO i = 1, klon |
---|
[5082] | 466 | logexpr2(i,k)=t_seri(i,k)<50..or.t_seri(i,k)>370. |
---|
[5117] | 467 | IF (logexpr2(i,k)) nbptspb=nbptspb+1 |
---|
| 468 | ! if ((t_seri(i,k).lt.50.) .OR. & |
---|
[5116] | 469 | ! & (t_seri(i,k).gt.370.)) THEN |
---|
[5103] | 470 | ! PRINT*,'WARN temp apres therm i=',i,' k=',k & |
---|
[973] | 471 | ! & ,' t_seri',t_seri(i,k) |
---|
[878] | 472 | ! CALL abort |
---|
[973] | 473 | ! endif |
---|
[878] | 474 | ENDDO |
---|
| 475 | ENDDO |
---|
[5103] | 476 | IF(nbptspb>0) PRINT*,'Number of points with q_seri(i,k)<=0 ',nbptspb |
---|
[878] | 477 | enddo ! isplit |
---|
| 478 | |
---|
| 479 | !*************************************************************** |
---|
| 480 | ! calcul du flux ascencant conservatif |
---|
[5103] | 481 | ! PRINT*,'<<<<calcul flux ascendant conservatif' |
---|
[878] | 482 | |
---|
| 483 | fmc_therm=0. |
---|
[5158] | 484 | DO k=1,klev |
---|
| 485 | DO i=1,klon |
---|
[5117] | 486 | IF (entr_therm(i,k)>0.) THEN |
---|
[878] | 487 | fmc_therm(i,k+1)=fmc_therm(i,k)+entr_therm(i,k) |
---|
| 488 | else |
---|
| 489 | fmc_therm(i,k+1)=fmc_therm(i,k) |
---|
| 490 | endif |
---|
| 491 | detrc_therm(i,k)=(fmc_therm(i,k+1)-fm_therm(i,k+1)) & |
---|
[5087] | 492 | -(fmc_therm(i,k)-fm_therm(i,k)) |
---|
[878] | 493 | enddo |
---|
| 494 | enddo |
---|
| 495 | |
---|
| 496 | |
---|
| 497 | !**************************************************************** |
---|
| 498 | ! calcul de l'humidite dans l'ascendance |
---|
[5103] | 499 | ! PRINT*,'<<<<calcul de lhumidite dans thermique' |
---|
[878] | 500 | !CR:on ne le calcule que pour le cas sec |
---|
[5117] | 501 | IF (iflag_thermals<=11) THEN |
---|
[5158] | 502 | DO i=1,klon |
---|
[878] | 503 | zqasc(i,1)=q_seri(i,1) |
---|
[5158] | 504 | DO k=2,klev |
---|
[5117] | 505 | IF (fmc_therm(i,k+1)>1.e-6) THEN |
---|
[878] | 506 | zqasc(i,k)=(fmc_therm(i,k)*zqasc(i,k-1) & |
---|
[5087] | 507 | +entr_therm(i,k)*q_seri(i,k))/fmc_therm(i,k+1) |
---|
[878] | 508 | !CR:test on asseche le thermique |
---|
| 509 | ! zqasc(i,k)=zqasc(i,k)/2. |
---|
| 510 | ! else |
---|
| 511 | ! zqasc(i,k)=q_seri(i,k) |
---|
| 512 | endif |
---|
| 513 | enddo |
---|
| 514 | enddo |
---|
| 515 | |
---|
| 516 | |
---|
| 517 | ! calcul de l'eau condensee dans l'ascendance |
---|
[5103] | 518 | ! PRINT*,'<<<<calcul de leau condensee dans thermique' |
---|
[5158] | 519 | DO i=1,klon |
---|
| 520 | DO k=1,klev |
---|
[878] | 521 | clwcon0(i,k)=zqasc(i,k)-zqsat(i,k) |
---|
[5117] | 522 | IF (clwcon0(i,k)<0. .OR. & |
---|
[5116] | 523 | (fm_therm(i,k+1)+detrc_therm(i,k))<1.e-6) THEN |
---|
[878] | 524 | clwcon0(i,k)=0. |
---|
| 525 | endif |
---|
| 526 | enddo |
---|
| 527 | enddo |
---|
| 528 | else |
---|
[5158] | 529 | DO i=1,klon |
---|
| 530 | DO k=1,klev |
---|
[878] | 531 | clwcon0(i,k)=zqla(i,k) |
---|
[5117] | 532 | IF (clwcon0(i,k)<0. .OR. & |
---|
[5116] | 533 | (fm_therm(i,k+1)+detrc_therm(i,k))<1.e-6) THEN |
---|
[878] | 534 | clwcon0(i,k)=0. |
---|
| 535 | endif |
---|
| 536 | enddo |
---|
| 537 | enddo |
---|
| 538 | endif |
---|
| 539 | !******************************************************************* |
---|
| 540 | |
---|
| 541 | |
---|
[1428] | 542 | !jyg Protection contre les temperatures nulles |
---|
[5158] | 543 | DO i=1,klon |
---|
| 544 | DO k=1,klev |
---|
[5117] | 545 | IF (ztla(i,k) < 1.e-10) fraca(i,k) =0. |
---|
[1428] | 546 | enddo |
---|
| 547 | enddo |
---|
| 548 | |
---|
| 549 | |
---|
[878] | 550 | return |
---|
| 551 | |
---|
[5119] | 552 | END |
---|