1 | MODULE co2condens_mod |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | logical, save :: scavco2cond = .false. ! flag for using scavenging_by_co2 |
---|
6 | |
---|
7 | CONTAINS |
---|
8 | |
---|
9 | SUBROUTINE co2condens(ngrid,nlayer,nq,ptimestep, |
---|
10 | $ pcapcal,pplay,pplev,ptsrf,pt, |
---|
11 | $ pphi,pdt,pdu,pdv,pdtsrf,pu,pv,pq,pdq, |
---|
12 | $ piceco2,psolaralb,pemisurf,rdust, |
---|
13 | $ pdtc,pdtsrfc,pdpsrf,pduc,pdvc,pdqc, |
---|
14 | $ fluxsurf_sw,zls, |
---|
15 | $ zdqssed_co2,pcondicea_co2microp, |
---|
16 | $ zdtcloudco2,pdqsc) |
---|
17 | |
---|
18 | use tracer_mod, only: noms, igcm_h2o_ice, |
---|
19 | & igcm_dust_mass, igcm_dust_number, |
---|
20 | & igcm_ccn_mass, igcm_ccn_number |
---|
21 | use surfdat_h, only: emissiv, phisfi |
---|
22 | use geometry_mod, only: latitude, ! grid point latitudes (rad) |
---|
23 | & longitude_deg, latitude_deg |
---|
24 | use planete_h, only: obliquit |
---|
25 | use comcstfi_h, only: cpp, g, r, pi |
---|
26 | |
---|
27 | #ifndef MESOSCALE |
---|
28 | USE vertical_layers_mod, ONLY: ap, bp |
---|
29 | #endif |
---|
30 | IMPLICIT NONE |
---|
31 | c======================================================================= |
---|
32 | c subject: |
---|
33 | c -------- |
---|
34 | c Condensation/sublimation of CO2 ice on the ground and in the |
---|
35 | c atmosphere |
---|
36 | c (Scheme described in Forget et al., Icarus, 1998) |
---|
37 | c |
---|
38 | c author: Francois Forget 1994-1996 ; updated 1996 -- 2018 |
---|
39 | c ------ |
---|
40 | c adapted to external CO2 ice clouds scheme by Deborah Bardet (2018) ' |
---|
41 | c |
---|
42 | c======================================================================= |
---|
43 | c |
---|
44 | c 0. Declarations : |
---|
45 | c ------------------ |
---|
46 | c |
---|
47 | include "callkeys.h" |
---|
48 | |
---|
49 | c----------------------------------------------------------------------- |
---|
50 | c Arguments : |
---|
51 | c --------- |
---|
52 | INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns |
---|
53 | INTEGER,INTENT(IN) :: nlayer ! number of vertical layers |
---|
54 | INTEGER,INTENT(IN) :: nq ! number of tracers |
---|
55 | |
---|
56 | REAL,INTENT(IN) :: ptimestep ! physics timestep (s) |
---|
57 | REAL,INTENT(IN) :: pcapcal(ngrid) |
---|
58 | REAL,INTENT(IN) :: pplay(ngrid,nlayer) !mid-layer pressure (Pa) |
---|
59 | REAL,INTENT(IN) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) |
---|
60 | REAL,INTENT(IN) :: ptsrf(ngrid) ! surface temperature (K) |
---|
61 | REAL,INTENT(IN) :: pt(ngrid,nlayer) ! atmospheric temperature (K) |
---|
62 | REAL,INTENT(IN) :: pphi(ngrid,nlayer) ! geopotential (m2.s-2) |
---|
63 | REAL,INTENT(IN) :: pdt(ngrid,nlayer) ! tendency on temperature from |
---|
64 | ! previous physical processes (K/s) |
---|
65 | REAL,INTENT(IN) :: pdu(ngrid,nlayer) ! tendency on zonal wind (m/s2) |
---|
66 | ! from previous physical processes |
---|
67 | REAL,INTENT(IN) :: pdv(ngrid,nlayer) ! tendency on meridional wind (m/s2) |
---|
68 | ! from previous physical processes |
---|
69 | REAL,INTENT(IN) :: pdtsrf(ngrid) ! tendency on surface temperature from |
---|
70 | ! previous physical processes (K/s) |
---|
71 | REAL,INTENT(IN) :: pu(ngrid,nlayer) ! zonal wind (m/s) |
---|
72 | REAL,INTENT(IN) :: pv(ngrid,nlayer) ! meridional wind (m/s) |
---|
73 | REAL,INTENT(IN) :: pq(ngrid,nlayer,nq) ! tracers (../kg_air) |
---|
74 | REAL,INTENT(IN) :: pdq(ngrid,nlayer,nq) ! tendency on tracers from |
---|
75 | ! previous physical processes |
---|
76 | |
---|
77 | REAL,INTENT(IN) :: zdqssed_co2(ngrid) ! CO2 flux at the surface (kg.m-2.s-1) |
---|
78 | REAL,INTENT(IN) :: pcondicea_co2microp(ngrid,nlayer)! tendency due to CO2 condensation (kg/kg.s-1) |
---|
79 | REAL,INTENT(IN) :: zdtcloudco2(ngrid,nlayer) ! tendency on temperature due to latent heat |
---|
80 | |
---|
81 | REAL,INTENT(INOUT) :: piceco2(ngrid) ! CO2 ice on the surface (kg.m-2) |
---|
82 | REAL,INTENT(INOUT) :: psolaralb(ngrid,2) ! albedo of the surface |
---|
83 | REAL,INTENT(INOUT) :: pemisurf(ngrid) ! emissivity of the surface |
---|
84 | REAL,INTENT(IN) :: rdust(ngrid,nlayer) ! dust effective radius |
---|
85 | |
---|
86 | ! tendencies due to CO2 condensation/sublimation: |
---|
87 | REAL,INTENT(OUT) :: pdtc(ngrid,nlayer) ! tendency on temperature (K/s) |
---|
88 | REAL,INTENT(OUT) :: pdtsrfc(ngrid) ! tendency on surface temperature (K/s) |
---|
89 | REAL,INTENT(OUT) :: pdpsrf(ngrid) ! tendency on surface pressure (Pa/s) |
---|
90 | REAL,INTENT(OUT) :: pduc(ngrid,nlayer) ! tendency on zonal wind (m.s-2) |
---|
91 | REAL,INTENT(OUT) :: pdvc(ngrid,nlayer) ! tendency on meridional wind (m.s-2) |
---|
92 | REAL,INTENT(OUT) :: pdqc(ngrid,nlayer,nq) ! tendency on tracers |
---|
93 | REAL,INTENT(OUT) :: pdqsc(ngrid,nq) ! tendency on surface tracers |
---|
94 | |
---|
95 | ! added to calculate flux dependent albedo: |
---|
96 | REAL,intent(in) :: fluxsurf_sw(ngrid,2) |
---|
97 | real,intent(in) :: zls ! solar longitude (rad) |
---|
98 | |
---|
99 | c |
---|
100 | c Local variables : |
---|
101 | c ----------------- |
---|
102 | |
---|
103 | INTEGER i,j |
---|
104 | INTEGER l,ig,iq,icap |
---|
105 | REAL zt(ngrid,nlayer) |
---|
106 | REAL zcpi |
---|
107 | REAL ztcond (ngrid,nlayer+1) ! CO2 condensation temperature (atm) |
---|
108 | REAL ztcondsol(ngrid) ! CO2 condensation temperature (surface) |
---|
109 | REAL zdiceco2(ngrid) |
---|
110 | REAL zcondicea(ngrid,nlayer) ! condensation rate in layer l (kg/m2/s) |
---|
111 | REAL zcondices(ngrid) ! condensation rate on the ground (kg/m2/s) |
---|
112 | REAL zfallice(ngrid,nlayer+1) ! amount of ice falling from layer l (kg/m2/s) |
---|
113 | REAL zfallheat |
---|
114 | REAL zmflux(nlayer+1) |
---|
115 | REAL zu(nlayer),zv(nlayer) |
---|
116 | REAL zqc(nlayer,nq),zq1(nlayer) |
---|
117 | REAL ztsrf(ngrid) |
---|
118 | REAL ztc(nlayer), ztm(nlayer+1) |
---|
119 | REAL zum(nlayer+1) , zvm(nlayer+1) |
---|
120 | REAL zqm(nlayer+1,nq),zqm1(nlayer+1) |
---|
121 | REAL masse(nlayer),w(nlayer+1) |
---|
122 | REAL Sm(nlayer),Smq(nlayer,nq),mixmas,qmix |
---|
123 | REAL availco2 |
---|
124 | LOGICAL condsub(ngrid) |
---|
125 | |
---|
126 | real :: emisref(ngrid) |
---|
127 | |
---|
128 | REAL zdq_scav(ngrid,nlayer,nq) ! tendancy due to scavenging by co2 |
---|
129 | REAL zq(ngrid,nlayer,nq) |
---|
130 | |
---|
131 | c variable speciale diagnostique |
---|
132 | real tconda1(ngrid,nlayer) |
---|
133 | real tconda2(ngrid,nlayer) |
---|
134 | c REAL zdiceco2a(ngrid) ! for diagnostic only |
---|
135 | real zdtsig (ngrid,nlayer) |
---|
136 | real zdt (ngrid,nlayer) |
---|
137 | real vmr_co2(ngrid,nlayer) ! co2 volume mixing ratio |
---|
138 | ! improved_ztcond flag: If set to .true. (AND running with a 'co2' tracer) |
---|
139 | ! then condensation temperature is computed using partial pressure of CO2 |
---|
140 | logical,parameter :: improved_ztcond=.true. |
---|
141 | |
---|
142 | c local saved variables |
---|
143 | integer,save :: ico2 ! index of CO2 tracer |
---|
144 | real,save :: qco2,mmean |
---|
145 | real,parameter :: latcond=5.9e5 ! (J/kg) Latent heat of solid CO2 ice |
---|
146 | real,parameter :: tcond1mb=136.27 ! condensation temperature (K) at 1 mbar |
---|
147 | real,parameter :: cpice=1000. ! (J.kg-1.K-1) specific heat of CO2 ice |
---|
148 | REAL,SAVE :: acond,bcond,ccond |
---|
149 | real,save :: m_co2, m_noco2, A , B |
---|
150 | |
---|
151 | LOGICAL,SAVE :: firstcall = .true. !,firstcall2=.true. |
---|
152 | |
---|
153 | c D.BARDET: for debug |
---|
154 | real ztc3D(ngrid,nlayer) |
---|
155 | REAL ztm3D(ngrid,nlayer) |
---|
156 | REAL zmflux3D(ngrid,nlayer) |
---|
157 | c---------------------------------------------------------------------- |
---|
158 | |
---|
159 | c Initialisation |
---|
160 | c -------------- |
---|
161 | c |
---|
162 | ! AS: firstcall OK absolute |
---|
163 | IF (firstcall) THEN |
---|
164 | |
---|
165 | bcond=1./tcond1mb |
---|
166 | ccond=cpp/(g*latcond) |
---|
167 | acond=r/latcond |
---|
168 | |
---|
169 | firstcall=.false. |
---|
170 | write(*,*) 'CO2condens: improved_ztcond=',improved_ztcond |
---|
171 | PRINT*,'In co2condens:Tcond(P=1mb)=',tcond1mb,' Lcond=',latcond |
---|
172 | PRINT*,'acond,bcond,ccond',acond,bcond,ccond |
---|
173 | |
---|
174 | ico2=0 |
---|
175 | |
---|
176 | if (tracer) then |
---|
177 | c Prepare Special treatment if one of the tracer is CO2 gas |
---|
178 | do iq=1,nq |
---|
179 | if (noms(iq).eq."co2") then |
---|
180 | ico2=iq |
---|
181 | m_co2 = 44.01E-3 ! CO2 molecular mass (kg/mol) |
---|
182 | m_noco2 = 33.37E-3 ! Non condensible mol mass (kg/mol) |
---|
183 | c Compute A and B coefficient use to compute |
---|
184 | c mean molecular mass Mair defined by |
---|
185 | c 1/Mair = q(ico2)/m_co2 + (1-q(ico2))/m_noco2 |
---|
186 | c 1/Mair = A*q(ico2) + B |
---|
187 | A =(1/m_co2 - 1/m_noco2) |
---|
188 | B=1/m_noco2 |
---|
189 | endif |
---|
190 | enddo |
---|
191 | end if |
---|
192 | ENDIF ! of IF (firstcall) |
---|
193 | zcpi=1./cpp |
---|
194 | |
---|
195 | c |
---|
196 | c====================================================================== |
---|
197 | c Calcul of CO2 condensation sublimation |
---|
198 | c ============================================================ |
---|
199 | c |
---|
200 | c Used variable : |
---|
201 | c piceco2(ngrid) : amount of co2 ice on the ground (kg/m2) |
---|
202 | c zcondicea(ngrid,l): condensation rate in layer l (kg/m2/s) |
---|
203 | c zcondices(ngrid): condensation rate on the ground (kg/m2/s) |
---|
204 | c zfallice(ngrid,l):amount of ice falling from layer l (kg/m2/s) |
---|
205 | c |
---|
206 | c pdtc(ngrid,nlayer) : dT/dt due to cond/sub |
---|
207 | c |
---|
208 | c |
---|
209 | c Tendencies set to 0 |
---|
210 | c ------------------------------------- |
---|
211 | zcondicea(1:ngrid,1:nlayer) = 0. |
---|
212 | zfallice(1:ngrid,1:nlayer+1) = 0. |
---|
213 | pduc(1:ngrid,1:nlayer) = 0 |
---|
214 | pdvc(1:ngrid,1:nlayer) = 0 |
---|
215 | pdtc(1:ngrid,1:nlayer) = 0. |
---|
216 | pdqsc(1:ngrid,1:nq) = 0 |
---|
217 | |
---|
218 | pdqc(1:ngrid,1:nlayer,1:nq) = 0 |
---|
219 | |
---|
220 | zcondices(1:ngrid) = 0. |
---|
221 | pdtsrfc(1:ngrid) = 0. |
---|
222 | pdpsrf(1:ngrid) = 0. |
---|
223 | condsub(1:ngrid) = .false. |
---|
224 | zdiceco2(1:ngrid) = 0. |
---|
225 | |
---|
226 | zfallheat=0 |
---|
227 | |
---|
228 | zdq_scav(:,:,:)=0. |
---|
229 | |
---|
230 | c Update tendencies from previous processes |
---|
231 | c ------------------------------------- |
---|
232 | DO l=1,nlayer |
---|
233 | DO ig=1,ngrid |
---|
234 | zt(ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep |
---|
235 | do iq=1,nq |
---|
236 | zq(ig,l,iq)=pq(ig,l,iq)+pdq(ig,l,iq)*ptimestep |
---|
237 | enddo |
---|
238 | ENDDO |
---|
239 | ENDDO |
---|
240 | |
---|
241 | c ************************* |
---|
242 | c ATMOSPHERIC CONDENSATION |
---|
243 | c ************************* |
---|
244 | |
---|
245 | c Compute CO2 Volume mixing ratio |
---|
246 | c ------------------------------- |
---|
247 | if (improved_ztcond.and.(ico2.ne.0)) then |
---|
248 | DO l=1,nlayer |
---|
249 | DO ig=1,ngrid |
---|
250 | qco2=pq(ig,l,ico2)+pdq(ig,l,ico2)*ptimestep |
---|
251 | c Mean air molecular mass = 1/(q(ico2)/m_co2 + (1-q(ico2))/m_noco2) |
---|
252 | mmean=1/(A*qco2 +B) |
---|
253 | vmr_co2(ig,l) = qco2*mmean/m_co2 |
---|
254 | ENDDO |
---|
255 | ENDDO |
---|
256 | else |
---|
257 | DO l=1,nlayer |
---|
258 | DO ig=1,ngrid |
---|
259 | vmr_co2(ig,l)=0.95 |
---|
260 | ENDDO |
---|
261 | ENDDO |
---|
262 | endif |
---|
263 | |
---|
264 | IF (.NOT. co2clouds) then |
---|
265 | c forecast of atmospheric temperature zt and frost temperature ztcond |
---|
266 | c -------------------------------------------------------------------- |
---|
267 | |
---|
268 | DO l=1,nlayer |
---|
269 | DO ig=1,ngrid |
---|
270 | ! ztcond(ig,l)=1./(bcond-acond*log(.0095*pplay(ig,l))) |
---|
271 | if (pplay(ig,l).ge.1e-4) then |
---|
272 | ztcond(ig,l)= |
---|
273 | & 1./(bcond-acond*log(.01*vmr_co2(ig,l)*pplay(ig,l))) |
---|
274 | else |
---|
275 | ztcond(ig,l)=0.0 !mars Monica |
---|
276 | endif |
---|
277 | ENDDO |
---|
278 | ENDDO |
---|
279 | |
---|
280 | ztcond(:,nlayer+1)=ztcond(:,nlayer) |
---|
281 | |
---|
282 | c Condensation/sublimation in the atmosphere |
---|
283 | c ------------------------------------------ |
---|
284 | c (calcul of zcondicea , zfallice and pdtc) |
---|
285 | c |
---|
286 | DO l=nlayer , 1, -1 |
---|
287 | DO ig=1,ngrid |
---|
288 | pdtc(ig,l)=0. |
---|
289 | IF((zt(ig,l).LT.ztcond(ig,l)).or.(zfallice(ig,l+1).gt.0))THEN |
---|
290 | condsub(ig)=.true. |
---|
291 | IF (zfallice(ig,l+1).gt.0) then |
---|
292 | zfallheat=zfallice(ig,l+1)* |
---|
293 | & (pphi(ig,l+1)-pphi(ig,l) + |
---|
294 | & cpice*(ztcond(ig,l+1)-ztcond(ig,l)))/latcond |
---|
295 | ELSE |
---|
296 | zfallheat=0. |
---|
297 | ENDIF |
---|
298 | pdtc(ig,l)=(ztcond(ig,l) - zt(ig,l))/ptimestep |
---|
299 | zcondicea(ig,l)=(pplev(ig,l)-pplev(ig,l+1)) |
---|
300 | & *ccond*pdtc(ig,l)- zfallheat |
---|
301 | c Case when the ice from above sublimes entirely |
---|
302 | c """"""""""""""""""""""""""""""""""""""""""""""" |
---|
303 | IF (zfallice(ig,l+1).lt.- zcondicea(ig,l)) then |
---|
304 | pdtc(ig,l)=(-zfallice(ig,l+1)+zfallheat)/ |
---|
305 | & (ccond*(pplev(ig,l)-pplev(ig,l+1))) |
---|
306 | zcondicea(ig,l)= -zfallice(ig,l+1) |
---|
307 | END IF |
---|
308 | |
---|
309 | zfallice(ig,l) = zcondicea(ig,l)+zfallice(ig,l+1) |
---|
310 | END IF |
---|
311 | ENDDO |
---|
312 | ENDDO |
---|
313 | |
---|
314 | if (scavco2cond) then |
---|
315 | call scavenging_by_co2(ngrid,nlayer,nq,ptimestep,pplev,zq, |
---|
316 | & rdust,zcondicea,zfallice,zdq_scav,pdqsc) |
---|
317 | endif |
---|
318 | |
---|
319 | ELSE ! if co2 clouds |
---|
320 | DO ig=1,ngrid |
---|
321 | zfallice(ig,1) = zdqssed_co2(ig) |
---|
322 | ENDDO |
---|
323 | DO l=nlayer , 1, -1 |
---|
324 | DO ig=1,ngrid |
---|
325 | zcondicea(ig,l) = pcondicea_co2microp(ig,l)* |
---|
326 | & (pplev(ig,l) - pplev(ig,l+1))/g |
---|
327 | ENDDO |
---|
328 | ENDDO |
---|
329 | |
---|
330 | ENDIF ! end of if co2clouds |
---|
331 | |
---|
332 | call WRITEdiagfi(ngrid,"pdtc_atm", |
---|
333 | & "temperature tendency due to CO2 condensation", |
---|
334 | & " ",3,pdtc) |
---|
335 | |
---|
336 | call WRITEdiagfi(ngrid,"zcondicea", |
---|
337 | & "", |
---|
338 | & " ",3,zcondicea) |
---|
339 | |
---|
340 | call WRITEdiagfi(ngrid,"zfallice", |
---|
341 | & "", |
---|
342 | & " ",2,zfallice(ngrid,1)) |
---|
343 | |
---|
344 | |
---|
345 | c ************************* |
---|
346 | c SURFACE CONDENSATION |
---|
347 | c ************************* |
---|
348 | |
---|
349 | c forecast of ground temperature ztsrf and frost temperature ztcondsol |
---|
350 | c -------------------------------------------------------------------- |
---|
351 | DO ig=1,ngrid |
---|
352 | ztcondsol(ig)= |
---|
353 | & 1./(bcond-acond*log(.01*vmr_co2(ig,1)*pplev(ig,1))) |
---|
354 | ztsrf(ig) = ptsrf(ig) + pdtsrf(ig)*ptimestep |
---|
355 | ENDDO |
---|
356 | |
---|
357 | c |
---|
358 | c Condensation/sublimation on the ground |
---|
359 | c -------------------------------------- |
---|
360 | c (compute zcondices and pdtsrfc) |
---|
361 | c |
---|
362 | DO ig=1,ngrid |
---|
363 | IF(latitude(ig).lt.0) THEN |
---|
364 | ! Southern hemisphere |
---|
365 | icap=2 |
---|
366 | ELSE |
---|
367 | ! Northern hemisphere |
---|
368 | icap=1 |
---|
369 | ENDIF |
---|
370 | |
---|
371 | c |
---|
372 | c Loop on where we have condensation/ sublimation |
---|
373 | IF ((ztsrf(ig) .LT. ztcondsol(ig)) .OR. ! ground cond |
---|
374 | $ (zfallice(ig,1).NE.0.) .OR. ! falling snow |
---|
375 | $ ((ztsrf(ig) .GT. ztcondsol(ig)) .AND. ! ground sublim. |
---|
376 | $ ((piceco2(ig)+zfallice(ig,1)*ptimestep) .NE. 0.))) THEN |
---|
377 | condsub(ig) = .true. |
---|
378 | |
---|
379 | IF (zfallice(ig,1).gt.0) then |
---|
380 | zfallheat=zfallice(ig,1)* |
---|
381 | & (pphi(ig,1)- phisfi(ig) + |
---|
382 | & cpice*(ztcond(ig,1)-ztcondsol(ig)))/latcond |
---|
383 | ELSE |
---|
384 | zfallheat=0. |
---|
385 | ENDIF |
---|
386 | |
---|
387 | c condensation or partial sublimation of CO2 ice |
---|
388 | c """"""""""""""""""""""""""""""""""""""""""""""" |
---|
389 | zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) |
---|
390 | & /(latcond*ptimestep) - zfallheat |
---|
391 | pdtsrfc(ig) = (ztcondsol(ig) - ztsrf(ig))/ptimestep |
---|
392 | zdiceco2(ig) = zcondices(ig) + zfallice(ig,1) |
---|
393 | |
---|
394 | #ifdef MESOSCALE |
---|
395 | print*, "not enough CO2 tracer in 1st layer to condense" |
---|
396 | print*, ">>> to be implemented in the mesoscale case" |
---|
397 | print*, "because this uses ap levels..." |
---|
398 | #else |
---|
399 | c If there is not enough CO2 tracer in 1st layer to condense |
---|
400 | c """""""""""""""""""""""""""""""""""""""""""""""""""""" |
---|
401 | IF(ico2.ne.0) then |
---|
402 | c Available CO2 tracer in layer 1 at end of timestep (kg/m2) |
---|
403 | availco2= pq(ig,1,ico2)*((ap(1)-ap(2))+ |
---|
404 | & (bp(1)-bp(2))*(pplev(ig,1)/g-zdiceco2(ig)*ptimestep)) |
---|
405 | |
---|
406 | IF ((zcondices(ig) + zcondicea(ig,1))*ptimestep |
---|
407 | & .gt.availco2) then |
---|
408 | zcondices(ig) = availco2/ptimestep -zcondicea(ig,1) |
---|
409 | zdiceco2(ig) = zcondices(ig) + zfallice(ig,1) |
---|
410 | pdtsrfc(ig)=(latcond/pcapcal(ig))* |
---|
411 | & (zcondices(ig)+zfallheat) |
---|
412 | ENDIF |
---|
413 | ENDIF |
---|
414 | #endif |
---|
415 | |
---|
416 | c If the entire CO2 ice layer sublimes |
---|
417 | c """""""""""""""""""""""""""""""""""""""""""""""""""" |
---|
418 | c (including what has just condensed in the atmosphere) |
---|
419 | |
---|
420 | IF((piceco2(ig)/ptimestep+zfallice(ig,1)).LE. |
---|
421 | & -zcondices(ig))THEN |
---|
422 | zcondices(ig) = -piceco2(ig)/ptimestep - zfallice(ig,1) |
---|
423 | pdtsrfc(ig)=(latcond/pcapcal(ig))* |
---|
424 | & (zcondices(ig)+zfallheat) |
---|
425 | zdiceco2(ig) = zcondices(ig) + zfallice(ig,1) |
---|
426 | END IF |
---|
427 | |
---|
428 | c Changing CO2 ice amount and pressure : |
---|
429 | c """""""""""""""""""""""""""""""""""" |
---|
430 | |
---|
431 | piceco2(ig) = piceco2(ig) + zdiceco2(ig)*ptimestep |
---|
432 | pdpsrf(ig) = -zdiceco2(ig)*g |
---|
433 | |
---|
434 | IF(ABS(pdpsrf(ig)*ptimestep).GT.pplev(ig,1)) THEN |
---|
435 | PRINT*,'STOP in condens' |
---|
436 | PRINT*,'condensing more than total mass' |
---|
437 | PRINT*,'Grid point ',ig |
---|
438 | PRINT*,'Longitude(degrees): ',longitude_deg(ig) |
---|
439 | PRINT*,'Latitude(degrees): ',latitude_deg(ig) |
---|
440 | PRINT*,'Ps = ',pplev(ig,1) |
---|
441 | PRINT*,'d Ps = ',pdpsrf(ig) |
---|
442 | STOP |
---|
443 | ENDIF |
---|
444 | END IF ! if there is condensation/sublimation |
---|
445 | ENDDO ! of DO ig=1,ngrid |
---|
446 | |
---|
447 | c ******************************************************************** |
---|
448 | c Surface albedo and emissivity of the surface below the snow (emisref) |
---|
449 | c ******************************************************************** |
---|
450 | |
---|
451 | ! Check that amont of CO2 ice is not problematic |
---|
452 | DO ig=1,ngrid |
---|
453 | if(.not.piceco2(ig).ge.0.) THEN |
---|
454 | if(piceco2(ig).le.-5.e-8) print*, |
---|
455 | $ 'WARNING co2condens piceco2(',ig,')=', piceco2(ig) |
---|
456 | piceco2(ig)=0. |
---|
457 | endif |
---|
458 | ENDDO |
---|
459 | |
---|
460 | ! Set albedo and emissivity of the surface |
---|
461 | ! ---------------------------------------- |
---|
462 | CALL albedocaps(zls,ngrid,piceco2,psolaralb,emisref) |
---|
463 | |
---|
464 | ! set pemisurf() to emissiv when there is bare surface (needed for co2snow) |
---|
465 | DO ig=1,ngrid |
---|
466 | if (piceco2(ig).eq.0) then |
---|
467 | pemisurf(ig)=emissiv |
---|
468 | endif |
---|
469 | ENDDO |
---|
470 | |
---|
471 | ! firstcall2=.false. |
---|
472 | c *************************************************************** |
---|
473 | c Correction to account for redistribution between sigma or hybrid |
---|
474 | c layers when changing surface pressure (and warming/cooling |
---|
475 | c of the CO2 currently changing phase). |
---|
476 | c ************************************************************* |
---|
477 | |
---|
478 | DO ig=1,ngrid |
---|
479 | if (condsub(ig)) then |
---|
480 | do l=1,nlayer |
---|
481 | ztc(l) =zt(ig,l) +pdtc(ig,l) *ptimestep |
---|
482 | zu(l) =pu(ig,l) +pdu( ig,l) *ptimestep |
---|
483 | zv(l) =pv(ig,l) +pdv( ig,l) *ptimestep |
---|
484 | do iq=1,nq |
---|
485 | zqc(l,iq)=zq(ig,l,iq)+zdq_scav(ig,l,iq)*ptimestep ! zdq_scav=0 if watercloud=false |
---|
486 | enddo |
---|
487 | enddo |
---|
488 | |
---|
489 | c Mass fluxes through the sigma levels (kg.m-2.s-1) (>0 when up) |
---|
490 | c """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
---|
491 | |
---|
492 | zmflux(1) = -zcondices(ig) |
---|
493 | DO l=1,nlayer |
---|
494 | zmflux(l+1) = zmflux(l) -zcondicea(ig,l) |
---|
495 | #ifndef MESOSCALE |
---|
496 | & + (bp(l)-bp(l+1))*(zfallice(ig,1)-zmflux(1)) |
---|
497 | c zmflux set to 0 if very low to avoid: top layer is disappearing in v1ld |
---|
498 | if (abs(zmflux(l+1)).lt.1E-13.OR.bp(l+1).eq.0.) zmflux(l+1)=0. |
---|
499 | #else |
---|
500 | if (abs(zmflux(l+1)).lt.1E-13) zmflux(l+1)=0. |
---|
501 | #endif |
---|
502 | END DO |
---|
503 | |
---|
504 | #ifdef MESOSCALE |
---|
505 | print*,"absurd mass set because bp not available" |
---|
506 | print*,"TO BE FIXED" |
---|
507 | #else |
---|
508 | c Mass of each layer at the end of timestep |
---|
509 | c ----------------------------------------- |
---|
510 | DO l=1,nlayer |
---|
511 | masse(l)=( pplev(ig,l) - pplev(ig,l+1) + |
---|
512 | & (bp(l)-bp(l+1))*pdpsrf(ig)*ptimestep)/g |
---|
513 | END DO |
---|
514 | #endif |
---|
515 | |
---|
516 | c Corresponding fluxes for T,U,V,Q |
---|
517 | c """""""""""""""""""""""""""""""" |
---|
518 | |
---|
519 | c averaging operator for TRANSPORT |
---|
520 | c """""""""""""""""""""""""""""""" |
---|
521 | c Value transfert at the surface interface when condensation |
---|
522 | c sublimation: |
---|
523 | ztm(1) = ztsrf(ig) + pdtsrfc(ig)*ptimestep |
---|
524 | zum(1) = 0 |
---|
525 | zvm(1) = 0 |
---|
526 | do iq=1,nq |
---|
527 | zqm(1,iq)=0. ! most tracer do not condense ! |
---|
528 | enddo |
---|
529 | c Special case if one of the tracer is CO2 gas |
---|
530 | if (ico2.ne.0) zqm(1,ico2)=1. ! flux is 100% CO2 |
---|
531 | |
---|
532 | c Van Leer scheme: |
---|
533 | DO l=1,nlayer+1 |
---|
534 | w(l)=-zmflux(l)*ptimestep |
---|
535 | END DO |
---|
536 | call vl1d(nlayer,ztc,2.,masse,w,ztm) |
---|
537 | call vl1d(nlayer,zu ,2.,masse,w,zum) |
---|
538 | call vl1d(nlayer,zv ,2.,masse,w,zvm) |
---|
539 | do iq=1,nq |
---|
540 | do l=1,nlayer |
---|
541 | zq1(l)=zqc(l,iq) |
---|
542 | enddo |
---|
543 | zqm1(1)=zqm(1,iq) |
---|
544 | call vl1d(nlayer,zq1,2.,masse,w,zqm1) |
---|
545 | do l=2,nlayer |
---|
546 | zqc(l,iq)=zq1(l) |
---|
547 | zqm(l,iq)=zqm1(l) |
---|
548 | enddo |
---|
549 | enddo |
---|
550 | |
---|
551 | c Surface condensation affects low winds |
---|
552 | if (zmflux(1).lt.0) then |
---|
553 | zum(1)= zu(1) * (w(1)/masse(1)) |
---|
554 | zvm(1)= zv(1) * (w(1)/masse(1)) |
---|
555 | if (w(1).gt.masse(1)) then ! ensure numerical stability |
---|
556 | zum(1)= (zu(1)-zum(2))*masse(1)/w(1) + zum(2) |
---|
557 | zvm(1)= (zv(1)-zvm(2))*masse(1)/w(1) + zvm(2) |
---|
558 | end if |
---|
559 | end if |
---|
560 | |
---|
561 | ztm(nlayer+1)= ztc(nlayer) ! should not be used, but... |
---|
562 | zum(nlayer+1)= zu(nlayer) ! should not be used, but... |
---|
563 | zvm(nlayer+1)= zv(nlayer) ! should not be used, but... |
---|
564 | do iq=1,nq |
---|
565 | zqm(nlayer+1,iq)= zqc(nlayer,iq) |
---|
566 | enddo |
---|
567 | |
---|
568 | #ifdef MESOSCALE |
---|
569 | !!!! AS: This part must be commented in the mesoscale model |
---|
570 | !!!! AS: ... to avoid instabilities. |
---|
571 | !!!! AS: you have to compile with -DMESOSCALE to do so |
---|
572 | #else |
---|
573 | c Tendencies on T, U, V, Q |
---|
574 | c """""""""""""""""""""""" |
---|
575 | DO l=1,nlayer |
---|
576 | IF(.not. co2clouds) THEN |
---|
577 | c Tendencies on T |
---|
578 | zdtsig(ig,l) = (1/masse(l)) * |
---|
579 | & ( zmflux(l)*(ztm(l) - ztc(l)) |
---|
580 | & - zmflux(l+1)*(ztm(l+1) - ztc(l)) |
---|
581 | & + zcondicea(ig,l)*(ztcond(ig,l)-ztc(l)) ) |
---|
582 | ELSE |
---|
583 | zdtsig(ig,l) = (1/masse(l)) * |
---|
584 | & ( zmflux(l)*(ztm(l) - ztc(l)) |
---|
585 | & - zmflux(l+1)*(ztm(l+1) - ztc(l))) |
---|
586 | ENDIF |
---|
587 | c D.BARDET: for diagnotics |
---|
588 | zmflux3D(ig,l)=zmflux(l) |
---|
589 | ztm3D(ig,l)=ztm(l) |
---|
590 | ztc3D(ig,l)=ztc(l) |
---|
591 | |
---|
592 | pdtc(ig,l) = pdtc(ig,l) + zdtsig(ig,l) |
---|
593 | |
---|
594 | c Tendencies on U |
---|
595 | pduc(ig,l) = (1/masse(l)) * |
---|
596 | & ( zmflux(l)*(zum(l) - zu(l)) |
---|
597 | & - zmflux(l+1)*(zum(l+1) - zu(l)) ) |
---|
598 | |
---|
599 | |
---|
600 | c Tendencies on V |
---|
601 | pdvc(ig,l) = (1/masse(l)) * |
---|
602 | & ( zmflux(l)*(zvm(l) - zv(l)) |
---|
603 | & - zmflux(l+1)*(zvm(l+1) - zv(l)) ) |
---|
604 | |
---|
605 | END DO |
---|
606 | |
---|
607 | #endif |
---|
608 | |
---|
609 | c Tendencies on Q |
---|
610 | do iq=1,nq |
---|
611 | ! if (noms(iq).eq.'co2') then |
---|
612 | if (iq.eq.ico2) then |
---|
613 | c SPECIAL Case when the tracer IS CO2 : |
---|
614 | DO l=1,nlayer |
---|
615 | pdqc(ig,l,iq)= (1/masse(l)) * |
---|
616 | & ( zmflux(l)*(zqm(l,iq) - zqc(l,iq)) |
---|
617 | & - zmflux(l+1)*(zqm(l+1,iq) - zqc(l,iq)) |
---|
618 | & + zcondicea(ig,l)*(zqc(l,iq)-1.) ) |
---|
619 | END DO |
---|
620 | else |
---|
621 | DO l=1,nlayer |
---|
622 | pdqc(ig,l,iq)= (1/masse(l)) * |
---|
623 | & ( zmflux(l)*(zqm(l,iq) - zqc(l,iq)) |
---|
624 | & - zmflux(l+1)*(zqm(l+1,iq) - zqc(l,iq)) |
---|
625 | & + zcondicea(ig,l)*zqc(l,iq) ) |
---|
626 | |
---|
627 | pdqc(ig,l,iq)=pdqc(ig,l,iq)+zdq_scav(ig,l,iq) ! zdq_scav=0 if watercloud=false |
---|
628 | END DO |
---|
629 | end if |
---|
630 | enddo |
---|
631 | |
---|
632 | end if ! if (condsub) |
---|
633 | END DO ! loop on ig |
---|
634 | |
---|
635 | c *************************************************************** |
---|
636 | c CO2 snow / clouds scheme |
---|
637 | c *************************************************************** |
---|
638 | |
---|
639 | call co2snow(ngrid,nlayer,ptimestep,emisref,condsub,pplev, |
---|
640 | & zcondicea,zcondices,zfallice,pemisurf) |
---|
641 | |
---|
642 | c *************************************************************** |
---|
643 | c Ecriture des diagnostiques |
---|
644 | c *************************************************************** |
---|
645 | |
---|
646 | c DO l=1,nlayer |
---|
647 | c DO ig=1,ngrid |
---|
648 | c Taux de cond en kg.m-2.pa-1.s-1 |
---|
649 | c tconda1(ig,l)=zcondicea(ig,l)/(pplev(ig,l)-pplev(ig,l+1)) |
---|
650 | c Taux de cond en kg.m-3.s-1 |
---|
651 | c tconda2(ig,l)=tconda1(ig,l)*pplay(ig,l)*g/(r*pt(ig,l)) |
---|
652 | c END DO |
---|
653 | c END DO |
---|
654 | c call WRITEDIAGFI(ngrid,'tconda1', |
---|
655 | c &'Taux de condensation CO2 atmospherique /Pa', |
---|
656 | c & 'kg.m-2.Pa-1.s-1',3,tconda1) |
---|
657 | c call WRITEDIAGFI(ngrid,'tconda2', |
---|
658 | c &'Taux de condensation CO2 atmospherique /m', |
---|
659 | c & 'kg.m-3.s-1',3,tconda2) |
---|
660 | |
---|
661 | ! output falling co2 ice in 1st layer: |
---|
662 | ! call WRITEDIAGFI(ngrid,'fallice', |
---|
663 | ! &'Precipitation of co2 ice', |
---|
664 | ! & 'kg.m-2.s-1',2,zfallice(1,1)) |
---|
665 | |
---|
666 | #ifndef MESOSCALE |
---|
667 | ! Extra special case for surface temperature tendency pdtsrfc: |
---|
668 | ! we want to fix the south pole temperature to CO2 condensation temperature |
---|
669 | if (caps.and.(obliquit.lt.27.)) then |
---|
670 | ! check if last grid point is the south pole |
---|
671 | if (abs(latitude(ngrid)-(-pi/2.)).lt.1.e-5) then |
---|
672 | ! NB: Updated surface pressure, at grid point 'ngrid', is |
---|
673 | ! ps(ngrid)=pplev(ngrid,1)+pdpsrf(ngrid)*ptimestep |
---|
674 | ! write(*,*) "co2condens: South pole: latitude(ngrid)=", |
---|
675 | ! & latitude(ngrid) |
---|
676 | ztcondsol(ngrid)= |
---|
677 | & 1./(bcond-acond*log(.01*vmr_co2(ngrid,1)* |
---|
678 | & (pplev(ngrid,1)+pdpsrf(ngrid)*ptimestep))) |
---|
679 | pdtsrfc(ngrid)=(ztcondsol(ngrid)-ztsrf(ngrid))/ptimestep |
---|
680 | endif |
---|
681 | endif |
---|
682 | #endif |
---|
683 | |
---|
684 | END SUBROUTINE co2condens |
---|
685 | |
---|
686 | |
---|
687 | |
---|
688 | c ***************************************************************** |
---|
689 | SUBROUTINE vl1d(nlayer,q,pente_max,masse,w,qm) |
---|
690 | c |
---|
691 | c |
---|
692 | c Operateur de moyenne inter-couche pour calcul de transport type |
---|
693 | c Van-Leer " pseudo amont " dans la verticale |
---|
694 | c q,w sont des arguments d'entree pour le s-pg .... |
---|
695 | c masse : masse de la couche Dp/g |
---|
696 | c w : masse d'atm ``transferee'' a chaque pas de temps (kg.m-2) |
---|
697 | c pente_max = 2 conseillee |
---|
698 | c |
---|
699 | c |
---|
700 | c -------------------------------------------------------------------- |
---|
701 | IMPLICIT NONE |
---|
702 | |
---|
703 | c |
---|
704 | c |
---|
705 | c |
---|
706 | c Arguments: |
---|
707 | c ---------- |
---|
708 | integer nlayer |
---|
709 | real masse(nlayer),pente_max |
---|
710 | REAL q(nlayer),qm(nlayer+1) |
---|
711 | REAL w(nlayer+1) |
---|
712 | c |
---|
713 | c Local |
---|
714 | c --------- |
---|
715 | c |
---|
716 | INTEGER l |
---|
717 | c |
---|
718 | real dzq(nlayer),dzqw(nlayer),adzqw(nlayer),dzqmax |
---|
719 | real sigw, Mtot, MQtot |
---|
720 | integer m |
---|
721 | c integer ismax,ismin |
---|
722 | |
---|
723 | |
---|
724 | c On oriente tout dans le sens de la pression |
---|
725 | c W > 0 WHEN DOWN !!!!!!!!!!!!! |
---|
726 | |
---|
727 | do l=2,nlayer |
---|
728 | dzqw(l)=q(l-1)-q(l) |
---|
729 | adzqw(l)=abs(dzqw(l)) |
---|
730 | enddo |
---|
731 | |
---|
732 | do l=2,nlayer-1 |
---|
733 | if(dzqw(l)*dzqw(l+1).gt.0.) then |
---|
734 | dzq(l)=0.5*(dzqw(l)+dzqw(l+1)) |
---|
735 | else |
---|
736 | dzq(l)=0. |
---|
737 | endif |
---|
738 | dzqmax=pente_max*min(adzqw(l),adzqw(l+1)) |
---|
739 | dzq(l)=sign(min(abs(dzq(l)),dzqmax),dzq(l)) |
---|
740 | enddo |
---|
741 | |
---|
742 | dzq(1)=0. |
---|
743 | dzq(nlayer)=0. |
---|
744 | |
---|
745 | do l = 1,nlayer-1 |
---|
746 | |
---|
747 | c Regular scheme (transfered mass < layer mass) |
---|
748 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
749 | if(w(l+1).gt.0. .and. w(l+1).le.masse(l+1)) then |
---|
750 | sigw=w(l+1)/masse(l+1) |
---|
751 | qm(l+1)=(q(l+1)+0.5*(1.-sigw)*dzq(l+1)) |
---|
752 | else if(w(l+1).le.0. .and. -w(l+1).le.masse(l)) then |
---|
753 | sigw=w(l+1)/masse(l) |
---|
754 | qm(l+1)=(q(l)-0.5*(1.+sigw)*dzq(l)) |
---|
755 | |
---|
756 | c Extended scheme (transfered mass > layer mass) |
---|
757 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
758 | else if(w(l+1).gt.0.) then |
---|
759 | m=l+1 |
---|
760 | Mtot = masse(m) |
---|
761 | MQtot = masse(m)*q(m) |
---|
762 | do while ((m.lt.nlayer).and.(w(l+1).gt.(Mtot+masse(m+1)))) |
---|
763 | m=m+1 |
---|
764 | Mtot = Mtot + masse(m) |
---|
765 | MQtot = MQtot + masse(m)*q(m) |
---|
766 | end do |
---|
767 | if (m.lt.nlayer) then |
---|
768 | sigw=(w(l+1)-Mtot)/masse(m+1) |
---|
769 | qm(l+1)= (1/w(l+1))*(MQtot + (w(l+1)-Mtot)* |
---|
770 | & (q(m+1)+0.5*(1.-sigw)*dzq(m+1)) ) |
---|
771 | else |
---|
772 | w(l+1) = Mtot |
---|
773 | qm(l+1) = Mqtot / Mtot |
---|
774 | write(*,*) 'top layer is disapearing !' |
---|
775 | stop |
---|
776 | end if |
---|
777 | else ! if(w(l+1).lt.0) |
---|
778 | m = l-1 |
---|
779 | Mtot = masse(m+1) |
---|
780 | MQtot = masse(m+1)*q(m+1) |
---|
781 | if (m.gt.0) then ! because some compilers will have problems |
---|
782 | ! evaluating masse(0) |
---|
783 | do while ((m.gt.0).and.(-w(l+1).gt.(Mtot+masse(m)))) |
---|
784 | m=m-1 |
---|
785 | Mtot = Mtot + masse(m+1) |
---|
786 | MQtot = MQtot + masse(m+1)*q(m+1) |
---|
787 | if (m.eq.0) exit |
---|
788 | end do |
---|
789 | endif |
---|
790 | if (m.gt.0) then |
---|
791 | sigw=(w(l+1)+Mtot)/masse(m) |
---|
792 | qm(l+1)= (-1/w(l+1))*(MQtot + (-w(l+1)-Mtot)* |
---|
793 | & (q(m)-0.5*(1.+sigw)*dzq(m)) ) |
---|
794 | else |
---|
795 | qm(l+1)= (-1/w(l+1))*(MQtot + (-w(l+1)-Mtot)*qm(1)) |
---|
796 | end if |
---|
797 | end if |
---|
798 | enddo |
---|
799 | |
---|
800 | c boundary conditions (not used in co2condens !!) |
---|
801 | c qm(nlayer+1)=0. |
---|
802 | c if(w(1).gt.0.) then |
---|
803 | c qm(1)=q(1) |
---|
804 | c else |
---|
805 | c qm(1)=0. |
---|
806 | c end if |
---|
807 | |
---|
808 | END SUBROUTINE vl1d |
---|
809 | |
---|
810 | c ***************************************************************** |
---|
811 | SUBROUTINE scavenging_by_co2(ngrid,nlayer,nq,ptimestep,pplev,pq, |
---|
812 | & rdust,pcondicea,pfallice,pdq_scav,pdqsc) |
---|
813 | |
---|
814 | c |
---|
815 | c |
---|
816 | c Calcul de la quantite de poussiere lessivee par les nuages de CO2 |
---|
817 | c |
---|
818 | c -------------------------------------------------------------------- |
---|
819 | use tracer_mod, only: nqmx, igcm_h2o_vap, igcm_h2o_ice, |
---|
820 | & igcm_dust_mass, igcm_dust_number, |
---|
821 | & igcm_ccn_mass, igcm_ccn_number, |
---|
822 | & rho_dust, nuice_sed, nuice_ref,r3n_q |
---|
823 | use comcstfi_h, only: g |
---|
824 | |
---|
825 | IMPLICIT NONE |
---|
826 | include "callkeys.h" ! for the flags water, microphys and freedust |
---|
827 | c |
---|
828 | c |
---|
829 | c Arguments: |
---|
830 | INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns |
---|
831 | INTEGER,INTENT(IN) :: nlayer ! number of vertical layers |
---|
832 | INTEGER,INTENT(IN) :: nq ! number of tracers |
---|
833 | REAL,INTENT(IN) :: ptimestep ! physics timestep (s) |
---|
834 | REAL,INTENT(IN) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) |
---|
835 | REAL,INTENT(IN) :: pq(ngrid,nlayer,nq) |
---|
836 | REAL,INTENT(IN) :: rdust(ngrid,nlayer) ! dust effective radius |
---|
837 | REAL,INTENT(IN) :: pcondicea(ngrid,nlayer) ! condensation rate in layer l (kg/m2/s) |
---|
838 | REAL,INTENT(IN) :: pfallice(ngrid,nlayer+1) ! amount of ice falling from layer l (kg/m2/s) |
---|
839 | |
---|
840 | REAL,INTENT(OUT) :: pdq_scav(ngrid,nlayer,nq) ! tendancy due to scavenging by co2 |
---|
841 | REAL,INTENT(OUT) :: pdqsc(ngrid,nq) ! tendency on surface tracers |
---|
842 | |
---|
843 | c Locals: |
---|
844 | INTEGER l,ig |
---|
845 | REAL scav_ratio_dust, scav_ratio_wice ! ratio of the dust/water ice mass mixing ratios in condensing CO2 ice and in air |
---|
846 | REAL scav_dust_mass(nlayer+1) ! dust flux (mass) scavenged towards the lower layer (kg/m2/s) (POSITIVE WHEN DOWNWARD) |
---|
847 | REAL scav_dust_number(nlayer+1) ! dust flux (number) scavenged towards the lower layer (kg/m2/s) (POSITIVE WHEN DOWNWARD) |
---|
848 | REAL scav_ccn_mass(nlayer+1) ! ccn flux (mass) scavenged towards the lower layer |
---|
849 | REAL scav_ccn_number(nlayer+1) ! ccn flux (number) scavenged towards the lower layer |
---|
850 | REAL scav_h2o_ice(nlayer+1) ! water ice flux (mass) scavenged towards the lower layer |
---|
851 | REAL massl ! mass of the layer l at point ig (kg/m2) |
---|
852 | |
---|
853 | c Initialization: |
---|
854 | scav_ratio_dust = 100 !1 !10 !100 !1000 |
---|
855 | scav_ratio_wice = scav_ratio_dust |
---|
856 | pdq_scav(:,:,:)=0. |
---|
857 | |
---|
858 | DO ig=1,ngrid |
---|
859 | scav_dust_mass(nlayer+1)=0. |
---|
860 | scav_dust_number(nlayer+1)=0. |
---|
861 | scav_ccn_mass(nlayer+1)=0. |
---|
862 | scav_ccn_number(nlayer+1)=0. |
---|
863 | scav_h2o_ice(nlayer+1)=0. |
---|
864 | |
---|
865 | DO l=nlayer , 1, -1 |
---|
866 | massl=(pplev(ig,l)-pplev(ig,l+1))/g |
---|
867 | IF(pcondicea(ig,l).GT.0.)THEN ! if CO2 condenses and traps dust/water ice |
---|
868 | ! Calculation of the tendencies |
---|
869 | if (freedust) then |
---|
870 | pdq_scav(ig,l,igcm_dust_mass)=-pq(ig,l,igcm_dust_mass) |
---|
871 | & /ptimestep*(1-exp( |
---|
872 | & -scav_ratio_dust*pcondicea(ig,l)*ptimestep/massl)) |
---|
873 | |
---|
874 | pdq_scav(ig,l,igcm_dust_number)=pdq_scav(ig,l,igcm_dust_mass) |
---|
875 | & *r3n_q/rdust(ig,l) |
---|
876 | endif |
---|
877 | if (freedust.AND.microphys) then |
---|
878 | pdq_scav(ig,l,igcm_ccn_mass)=-pq(ig,l,igcm_ccn_mass) |
---|
879 | & /ptimestep*(1-exp( |
---|
880 | & -scav_ratio_wice*pcondicea(ig,l)*ptimestep/massl)) |
---|
881 | pdq_scav(ig,l,igcm_ccn_number)=pdq_scav(ig,l,igcm_ccn_mass) |
---|
882 | & *r3n_q/rdust(ig,l) |
---|
883 | endif |
---|
884 | if (water) then |
---|
885 | pdq_scav(ig,l,igcm_h2o_ice)=-pq(ig,l,igcm_h2o_ice) |
---|
886 | & /ptimestep*(1-exp( |
---|
887 | & -scav_ratio_wice*pcondicea(ig,l)*ptimestep/massl)) |
---|
888 | endif |
---|
889 | |
---|
890 | ELSE IF(pcondicea(ig,l).LT.0.)THEN ! if CO2 sublimates and releases dust/water ice |
---|
891 | ! Calculation of the tendencies |
---|
892 | if (freedust) then |
---|
893 | pdq_scav(ig,l,igcm_dust_mass)=-pcondicea(ig,l)/massl* |
---|
894 | & scav_dust_mass(l+1)/pfallice(ig,l+1) |
---|
895 | |
---|
896 | pdq_scav(ig,l,igcm_dust_number)=-pcondicea(ig,l)/massl* |
---|
897 | & scav_dust_number(l+1)/pfallice(ig,l+1) |
---|
898 | endif |
---|
899 | if (freedust.AND.microphys) then |
---|
900 | pdq_scav(ig,l,igcm_ccn_mass)=-pcondicea(ig,l)/massl* |
---|
901 | & scav_ccn_mass(l+1)/pfallice(ig,l+1) |
---|
902 | |
---|
903 | pdq_scav(ig,l,igcm_ccn_number)=-pcondicea(ig,l)/massl* |
---|
904 | & scav_ccn_number(l+1)/pfallice(ig,l+1) |
---|
905 | endif |
---|
906 | if (water) then |
---|
907 | pdq_scav(ig,l,igcm_h2o_ice)=-pcondicea(ig,l)/massl* |
---|
908 | & scav_h2o_ice(l+1)/pfallice(ig,l+1) |
---|
909 | endif |
---|
910 | |
---|
911 | END IF |
---|
912 | ! Calculation of the scavenged dust/wice flux towards the lower layers |
---|
913 | if (freedust) then |
---|
914 | scav_dust_mass(l)=-pdq_scav(ig,l,igcm_dust_mass)*massl |
---|
915 | & +scav_dust_mass(l+1) |
---|
916 | |
---|
917 | scav_dust_number(l)=-pdq_scav(ig,l,igcm_dust_number)*massl |
---|
918 | & +scav_dust_number(l+1) |
---|
919 | endif |
---|
920 | if (freedust.AND.microphys) then |
---|
921 | scav_ccn_mass(l)=-pdq_scav(ig,l,igcm_ccn_mass)*massl |
---|
922 | & +scav_ccn_mass(l+1) |
---|
923 | |
---|
924 | scav_ccn_number(l)=-pdq_scav(ig,l,igcm_ccn_number)*massl |
---|
925 | & +scav_dust_number(l+1) |
---|
926 | endif |
---|
927 | if (water) then |
---|
928 | scav_h2o_ice(l)=-pdq_scav(ig,l,igcm_h2o_ice)*massl |
---|
929 | & +scav_h2o_ice(l+1) |
---|
930 | endif |
---|
931 | |
---|
932 | ENDDO |
---|
933 | ! Calculation of the surface tendencies |
---|
934 | pdqsc(ig,igcm_dust_mass)=0. |
---|
935 | pdqsc(ig,igcm_dust_number)=0. |
---|
936 | |
---|
937 | if (freedust) then |
---|
938 | pdqsc(ig,igcm_dust_mass)=pdqsc(ig,igcm_dust_mass) |
---|
939 | & +scav_dust_mass(1) |
---|
940 | pdqsc(ig,igcm_dust_number)=pdqsc(ig,igcm_dust_number) |
---|
941 | & +scav_dust_number(1) |
---|
942 | endif |
---|
943 | if (freedust.AND.microphys) then |
---|
944 | pdqsc(ig,igcm_dust_mass)=pdqsc(ig,igcm_dust_mass) |
---|
945 | & +scav_ccn_mass(1) |
---|
946 | pdqsc(ig,igcm_dust_number)=pdqsc(ig,igcm_dust_number) |
---|
947 | & +scav_ccn_number(1) |
---|
948 | endif |
---|
949 | if (water) then |
---|
950 | pdqsc(ig,igcm_h2o_ice)=scav_h2o_ice(1) |
---|
951 | endif |
---|
952 | ENDDO |
---|
953 | |
---|
954 | END SUBROUTINE scavenging_by_co2 |
---|
955 | |
---|
956 | END MODULE co2condens_mod |
---|