source: trunk/LMDZ.MARS/libf/phymars/improvedco2clouds_mod.F90 @ 2584

Last change on this file since 2584 was 2562, checked in by cmathe, 4 years ago

GCM MARS: CO2 clouds microphysics improvements

  • Property svn:executable set to *
File size: 28.4 KB
Line 
1!======================================================================================================================!
2! Module: Scheme of co2 cloud formation ===============================================================================!
3!----------------------------------------------------------------------------------------------------------------------!
4! Authors: Joaquim Audouard, Constantino Listowski, Anni Määttänen
5! Date: 09/2016
6!----------------------------------------------------------------------------------------------------------------------!
7! Contains subroutines:
8!     - improvedco2clouds_mod: nucleation
9!======================================================================================================================!
10module improvedco2clouds_mod
11
12implicit none
13
14contains
15!======================================================================================================================!
16! SUBROUTINE: improvedco2clouds =======================================================================================!
17!======================================================================================================================!
18! Subject:
19!---------
20!  This routine is used to form CO2 clouds when a parcel of the GCM is saturated.
21!----------------------------------------------------------------------------------------------------------------------!
22! Comments:
23!----------
24!  Adaptation for CO2 clouds based on improvedclouds_mod.F
25!
26!  It includes the ability to have supersaturation, a computation of the nucleation rates, growthrates and the
27!  scavenging of dust particles by clouds. It is worth noting that the amount of dust is computed using the dust
28!  optical depth computed in aeropacity.F.
29!  That's why the variable called "tauscaling" is used to convert pq(dust_mass) and pq(dust_number), which are relative
30!  quantities, to absolute and realistic quantities stored in zq. This has to be done to convert the inputs into
31!  absolute values, but also to convert the outputs back into relative values which are then used by the sedimentation
32!  and advection schemes.
33!  CO2 ice particles can nucleate on both dust and water ice particles. When CO2 ice is deposited onto a water ice
34!  particles, the particle is removed from the water tracers. Memory of the origin of the co2 particles is kept and
35!  thus the water cycle shouldn't be modified by this.
36!  There is an energy limit to how much co2 can sublimate/condensate. It is defined by the difference of the GCM
37!  temperature with the co2 condensation temperature.
38!
39!                                                /!\ WARNING /!\
40!  No sedimentation of the water ice origin is performed in the microphysical timestep in co2cloud.F.
41!
42!  If meteoritic particles are activated and turn into co2 ice particles, then they will be reversed in the dust
43!  tracers if the cloud sublimates.
44!----------------------------------------------------------------------------------------------------------------------!
45! Paper:
46!-------
47!    see co2cloud.F90
48!----------------------------------------------------------------------------------------------------------------------!
49! Algorithm:
50!-----------
51!   0. Firstcall
52!     0.1. Bonus: meteoritic component, extract data
53!   1. Initialization
54!   2. Compute saturation
55!   3. Bonus: additional meteoritic particles for nucleation
56!   4. Actual microphysics: Main loop over the GCM's grid
57!     4.1 Nucleation
58!     4.2. Ice growth: scheme for radius evolution
59!     4.3 Dust cores releasing if no more co2 ice
60!   5. Get cloud tendencies
61!======================================================================================================================!
62  subroutine improvedCO2clouds(ngrid, nlay, microtimestep, pplay, pplev, pteff, sum_subpdt, pqeff, sum_subpdq, &
63                               subpdqcloudco2, subpdtcloudco2, nq, tauscaling, rb_cldco2, sigma_iceco2, dev2)
64
65  use comcstfi_h,   only: pi, g, cpp
66
67  use updaterad,    only: updaterice_micro, updaterice_microco2, updaterccnCO2
68
69  use tracer_mod,   only: igcm_dust_mass, igcm_dust_number, rho_dust, igcm_h2o_ice, igcm_ccn_mass, igcm_ccn_number, &
70                          nuice_sed, igcm_co2, igcm_co2_ice, igcm_ccnco2_mass, igcm_ccnco2_number, &
71                          igcm_ccnco2_h2o_mass_ice, igcm_ccnco2_h2o_mass_ccn, igcm_ccnco2_h2o_number, nuiceco2_sed, &
72                          nuiceco2_ref
73
74  use conc_mod,     only: mmean
75
76  use nucleaco2_mod, only: nucleaco2
77  use datafile_mod, only: datadir
78
79  use density_co2_ice_mod, only: density_co2_ice
80
81  implicit none
82
83  include "callkeys.h"
84  include "microphys.h"
85!----------------------------------------------------------------------------------------------------------------------!
86! VARIABLES DECLARATION
87!----------------------------------------------------------------------------------------------------------------------!
88! Input arguments:
89!-----------------
90  integer, intent(in) :: &
91     nq,    &! number of tracers
92     ngrid, &! number of point grid
93     nlay    ! number of layer
94
95  real, intent(in) :: &
96     microtimestep,           &! physics time step (s)
97     pplay(ngrid,nlay),       &! mid-layer pressure (Pa)
98     pplev(ngrid,nlay+1),     &! inter-layer pressure (Pa)
99     pteff(ngrid,nlay),       &! temperature at the middle of the layers (K)
100     sum_subpdt(ngrid,nlay),  &! tendency on temperature from previous physical parametrizations
101     pqeff(ngrid,nlay,nq),    &! tracers (kg/kg)
102     tauscaling(ngrid),       &! convertion factor for qdust and Ndust
103     sum_subpdq(ngrid,nlay,nq) ! tendencies on tracers before condensation (kg/kg.s-1)
104
105  real,  intent(in) :: &
106     sigma_iceco2 ! Variance of the co2 ice and CCN distributions
107
108  double precision, intent(in) :: &
109     rb_cldco2(nbinco2_cld+1), & ! boundary values of each rad_cldco2
110     dev2
111!----------------------------------------------------------------------------------------------------------------------!
112! Output arguments:
113!------------------
114  real, intent(out) :: &
115     subpdtcloudco2(ngrid,nlay),  &! tendency on tracers due to CO2 condensation (K/s)
116     subpdqcloudco2(ngrid,nlay,nq) ! tendency on tracers due to CO2 condensation (kg/kg.s-1)
117!----------------------------------------------------------------------------------------------------------------------!
118! Local:
119!-------
120!----1) Parameters:
121!------------------
122  integer, parameter :: &
123! ---Meteoritic flux input file
124     nbin_meteor = 100, &! Dimension 1
125     nlev_meteor = 130, &! Dimension 2
126     uMeteor = 666,     &! File unit
127! ---Latent heat computation
128     l0 = 595594d0,     &! coeff from: Azreg-Aïnou (2005)
129     l1 = 903.111d0,    &!   Title: "Low-temperature data for carbon dioxide"
130     l2 = -11.5959d0,   &!   Pulication: eprint arXiv:1403.4403
131     l3 = 0.0528288d0,  &!
132     l4 = -0.000103183d0 !
133
134  real, parameter :: &
135     threshold = 1e-30 ! limit value
136
137  character(len=20), parameter:: &
138     file_meteoritic_flux = 'Meteo_flux_Plane.dat'
139!----------------------------------------------------------------------------------------------------------------------!
140!----2) Saved:
141!-------------
142  real, save :: &
143     sigma_ice  ! Variance of the h2o ice and CCN distributions
144
145  double precision, save :: &
146     meteor(nlev_meteor,nbin_meteor), &! Meteoritic flux read from file uMeteor
147     dev3                              ! 1. / ( sqrt(2.) * sigma_ice )
148
149  logical, save :: &
150     firstcall = .true. ! Used to compute saved variables
151!----------------------------------------------------------------------------------------------------------------------!
152!----3) Variables:
153!-----------------
154  integer :: &
155     ig,     &! loop on ngrid
156     l,      &! loop on nlay
157     i,      &! loop on nbinco2
158! ---Variables for meteoritic flux
159     ibin,   &! loop on nbin_meteor
160     nelem,  &! nb of points during interpolation of meteoritic flux
161     lebon1, &! index where P_meteor is the nearest of pplev(ig,l)
162     lebon2, &! index where P_meteor is the nearest of pplev(ig,l+1)
163     read_ok  ! file uMeteor iostat
164
165  real :: &
166    Nccnco2, &
167    Qccnco2, &
168    Nccnco2_h2o, &
169    Qccnco2_h2o, &
170    masse(ngrid,nlay),     &! mass layer (kg.m-2)
171    rice(ngrid,nlay),      &! water ice mass mean radius (m): used for nucleation of CO2 on ice-coated ccns
172    zq(ngrid,nlay,nq),     &! local value of tracers (kg/kg)
173    zq0(ngrid,nlay,nq),    &! local init value of tracers (kg/kg)
174    zt(ngrid,nlay),        &! local value of temperature (K)
175    zqsat(ngrid,nlay),     &! saturation vapor pressure for CO2 (K)
176    tcond(ngrid,nlay),     &! condensation temperature of CO2 (K)
177    lw,                    &! Latent heat of sublimation (J.kg-1)
178    rdust(ngrid,nlay),     &! Dust geometric mean radius (m)
179    rhocloud(ngrid,nlay),  &! Cloud density (kg.m-3)
180    rhocloudco2(ngrid,nlay) ! Cloud density (kg.m-3)
181
182  real(kind=8) :: &
183    derf ! Error function
184 
185  double precision :: &
186    dMice,                             &! mass of condensed ice
187    facteurmax,                        &! for energy limit on mass growth
188    pco2,                              &! Co2 vapor partial pressure (Pa)
189    satu,                              &! Co2 vapor saturation ratio over ice
190    Mo,                                &! mass of aerosol particles
191    No,                                &! number of aerosol particles
192    Rn,                                &! logarithm of rdust/rice
193    Rm,                                &! Rn * variance of ice and CCN distribution
194    n_derf,                            &! derf( (rb_cldco2(1)+Rn) *dev3)
195    m_derf,                            &! derf( (rb_cldco2(1)+Rm) *dev2)
196    n_aer(nbinco2_cld),                &! Radius used by the microphysical scheme (m)
197    m_aer(nbinco2_cld),                &! number concentration V-1 of particle/each size bin
198    n_aer_h2oice(nbinco2_cld),         &! mass mixing ratio of particle/each size bin
199    m_aer_h2oice(nbinco2_cld),         &! Same - for CO2 nucleation
200    Ic_rice,                           &! Mass transfer rate CO2 ice crystal
201    ratioh2o_ccn,                      &! 1./(zq(ig,l,igcm_h2o_ice)  + zq(ig,l,igcm_ccn_mass)*tauscaling(ig))
202    vo2co2,                            &! volume of co2 ice particle
203    dN,                                &! number of particle of dust used as ccn
204    dM,                                &! mass of dN
205    dNh2o,                             &! number of particle of h2o ice used as ccn
206    dMh2o,                             &! mass of dNh2o
207    dNN,                               &! min(dN,zq(ig,l,igcm_dust_number))
208    dMM,                               &! min(dM,zq(ig,l,igcm_dust_mass))
209    dNNh2o,                            &! min(dNNh2o,zq(ig,l,igcm_ccn_number))
210    dMh2o_ice,                         &! min(dMh2o*zq(ig,l,igcm_h2o_ice)*ratioh2o_ccn, zq(ig,l,igcm_h2o_ice))
211    dMh2o_ccn,                         &! min(dMh2o_ccn,zq(ig,l,igcm_ccn_mass))
212    rate(nbinco2_cld),                 &! nucleation rate
213    rateh2o(nbinco2_cld),              &! nucleation rate for h2o
214    rho_ice_co2T,                      &! density of co2 ice Temperature-dependent
215    riceco2(ngrid,nlay),               &! CO2 ice mean radius (m)
216    vrat_cld,                          &! Volume ratio
217    Proba,                             &! 1.0 - exp(-1.*microtimestep*rate(i))
218    Probah2o,                          &! 1.0 - exp(-1.*microtimestep*rateh2o(i))
219    mtemp(nbinco2_cld),                &! sum(meteor(lebon1:lebon2,ibin))
220    pression_meteor(nlev_meteor),      &! pressure from meteoritic flux input file
221    ltemp1(nlev_meteor),               &! abs(pression_meteor(:)-pplev(ig,l))
222    ltemp2(nlev_meteor),               &! abs(pression_meteor(:)-pplev(ig,l+1))
223    meteor_ccn(ngrid,nlay,nbinco2_cld)  ! nbinco2_cld = 100
224
225  logical :: &
226    file_ok ! test if meteoritic input file exists
227!======================================================================================================================!
228! BEGIN ===============================================================================================================!
229!======================================================================================================================!
230! 0. Firstcall
231!----------------------------------------------------------------------------------------------------------------------!
232  if (firstcall) then
233    firstcall = .false.
234
235!   Variance of the ice and CCN distributions
236    sigma_ice = sqrt(log(1.+nuice_sed))
237    dev3 = 1. / ( sqrt(2.) * sigma_ice )
238!----------------------------------------------------------------------------------------------------------------------!
239! 0.1. Bonus: meteoritic component, extract data
240!----------------------------------------------------------------------------------------------------------------------!
241    if (meteo_flux) then
242      ! Check if file exists
243      inquire(file=trim(datadir)//'/'//file_meteoritic_flux, exist=file_ok)
244      if (.not. file_ok) then
245        call abort_physic("CO2clouds", 'file '//file_meteoritic_flux//' should be in'//trim(datadir), 1)
246      end if
247
248      ! open file
249      open(unit=uMeteor,file=trim(datadir)//'/'//file_meteoritic_flux, FORM='formatted')
250
251      !skip 1 line
252      read(uMeteor,*)
253
254      ! extract pressure_meteor
255      do i = 1, nlev_meteor
256        read(uMeteor,*)pression_meteor(i)
257      end do
258
259      !skip 1 line
260      read(uMeteor,*)
261
262      ! extract meteor flux
263      do i = 1, nlev_meteor
264        ! les mêmes 100 bins size que la distri nuclea : on touche pas
265        do ibin = 1, nbin_meteor
266          read(uMeteor,'(F12.6)') meteor(i,ibin)
267        end do
268      end do
269
270      ! close file
271      close(uMeteor)
272    end if ! of if meteo_flux
273  end if ! firstcall
274!----------------------------------------------------------------------------------------------------------------------!
275! 1. Initialization
276!----------------------------------------------------------------------------------------------------------------------!
277  rdust(:,:) = 0.
278  meteor_ccn(:,:,:) = 0.
279  rice(:,:) = 1.e-8
280  riceco2(:,:) = 1.e-11
281
282  ! Initialize the tendencies
283  subpdqcloudco2(:,:,:) = 0.
284  subpdtcloudco2(:,:) = 0.
285
286  ! pteff temperature layer; sum_subpdt dT.s-1
287  zt(1:ngrid,1:nlay) = 0.
288  zt(:,:) = pteff(:,:) + sum_subpdt(:,:) * microtimestep
289
290  ! pqeff traceur kg/kg; sum_subpdq tendance idem .s-1
291  zq(:,:,:) = pqeff(:,:,:) + sum_subpdq(:,:,:) * microtimestep
292  where( zq(:,:,:) < threshold ) zq(:,:,:) = threshold
293
294  zq0(:,:,:) = zq(:,:,:)
295  zqsat(:,:) = 0.
296!----------------------------------------------------------------------------------------------------------------------!
297! 2. Compute saturation
298!----------------------------------------------------------------------------------------------------------------------!
299  call co2sat(ngrid*nlay,zt,zqsat)
300  call tcondco2(ngrid,nlay,pplay, zq(:,:,igcm_co2) + zq(:,:,igcm_co2_ice),tcond)
301!----------------------------------------------------------------------------------------------------------------------!
302! 3. Bonus: additional meteoritic particles for nucleation
303!----------------------------------------------------------------------------------------------------------------------!
304  ! TODO: instead of intepolation, used only the nearest pplev(ig,l)
305  if (meteo_flux) then
306    do l = 1, nlay
307      do ig = 1, ngrid
308        masse(ig,l) = (pplev(ig,l) - pplev(ig,l+1)) / g
309
310        ltemp1 = abs(pression_meteor(:)-pplev(ig,l))
311        ltemp2 = abs(pression_meteor(:)-pplev(ig,l+1))
312
313        lebon1 = minloc(ltemp1,DIM=1)
314        lebon2 = minloc(ltemp2,DIM=1)
315
316        nelem = lebon2-lebon1+1.
317
318        mtemp(:) = 0d0
319
320        do ibin = 1, nbin_meteor
321          mtemp(ibin) = sum(meteor(lebon1:lebon2,ibin))
322        end do
323
324        ! Par kg air csi par m carre, x epaisseur/masse pour par kg/air. Check original unit with J. Plane
325        meteor_ccn(ig,l,:)=mtemp(:)/nelem/masse(ig,l)
326      end do
327    end do
328  end if
329!----------------------------------------------------------------------------------------------------------------------!
330! 4. Actual microphysics: Main loop over the GCM's grid
331!----------------------------------------------------------------------------------------------------------------------!
332  do l = 1, nlay
333    do ig = 1, ngrid
334
335      ! Get the partial pressure of co2 vapor and its saturation ratio
336      pco2 = zq(ig,l,igcm_co2) * (mmean(ig,l)/(mco2*1e3)) * pplay(ig,l) ! mco2 (kg/mol) => mmean (g/mol)
337      satu = pco2 / zqsat(ig,l)
338
339      !T-dependant CO2 ice density
340      call density_co2_ice(dble(zt(ig,l)), rho_ice_co2T)
341
342      vo2co2 = m0co2 / rho_ice_co2T
343!----------------------------------------------------------------------------------------------------------------------!
344! 4.1 Nucleation
345!----------------------------------------------------------------------------------------------------------------------!
346      ! if there is condensation
347      if ( satu >= 1 ) then
348        call updaterccnCO2(zq(ig,l,igcm_dust_mass), zq(ig,l,igcm_dust_number), rdust(ig,l), tauscaling(ig))
349
350        ! Expand the dust moments into a binned distribution
351        n_aer(:) = 0d0 ! number of aerosol particles
352        m_aer(:) = 0d0 ! mass of aerosol particles
353
354        No = zq(ig,l,igcm_dust_number) * tauscaling(ig)
355
356        Mo = (4./3.) * pi * rho_dust * No * rdust(ig,l)**3 *exp(9.*nuiceco2_ref/2.)
357
358        if (No > threshold) then
359          Rn = -log(rdust(ig,l))
360
361          Rm = Rn - 3. * sigma_iceco2 * sigma_iceco2
362
363          n_derf = derf( (rb_cldco2(1)+Rn) *dev2)
364          m_derf = derf( (rb_cldco2(1)+Rm) *dev2)
365
366          do i = 1, nbinco2_cld
367            n_aer(i) = -0.5 * No * n_derf
368            m_aer(i) = -0.5 * Mo * m_derf
369
370            n_derf = derf((rb_cldco2(i+1)+Rn) *dev2)
371            m_derf = derf((rb_cldco2(i+1)+Rm) *dev2)
372
373            n_aer(i) = n_aer(i) + 0.5 * No * n_derf
374            m_aer(i) = m_aer(i) + 0.5 * Mo * m_derf
375          end do
376
377          ! Call to nucleation routine
378          call nucleaco2(dble(pco2), zt(ig,l), dble(satu), n_aer, rate, vo2co2, mtetaco2)
379          dN = 0.
380          dM = 0.
381
382          do i = 1, nbinco2_cld
383            Proba = 1.0 - exp(-1.*microtimestep*rate(i))
384            dN = dN + n_aer(i) * Proba
385            dM = dM + m_aer(i) * Proba
386          end do
387
388          ! Now increment CCN tracers and update dust tracers
389          dNN = min(dN,zq(ig,l,igcm_dust_number)) ! dNN est devenu DN
390          dMM = min(dM,zq(ig,l,igcm_dust_mass))  ! idem dans le min
391
392          zq(ig,l,igcm_ccnco2_mass) = zq(ig,l,igcm_ccnco2_mass) + dMM /tauscaling(ig)
393
394          zq(ig,l,igcm_ccnco2_number) = zq(ig,l,igcm_ccnco2_number) + dNN /tauscaling(ig)
395
396          zq(ig,l,igcm_dust_mass) = zq(ig,l,igcm_dust_mass) - dMM /tauscaling(ig)
397
398          zq(ig,l,igcm_dust_number) = zq(ig,l,igcm_dust_number) - dNN /tauscaling(ig)
399
400          ! Ajout meteor_ccn particles aux particules de poussière background
401          if (meteo_flux) then
402            do i = 1, nbinco2_cld
403              n_aer(i) = n_aer(i) + meteor_ccn(ig,l,i)
404
405              m_aer(i) = m_aer(i) + (4./3.) * pi * rho_dust * meteor_ccn(ig,l,i) * rad_cldco2(i)**3
406             end do
407          end if
408        end if ! of if No > 1e-30
409
410        ! Same but with h2o particles as CCN only if co2useh2o = .true.
411        if (co2useh2o) then
412          call updaterice_micro(zq(ig,l,igcm_h2o_ice), zq(ig,l,igcm_ccn_mass), zq(ig,l,igcm_ccn_number), &
413                                tauscaling(ig), rice(ig,l), rhocloud(ig,l))
414
415          ! Total mass of H20 crystals,CCN included
416          Mo = zq(ig,l,igcm_h2o_ice) + zq(ig,l,igcm_ccn_mass) * tauscaling(ig) + threshold
417
418          No = zq(ig,l,igcm_ccn_number) * tauscaling(ig) + threshold
419          if (No > threshold) then
420            Rn = -log(rice(ig,l))
421
422            Rm = Rn - 3. * sigma_ice * sigma_ice
423
424            n_derf = derf( (rb_cldco2(1)+Rn) *dev3)
425            m_derf = derf( (rb_cldco2(1)+Rm) *dev3)
426
427            n_aer_h2oice(:)=0.
428            m_aer_h2oice(:)=0.
429            do i = 1, nbinco2_cld
430              n_aer_h2oice(i) = -0.5 * No * n_derf
431              m_aer_h2oice(i) = -0.5 * Mo * m_derf
432
433              n_derf = derf( (rb_cldco2(i+1)+Rn) *dev3)
434              m_derf = derf( (rb_cldco2(i+1)+Rm) *dev3)
435
436              n_aer_h2oice(i) = n_aer_h2oice(i) + 0.5 * No * n_derf
437              m_aer_h2oice(i) = m_aer_h2oice(i) + 0.5 * Mo * m_derf
438            end do
439
440            call nucleaco2(dble(pco2), zt(ig,l), dble(satu), n_aer_h2oice, rateh2o, vo2co2, mteta)
441            dNh2o = 0.
442            dMh2o = 0.
443
444            do i = 1, nbinco2_cld
445              Probah2o = 1.0 - exp(-1.*microtimestep*rateh2o(i))
446              dNh2o = dNh2o + n_aer_h2oice(i) * Probah2o
447              dMh2o = dMh2o + m_aer_h2oice(i) * Probah2o
448            end do
449
450            ! Update CCN for CO2 nucleating on H2O CCN : Warning: must keep memory of it
451            dNNh2o = dNh2o/tauscaling(ig)
452            dNNh2o = min(dNNh2o,zq(ig,l,igcm_ccn_number))
453
454            ratioh2o_ccn = 1./(zq(ig,l,igcm_h2o_ice)  + zq(ig,l,igcm_ccn_mass)*tauscaling(ig))
455
456            dMh2o_ccn = dMh2o * zq(ig,l,igcm_ccn_mass) *  tauscaling(ig) * ratioh2o_ccn
457            dMh2o_ccn = dMh2o_ccn/tauscaling(ig)
458            dMh2o_ccn = min(dMh2o_ccn,zq(ig,l,igcm_ccn_mass))
459
460            dMh2o_ice = dMh2o * zq(ig,l,igcm_h2o_ice) * ratioh2o_ccn
461            dMh2o_ice = min(dMh2o_ice,zq(ig,l,igcm_h2o_ice))
462
463            zq(ig,l,igcm_ccnco2_h2o_mass_ice) = zq(ig,l,igcm_ccnco2_h2o_mass_ice)  + dMh2o_ice
464            zq(ig,l,igcm_ccnco2_h2o_mass_ccn) = zq(ig,l,igcm_ccnco2_h2o_mass_ccn)  + dMh2o_ccn
465            zq(ig,l,igcm_ccnco2_h2o_number) = zq(ig,l,igcm_ccnco2_h2o_number) + dNNh2o
466
467            zq(ig,l,igcm_ccn_number) =  zq(ig,l,igcm_ccn_number)  - dNNh2o
468            zq(ig,l,igcm_h2o_ice) = zq(ig,l,igcm_h2o_ice)  - dMh2o_ice
469            zq(ig,l,igcm_ccn_mass) = zq(ig,l,igcm_ccn_mass) - dMh2o_ccn
470
471                  zq(ig,l,igcm_ccnco2_mass) = zq(ig,l,igcm_ccnco2_mass)  + dMh2o_ice + dMh2o_ccn
472                  zq(ig,l,igcm_ccnco2_number) =  zq(ig,l,igcm_ccnco2_number) + dNNh2o
473          end if
474        end if ! of if co2useh2o
475      end if ! of is satu > 1
476!----------------------------------------------------------------------------------------------------------------------!
477! 4.2. Ice growth: scheme for radius evolution
478!----------------------------------------------------------------------------------------------------------------------!
479!    We trigger crystal growth if and only if there is at least one nuclei (N>1). Indeed, if we are supersaturated
480!      and still don't have at least one nuclei, we should better wait to avoid unrealistic value for nuclei radius
481!      and so on for cases that remain negligible.
482!----------------------------------------------------------------------------------------------------------------------!
483      ! we trigger crystal growth
484      if ((zq(ig,l,igcm_ccnco2_number)) * tauscaling(ig) + threshold >= 1) then
485        Nccnco2 = dble(zq(ig,l,igcm_ccnco2_number))
486        Qccnco2 = dble(zq(ig,l,igcm_ccnco2_mass))
487        Nccnco2_h2o = 0.
488        Qccnco2_h2o = 0.
489
490        if (co2useh2o) then
491          Nccnco2_h2o = zq(ig,l,igcm_ccnco2_h2o_number)
492          Qccnco2_h2o = zq(ig,l,igcm_ccnco2_h2o_mass_ice) + zq(ig,l,igcm_ccnco2_h2o_mass_ccn)
493          Nccnco2 = Nccnco2 - Nccnco2_h2o
494          Qccnco2 = Qccnco2 - Qccnco2_h2o
495        end if
496
497        call updaterice_microco2(dble(zq(ig,l,igcm_co2_ice)), dble(Qccnco2), dble(Nccnco2), dble(Qccnco2_h2o), &
498                                 dble(Nccnco2_h2o), zt(ig,l), tauscaling(ig), riceco2(ig,l), rhocloudco2(ig,l))
499        Ic_rice = 0.
500
501        ! J.kg-1
502        lw = l0 + l1 * zt(ig,l) + l2 * zt(ig,l)**2 + l3 * zt(ig,l)**3 + l4 * zt(ig,l)**4
503
504        facteurmax = abs(tcond(ig,l)-zt(ig,l)) * (cpp/lw)
505
506        ! call scheme of microphys. mass growth for CO2 (evaporation/condensation)
507        call massflowrateCO2(pplay(ig,l), zt(ig,l), satu, riceco2(ig,l), mmean(ig,l), Ic_rice)
508
509        ! Ic_rice Mass transfer rate (kg/s) for a rice particle > 0 si croissance !
510        if (isnan(Ic_rice) .or. Ic_rice == 0.) then
511          Ic_rice = 0.
512          subpdtcloudco2(ig,l) = -sum_subpdt(ig,l)
513          dMice = 0
514        else
515          ! Kg par kg d'air, >0 si croissance !
516          ! kg.s-1 par particule * nb particule par kg air*s = kg par kg air
517          dMice = zq(ig,l,igcm_ccnco2_number) * Ic_rice * microtimestep * tauscaling(ig)
518
519          ! facteurmax maximum quantity of CO2 that can sublime/condense according to available thermal energy
520          ! latent heat release > 0 if growth i.e. if dMice > 0
521          dMice = max(dMice,max(-facteurmax,-zq(ig,l,igcm_co2_ice)))
522          dMice = min(dMice,min(facteurmax,zq(ig,l,igcm_co2)))
523
524          ! kgco2/kgair* J/kgco2 * 1/(J.kgair-1.K-1)/s = K /s
525          subpdtcloudco2(ig,l) = dMice * lw / cpp / microtimestep
526
527          !Now update tracers
528          zq(ig,l,igcm_co2_ice) = zq(ig,l,igcm_co2_ice) + dMice
529          zq(ig,l,igcm_co2) = zq(ig,l,igcm_co2) - dMice
530        end if
531      end if ! if zq(ccnco2_number) >= 1
532!----------------------------------------------------------------------------------------------------------------------!
533! 4.3 Dust cores releasing if no more co2 ice
534!----------------------------------------------------------------------------------------------------------------------!
535      ! On sublime tout
536      if ((zq(ig,l,igcm_co2_ice) <= threshold).or.(zq(ig,l,igcm_ccnco2_number) * tauscaling(ig) < 1.)) then
537          zq(ig,l,igcm_dust_mass) = zq(ig,l,igcm_dust_mass) + zq(ig,l,igcm_ccnco2_mass)
538          zq(ig,l,igcm_dust_number) = zq(ig,l,igcm_dust_number) + zq(ig,l,igcm_ccnco2_number)
539          zq(ig,l,igcm_ccnco2_mass) = 0.
540          zq(ig,l,igcm_ccnco2_number) = 0.
541          if (co2useh2o) then
542            zq(ig,l,igcm_dust_mass) = zq(ig,l,igcm_dust_mass) - zq(ig,l,igcm_ccnco2_h2o_mass_ccn) - &
543                                      zq(ig,l,igcm_ccnco2_h2o_mass_ice)
544            zq(ig,l,igcm_dust_number) = zq(ig,l,igcm_dust_number) - zq(ig,l,igcm_ccnco2_h2o_number)
545
546            zq(ig,l,igcm_ccn_mass) = zq(ig,l,igcm_ccn_mass) + zq(ig,l,igcm_ccnco2_h2o_mass_ccn)
547            zq(ig,l,igcm_h2o_ice) = zq(ig,l,igcm_h2o_ice) + zq(ig,l,igcm_ccnco2_h2o_mass_ice)
548            zq(ig,l,igcm_ccn_number) = zq(ig,l,igcm_ccn_number) + zq(ig,l,igcm_ccnco2_h2o_number)
549            zq(ig,l,igcm_ccnco2_h2o_number) = 0.
550            zq(ig,l,igcm_ccnco2_h2o_mass_ccn) = 0.
551            zq(ig,l,igcm_ccnco2_h2o_mass_ice) = 0.
552          end if
553          zq(ig,l,igcm_co2) = zq(ig,l,igcm_co2) + zq(ig,l,igcm_co2_ice)
554          zq(ig,l,igcm_co2_ice) = 0.
555          riceco2(ig,l) = 0.
556      end if !of if co2_ice < threshold or zq(ccnco2_number) < 1
557    end do ! of ig loop
558  end do ! of nlayer loop
559!----------------------------------------------------------------------------------------------------------------------!
560! 5. Get cloud tendencies
561!----------------------------------------------------------------------------------------------------------------------!
562  subpdqcloudco2(:,:,igcm_co2) =   ( zq(:,:,igcm_co2) - zq0(:,:,igcm_co2) ) / microtimestep
563
564  subpdqcloudco2(:,:,igcm_co2_ice) =  ( zq(:,:,igcm_co2_ice) - zq0(:,:,igcm_co2_ice) ) / microtimestep
565
566  subpdqcloudco2(:,:,igcm_ccnco2_mass) =  ( zq(:,:,igcm_ccnco2_mass) - zq0(:,:,igcm_ccnco2_mass) ) / microtimestep
567
568  subpdqcloudco2(:,:,igcm_ccnco2_number) = ( zq(:,:,igcm_ccnco2_number) - zq0(:,:,igcm_ccnco2_number))/microtimestep
569
570  subpdqcloudco2(:,:,igcm_dust_mass) = ( zq(:,:,igcm_dust_mass) - zq0(:,:,igcm_dust_mass) )  / microtimestep
571
572  subpdqcloudco2(:,:,igcm_dust_number) = ( zq(:,:,igcm_dust_number) - zq0(:,:,igcm_dust_number) )   / microtimestep
573
574  if (co2useh2o) then
575    subpdqcloudco2(:,:,igcm_h2o_ice) = ( zq(:,:,igcm_h2o_ice) - zq0(:,:,igcm_h2o_ice) )  / microtimestep
576
577    subpdqcloudco2(:,:,igcm_ccn_mass) = ( zq(:,:,igcm_ccn_mass) - zq0(:,:,igcm_ccn_mass) )    / microtimestep
578
579    subpdqcloudco2(:,:,igcm_ccn_number) = ( zq(:,:,igcm_ccn_number) - zq0(:,:,igcm_ccn_number) ) / microtimestep
580
581    subpdqcloudco2(:,:,igcm_ccnco2_h2o_mass_ice) = (zq(:,:,igcm_ccnco2_h2o_mass_ice)-zq0(:,:,igcm_ccnco2_h2o_mass_ice)&
582                                                   )/microtimestep
583
584    subpdqcloudco2(:,:,igcm_ccnco2_h2o_mass_ccn) = (zq(:,:,igcm_ccnco2_h2o_mass_ccn)-zq0(:,:,igcm_ccnco2_h2o_mass_ccn)&
585                                                   )/microtimestep
586
587    subpdqcloudco2(:,:,igcm_ccnco2_h2o_number) = ( zq(:,:,igcm_ccnco2_h2o_number) - zq0(:,:,igcm_ccnco2_h2o_number) &
588                                                 )/microtimestep
589  end if
590!======================================================================================================================!
591! END =================================================================================================================!
592!======================================================================================================================!
593  end subroutine improvedCO2clouds
594
595end module improvedCO2clouds_mod
596
Note: See TracBrowser for help on using the repository browser.