LMDZ
thermcell_condens.F90
Go to the documentation of this file.
1 subroutine thermcell_condens(klon,active,zpspsk,pplev,ztla,zqta,zqla)
2 implicit none
3 
4 #include "YOMCST.h"
5 #include "YOETHF.h"
6 #include "FCTTRE.h"
7 
8 
9 !====================================================================
10 ! DECLARATIONS
11 !====================================================================
12 
13 ! Arguments
14 INTEGER klon
15 REAL zpspsk(klon),pplev(klon)
16 REAL ztla(klon),zqta(klon),zqla(klon)
17 LOGICAL active(klon)
18 
19 ! Variables locales
20 INTEGER ig,iter
21 REAL Tbef(klon),DT(klon)
22 REAL tdelta,qsatbef,zcor,qlbef,zdelta,zcvm5,dqsat,num,denom,dqsat_dT
23 logical Zsat
24 REAL RLvCp
25 REAL, SAVE :: DDT0=.01
26 LOGICAL afaire(klon),tout_converge
27 
28 !====================================================================
29 ! INITIALISATIONS
30 !====================================================================
31 
32 rlvcp = rlvtt/rcpd
33 tout_converge=.false.
34 afaire(:)=.false.
35 dt(:)=0.
36 
37 
38 !====================================================================
39 ! Routine a vectoriser en copiant active dans converge et en mettant
40 ! la boucle sur les iterations a l'exterieur est en mettant
41 ! converge= false des que la convergence est atteinte.
42 !====================================================================
43 
44 do ig=1,klon
45  if (active(ig)) then
46  tbef(ig)=ztla(ig)*zpspsk(ig)
47  zdelta=max(0.,sign(1.,rtt-tbef(ig)))
48  qsatbef= r2es * foeew(tbef(ig),zdelta)/pplev(ig)
49  qsatbef=min(0.5,qsatbef)
50  zcor=1./(1.-retv*qsatbef)
51  qsatbef=qsatbef*zcor
52  qlbef=max(0.,zqta(ig)-qsatbef)
53  dt(ig) = 0.5*rlvcp*qlbef
54  endif
55 enddo
56 
57 do iter=1,10
58  afaire(:)=abs(dt(:)).gt.ddt0
59  do ig=1,klon
60  if (afaire(ig)) then
61  tbef(ig)=tbef(ig)+dt(ig)
62  zdelta=max(0.,sign(1.,rtt-tbef(ig)))
63  qsatbef= r2es * foeew(tbef(ig),zdelta)/pplev(ig)
64  qsatbef=min(0.5,qsatbef)
65  zcor=1./(1.-retv*qsatbef)
66  qsatbef=qsatbef*zcor
67  qlbef=zqta(ig)-qsatbef
68  zdelta=max(0.,sign(1.,rtt-tbef(ig)))
69  zcvm5=r5les*(1.-zdelta) + r5ies*zdelta
70  zcor=1./(1.-retv*qsatbef)
71  dqsat_dt=foede(tbef(ig),zdelta,zcvm5,qsatbef,zcor)
72  num=-tbef(ig)+ztla(ig)*zpspsk(ig)+rlvcp*qlbef
73  denom=1.+rlvcp*dqsat_dt
74  zqla(ig) = max(0.,zqta(ig)-qsatbef)
75  dt(ig)=num/denom
76  endif
77  enddo
78 enddo
79 
80 return
81 end
subroutine thermcell_condens(klon, active, zpspsk, pplev, ztla, zqta, zqla)
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
Definition: calcul_STDlev.h:26