source: trunk/LMDZ.PLUTO.old/libf/phypluto/conduction.F

Last change on this file was 3175, checked in by emillour, 11 months ago

Pluto PCM:
Add the old Pluto LMDZ for reference (required prior step to making
an LMDZ.PLUTO using the same framework as the other physics packages).
TB+EM

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