source: trunk/LMDZ.VENUS/libf/phyvenus/conduction.F @ 3556

Last change on this file since 3556 was 2687, checked in by slebonnois, 3 years ago

SL+AM : small correction in conduction.

File size: 5.3 KB
RevLine 
[1310]1       SUBROUTINE conduction(nlon, nlev,ptimestep,pplay,pplev,pt,
2     $                   tsurf,zzlev,zzlay,d_t_conduc)
3   
4      use dimphy
5      use conc, only: akknew, rnew, cpnew
6      IMPLICIT NONE
7
8c=======================================================================
9c
10c   Molecular thermal conduction
11c   
12c   N. Descamp, F. Forget 05/1999
13c
14c=======================================================================
15
16c-----------------------------------------------------------------------
17c   declarations:
18c-----------------------------------------------------------------------
19
20c   arguments:
21c   ----------
22
23      integer,intent(in) :: nlon ! number of atmospheric columns
24      integer,intent(in) :: nlev ! number of atmospheric layers
25      real,intent(in) :: ptimestep
26      REAL,intent(in) :: pplay(nlon,nlev)  ! pressure at middle of layers (Pa)
27      real,intent(in) :: pplev(nlon,nlev+1)
28      REAL,intent(in) :: zzlay(nlon,nlev)   ! (m)
29      real,intent(in) :: zzlev(nlon,nlev+1)
30      REAL,intent(in) :: pt(nlon,nlev)
31      real,intent(in) :: tsurf(nlon)
32
33      real,intent(out) :: d_t_conduc(nlon,nlev)
34
35c   local:
36c   ------
37
38      INTEGER i,ig,l
39      real Akk
40      real,save :: phitop
41      real m,tmean
42      REAL alpha(nlev)
43      real zt(nlev)
44      REAL lambda(nlev)
45      real muvol(nlev)   ! kg m-3
46      REAL C(nlev)
47      real D(nlev)
48      real den(nlev)
49      REAL pdtc(nlev)
50      real zlay(nlev)
51      real zlev(nlev+1)
52
53c   constants used locally
54c    ---------------------
55c     The atmospheric conductivity is a function of temperature T :
56c      conductivity = Akk* T**skk
57      REAL,PARAMETER :: skk=0.69
58     
59      logical,save :: firstcall=.true.
60
61c-----------------------------------------------------------------------
62c   calcul des coefficients alpha et lambda
63c-----------------------------------------------------------------------
64
65      IF (firstcall) THEN
66!        write (*,*)'conduction: coeff to compute molecular',
67!     &             ' conductivity Akk,skk'
68!        write(*,*) Akk,skk
69! NB: Akk is undefined at this stage
70        write (*,*)'conduction: coeff to compute molecular',
71     &             ' conductivity skk = ', skk
72
73! Initialize phitop
74        phitop=0.0
75       
76        firstcall = .false.
77      ENDIF ! of IF (firstcall)
78
79      do ig=1,nlon
80
81c        zt(1)=pt(ig,1)+pdt(ig,1)*ptimestep
82         zt(1)=pt(ig,1)
83
84c        zlay(1)=-log(pplay(ig,1)/pplev(ig,1))*Rnew(ig,1)*zt(1)/g
85c        zlev(1)=0.0
86         zlay(1)=zzlay(ig,1)
87         zlev(1)=zzlev(ig,1)
88     
89        do i=2,nlev
90
91           zt(i)= pt(ig,i)
92c           print*, zt(i)
93
94c          tmean=zt(i)
95c          if(zt(i).ne.zt(i-1))
96c     &    tmean=(zt(i)-zt(i-1))/log(zt(i)/zt(i-1))
97c          zlay(i)= zlay(i-1)
98c     &          -log(pplay(ig,i)/pplay(ig,i-1))*Rnew(ig,i-1)*tmean/g
99c          zlev(i)= zlev(i-1)
100c     &         -log(pplev(ig,i)/pplev(ig,i-1))*Rnew(ig,i-1)*tmean/g
101           zlay(i)=zzlay(ig,i)
102           zlev(i)=zzlev(ig,i)
103        enddo
104        zlev(nlev+1)= zzlev(ig,nlev+1)
105     
106        Akk=akknew(ig,1)
107        lambda(1) = Akk*tsurf(ig)**skk/zlay(1)   
108
109        DO i = 2 , nlev
110          Akk=akknew(ig,i)
111          lambda(i)=Akk*zt(i)**skk/(zlay(i)-zlay(i-1))
112        ENDDO
113        DO i=1,nlev-1
114c          print*, rnew(1,i)
115           muvol(i)=pplay(ig,i)/(rnew(ig,i)*zt(i))
116           alpha(i)=cpnew(ig,i)*(muvol(i)/ptimestep)
117     $                        *(zlev(i+1)-zlev(i))
118       ENDDO
119
120
121c           if (ig .eq. 2) then
122c              print*, '---conduction---'
123c              print*, i, cpnew(ig,i), zt(i)
124c           endif
125C        stop
126
127        muvol(nlev)=pplay(ig,nlev)/(rnew(ig,nlev)*zt(nlev))
[2687]128        alpha(nlev)=cpnew(ig,nlev)*(muvol(nlev)/ptimestep)
[1310]129     $                       *(zlev(nlev+1)-zlev(nlev))
130
131c--------------------------------------------------------------------
132c
133c     calcul des coefficients C et D
134c
135c-------------------------------------------------------------------
136
137        den(1)=alpha(1)+lambda(2)+lambda(1)
138        C(1)=lambda(1)*(tsurf(ig)-zt(1))+lambda(2)*(zt(2)-zt(1))
139        C(1)=C(1)/den(1)             
140        D(1)=lambda(2)/den(1)           
141   
142        DO i = 2,nlev-1
143          den(i)=alpha(i)+lambda(i+1)
144          den(i)=den(i)+lambda(i)*(1-D(i-1))
145           
146          C(i) =lambda(i+1)*(zt(i+1)-zt(i))
147     $         +lambda(i)*(zt(i-1)-zt(i)+C(i-1))   
148          C(i) =C(i)/den(i)           
149
150          D(i) =lambda(i+1) / den(i)
151        ENDDO
152
153        den(nlev)=alpha(nlev) + lambda(nlev) * (1-D(nlev-1))
154        C(nlev)=C(nlev-1)+zt(nlev-1)-zt(nlev)
155        C(nlev)=(C(nlev)*lambda(nlev)+phitop) / den(nlev)
156               
157c----------------------------------------------------------------------
158c
159c      calcul de la nouvelle temperature ptconduc
160c
161c----------------------------------------------------------------------
162
163        DO i=1,nlev
164          pdtc(i)=0.
165        ENDDO
166        pdtc(nlev)=C(nlev)
167        DO i=nlev-1,1,-1
168          pdtc(i)=C(i)+D(i)*pdtc(i+1)
169        ENDDO
170c-----------------------------------------------------------------------
171c
172c     calcul de la tendance zdtconduc
173c
174c-----------------------------------------------------------------------
175   
176        DO i=1,nlev
177          d_t_conduc(ig,i)=pdtc(i)/ptimestep
178c          print*, i, zdtconduc(0, i)
179
180        ENDDO
181c
182      enddo ! of do ig=1,nlon
183
184      RETURN
185      END
Note: See TracBrowser for help on using the repository browser.