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 firstcall |
---|
52 | save firstcall |
---|
53 | data firstcall /.true./ |
---|
54 | !----------------------------------------------------------------------- |
---|
55 | ! calcul des coefficients alpha et lambda |
---|
56 | ! |
---|
57 | !----------------------------------------------------------------------- |
---|
58 | |
---|
59 | IF (firstcall) THEN |
---|
60 | write (*,*) 'coeff to compute molecular conductivity Akk,skk' |
---|
61 | write(*,*) Akk,skk |
---|
62 | firstcall = .false. |
---|
63 | END IF |
---|
64 | |
---|
65 | ! DO ilayer=1,nlayer |
---|
66 | ! do ig=1,ngrid |
---|
67 | |
---|
68 | ! zt(ig,ilayer)=pt(ig,ilayer)+pdt(ig,ilayer)*ptimestep |
---|
69 | |
---|
70 | ! enddo |
---|
71 | ! ENDDO |
---|
72 | |
---|
73 | |
---|
74 | DO ig=1,ngrid |
---|
75 | |
---|
76 | lambda(1) = Akk*tsurf**skk / pzlay(ig,1) |
---|
77 | DO ilayer = 2 , nlayer |
---|
78 | lambda(ilayer) = Akk * pt(ig,ilayer)**skk / & |
---|
79 | (pzlay(ig,ilayer)-pzlay(ig,ilayer-1)) |
---|
80 | ENDDO |
---|
81 | |
---|
82 | DO ilayer=1,nlayer-1 |
---|
83 | muvol(ilayer)=pplay(ig,ilayer)/(r*pt(ig,ilayer)) |
---|
84 | alpha(ilayer)=cpp*(muvol(ilayer)/ptimestep)* & |
---|
85 | (pzlev(ig,ilayer+1)-pzlev(ig,ilayer)) |
---|
86 | ENDDO |
---|
87 | !!!!!! alerte !!!!!c |
---|
88 | !!!!!! zlev n'est pas declare a nlev !!!!! |
---|
89 | !!!!!! ----> |
---|
90 | muvol(nlayer)=pplay(ig,nlayer)/(r*pt(ig,nlayer)) |
---|
91 | alpha(nlayer)=cpp*(muvol(nlayer)/ptimestep)* & |
---|
92 | 2*(pzlay(ig,nlayer)-pzlev(ig,nlayer)) |
---|
93 | !!!!!! <---- |
---|
94 | !!!!!! alerte !!!!!c |
---|
95 | ! write(*,*) lambda(1),muvol(1),tsurf,pt(1,1) |
---|
96 | |
---|
97 | |
---|
98 | !-------------------------------------------------------------------- |
---|
99 | ! |
---|
100 | ! calcul des coefficients C et D |
---|
101 | ! |
---|
102 | !------------------------------------------------------------------- |
---|
103 | |
---|
104 | den(1)=alpha(1)+lambda(2)+lambda(1) |
---|
105 | C(1)=lambda(1)*(tsurf-pt(ig,1))+lambda(2)*(pt(ig,2)-pt(ig,1)) |
---|
106 | C(1)=C(1)/den(1) |
---|
107 | D(1)=lambda(2)/den(1) |
---|
108 | |
---|
109 | DO ilayer = 2,nlayer-1 |
---|
110 | den(ilayer)=alpha(ilayer)+lambda(ilayer+1) |
---|
111 | den(ilayer)=den(ilayer)+lambda(ilayer)*(1-D(ilayer-1)) |
---|
112 | |
---|
113 | C(ilayer) =lambda(ilayer+1)*(pt(ig,ilayer+1)-pt(ig,ilayer)) & |
---|
114 | +lambda(ilayer)*(pt(ig,ilayer-1)-pt(ig,ilayer)+C(ilayer-1)) |
---|
115 | C(ilayer) =C(ilayer)/den(ilayer) |
---|
116 | |
---|
117 | D(ilayer) =lambda(ilayer+1) / den(ilayer) |
---|
118 | ENDDO |
---|
119 | |
---|
120 | den(nlayer)=alpha(nlayer) + lambda(nlayer) * (1-D(nlayer-1)) |
---|
121 | ! C(nlayer)=((C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer)) |
---|
122 | ! $ *lambda(nlayer) + phitop) / den(nlayer) |
---|
123 | C(nlayer)=C(nlayer-1)+pt(ig,nlayer-1)-pt(ig,nlayer) |
---|
124 | C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop) / den(nlayer) |
---|
125 | ! C(nlayer)=(C(nlayer)*lambda(nlayer)+phitop(ig)) / den(nlayer) |
---|
126 | |
---|
127 | !---------------------------------------------------------------------- |
---|
128 | ! |
---|
129 | ! calcul de la nouvelle temperature ptconduc |
---|
130 | ! |
---|
131 | !---------------------------------------------------------------------- |
---|
132 | |
---|
133 | DO ilayer=1,nlayer |
---|
134 | pdt(ilayer)=0. |
---|
135 | ENDDO |
---|
136 | |
---|
137 | pdt(nlayer)=C(nlayer) |
---|
138 | ! pt(nlayer)=ttop |
---|
139 | ! write(*,*)'pt',pt(nlayer) |
---|
140 | |
---|
141 | DO ilayer=nlayer-1,1,-1 |
---|
142 | pdt(ilayer)=C(ilayer)+D(ilayer)*pdt(ilayer+1) |
---|
143 | ENDDO |
---|
144 | |
---|
145 | ! write(*,*) alpha(1),lambda(2),den(1),C(1),D(1),pdt(1) |
---|
146 | |
---|
147 | ! write(*,*)'15: c et d',C(nlayer),D(nlayer),ptconduc(nlayer), |
---|
148 | ! $ pt(ig,nlayer),ig |
---|
149 | ! write(*,*)'14: c et d',C(14),D(14),ptconduc(14), |
---|
150 | ! $ pt(ig,14),ig |
---|
151 | ! write(*,*)'3: c et d',C(3),D(3),ptconduc(3), |
---|
152 | ! $ pt(ig,3) |
---|
153 | ! write(*,*)'2: c et d',C(2),D(2),ptconduc(2), |
---|
154 | ! $ pt(ig,2) |
---|
155 | |
---|
156 | !----------------------------------------------------------------------- |
---|
157 | ! |
---|
158 | ! calcul de la tendance zdtconduc |
---|
159 | ! |
---|
160 | !----------------------------------------------------------------------- |
---|
161 | |
---|
162 | DO ilayer=1,nlayer |
---|
163 | zdtconduc(ig,ilayer) = pdt(ilayer) / ptimestep |
---|
164 | ! write(*,*)'zdtconduc,c,d',ilayer,zdtconduc(ig,ilayer),C(ilayer) |
---|
165 | ! $,D(ilayer) |
---|
166 | ! write(*,*) 'pt',ilayer,pt(ig,ilayer) |
---|
167 | ENDDO |
---|
168 | |
---|
169 | ENDDO ! boucle sur ngrid |
---|
170 | ! write(*,*)'zdtconduc',zdtconduc(ngrid,nlayer),ngrid |
---|
171 | ! write(*,*)'*********************************' |
---|
172 | RETURN |
---|
173 | END |
---|