source: trunk/LMDZ.PLUTO/libf/phypluto/conduction.F90 @ 3474

Last change on this file since 3474 was 3474, checked in by afalco, 4 weeks ago

Pluto PCM: imcompatibility message;
Initialize firstcall properly.
AF

File size: 5.2 KB
Line 
1       SUBROUTINE conduction(ngrid,nlayer,ptimestep,    &
2                          pplay,pt,pzlay,pzlev,   &
3                          zdtconduc,tsurf)
4
5      use comcstfi_mod, only: cpp, r
6      use surfdat_h, only: phitop
7
8      IMPLICIT NONE
9
10!=======================================================================
11!
12!   Molecular thermal conduction
13!
14!   N. Descamp, F. Forget 05/1999
15!
16!=======================================================================
17
18!-----------------------------------------------------------------------
19!   declarations:
20!-----------------------------------------------------------------------
21
22#include "dimensions.h"
23
24!   arguments:
25!   ----------
26
27      INTEGER ngrid,nlayer
28      REAL ptimestep
29      REAL pt(ngrid,nlayer),zdtconduc(ngrid,nlayer)
30      REAL pzlay(ngrid,nlayer),pzlev(ngrid,nlayer+1),pplay(ngrid,nlayer)
31      REAL zt(ngrid,nlayer)
32
33!   local:
34!   ------
35
36      INTEGER ilayer,ig
37      REAL alpha(nlayer)
38      REAL lambda(nlayer),muvol(nlayer)
39      REAL C(nlayer),D(nlayer),den(nlayer)
40      REAL tsurf
41!      REAL pdt(nlayer),tsurf
42      REAL pdt(nlayer)
43
44!   constants used locally
45!    ---------------------
46!     The atmospheric conductivity is a function of temperature T :
47!      conductivity = Akk* T**skk
48      real,parameter :: Akk=5.63E-05
49      real,parameter :: skk=1.12
50
51      logical, save :: firstcall=.true.
52!-----------------------------------------------------------------------
53!   calcul des coefficients alpha et lambda
54!
55!-----------------------------------------------------------------------
56
57      IF (firstcall) THEN
58        write (*,*) 'coeff to compute molecular conductivity Akk,skk'
59        write(*,*) Akk,skk
60        firstcall = .false.
61      END IF
62
63!       DO ilayer=1,nlayer
64!           do ig=1,ngrid
65
66!           zt(ig,ilayer)=pt(ig,ilayer)+pdt(ig,ilayer)*ptimestep
67
68!           enddo
69!       ENDDO
70
71
72      DO ig=1,ngrid
73
74        lambda(1) = Akk*tsurf**skk / pzlay(ig,1)
75        DO ilayer = 2 , nlayer
76          lambda(ilayer) = Akk * pt(ig,ilayer)**skk /   &
77                                (pzlay(ig,ilayer)-pzlay(ig,ilayer-1))
78        ENDDO
79
80        DO ilayer=1,nlayer-1
81          muvol(ilayer)=pplay(ig,ilayer)/(r*pt(ig,ilayer))
82          alpha(ilayer)=cpp*(muvol(ilayer)/ptimestep)*  &
83                                (pzlev(ig,ilayer+1)-pzlev(ig,ilayer))
84        ENDDO
85!!!!!! alerte !!!!!c
86!!!!!! zlev n'est pas declare a nlev !!!!!
87!!!!!! ---->
88          muvol(nlayer)=pplay(ig,nlayer)/(r*pt(ig,nlayer))
89          alpha(nlayer)=cpp*(muvol(nlayer)/ptimestep)*  &
90                                2*(pzlay(ig,nlayer)-pzlev(ig,nlayer))
91!!!!!! <----
92!!!!!! alerte !!!!!c
93!        write(*,*) lambda(1),muvol(1),tsurf,pt(1,1)
94
95
96!--------------------------------------------------------------------
97!
98!     calcul des coefficients C et D
99!
100!-------------------------------------------------------------------
101
102      den(1)=alpha(1)+lambda(2)+lambda(1)
103      C(1)=lambda(1)*(tsurf-pt(ig,1))+lambda(2)*(pt(ig,2)-pt(ig,1))
104      C(1)=C(1)/den(1)
105      D(1)=lambda(2)/den(1)
106
107      DO ilayer = 2,nlayer-1
108         den(ilayer)=alpha(ilayer)+lambda(ilayer+1)
109         den(ilayer)=den(ilayer)+lambda(ilayer)*(1-D(ilayer-1))
110
111         C(ilayer) =lambda(ilayer+1)*(pt(ig,ilayer+1)-pt(ig,ilayer))    &
112            +lambda(ilayer)*(pt(ig,ilayer-1)-pt(ig,ilayer)+C(ilayer-1))
113         C(ilayer) =C(ilayer)/den(ilayer)
114
115         D(ilayer) =lambda(ilayer+1) / den(ilayer)
116      ENDDO
117
118      den(nlayer)=alpha(nlayer) + lambda(nlayer) * (1-D(nlayer-1))
119!      C(nlayer)=((C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer))
120!     $            *lambda(nlayer) + phitop) / den(nlayer)
121      C(nlayer)=C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer)
122      C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop) / den(nlayer)
123    !   C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop(ig)) / den(nlayer)
124
125!----------------------------------------------------------------------
126!
127!      calcul de la nouvelle temperature ptconduc
128!
129!----------------------------------------------------------------------
130
131      DO ilayer=1,nlayer
132         pdt(ilayer)=0.
133      ENDDO
134
135         pdt(nlayer)=C(nlayer)
136!         pt(nlayer)=ttop
137!         write(*,*)'pt',pt(nlayer)
138
139      DO ilayer=nlayer-1,1,-1
140         pdt(ilayer)=C(ilayer)+D(ilayer)*pdt(ilayer+1)
141      ENDDO
142
143!      write(*,*) alpha(1),lambda(2),den(1),C(1),D(1),pdt(1)
144
145!       write(*,*)'15: c et d',C(nlayer),D(nlayer),ptconduc(nlayer),
146!     $    pt(ig,nlayer),ig
147!       write(*,*)'14: c et d',C(14),D(14),ptconduc(14),
148!     $    pt(ig,14),ig
149!       write(*,*)'3: c et d',C(3),D(3),ptconduc(3),
150!     $    pt(ig,3)
151!       write(*,*)'2: c et d',C(2),D(2),ptconduc(2),
152!     $    pt(ig,2)
153
154!-----------------------------------------------------------------------
155!
156!     calcul de la tendance zdtconduc
157!
158!-----------------------------------------------------------------------
159
160      DO ilayer=1,nlayer
161         zdtconduc(ig,ilayer) = pdt(ilayer) / ptimestep
162!         write(*,*)'zdtconduc,c,d',ilayer,zdtconduc(ig,ilayer),C(ilayer)
163!     $,D(ilayer)
164!         write(*,*) 'pt',ilayer,pt(ig,ilayer)
165      ENDDO
166
167      ENDDO             ! boucle sur ngrid
168!       write(*,*)'zdtconduc',zdtconduc(ngrid,nlayer),ngrid
169!        write(*,*)'*********************************'
170      RETURN
171      END
Note: See TracBrowser for help on using the repository browser.