/[lmdze]/trunk/phylmd/Thermcell/dqthermcell.f90
ViewVC logotype

Annotation of /trunk/phylmd/Thermcell/dqthermcell.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 340 - (hide annotations)
Thu Sep 26 17:29:50 2019 UTC (4 years, 8 months ago) by guez
File size: 1829 byte(s)
Remove `new_oliq` and `ok_stratus`

Remove possibility to choose `new_oliq` false. LMDZ is always used with
`new_oliq` true.

Remove possibility to choose `ok_stratus` true. LMDZ is always used
with `ok_stratus` false.

Encapsulate dqthermcell in a module.

1 guez 340 module dqthermcell_m
2 guez 47
3 guez 340 implicit none
4 guez 47
5 guez 340 contains
6 guez 47
7 guez 340 subroutine dqthermcell(ngrid,nlay,ptimestep,fm,entr,masse &
8     ,q,dq,qa)
9     use dimensions
10     use dimphy
11 guez 47
12 guez 340 !=======================================================================
13     !
14     ! Calcul du transport verticale dans la couche limite en presence
15     ! de "thermiques" explicitement representes
16     ! calcul du dq/dt une fois qu'on connait les ascendances
17     !
18     !=======================================================================
19 guez 47
20    
21 guez 340 integer ngrid,nlay
22 guez 47
23 guez 340 real ptimestep
24     real, intent(in):: masse(ngrid,nlay)
25     real fm(ngrid,nlay+1)
26     real entr(ngrid,nlay)
27     real q(ngrid,nlay)
28     real dq(ngrid,nlay)
29 guez 47
30 guez 340 real qa(klon,klev),detr(klon,klev),wqd(klon,klev+1)
31 guez 47
32 guez 340 integer ig,k
33 guez 47
34 guez 340 ! calcul du detrainement
35 guez 47
36 guez 340 do k=1,nlay
37     do ig=1,ngrid
38     detr(ig,k)=fm(ig,k)-fm(ig,k+1)+entr(ig,k)
39     enddo
40     enddo
41    
42     ! calcul de la valeur dans les ascendances
43     do ig=1,ngrid
44     qa(ig,1)=q(ig,1)
45     enddo
46    
47     do k=2,nlay
48     do ig=1,ngrid
49     if ((fm(ig,k+1)+detr(ig,k))*ptimestep.gt. &
50 guez 47 1.e-5*masse(ig,k)) then
51 guez 340 qa(ig,k)=(fm(ig,k)*qa(ig,k-1)+entr(ig,k)*q(ig,k)) &
52     /(fm(ig,k+1)+detr(ig,k))
53     else
54     qa(ig,k)=q(ig,k)
55     endif
56     enddo
57     enddo
58 guez 47
59 guez 340 do k=2,nlay
60     do ig=1,ngrid
61     ! wqd(ig,k)=fm(ig,k)*0.5*(q(ig,k-1)+q(ig,k))
62     wqd(ig,k)=fm(ig,k)*q(ig,k)
63     enddo
64     enddo
65     do ig=1,ngrid
66     wqd(ig,1)=0.
67     wqd(ig,nlay+1)=0.
68     enddo
69 guez 47
70 guez 340 do k=1,nlay
71     do ig=1,ngrid
72     dq(ig,k)=(detr(ig,k)*qa(ig,k)-entr(ig,k)*q(ig,k) &
73     -wqd(ig,k)+wqd(ig,k+1)) &
74     /masse(ig,k)
75     enddo
76     enddo
77 guez 47
78 guez 340 end subroutine dqthermcell
79    
80     end module dqthermcell_m

  ViewVC Help
Powered by ViewVC 1.1.21