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

Last change on this file since 4666 was 4590, checked in by fhourdin, 12 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
RevLine 
[4590]1MODULE lmdz_thermcell_env
2CONTAINS
3
[4089]4   SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay,  &
[1403]5     &           pplev,zo,zh,zl,ztv,zthl,zu,zv,zpspsk,pqsat,lev_out)
[878]6
7!--------------------------------------------------------------
8!thermcell_env: calcule les caracteristiques de l environnement
9!necessaires au calcul des proprietes dans le thermique
10!--------------------------------------------------------------
11
12
[4590]13   USE lmdz_thermcell_ini, ONLY : prt_level,RLvCp,RKAPPA,RETV
14   USE lmdz_thermcell_qsat, ONLY : thermcell_qsat
[4089]15   IMPLICIT NONE
[878]16
[4089]17! arguments
[878]18
[4089]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
[878]26
[4089]27   integer ig,ll
28   real dqsat_dT
29   logical mask(ngrid,nlay)
[878]30
31
[1403]32!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33! Initialisations :
34!------------------
35
[4089]36   mask(:,:)=.true.
[1403]37
[878]38!
39! calcul des caracteristiques de l environnement
[4089]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
[1403]48! Condensation :
49!---------------
50! Calcul de l'humidite a saturation et de la condensation
51
[4089]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
[878]61!-----------------------------------------------------------------------
[4089]62   if (prt_level.ge.1) print*,'0 OK convect8'
[878]63
[4089]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)
[878]69!attention zh est maintenant le profil de T et plus le profil de theta !
[1403]70! Quelle horreur ! A eviter.
[878]71!   T-> Theta
[1403]72            ztv(ig,ll)=zh(ig,ll)/zpspsk(ig,ll)
[878]73!Theta_v
[1403]74            ztv(ig,ll)=ztv(ig,ll)*(1.+RETV*(zo(ig,ll))-zl(ig,ll))
[878]75!Thetal
[1403]76            zthl(ig,ll)=pt(ig,ll)/zpspsk(ig,ll)
[878]77!           
[4089]78      enddo
79   enddo
[878]80 
[4094]81 RETURN
[4089]82   END
[4590]83END MODULE lmdz_thermcell_env
Note: See TracBrowser for help on using the repository browser.