source: LMDZ6/trunk/libf/phylmd/lmdz_thermcell_env.F90 @ 4590

Last change on this file since 4590 was 4590, checked in by fhourdin, 11 months ago

Passage des thermiques a la nouvelle norme.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1MODULE lmdz_thermcell_env
2CONTAINS
3
4   SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay,  &
5     &           pplev,zo,zh,zl,ztv,zthl,zu,zv,zpspsk,pqsat,lev_out)
6
7!--------------------------------------------------------------
8!thermcell_env: calcule les caracteristiques de l environnement
9!necessaires au calcul des proprietes dans le thermique
10!--------------------------------------------------------------
11
12
13   USE lmdz_thermcell_ini, ONLY : prt_level,RLvCp,RKAPPA,RETV
14   USE lmdz_thermcell_qsat, ONLY : thermcell_qsat
15   IMPLICIT NONE
16
17! arguments
18
19   integer,intent(in) :: ngrid,nlay,lev_out
20   real,intent(in), dimension(ngrid,nlay) :: po,pt,pu,pv,pplay
21   real,intent(in), dimension(ngrid,nlay+1) :: pplev
22   real,intent(out), dimension(ngrid,nlay) :: zo,zl,zh,ztv,zthl
23   real,intent(out), dimension(ngrid,nlay) :: zpspsk,zu,zv,pqsat
24   
25! Local
26
27   integer ig,ll
28   real dqsat_dT
29   logical mask(ngrid,nlay)
30
31
32!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33! Initialisations :
34!------------------
35
36   mask(:,:)=.true.
37
38!
39! calcul des caracteristiques de l environnement
40   DO  ll=1,nlay
41     DO ig=1,ngrid
42        zo(ig,ll)=po(ig,ll)
43        zl(ig,ll)=0.
44        zh(ig,ll)=pt(ig,ll)
45     enddo
46   enddo
47
48! Condensation :
49!---------------
50! Calcul de l'humidite a saturation et de la condensation
51
52   call thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat)
53   do ll=1,nlay
54      do ig=1,ngrid
55         zl(ig,ll) = max(0.,po(ig,ll)-pqsat(ig,ll))
56         zh(ig,ll) = pt(ig,ll)+RLvCp*zl(ig,ll)         !   T = Tl + Lv/Cp ql
57         zo(ig,ll) = po(ig,ll)-zl(ig,ll)
58      enddo
59   enddo
60
61!-----------------------------------------------------------------------
62   if (prt_level.ge.1) print*,'0 OK convect8'
63
64   do ll=1,nlay
65      do ig=1,ngrid
66          zpspsk(ig,ll)=(pplay(ig,ll)/100000.)**RKAPPA
67          zu(ig,ll)=pu(ig,ll)
68          zv(ig,ll)=pv(ig,ll)
69!attention zh est maintenant le profil de T et plus le profil de theta !
70! Quelle horreur ! A eviter.
71!   T-> Theta
72            ztv(ig,ll)=zh(ig,ll)/zpspsk(ig,ll)
73!Theta_v
74            ztv(ig,ll)=ztv(ig,ll)*(1.+RETV*(zo(ig,ll))-zl(ig,ll))
75!Thetal
76            zthl(ig,ll)=pt(ig,ll)/zpspsk(ig,ll)
77!           
78      enddo
79   enddo
80 
81 RETURN
82   END
83END MODULE lmdz_thermcell_env
Note: See TracBrowser for help on using the repository browser.