1 | SUBROUTINE newcondens(ngrid,nlayer,nq,ptimestep, |
---|
2 | $ pcapcal,pplay,pplev,ptsrf,pt, |
---|
3 | $ pphi,pdt,pdu,pdv,pdtsrf,pu,pv,pq,pdq, |
---|
4 | $ piceco2,psolaralb,pemisurf, |
---|
5 | $ pdtc,pdtsrfc,pdpsrf,pduc,pdvc,pdqc, |
---|
6 | $ fluxsurf_sw,zls) |
---|
7 | |
---|
8 | IMPLICIT NONE |
---|
9 | c======================================================================= |
---|
10 | c subject: |
---|
11 | c -------- |
---|
12 | c Condensation/sublimation of CO2 ice on the ground and in the |
---|
13 | c atmosphere |
---|
14 | c (Scheme described in Forget et al., Icarus, 1998) |
---|
15 | c |
---|
16 | c author: Francois Forget 1994-1996 |
---|
17 | c ------ |
---|
18 | c |
---|
19 | c input: |
---|
20 | c ----- |
---|
21 | c ngrid nombre de points de verticales |
---|
22 | c (toutes les boucles de la physique sont au |
---|
23 | c moins vectorisees sur ngrid) |
---|
24 | c nlayer nombre de couches |
---|
25 | c pplay(ngrid,nlayer) Pressure levels |
---|
26 | c pplev(ngrid,nlayer+1) Pressure levels |
---|
27 | c pt(ngrid,nlayer) temperature (en K) |
---|
28 | c ptsrf(ngrid) temperature de surface |
---|
29 | c |
---|
30 | c \ |
---|
31 | c pdt(ngrid,nlayermx) \ derivee temporelle physique avant condensation |
---|
32 | c / ou sublimation pour pt,ptsrf |
---|
33 | c pdtsrf(ngrid) / |
---|
34 | c |
---|
35 | c output: |
---|
36 | c ------- |
---|
37 | c |
---|
38 | c pdpsrf(ngrid) \ derivee temporelle physique (contribution de |
---|
39 | c pdtc(ngrid,nlayermx) / la condensation ou sublimation) pour Ps,pt,ptsrf |
---|
40 | c pdtsrfc(ngrid) / |
---|
41 | c |
---|
42 | c Entree/sortie |
---|
43 | c ------------- |
---|
44 | c |
---|
45 | c piceco2(ngrid) : quantite de glace co2 au sol (kg/m2) |
---|
46 | c psolaralb(ngrid,2) : albedo au sol |
---|
47 | c pemisurf(ngrid) : emissivite du sol |
---|
48 | |
---|
49 | c |
---|
50 | c======================================================================= |
---|
51 | c |
---|
52 | c 0. Declarations : |
---|
53 | c ------------------ |
---|
54 | c |
---|
55 | #include "dimensions.h" |
---|
56 | #include "dimphys.h" |
---|
57 | #include "comcstfi.h" |
---|
58 | #include "surfdat.h" |
---|
59 | #include "comgeomfi.h" |
---|
60 | #include "comvert.h" |
---|
61 | #include "paramet.h" |
---|
62 | #include "callkeys.h" |
---|
63 | #include "tracer.h" |
---|
64 | |
---|
65 | c----------------------------------------------------------------------- |
---|
66 | c Arguments : |
---|
67 | c --------- |
---|
68 | INTEGER ngrid, nlayer, nq |
---|
69 | |
---|
70 | REAL ptimestep |
---|
71 | REAL pplay(ngrid,nlayer),pplev(ngrid,nlayer+1) |
---|
72 | REAL pcapcal(ngrid) |
---|
73 | REAL pt(ngrid,nlayer) |
---|
74 | REAL ptsrf(ngrid) |
---|
75 | REAL pphi(ngrid,nlayer) |
---|
76 | REAL pdt(ngrid,nlayer),pdtsrf(ngrid),pdtc(ngrid,nlayer) |
---|
77 | REAL pdtsrfc(ngrid),pdpsrf(ngrid) |
---|
78 | REAL piceco2(ngrid),psolaralb(ngrid,2),pemisurf(ngrid) |
---|
79 | |
---|
80 | REAL pu(ngrid,nlayer) , pv(ngrid,nlayer) |
---|
81 | REAL pdu(ngrid,nlayer) , pdv(ngrid,nlayer) |
---|
82 | REAL pduc(ngrid,nlayer) , pdvc(ngrid,nlayer) |
---|
83 | REAL pq(ngridmx,nlayer,nq),pdq(ngrid,nlayer,nq) |
---|
84 | REAL pdqc(ngrid,nlayer,nq) |
---|
85 | REAL fluxsurf_sw(ngrid,2) ! added to calculate flux dependent albedo |
---|
86 | real zls ! solar longitude (rad) |
---|
87 | c |
---|
88 | c Local variables : |
---|
89 | c ----------------- |
---|
90 | |
---|
91 | c variables used for albedo parametrization |
---|
92 | c -------------------------------------------- |
---|
93 | INTEGER i,j |
---|
94 | REAL Fluxmean(jjp1) |
---|
95 | INTEGER l,ig,iq,icap,nmix |
---|
96 | LOGICAL transparency, fluxdependent |
---|
97 | c flag transparency if you want to make the co2ice semi-transparent |
---|
98 | PARAMETER(transparency=.true.) |
---|
99 | c flag fluxdependent if you want the co2ice albedo to be dependent on |
---|
100 | c the incident solar flux |
---|
101 | PARAMETER(fluxdependent=.false.) |
---|
102 | REAL slopy,alpha,constA,constB,constT,albediceF_new(ngridmx) |
---|
103 | REAL zt(ngridmx,nlayermx) |
---|
104 | REAL zcpi |
---|
105 | REAL ztcond (ngridmx,nlayermx+1) |
---|
106 | REAL ztcondsol(ngridmx) |
---|
107 | REAL zdiceco2(ngridmx) |
---|
108 | REAL zcondicea(ngridmx,nlayermx) |
---|
109 | REAL zcondices(ngridmx) |
---|
110 | REAL zfallice(ngridmx,nlayermx+1) , zfallheat |
---|
111 | REAL zmflux(nlayermx+1) |
---|
112 | REAL zu(nlayermx),zv(nlayermx) |
---|
113 | REAL zq(nlayermx,nqmx),zq1(nlayermx) |
---|
114 | REAL ztsrf(ngridmx) |
---|
115 | REAL ztc(nlayermx), ztm(nlayermx+1) |
---|
116 | REAL zum(nlayermx+1) , zvm(nlayermx+1) |
---|
117 | REAL zqm(nlayermx+1,nqmx),zqm1(nlayermx+1) |
---|
118 | REAL masse(nlayermx),w(nlayermx+1) |
---|
119 | REAL Sm(nlayermx),Smq(nlayermx,nqmx),mixmas,qmix |
---|
120 | LOGICAL condsub(ngridmx) |
---|
121 | |
---|
122 | c variable speciale diagnostique |
---|
123 | real tconda1(ngridmx,nlayermx) |
---|
124 | real tconda2(ngridmx,nlayermx) |
---|
125 | c REAL zdiceco2a(ngridmx) ! for diagnostic only |
---|
126 | real zdtsig (ngridmx,nlayermx) |
---|
127 | real zdt (ngridmx,nlayermx) |
---|
128 | real vmr_co2(ngridmx,nlayermx) ! co2 volume mixing ratio |
---|
129 | ! improved_ztcond flag: If set to .true. (AND running with a 'co2' tracer) |
---|
130 | ! then condensation temperature is computed using partial pressure of CO2 |
---|
131 | logical,parameter :: improved_ztcond=.true. |
---|
132 | ! Bound co2 (tracer) values... |
---|
133 | logical,parameter :: bound_qco2=.false. |
---|
134 | real,parameter :: qco2max=1.1 |
---|
135 | real,parameter :: qco2mini=0.1 |
---|
136 | real :: zqco2 |
---|
137 | |
---|
138 | c local saved variables |
---|
139 | integer ico2 |
---|
140 | real qco2min,qco2,mmean |
---|
141 | save ico2,qco2min |
---|
142 | REAL emisref(ngridmx) |
---|
143 | REAL latcond,tcond1mb |
---|
144 | REAL acond,bcond,ccond,cpice |
---|
145 | ! REAL albediceF(ngridmx) |
---|
146 | SAVE emisref |
---|
147 | SAVE latcond,acond,bcond,ccond,cpice |
---|
148 | ! SAVE albediceF |
---|
149 | real m_co2, m_noco2, A , B |
---|
150 | save A, B, m_co2, m_noco2 |
---|
151 | |
---|
152 | LOGICAL firstcall !,firstcall2 |
---|
153 | SAVE firstcall !,firstcall2 |
---|
154 | ! REAL SSUM |
---|
155 | ! EXTERNAL SSUM |
---|
156 | |
---|
157 | DATA latcond,tcond1mb/5.9e5,136.27/ |
---|
158 | DATA cpice /1000./ |
---|
159 | DATA firstcall/.true./ |
---|
160 | ! DATA firstcall2/.true./ |
---|
161 | |
---|
162 | integer flag |
---|
163 | |
---|
164 | c---------------------------------------------------------------------- |
---|
165 | |
---|
166 | c Initialisation |
---|
167 | c -------------- |
---|
168 | c |
---|
169 | IF (firstcall) THEN |
---|
170 | bcond=1./tcond1mb |
---|
171 | ccond=cpp/(g*latcond) |
---|
172 | acond=r/latcond |
---|
173 | |
---|
174 | firstcall=.false. |
---|
175 | write(*,*) 'Newcondens: improved_ztcond=',improved_ztcond |
---|
176 | write(*,*) 'Newcondens: bound_qco2=',bound_qco2 |
---|
177 | PRINT*,'In newcondens:Tcond(P=1mb)=',tcond1mb,' Lcond=',latcond |
---|
178 | PRINT*,'acond,bcond,ccond',acond,bcond,ccond |
---|
179 | |
---|
180 | ico2=0 |
---|
181 | |
---|
182 | if (tracer) then |
---|
183 | c Prepare Special treatment if one of the tracer is CO2 gas |
---|
184 | do iq=1,nqmx |
---|
185 | if (noms(iq).eq."co2") then |
---|
186 | ico2=iq |
---|
187 | m_co2 = 44.01E-3 ! CO2 molecular mass (kg/mol) |
---|
188 | m_noco2 = 33.37E-3 ! Non condensible mol mass (kg/mol) |
---|
189 | c Compute A and B coefficient use to compute |
---|
190 | c mean molecular mass Mair defined by |
---|
191 | c 1/Mair = q(ico2)/m_co2 + (1-q(ico2))/m_noco2 |
---|
192 | c 1/Mair = A*q(ico2) + B |
---|
193 | A =(1/m_co2 - 1/m_noco2) |
---|
194 | B=1/m_noco2 |
---|
195 | endif |
---|
196 | enddo |
---|
197 | c minimum CO2 mix. ratio below which mixing occur with layer above: |
---|
198 | qco2min =0.75 |
---|
199 | end if |
---|
200 | ENDIF |
---|
201 | zcpi=1./cpp |
---|
202 | c |
---|
203 | c====================================================================== |
---|
204 | c Calcul of CO2 condensation sublimation |
---|
205 | c ============================================================ |
---|
206 | c |
---|
207 | c Used variable : |
---|
208 | c piceco2(ngrid) : amount of co2 ice on the ground (kg/m2) |
---|
209 | c zcondicea(ngrid,l): condensation rate in layer l (kg/m2/s) |
---|
210 | c zcondices(ngrid): condensation rate on the ground (kg/m2/s) |
---|
211 | c zfallice(ngrid,l):amount of ice falling from layer l (kg/m2/s) |
---|
212 | c |
---|
213 | c pdtc(ngrid,nlayermx) : dT/dt due to cond/sub |
---|
214 | c |
---|
215 | c |
---|
216 | c Tendencies set to 0 (except pdtc) |
---|
217 | c ------------------------------------- |
---|
218 | DO l=1,nlayer |
---|
219 | DO ig=1,ngrid |
---|
220 | zcondicea(ig,l) = 0. |
---|
221 | zfallice(ig,l) = 0. |
---|
222 | pduc(ig,l) = 0 |
---|
223 | pdvc(ig,l) = 0 |
---|
224 | END DO |
---|
225 | END DO |
---|
226 | |
---|
227 | DO iq=1,nqmx |
---|
228 | DO l=1,nlayer |
---|
229 | DO ig=1,ngrid |
---|
230 | pdqc(ig,l,iq) = 0 |
---|
231 | END DO |
---|
232 | END DO |
---|
233 | END DO |
---|
234 | |
---|
235 | DO ig=1,ngrid |
---|
236 | zfallice(ig,nlayer+1) = 0. |
---|
237 | zcondices(ig) = 0. |
---|
238 | pdtsrfc(ig) = 0. |
---|
239 | pdpsrf(ig) = 0. |
---|
240 | condsub(ig) = .false. |
---|
241 | zdiceco2(ig) = 0. |
---|
242 | ENDDO |
---|
243 | zfallheat=0 |
---|
244 | |
---|
245 | c ************************* |
---|
246 | c ATMOSPHERIC CONDENSATION |
---|
247 | c ************************* |
---|
248 | |
---|
249 | c Compute CO2 Volume mixing ratio |
---|
250 | c ------------------------------- |
---|
251 | if (improved_ztcond.and.(ico2.ne.0)) then |
---|
252 | DO l=1,nlayer |
---|
253 | DO ig=1,ngrid |
---|
254 | qco2=pq(ig,l,ico2)+pdq(ig,l,ico2)*ptimestep |
---|
255 | c Mean air molecular mass = 1/(q(ico2)/m_co2 + (1-q(ico2))/m_noco2) |
---|
256 | mmean=1/(A*qco2 +B) |
---|
257 | vmr_co2(ig,l) = qco2*mmean/m_co2 |
---|
258 | ENDDO |
---|
259 | ENDDO |
---|
260 | else |
---|
261 | DO l=1,nlayer |
---|
262 | DO ig=1,ngrid |
---|
263 | vmr_co2(ig,l)=0.95 |
---|
264 | ENDDO |
---|
265 | ENDDO |
---|
266 | end if |
---|
267 | |
---|
268 | c forecast of atmospheric temperature zt and frost temperature ztcond |
---|
269 | c -------------------------------------------------------------------- |
---|
270 | |
---|
271 | DO l=1,nlayer |
---|
272 | DO ig=1,ngrid |
---|
273 | zt(ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep |
---|
274 | ! ztcond(ig,l)=1./(bcond-acond*log(.0095*pplay(ig,l))) |
---|
275 | ztcond(ig,l)= |
---|
276 | & 1./(bcond-acond*log(.01*vmr_co2(ig,l)*pplay(ig,l))) |
---|
277 | if (pplay(ig,l).lt.1e-4) ztcond(ig,l)=0.0 !mars Monica |
---|
278 | ENDDO |
---|
279 | ENDDO |
---|
280 | |
---|
281 | ztcond(:,nlayer+1)=ztcond(:,nlayer) |
---|
282 | |
---|
283 | c Condensation/sublimation in the atmosphere |
---|
284 | c ------------------------------------------ |
---|
285 | c (calcul of zcondicea , zfallice and pdtc) |
---|
286 | c |
---|
287 | DO l=nlayer , 1, -1 |
---|
288 | DO ig=1,ngrid |
---|
289 | pdtc(ig,l)=0. |
---|
290 | IF((zt(ig,l).LT.ztcond(ig,l)).or.(zfallice(ig,l+1).gt.0))THEN |
---|
291 | condsub(ig)=.true. |
---|
292 | IF (zfallice(ig,l+1).gt.0) then |
---|
293 | zfallheat=zfallice(ig,l+1)* |
---|
294 | & (pphi(ig,l+1)-pphi(ig,l) + |
---|
295 | & cpice*(ztcond(ig,l+1)-ztcond(ig,l)))/latcond |
---|
296 | ELSE |
---|
297 | zfallheat=0. |
---|
298 | ENDIF |
---|
299 | pdtc(ig,l)=(ztcond(ig,l) - zt(ig,l))/ptimestep |
---|
300 | zcondicea(ig,l)=(pplev(ig,l)-pplev(ig,l+1)) |
---|
301 | & *ccond*pdtc(ig,l)- zfallheat |
---|
302 | c Case when the ice from above sublimes entirely |
---|
303 | c """"""""""""""""""""""""""""""""""""""""""""""" |
---|
304 | IF (zfallice(ig,l+1).lt.- zcondicea(ig,l)) then |
---|
305 | pdtc(ig,l)=(-zfallice(ig,l+1)+zfallheat)/ |
---|
306 | & (ccond*(pplev(ig,l)-pplev(ig,l+1))) |
---|
307 | zcondicea(ig,l)= -zfallice(ig,l+1) |
---|
308 | END IF |
---|
309 | |
---|
310 | zfallice(ig,l) = zcondicea(ig,l)+zfallice(ig,l+1) |
---|
311 | END IF |
---|
312 | ENDDO |
---|
313 | ENDDO |
---|
314 | |
---|
315 | c ************************* |
---|
316 | c SURFACE CONDENSATION |
---|
317 | c ************************* |
---|
318 | |
---|
319 | c forecast of ground temperature ztsrf and frost temperature ztcondsol |
---|
320 | c -------------------------------------------------------------------- |
---|
321 | DO ig=1,ngrid |
---|
322 | ztcondsol(ig)= |
---|
323 | & 1./(bcond-acond*log(.01*vmr_co2(ig,1)*pplev(ig,1))) |
---|
324 | ztsrf(ig) = ptsrf(ig) + pdtsrf(ig)*ptimestep |
---|
325 | ENDDO |
---|
326 | |
---|
327 | c |
---|
328 | c Condensation/sublimation on the ground |
---|
329 | c -------------------------------------- |
---|
330 | c (calcul of zcondices , pdtsrfc) |
---|
331 | c |
---|
332 | DO ig=1,ngrid |
---|
333 | IF(ig.GT.ngrid/2+1) THEN |
---|
334 | icap=2 |
---|
335 | ELSE |
---|
336 | icap=1 |
---|
337 | ENDIF |
---|
338 | |
---|
339 | c |
---|
340 | c Loop on where we have condensation/ sublimation |
---|
341 | IF ((ztsrf(ig) .LT. ztcondsol(ig)) .OR. ! ground cond |
---|
342 | $ (zfallice(ig,1).NE.0.) .OR. ! falling snow |
---|
343 | $ ((ztsrf(ig) .GT. ztcondsol(ig)) .AND. ! ground sublim. |
---|
344 | $ ((piceco2(ig)+zfallice(ig,1)*ptimestep) .NE. 0.))) THEN |
---|
345 | condsub(ig) = .true. |
---|
346 | |
---|
347 | IF (zfallice(ig,1).gt.0) then |
---|
348 | zfallheat=zfallice(ig,1)* |
---|
349 | & (pphi(ig,1)- phisfi(ig) + |
---|
350 | & cpice*(ztcond(ig,1)-ztcondsol(ig)))/(latcond*ptimestep) |
---|
351 | ELSE |
---|
352 | zfallheat=0. |
---|
353 | ENDIF |
---|
354 | |
---|
355 | c condensation or partial sublimation of CO2 ice |
---|
356 | c """"""""""""""""""""""""""""""""""""""""""""""" |
---|
357 | zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) |
---|
358 | & /(latcond*ptimestep) - zfallheat |
---|
359 | pdtsrfc(ig) = (ztcondsol(ig) - ztsrf(ig))/ptimestep |
---|
360 | |
---|
361 | c If the entire CO_2 ice layer sublimes |
---|
362 | c """""""""""""""""""""""""""""""""""""""""""""""""""" |
---|
363 | c (including what has just condensed in the atmosphere) |
---|
364 | |
---|
365 | IF((piceco2(ig)/ptimestep+zfallice(ig,1)).LE. |
---|
366 | & -zcondices(ig))THEN |
---|
367 | zcondices(ig) = -piceco2(ig)/ptimestep - zfallice(ig,1) |
---|
368 | pdtsrfc(ig)=(latcond/pcapcal(ig))* |
---|
369 | & (zcondices(ig)+zfallheat) |
---|
370 | END IF |
---|
371 | |
---|
372 | c Changing CO2 ice amount and pressure : |
---|
373 | c """""""""""""""""""""""""""""""""""" |
---|
374 | |
---|
375 | zdiceco2(ig) = zcondices(ig) + zfallice(ig,1) |
---|
376 | piceco2(ig) = piceco2(ig) + zdiceco2(ig)*ptimestep |
---|
377 | pdpsrf(ig) = -zdiceco2(ig)*g |
---|
378 | |
---|
379 | IF(ABS(pdpsrf(ig)*ptimestep).GT.pplev(ig,1)) THEN |
---|
380 | PRINT*,'STOP in condens' |
---|
381 | PRINT*,'condensing more than total mass' |
---|
382 | PRINT*,'Grid point ',ig |
---|
383 | PRINT*,'Ps = ',pplev(ig,1) |
---|
384 | PRINT*,'d Ps = ',pdpsrf(ig) |
---|
385 | STOP |
---|
386 | ENDIF |
---|
387 | END IF ! if there is condensation/sublimmation |
---|
388 | ENDDO ! of DO ig=1,ngrid |
---|
389 | |
---|
390 | c ******************************************************************** |
---|
391 | c Surface albedo and emissivity of the surface below the snow (emisref) |
---|
392 | c ******************************************************************** |
---|
393 | c Prepare the case where albedo varies with insolation: |
---|
394 | c ---------------------------------------------------- |
---|
395 | ! if (fluxdependent) then |
---|
396 | ! |
---|
397 | c Calcul du flux moyen (zonal mean) |
---|
398 | ! do j=1,jjp1 |
---|
399 | ! Fluxmean(j)=0 |
---|
400 | ! do i=1,iim |
---|
401 | ! ig=1+(j-2)*iim +i |
---|
402 | ! if(j.eq.1) ig=1 |
---|
403 | ! if(j.eq.jjp1) ig=ngrid |
---|
404 | ! Fluxmean(j)=Fluxmean(j)+fluxsurf_sw(ig,1) |
---|
405 | ! $ +fluxsurf_sw(ig,2) |
---|
406 | ! enddo |
---|
407 | ! Fluxmean(j)=Fluxmean(j)/float(iim) |
---|
408 | ! enddo |
---|
409 | ! |
---|
410 | c const A and B used to calculate the albedo which depends on solar flux |
---|
411 | c albedice=constA+constB*Flux |
---|
412 | c constT = time step to calculate the solar flux when flux decreases |
---|
413 | ! constA=0.26 |
---|
414 | c constA=0.33 |
---|
415 | c constA=0.186 |
---|
416 | ! constB=0.00187 |
---|
417 | ! constT=10 |
---|
418 | ! endif ! of if (fluxdependent) |
---|
419 | |
---|
420 | ! Check that amont of CO2 ice is not problematic |
---|
421 | DO ig=1,ngrid |
---|
422 | if(.not.piceco2(ig).ge.0.) THEN |
---|
423 | if(piceco2(ig).le.-5.e-8) print*, |
---|
424 | $ 'WARNING newcondens piceco2(',ig,')=', piceco2(ig) |
---|
425 | piceco2(ig)=0. |
---|
426 | endif |
---|
427 | ENDDO |
---|
428 | |
---|
429 | ! Set albedo and emissivity of the surface |
---|
430 | ! ---------------------------------------- |
---|
431 | CALL albedocaps(zls,ngrid,piceco2,psolaralb,emisref) |
---|
432 | |
---|
433 | c Calcul de l'albedo |
---|
434 | c ------------------ |
---|
435 | ! do ig =1,ngrid |
---|
436 | ! IF(ig.GT.ngrid/2+1) THEN |
---|
437 | ! icap=2 |
---|
438 | ! ELSE |
---|
439 | ! icap=1 |
---|
440 | ! ENDIF |
---|
441 | ! IF(firstcall2) THEN |
---|
442 | ! albediceF(ig)=albedice(icap) |
---|
443 | ! ENDIF |
---|
444 | c if there is still co2ice ccccccccccccccccccccccc |
---|
445 | ! if (piceco2(ig).gt.0) then |
---|
446 | ! emisref(ig) = emisice(icap) |
---|
447 | |
---|
448 | c if flux dependent albedo is used |
---|
449 | c -------------------------------- |
---|
450 | ! if (fluxdependent) then |
---|
451 | ! j=INT((ig-2)/iim)+2 |
---|
452 | ! if(ig.eq.1) j=1 |
---|
453 | ! if(ig.eq.ngrid) j=jjp1 |
---|
454 | c albediceF_new(ig)=MIN(constA+constB*Fluxmean(j), |
---|
455 | c $ constA+constB*250) |
---|
456 | ! albediceF_new(ig)=constA+constB*Fluxmean(j) |
---|
457 | ! if (albediceF(ig).gt.albediceF_new(ig)) then |
---|
458 | ! albediceF(ig)=albediceF(ig)+ ptimestep/(daysec* |
---|
459 | ! $ constT)*(albediceF_new(ig)-albediceF(ig)) |
---|
460 | ! else |
---|
461 | ! albediceF(ig)=albediceF_new(ig) |
---|
462 | ! endif |
---|
463 | c if part of the ice is transparent |
---|
464 | c slopy = pente de la droite: alpha = y*co2ice/1620 |
---|
465 | c pour une valeur superieur a une epaisseur de glace donnee |
---|
466 | c ici, epaisseur limite = 10cm |
---|
467 | ! if (transparency) then |
---|
468 | ! slopy=1/(1620*0.10) |
---|
469 | ! alpha=MIN(slopy*piceco2(ig),1.) |
---|
470 | ! psolaralb(ig,1) = alpha*albediceF(ig) |
---|
471 | ! $ +(1-alpha)*albedodat(ig) |
---|
472 | ! psolaralb(ig,2) = psolaralb(ig,1) |
---|
473 | ! else |
---|
474 | ! psolaralb(ig,1) = albediceF(ig) |
---|
475 | ! psolaralb(ig,2) = psolaralb(ig,1) |
---|
476 | ! endif |
---|
477 | ! else |
---|
478 | c transparency set to true and fluxdependent set to false |
---|
479 | ! if (transparency) then |
---|
480 | ! slopy=1/(1620*0.10) |
---|
481 | ! alpha=MIN(slopy*piceco2(ig),1.) |
---|
482 | ! psolaralb(ig,1) = alpha*albedice(icap) |
---|
483 | ! $ +(1-alpha)*albedodat(ig) |
---|
484 | ! psolaralb(ig,2) = psolaralb(ig,1) |
---|
485 | ! else |
---|
486 | c simplest case: transparency and flux dependent set to false |
---|
487 | ! psolaralb(ig,1) = albedice(icap) |
---|
488 | ! psolaralb(ig,2) = albedice(icap) |
---|
489 | ! endif |
---|
490 | ! endif |
---|
491 | c no more co2ice, albedo = ground albedo |
---|
492 | ! else |
---|
493 | ! psolaralb(ig,1) = albedodat(ig) |
---|
494 | ! psolaralb(ig,2) = albedodat(ig) |
---|
495 | ! emisref(ig) = emissiv |
---|
496 | ! pemisurf(ig) = emissiv |
---|
497 | ! endif |
---|
498 | ! end do ! end of the ig loop |
---|
499 | |
---|
500 | ! set pemisurf() to emissiv when there is bare surface (needed for co2snow) |
---|
501 | DO ig=1,ngrid |
---|
502 | if (piceco2(ig).eq.0) then |
---|
503 | pemisurf(ig)=emissiv |
---|
504 | endif |
---|
505 | ENDDO |
---|
506 | |
---|
507 | ! firstcall2=.false. |
---|
508 | c *************************************************************** |
---|
509 | c Correction to account for redistribution between sigma or hybrid |
---|
510 | c layers when changing surface pressure (and warming/cooling |
---|
511 | c of the CO2 currently changing phase). |
---|
512 | c ************************************************************* |
---|
513 | |
---|
514 | DO ig=1,ngrid |
---|
515 | if (condsub(ig)) then |
---|
516 | do l=1,nlayer |
---|
517 | ztc(l) =zt(ig,l) +pdtc(ig,l) *ptimestep |
---|
518 | zu(l) =pu(ig,l) +pdu( ig,l) *ptimestep |
---|
519 | zv(l) =pv(ig,l) +pdv( ig,l) *ptimestep |
---|
520 | do iq=1,nqmx |
---|
521 | zq(l,iq)=pq(ig,l,iq)+pdq(ig,l,iq)*ptimestep |
---|
522 | enddo |
---|
523 | end do |
---|
524 | |
---|
525 | c Mass fluxes through the sigma levels (kg.m-2.s-1) (>0 when up) |
---|
526 | c """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
---|
527 | |
---|
528 | zmflux(1) = -zcondices(ig) |
---|
529 | DO l=1,nlayer |
---|
530 | zmflux(l+1) = zmflux(l) -zcondicea(ig,l) |
---|
531 | & + (bp(l)-bp(l+1))*(zfallice(ig,1)-zmflux(1)) |
---|
532 | c zmflux set to 0 if very low to avoid: top layer is disappearing in v1ld |
---|
533 | if (abs(zmflux(l+1)).lt.1E-13.OR.bp(l+1).eq.0.) zmflux(l+1)=0. |
---|
534 | END DO |
---|
535 | |
---|
536 | c Mass of each layer |
---|
537 | c ------------------ |
---|
538 | DO l=1,nlayer |
---|
539 | masse(l)=(pplev(ig,l) - pplev(ig,l+1))/g |
---|
540 | END DO |
---|
541 | |
---|
542 | |
---|
543 | c Corresponding fluxes for T,U,V,Q |
---|
544 | c """""""""""""""""""""""""""""""" |
---|
545 | |
---|
546 | c averaging operator for TRANSPORT |
---|
547 | c """""""""""""""""""""""""""""""" |
---|
548 | c Value transfert at the surface interface when condensation |
---|
549 | c sublimation: |
---|
550 | ztm(1) = ztsrf(ig) + pdtsrfc(ig)*ptimestep |
---|
551 | zum(1) = 0 |
---|
552 | zvm(1) = 0 |
---|
553 | do iq=1,nqmx |
---|
554 | zqm(1,iq)=0. ! most tracer do not condense ! |
---|
555 | enddo |
---|
556 | c Special case if one of the tracer is CO2 gas |
---|
557 | if (ico2.ne.0) zqm(1,ico2)=1. ! flux is 100% CO2 |
---|
558 | |
---|
559 | c Van Leer scheme: |
---|
560 | DO l=1,nlayer+1 |
---|
561 | w(l)=-zmflux(l)*ptimestep |
---|
562 | END DO |
---|
563 | call vl1d(ztc,2.,masse,w,ztm) |
---|
564 | call vl1d(zu ,2.,masse,w,zum) |
---|
565 | call vl1d(zv ,2.,masse,w,zvm) |
---|
566 | do iq=1,nqmx |
---|
567 | do l=1,nlayer |
---|
568 | zq1(l)=zq(l,iq) |
---|
569 | enddo |
---|
570 | zqm1(1)=zqm(1,iq) |
---|
571 | call vl1d(zq1,2.,masse,w,zqm1) |
---|
572 | do l=2,nlayer |
---|
573 | zq( l,iq)=zq1(l) |
---|
574 | zqm(l,iq)=zqm1(l) |
---|
575 | enddo |
---|
576 | enddo |
---|
577 | |
---|
578 | c Surface condensation affects low winds |
---|
579 | if (zmflux(1).lt.0) then |
---|
580 | zum(1)= zu(1) * (w(1)/masse(1)) |
---|
581 | zvm(1)= zv(1) * (w(1)/masse(1)) |
---|
582 | if (w(1).gt.masse(1)) then ! ensure numerical stability |
---|
583 | zum(1)= (zu(1)-zum(2))*masse(1)/w(1) + zum(2) |
---|
584 | zvm(1)= (zv(1)-zvm(2))*masse(1)/w(1) + zvm(2) |
---|
585 | end if |
---|
586 | end if |
---|
587 | |
---|
588 | ztm(nlayer+1)= ztc(nlayer) ! should not be used, but... |
---|
589 | zum(nlayer+1)= zu(nlayer) ! should not be used, but... |
---|
590 | zvm(nlayer+1)= zv(nlayer) ! should not be used, but... |
---|
591 | do iq=1,nqmx |
---|
592 | zqm(nlayer+1,iq)= zq(nlayer,iq) |
---|
593 | enddo |
---|
594 | |
---|
595 | #ifdef MESOSCALE |
---|
596 | !!!! AS: This part must be commented in the mesoscale model |
---|
597 | !!!! AS: ... to avoid instabilities. |
---|
598 | !!!! AS: you have to compile with -DMESOSCALE to do so |
---|
599 | #else |
---|
600 | c Tendencies on T, U, V, Q |
---|
601 | c """""""""""""""""""""""" |
---|
602 | DO l=1,nlayer |
---|
603 | |
---|
604 | c Tendencies on T |
---|
605 | zdtsig(ig,l) = (1/masse(l)) * |
---|
606 | & ( zmflux(l)*(ztm(l) - ztc(l)) |
---|
607 | & - zmflux(l+1)*(ztm(l+1) - ztc(l)) |
---|
608 | & + zcondicea(ig,l)*(ztcond(ig,l)-ztc(l)) ) |
---|
609 | pdtc(ig,l) = pdtc(ig,l) + zdtsig(ig,l) |
---|
610 | |
---|
611 | c Tendencies on U |
---|
612 | pduc(ig,l) = (1/masse(l)) * |
---|
613 | & ( zmflux(l)*(zum(l) - zu(l)) |
---|
614 | & - zmflux(l+1)*(zum(l+1) - zu(l)) ) |
---|
615 | |
---|
616 | |
---|
617 | c Tendencies on V |
---|
618 | pdvc(ig,l) = (1/masse(l)) * |
---|
619 | & ( zmflux(l)*(zvm(l) - zv(l)) |
---|
620 | & - zmflux(l+1)*(zvm(l+1) - zv(l)) ) |
---|
621 | |
---|
622 | END DO |
---|
623 | #endif |
---|
624 | |
---|
625 | c Tendencies on Q |
---|
626 | do iq=1,nqmx |
---|
627 | ! if (noms(iq).eq.'co2') then |
---|
628 | if (iq.eq.ico2) then |
---|
629 | c SPECIAL Case when the tracer IS CO2 : |
---|
630 | DO l=1,nlayer |
---|
631 | pdqc(ig,l,iq)= (1/masse(l)) * |
---|
632 | & ( zmflux(l)*(zqm(l,iq) - zq(l,iq)) |
---|
633 | & - zmflux(l+1)*(zqm(l+1,iq) - zq(l,iq)) |
---|
634 | & + zcondicea(ig,l)*(zq(l,iq)-1.) ) |
---|
635 | END DO |
---|
636 | else |
---|
637 | DO l=1,nlayer |
---|
638 | pdqc(ig,l,iq)= (1/masse(l)) * |
---|
639 | & ( zmflux(l)*(zqm(l,iq) - zq(l,iq)) |
---|
640 | & - zmflux(l+1)*(zqm(l+1,iq) - zq(l,iq)) |
---|
641 | & + zcondicea(ig,l)*zq(l,iq) ) |
---|
642 | END DO |
---|
643 | end if |
---|
644 | enddo |
---|
645 | |
---|
646 | c -------------------------------------------------------- |
---|
647 | c Roughly Simulate Molecular mixing when CO2 is too depleted by |
---|
648 | c Surface condensation (mixing starts if qco2 < qco2min ) |
---|
649 | c FF 06/2004 |
---|
650 | c WARNING : this is now done in convadj, better (FF 02/2005) |
---|
651 | c -------------------------------------------------------- |
---|
652 | flag=0 ! now done in convadj : must be =0 |
---|
653 | if (flag.eq.1) then |
---|
654 | if(ico2.gt.0) then ! relevant only if one tracer is CO2 |
---|
655 | if(pq(ig,1,ico2)+(pdq(ig,1,ico2)+pdqc(ig,1,ico2))*ptimestep |
---|
656 | & .lt.qco2min) then |
---|
657 | do iq=1,nqmx |
---|
658 | zq(1,iq)=pq(ig,1,iq) |
---|
659 | & +(pdq(ig,1,iq)+pdqc(ig,1,iq))*ptimestep |
---|
660 | Smq(1,iq) = masse(1)*zq(1,iq) |
---|
661 | end do |
---|
662 | Sm(1) = masse(1) |
---|
663 | do l =2,nlayermx |
---|
664 | do iq=1,nqmx |
---|
665 | zq(l,iq)=pq(ig,l,iq) |
---|
666 | & +(pdq(ig,l,iq)+pdqc(ig,l,iq))*ptimestep |
---|
667 | smq(l,iq) = smq(l-1,iq) + masse(l)*zq(l,iq) |
---|
668 | end do |
---|
669 | sm(l) = sm(l-1) + masse(l) |
---|
670 | if(zq(l,ico2).gt.qco2min) then |
---|
671 | c mixmas: mass of atmosphere that must be mixed to reach qco2min |
---|
672 | mixmas = (sm(l-1)*zq(l,ico2)-Smq(l-1,ico2)) |
---|
673 | & /(zq(l,ico2)-qco2min) |
---|
674 | if((mixmas.le.sm(l)))then |
---|
675 | c OK if mixed mass less than mass of layers affected |
---|
676 | nmix=l ! number of layer affected by mixing |
---|
677 | goto 99 |
---|
678 | end if |
---|
679 | end if |
---|
680 | end do |
---|
681 | 99 continue |
---|
682 | do iq=1,nqmx |
---|
683 | qmix=zq(nmix,iq) |
---|
684 | & +(Smq(nmix-1,iq)-zq(nmix,iq)*Sm(nmix-1))/mixmas |
---|
685 | do l=1,nmix-1 |
---|
686 | pdqc(ig,l,iq)= |
---|
687 | & (qmix-pq(ig,l,iq))/ptimestep - pdq(ig,l,iq) |
---|
688 | end do |
---|
689 | c layer only partly mixed : |
---|
690 | pdqc(ig,nmix,iq)=( |
---|
691 | & qmix+(Sm(nmix)-mixmas)*(zq(nmix,iq)-qmix)/masse(nmix) |
---|
692 | & -pq(ig,nmix,iq))/ptimestep -pdq(ig,nmix,iq) |
---|
693 | |
---|
694 | end do |
---|
695 | end if |
---|
696 | end if |
---|
697 | |
---|
698 | endif ! (flag.eq.1) |
---|
699 | end if ! if (condsub) |
---|
700 | END DO ! loop on ig |
---|
701 | |
---|
702 | c *************************************************************** |
---|
703 | c CO2 snow / clouds scheme |
---|
704 | c *************************************************************** |
---|
705 | |
---|
706 | call co2snow(ngrid,nlayer,ptimestep,emisref,condsub,pplev, |
---|
707 | & zcondicea,zcondices,zfallice,pemisurf) |
---|
708 | |
---|
709 | c *************************************************************** |
---|
710 | c Ecriture des diagnostiques |
---|
711 | c *************************************************************** |
---|
712 | |
---|
713 | c DO l=1,nlayer |
---|
714 | c DO ig=1,ngrid |
---|
715 | c Taux de cond en kg.m-2.pa-1.s-1 |
---|
716 | c tconda1(ig,l)=zcondicea(ig,l)/(pplev(ig,l)-pplev(ig,l+1)) |
---|
717 | c Taux de cond en kg.m-3.s-1 |
---|
718 | c tconda2(ig,l)=tconda1(ig,l)*pplay(ig,l)*g/(r*pt(ig,l)) |
---|
719 | c END DO |
---|
720 | c END DO |
---|
721 | c call WRITEDIAGFI(ngridmx,'tconda1', |
---|
722 | c &'Taux de condensation CO2 atmospherique /Pa', |
---|
723 | c & 'kg.m-2.Pa-1.s-1',3,tconda1) |
---|
724 | c call WRITEDIAGFI(ngridmx,'tconda2', |
---|
725 | c &'Taux de condensation CO2 atmospherique /m', |
---|
726 | c & 'kg.m-3.s-1',3,tconda2) |
---|
727 | |
---|
728 | ! output falling co2 ice in 1st layer: |
---|
729 | ! call WRITEDIAGFI(ngridmx,'fallice', |
---|
730 | ! &'Precipitation of co2 ice', |
---|
731 | ! & 'kg.m-2.s-1',2,zfallice(1,1)) |
---|
732 | |
---|
733 | !! Specific stuff to bound co2 tracer values .... |
---|
734 | if (bound_qco2.and.(ico2.ne.0)) then |
---|
735 | do ig=1,ngridmx |
---|
736 | do l=1,nlayermx |
---|
737 | zqco2=pq(ig,l,ico2) |
---|
738 | & +(pdq(ig,l,ico2)+pdqc(ig,l,ico2))*ptimestep |
---|
739 | if (zqco2.gt.qco2max) then |
---|
740 | ! correct pdqc: |
---|
741 | pdqc(ig,l,ico2)=((qco2max-pq(ig,l,ico2))/ptimestep) |
---|
742 | & -pdq(ig,l,ico2) |
---|
743 | write(*,*) "newcondens: adapting pdqc(ig,l,ico2)", |
---|
744 | & " so that co2 conc. does not exceed",qco2max |
---|
745 | write(*,*) " ig:",ig," l:",l |
---|
746 | endif ! of if (zqco2.gt.qco2max) |
---|
747 | if (zqco2.lt.qco2mini) then |
---|
748 | ! correct pdqc: |
---|
749 | pdqc(ig,l,ico2)=((qco2mini-pq(ig,l,ico2))/ptimestep) |
---|
750 | & -pdq(ig,l,ico2) |
---|
751 | write(*,*) "newcondens: adapting pdqc(ig,l,ico2)", |
---|
752 | & " so that co2 conc. is not less than",qco2mini |
---|
753 | write(*,*) " ig:",ig," l:",l |
---|
754 | endif ! of if (zqco2.lt.qco2mini) |
---|
755 | end do |
---|
756 | enddo |
---|
757 | endif ! of if (bound_qco2.and.(ico2.ne.0)) then |
---|
758 | |
---|
759 | return |
---|
760 | end |
---|
761 | |
---|
762 | |
---|
763 | |
---|
764 | c ***************************************************************** |
---|
765 | SUBROUTINE vl1d(q,pente_max,masse,w,qm) |
---|
766 | c |
---|
767 | c |
---|
768 | c Operateur de moyenne inter-couche pour calcul de transport type |
---|
769 | c Van-Leer " pseudo amont " dans la verticale |
---|
770 | c q,w sont des arguments d'entree pour le s-pg .... |
---|
771 | c masse : masse de la couche Dp/g |
---|
772 | c w : masse d'atm ``transferee'' a chaque pas de temps (kg.m-2) |
---|
773 | c pente_max = 2 conseillee |
---|
774 | c |
---|
775 | c |
---|
776 | c -------------------------------------------------------------------- |
---|
777 | IMPLICIT NONE |
---|
778 | |
---|
779 | #include "dimensions.h" |
---|
780 | |
---|
781 | c |
---|
782 | c |
---|
783 | c |
---|
784 | c Arguments: |
---|
785 | c ---------- |
---|
786 | real masse(llm),pente_max |
---|
787 | REAL q(llm),qm(llm+1) |
---|
788 | REAL w(llm+1) |
---|
789 | c |
---|
790 | c Local |
---|
791 | c --------- |
---|
792 | c |
---|
793 | INTEGER l |
---|
794 | c |
---|
795 | real dzq(llm),dzqw(llm),adzqw(llm),dzqmax |
---|
796 | real sigw, Mtot, MQtot |
---|
797 | integer m |
---|
798 | c integer ismax,ismin |
---|
799 | |
---|
800 | |
---|
801 | c On oriente tout dans le sens de la pression |
---|
802 | c W > 0 WHEN DOWN !!!!!!!!!!!!! |
---|
803 | |
---|
804 | do l=2,llm |
---|
805 | dzqw(l)=q(l-1)-q(l) |
---|
806 | adzqw(l)=abs(dzqw(l)) |
---|
807 | enddo |
---|
808 | |
---|
809 | do l=2,llm-1 |
---|
810 | if(dzqw(l)*dzqw(l+1).gt.0.) then |
---|
811 | dzq(l)=0.5*(dzqw(l)+dzqw(l+1)) |
---|
812 | else |
---|
813 | dzq(l)=0. |
---|
814 | endif |
---|
815 | dzqmax=pente_max*min(adzqw(l),adzqw(l+1)) |
---|
816 | dzq(l)=sign(min(abs(dzq(l)),dzqmax),dzq(l)) |
---|
817 | enddo |
---|
818 | |
---|
819 | dzq(1)=0. |
---|
820 | dzq(llm)=0. |
---|
821 | |
---|
822 | do l = 1,llm-1 |
---|
823 | |
---|
824 | c Regular scheme (transfered mass < layer mass) |
---|
825 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
826 | if(w(l+1).gt.0. .and. w(l+1).le.masse(l+1)) then |
---|
827 | sigw=w(l+1)/masse(l+1) |
---|
828 | qm(l+1)=(q(l+1)+0.5*(1.-sigw)*dzq(l+1)) |
---|
829 | else if(w(l+1).le.0. .and. -w(l+1).le.masse(l)) then |
---|
830 | sigw=w(l+1)/masse(l) |
---|
831 | qm(l+1)=(q(l)-0.5*(1.+sigw)*dzq(l)) |
---|
832 | |
---|
833 | c Extended scheme (transfered mass > layer mass) |
---|
834 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
835 | else if(w(l+1).gt.0.) then |
---|
836 | m=l+1 |
---|
837 | Mtot = masse(m) |
---|
838 | MQtot = masse(m)*q(m) |
---|
839 | do while ((m.lt.llm).and.(w(l+1).gt.(Mtot+masse(m+1)))) |
---|
840 | m=m+1 |
---|
841 | Mtot = Mtot + masse(m) |
---|
842 | MQtot = MQtot + masse(m)*q(m) |
---|
843 | end do |
---|
844 | if (m.lt.llm) then |
---|
845 | sigw=(w(l+1)-Mtot)/masse(m+1) |
---|
846 | qm(l+1)= (1/w(l+1))*(MQtot + (w(l+1)-Mtot)* |
---|
847 | & (q(m+1)+0.5*(1.-sigw)*dzq(m+1)) ) |
---|
848 | else |
---|
849 | w(l+1) = Mtot |
---|
850 | qm(l+1) = Mqtot / Mtot |
---|
851 | write(*,*) 'top layer is disapearing !' |
---|
852 | stop |
---|
853 | end if |
---|
854 | else ! if(w(l+1).lt.0) |
---|
855 | m = l-1 |
---|
856 | Mtot = masse(m+1) |
---|
857 | MQtot = masse(m+1)*q(m+1) |
---|
858 | if (m.gt.0) then ! because some compilers will have problems |
---|
859 | ! evaluating masse(0) |
---|
860 | do while ((m.gt.0).and.(-w(l+1).gt.(Mtot+masse(m)))) |
---|
861 | m=m-1 |
---|
862 | Mtot = Mtot + masse(m+1) |
---|
863 | MQtot = MQtot + masse(m+1)*q(m+1) |
---|
864 | if (m.eq.0) exit |
---|
865 | end do |
---|
866 | endif |
---|
867 | if (m.gt.0) then |
---|
868 | sigw=(w(l+1)+Mtot)/masse(m) |
---|
869 | qm(l+1)= (-1/w(l+1))*(MQtot + (-w(l+1)-Mtot)* |
---|
870 | & (q(m)-0.5*(1.+sigw)*dzq(m)) ) |
---|
871 | else |
---|
872 | qm(l+1)= (-1/w(l+1))*(MQtot + (-w(l+1)-Mtot)*qm(1)) |
---|
873 | end if |
---|
874 | end if |
---|
875 | enddo |
---|
876 | |
---|
877 | c boundary conditions (not used in newcondens !!) |
---|
878 | c qm(llm+1)=0. |
---|
879 | c if(w(1).gt.0.) then |
---|
880 | c qm(1)=q(1) |
---|
881 | c else |
---|
882 | c qm(1)=0. |
---|
883 | c end if |
---|
884 | |
---|
885 | return |
---|
886 | end |
---|