1 |
|
|
MODULE lmdz_thermcell_env |
2 |
|
|
CONTAINS |
3 |
|
|
|
4 |
|
288 |
SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay, & |
5 |
|
288 |
& 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 |
|
288 |
logical mask(ngrid,nlay) |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
33 |
|
|
! Initialisations : |
34 |
|
|
!------------------ |
35 |
|
|
|
36 |
✓✓✓✓
|
11176128 |
mask(:,:)=.true. |
37 |
|
|
|
38 |
|
|
! |
39 |
|
|
! calcul des caracteristiques de l environnement |
40 |
✓✓ |
11520 |
DO ll=1,nlay |
41 |
✓✓ |
11176128 |
DO ig=1,ngrid |
42 |
|
11164608 |
zo(ig,ll)=po(ig,ll) |
43 |
|
11164608 |
zl(ig,ll)=0. |
44 |
|
11175840 |
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 |
|
288 |
call thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat) |
53 |
✓✓ |
11520 |
do ll=1,nlay |
54 |
✓✓ |
11176128 |
do ig=1,ngrid |
55 |
|
11164608 |
zl(ig,ll) = max(0.,po(ig,ll)-pqsat(ig,ll)) |
56 |
|
11164608 |
zh(ig,ll) = pt(ig,ll)+RLvCp*zl(ig,ll) ! T = Tl + Lv/Cp ql |
57 |
|
11175840 |
zo(ig,ll) = po(ig,ll)-zl(ig,ll) |
58 |
|
|
enddo |
59 |
|
|
enddo |
60 |
|
|
|
61 |
|
|
!----------------------------------------------------------------------- |
62 |
✗✓ |
288 |
if (prt_level.ge.1) print*,'0 OK convect8' |
63 |
|
|
|
64 |
✓✓ |
11520 |
do ll=1,nlay |
65 |
✓✓ |
11176128 |
do ig=1,ngrid |
66 |
|
11164608 |
zpspsk(ig,ll)=(pplay(ig,ll)/100000.)**RKAPPA |
67 |
|
11164608 |
zu(ig,ll)=pu(ig,ll) |
68 |
|
11164608 |
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 |
|
11164608 |
ztv(ig,ll)=zh(ig,ll)/zpspsk(ig,ll) |
73 |
|
|
!Theta_v |
74 |
|
11164608 |
ztv(ig,ll)=ztv(ig,ll)*(1.+RETV*(zo(ig,ll))-zl(ig,ll)) |
75 |
|
|
!Thetal |
76 |
|
11175840 |
zthl(ig,ll)=pt(ig,ll)/zpspsk(ig,ll) |
77 |
|
|
! |
78 |
|
|
enddo |
79 |
|
|
enddo |
80 |
|
|
|
81 |
|
288 |
RETURN |
82 |
|
|
END |
83 |
|
|
END MODULE lmdz_thermcell_env |