source: LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/thermcell_env.F90 @ 1369

Last change on this file since 1369 was 1330, checked in by idelkadi, 14 years ago

Optimisation des thermiques

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1      SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay,  &
2     &           pplev,zo,zh,zl,ztv,zthl,zu,zv,zpspsk,pqsat,lev_out)
3
4!--------------------------------------------------------------
5!thermcell_env: calcule les caracteristiques de l environnement
6!necessaires au calcul des proprietes dans le thermique
7!--------------------------------------------------------------
8
9      IMPLICIT NONE
10
11#include "YOMCST.h"
12#include "YOETHF.h"
13#include "FCTTRE.h"     
14#include "iniprint.h"
15
16      INTEGER ngrid,nlay
17      REAL po(ngrid,nlay)
18      REAL pt(ngrid,nlay)
19      REAL pu(ngrid,nlay)
20      REAL pv(ngrid,nlay)
21      REAL pplay(ngrid,nlay)
22      REAL pplev(ngrid,nlay+1)
23      integer lev_out                           ! niveau pour les print
24
25      REAL zo(ngrid,nlay)
26      REAL zl(ngrid,nlay)
27      REAL zh(ngrid,nlay)
28      REAL ztv(ngrid,nlay)
29      REAL zthl(ngrid,nlay)
30      REAL zpspsk(ngrid,nlay)
31      REAL zu(ngrid,nlay)
32      REAL zv(ngrid,nlay)
33      REAL pqsat(ngrid,nlay)
34
35      INTEGER ig,ll
36
37      real dqsat_dT
38      real RLvCp
39
40logical mask(ngrid,nlay)
41
42
43!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44! Initialisations :
45!------------------
46
47print*,'THERMCELL ENV OPTIMISE '
48mask(:,:)=.true.
49RLvCp = RLVTT/RCPD
50
51!
52! calcul des caracteristiques de l environnement
53       DO  ll=1,nlay
54         DO ig=1,ngrid
55            zo(ig,ll)=po(ig,ll)
56            zl(ig,ll)=0.
57            zh(ig,ll)=pt(ig,ll)
58         EndDO
59       EndDO
60!
61!
62! Condensation :
63!---------------
64! Calcul de l'humidite a saturation et de la condensation
65
66call thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat)
67DO ll=1,nlay
68   DO ig=1,ngrid
69      zl(ig,ll) = max(0.,po(ig,ll)-pqsat(ig,ll))
70      zh(ig,ll) = pt(ig,ll)+RLvCp*zl(ig,ll)         !   T = Tl + Lv/Cp ql
71      zo(ig,ll) = po(ig,ll)-zl(ig,ll)
72   ENDDO
73ENDDO
74!
75!
76!-----------------------------------------------------------------------
77
78      if (prt_level.ge.1) print*,'0 OK convect8'
79
80      DO ll=1,nlay
81         DO ig=1,ngrid
82             zpspsk(ig,ll)=(pplay(ig,ll)/100000.)**RKAPPA
83             zu(ig,ll)=pu(ig,ll)
84             zv(ig,ll)=pv(ig,ll)
85!attention zh est maintenant le profil de T et plus le profil de theta !
86! Quelle horreur ! A eviter.
87!
88!   T-> Theta
89            ztv(ig,ll)=zh(ig,ll)/zpspsk(ig,ll)
90!Theta_v
91            ztv(ig,ll)=ztv(ig,ll)*(1.+RETV*(zo(ig,ll))-zl(ig,ll))
92!Thetal
93            zthl(ig,ll)=pt(ig,ll)/zpspsk(ig,ll)
94!           
95         ENDDO
96      ENDDO
97 
98      RETURN
99      END
Note: See TracBrowser for help on using the repository browser.