1 | SUBROUTINE concentrations(pplay,pt,pdt,pq,pdq,ptimestep) |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | c======================================================================= |
---|
5 | |
---|
6 | c CALCULATION OF MEAN MOLECULAR MASS, Cp, Akk and R |
---|
7 | c |
---|
8 | c mmean(ngridmx,nlayermx) amu |
---|
9 | c cpnew(ngridmx,nlayermx) J/kg/K |
---|
10 | c rnew(ngridmx,nlayermx) J/kg/K |
---|
11 | c akknew(ngridmx,nlayermx) coefficient of thermal concduction |
---|
12 | c |
---|
13 | c======================================================================= |
---|
14 | c 0. Declarations : |
---|
15 | c ------------------ |
---|
16 | c |
---|
17 | #include "dimensions.h" |
---|
18 | #include "dimphys.h" |
---|
19 | #include "comcstfi.h" |
---|
20 | #include "callkeys.h" |
---|
21 | #include "comdiurn.h" |
---|
22 | #include "chimiedata.h" |
---|
23 | #include "tracer.h" |
---|
24 | #include "conc.h" |
---|
25 | |
---|
26 | c----------------------------------------------------------------------- |
---|
27 | c Input/Output |
---|
28 | c ------------ |
---|
29 | INTEGER ngrid,nlayer |
---|
30 | |
---|
31 | REAL pplay(ngridmx,nlayermx) |
---|
32 | REAL pt(ngridmx,nlayermx) |
---|
33 | REAL pdt(ngridmx,nlayermx) |
---|
34 | real pq(ngridmx,nlayermx,nqmx) |
---|
35 | REAL pdq(ngridmx,nlayermx,nqmx) |
---|
36 | REAL ptimestep |
---|
37 | |
---|
38 | c Local variables : |
---|
39 | c ----------------- |
---|
40 | INTEGER iq,l,ig,ll,n,k,nq |
---|
41 | integer gind(ncomptot) |
---|
42 | real ni(ncomptot) |
---|
43 | real nt, ntot |
---|
44 | real q2(ngridmx,nlayermx,ncomptot) |
---|
45 | real zt(ngridmx,nlayermx) |
---|
46 | real q2tot(ngridmx,nlayermx) |
---|
47 | real aki(ncomptot) |
---|
48 | real cpi(ncomptot) |
---|
49 | |
---|
50 | integer i_co2, i_co, i_o2, i_h2, i_h2o, i_h2o2, |
---|
51 | $ i_o1d, i_o, i_h, i_oh, i_ho2, i_n2, i_o3, i_ar |
---|
52 | |
---|
53 | c save aki, cpi |
---|
54 | |
---|
55 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
56 | c tracer numbering for the thermal conduction and |
---|
57 | c specific heat coefficients |
---|
58 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
59 | c |
---|
60 | i_co2 = 1 |
---|
61 | i_co = 2 |
---|
62 | i_o = 3 |
---|
63 | i_o1d = 4 |
---|
64 | i_o2 = 5 |
---|
65 | i_o3 = 6 |
---|
66 | i_h = 7 |
---|
67 | i_h2 = 8 |
---|
68 | i_oh = 9 |
---|
69 | i_ho2 = 10 |
---|
70 | i_h2o2 = 11 |
---|
71 | i_n2 = 12 |
---|
72 | i_ar = 13 |
---|
73 | i_h2o = 14 |
---|
74 | |
---|
75 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
76 | c tracer numbering in the gcm |
---|
77 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
78 | c |
---|
79 | gind(i_co2) = nqchem_min ! co2 |
---|
80 | gind(i_co) = nqchem_min + 1 ! co |
---|
81 | gind(i_o) = nqchem_min + 2 ! o |
---|
82 | gind(i_o1d) = nqchem_min + 3 ! o1d |
---|
83 | gind(i_o2) = nqchem_min + 4 ! o2 |
---|
84 | gind(i_o3) = nqchem_min + 5 ! o3 |
---|
85 | gind(i_h) = nqchem_min + 6 ! h |
---|
86 | gind(i_h2) = nqchem_min + 7 ! h2 |
---|
87 | gind(i_oh) = nqchem_min + 8 ! oh |
---|
88 | gind(i_ho2) = nqchem_min + 9 ! ho2 |
---|
89 | gind(i_h2o2) = nqchem_min + 10 ! h2o2 |
---|
90 | gind(i_n2) = nqchem_min + 11 ! n2 |
---|
91 | gind(i_ar) = nqchem_min + 12 ! ar |
---|
92 | gind(i_h2o) = nqmx ! h2o |
---|
93 | |
---|
94 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
95 | c Thermal conductivity and specific heat coefficients |
---|
96 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
97 | c |
---|
98 | aki(i_co2) = 3.072e-4 |
---|
99 | aki(i_co) = 4.87e-4 |
---|
100 | aki(i_o) = 7.59e-4 |
---|
101 | aki(i_o1d) = 7.59e-4 !? |
---|
102 | aki(i_o2) = 5.68e-4 |
---|
103 | aki(i_o3) = 3.00e-4 !? |
---|
104 | aki(i_h) = 0.0 |
---|
105 | aki(i_h2) = 36.314e-4 |
---|
106 | aki(i_oh) = 7.00e-4 !? |
---|
107 | aki(i_ho2) = 0.0 |
---|
108 | aki(i_h2o2) = 0.0 |
---|
109 | aki(i_n2) = 5.6e-4 |
---|
110 | aki(i_ar) = 0.0 !? |
---|
111 | aki(i_h2o) = 0.0 |
---|
112 | |
---|
113 | cpi(i_co2) = 0.834e3 |
---|
114 | cpi(i_co) = 1.034e3 |
---|
115 | cpi(i_o) = 1.3e3 |
---|
116 | cpi(i_o1d) = 1.3e3 !? |
---|
117 | cpi(i_o2) = 0.9194e3 |
---|
118 | cpi(i_o3) = 0.800e3 !? |
---|
119 | cpi(i_h) = 20.780e3 |
---|
120 | cpi(i_h2) = 14.266e3 |
---|
121 | cpi(i_oh) = 1.045e3 |
---|
122 | cpi(i_ho2) = 1.065e3 !? |
---|
123 | cpi(i_h2o2) = 1.000e3 !? |
---|
124 | cpi(i_n2) = 1.034e3 |
---|
125 | cpi(i_ar) = 1.000e3 !? |
---|
126 | cpi(i_h2o) = 1.870e3 |
---|
127 | c |
---|
128 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
129 | |
---|
130 | nlayer=nlayermx |
---|
131 | ngrid=ngridmx |
---|
132 | nq=nqmx |
---|
133 | |
---|
134 | DO l=1,nlayer |
---|
135 | DO ig=1,ngrid |
---|
136 | DO n=1,ncomptot |
---|
137 | q2(ig,l,n)=max(1.e-30, |
---|
138 | . pq(ig,l,gind(n))+pdq(ig,l,gind(n))*ptimestep) |
---|
139 | ENDDO |
---|
140 | zt(ig,l)=pt(ig,l) +pdt(ig,l)*ptimestep |
---|
141 | ENDDO |
---|
142 | ENDDO |
---|
143 | |
---|
144 | do l=1,nlayermx |
---|
145 | do ig=1,ngridmx |
---|
146 | ntot=pplay(ig,l)/(1.381e-23*zt(ig,l))*1.e-6 ! in #/cm3 |
---|
147 | cpnew(ig,l)=0. |
---|
148 | akknew(ig,l)=0. |
---|
149 | mmean(ig,l)=0. |
---|
150 | q2tot(ig,l)=0. |
---|
151 | nt=0. |
---|
152 | do n=1,ncomptot |
---|
153 | ni(n)=0.0 |
---|
154 | do k=1,ncomptot |
---|
155 | if(k.ne.n) ni(n)=ni(n)+q2(ig,l,k)/mmol(gind(k)) |
---|
156 | enddo |
---|
157 | ni(n)=ntot/(1.+mmol(gind(n))/q2(ig,l,n)*ni(n)) |
---|
158 | cpnew(ig,l)=cpnew(ig,l)+ni(n)*cpi(n) |
---|
159 | akknew(ig,l)=akknew(ig,l)+ni(n)*aki(n) |
---|
160 | mmean(ig,l)=mmean(ig,l)+q2(ig,l,n)/mmol(gind(n)) |
---|
161 | q2tot(ig,l)=q2tot(ig,l)+q2(ig,l,n) |
---|
162 | c if(ig.eq.1.and.l.eq.1) write(*,*)'q2tot(ig,l)',n,q2tot(ig,l) |
---|
163 | if(cpi(n) .ne. 0.0) nt=nt+ni(n) |
---|
164 | enddo |
---|
165 | |
---|
166 | c print*,"concentrations rep 3",l,ig,nt,mmean(ig,l),zt(ig+1,l) |
---|
167 | |
---|
168 | cpnew(ig,l)=cpnew(ig,l)/nt |
---|
169 | akknew(ig,l)=akknew(ig,l)/nt |
---|
170 | mmean(ig,l)=1/mmean(ig,l) ! in amu |
---|
171 | rnew(ig,l)=8.314/mmean(ig,l)*1.e3 ! J/kg/K |
---|
172 | enddo |
---|
173 | c print*,l,mmean(1,l),cpnew(1,l),rnew(1,l) |
---|
174 | c write(228,*),l,pplay(1,l),ntot |
---|
175 | enddo |
---|
176 | return |
---|
177 | end |
---|