1 |
|
|
MODULE lmdz_thermcell_alim |
2 |
|
|
! |
3 |
|
|
! $Id: thermcell_plume.F90 2311 2015-06-25 07:45:24Z emillour $ |
4 |
|
|
! |
5 |
|
|
CONTAINS |
6 |
|
|
|
7 |
|
288 |
SUBROUTINE thermcell_alim(flag,ngrid,klev,ztv,d_temp,zlev,alim_star,lalim) |
8 |
|
|
IMPLICIT NONE |
9 |
|
|
|
10 |
|
|
!-------------------------------------------------------------------------- |
11 |
|
|
! FH : 2015/11/06 |
12 |
|
|
! thermcell_alim: calcule la distribution verticale de l'alimentation |
13 |
|
|
! laterale a la base des panaches thermiques |
14 |
|
|
!-------------------------------------------------------------------------- |
15 |
|
|
|
16 |
|
|
INTEGER, INTENT(IN) :: ngrid,klev |
17 |
|
|
REAL, INTENT(IN) :: ztv(ngrid,klev) |
18 |
|
|
REAL, INTENT(IN) :: d_temp(ngrid) |
19 |
|
|
REAL, INTENT(IN) :: zlev(ngrid,klev+1) |
20 |
|
|
REAL, INTENT(OUT) :: alim_star(ngrid,klev) |
21 |
|
|
INTEGER, INTENT(OUT) :: lalim(ngrid) |
22 |
|
|
INTEGER, INTENT(IN) :: flag |
23 |
|
|
|
24 |
|
576 |
REAL :: alim_star_tot(ngrid),zi(ngrid),zh(ngrid) |
25 |
|
288 |
REAL :: zlay(ngrid,klev) |
26 |
|
|
REAL ztv_parcel |
27 |
|
|
|
28 |
|
|
INTEGER ig,l |
29 |
|
|
|
30 |
|
|
REAL h,z,falim |
31 |
|
|
falim(h,z)=0.2*((z-h)**5+h**5) |
32 |
|
|
|
33 |
|
|
|
34 |
|
|
!=================================================================== |
35 |
|
|
|
36 |
✓✓ |
286560 |
lalim(:)=1 |
37 |
✓✓ |
286560 |
alim_star_tot(:)=0. |
38 |
|
|
|
39 |
|
|
!------------------------------------------------------------------------- |
40 |
|
|
! Definition de l'alimentation |
41 |
|
|
!------------------------------------------------------------------------- |
42 |
✓✗ |
288 |
IF (flag==0) THEN ! CMIP5 version |
43 |
✓✓ |
11232 |
do l=1,klev-1 |
44 |
✓✓ |
10889568 |
do ig=1,ngrid |
45 |
✓✓✓✓
|
10889280 |
if (ztv(ig,l)> ztv(ig,l+1) .and. ztv(ig,1)>=ztv(ig,l) ) then |
46 |
|
|
alim_star(ig,l)=MAX((ztv(ig,l)-ztv(ig,l+1)),0.) & |
47 |
|
339183 |
& *sqrt(zlev(ig,l+1)) |
48 |
|
339183 |
lalim(ig)=l+1 |
49 |
|
339183 |
alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,l) |
50 |
|
|
endif |
51 |
|
|
enddo |
52 |
|
|
enddo |
53 |
✓✓ |
11520 |
do l=1,klev |
54 |
✓✓ |
11176128 |
do ig=1,ngrid |
55 |
✓✓ |
11175840 |
if (alim_star_tot(ig) > 1.e-10 ) then |
56 |
|
5361369 |
alim_star(ig,l)=alim_star(ig,l)/alim_star_tot(ig) |
57 |
|
|
endif |
58 |
|
|
enddo |
59 |
|
|
enddo |
60 |
|
288 |
alim_star_tot(:)=1. |
61 |
|
|
|
62 |
|
|
!------------------------------------------------------------------------- |
63 |
|
|
! Nouvelle definition avec possibilite d'introduire un DT en surface |
64 |
|
|
! On suppose que la forme du profile d'alimentation scale avec la hauteur |
65 |
|
|
! d'inversion calculée avec une particule partant de la premieere couche |
66 |
|
|
|
67 |
|
|
! Fonction f(z) = z ( h - z ) , avec h = zi/3 |
68 |
|
|
! On utilise l'integralle |
69 |
|
|
! Int_0^z f(z') dz' = z^2 ( h/2 - z/3 ) = falim(h,z) |
70 |
|
|
! Pour calculer l'alimentation des couches |
71 |
|
|
!------------------------------------------------------------------------- |
72 |
|
|
ELSE |
73 |
|
|
! Computing inversion height zi and zh=zi/3. |
74 |
|
|
zi(:)=0. |
75 |
|
|
! Il faut recalculer zlay qui n'est pas dispo dans thermcell_plume |
76 |
|
|
! A changer eventuellement. |
77 |
|
|
do l=1,klev |
78 |
|
|
zlay(:,l)=0.5*(zlev(:,l)+zlev(:,l+1)) |
79 |
|
|
enddo |
80 |
|
|
|
81 |
|
|
do l=klev-1,1,-1 |
82 |
|
|
do ig=1,ngrid |
83 |
|
|
ztv_parcel=ztv(ig,1)+d_temp(ig) |
84 |
|
|
if (ztv_parcel<ztv(ig,l+1)) lalim(ig)=l |
85 |
|
|
enddo |
86 |
|
|
enddo |
87 |
|
|
|
88 |
|
|
do ig=1,ngrid |
89 |
|
|
l=lalim(ig) |
90 |
|
|
IF (l==1) THEN |
91 |
|
|
zi(ig)=0. |
92 |
|
|
ELSE |
93 |
|
|
ztv_parcel=ztv(ig,1)+d_temp(ig) |
94 |
|
|
zi(ig)=zlay(ig,l)+(zlay(ig,l+1)-zlay(ig,l))/(ztv(ig,l+1)-ztv(ig,l))*(ztv_parcel-ztv(ig,l)) |
95 |
|
|
ENDIF |
96 |
|
|
enddo |
97 |
|
|
|
98 |
|
|
zh(:)=zi(:)/2. |
99 |
|
|
alim_star_tot(:)=0. |
100 |
|
|
alim_star(:,:)=0. |
101 |
|
|
lalim(:)=0 |
102 |
|
|
do l=1,klev-1 |
103 |
|
|
do ig=1,ngrid |
104 |
|
|
IF (zh(ig)==0.) THEN |
105 |
|
|
alim_star(ig,l)=0. |
106 |
|
|
lalim(ig)=1 |
107 |
|
|
ELSE IF (zlev(ig,l+1)<=zh(ig)) THEN |
108 |
|
|
alim_star(ig,l)=(falim(zh(ig),zlev(ig,l+1))-falim(zh(ig),zlev(ig,l)))/falim(zh(ig),zh(ig)) |
109 |
|
|
lalim(ig)=l |
110 |
|
|
ELSE IF (zlev(ig,l)<=zh(ig)) THEN |
111 |
|
|
alim_star(ig,l)=(falim(zh(ig),zh(ig))-falim(zh(ig),zlev(ig,l)))/falim(zh(ig),zh(ig)) |
112 |
|
|
lalim(ig)=l |
113 |
|
|
ELSE |
114 |
|
|
alim_star(ig,l)=0. |
115 |
|
|
ENDIF |
116 |
|
|
ENDDO |
117 |
|
|
alim_star_tot(:)=alim_star_tot(:)+alim_star(:,l) |
118 |
|
|
ENDDO |
119 |
|
|
IF (ngrid==1) print*,'NEW ALIM CALCUL DE ZI ',alim_star_tot,lalim,zi,zh |
120 |
|
|
alim_star_tot(:)=1. |
121 |
|
|
|
122 |
|
|
ENDIF |
123 |
|
|
|
124 |
|
|
|
125 |
|
288 |
RETURN |
126 |
|
|
END |
127 |
|
|
END MODULE lmdz_thermcell_alim |