[2362] | 1 | !======================================================================================================================! |
---|
| 2 | ! Module: CO2 clouds formation ========================================================================================! |
---|
| 3 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 4 | ! Authors: Joachim Audouard, Constantino Listowski, Anni Määttänen |
---|
| 5 | ! Date: 09/2016 |
---|
| 6 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 7 | ! Contains subroutines: |
---|
| 8 | ! - co2cloud: of co2 cloud microphysics |
---|
| 9 | ! |
---|
| 10 | ! - ini_co2cloud: (only used in phys_state_var_init_mod.F90) |
---|
| 11 | ! |
---|
| 12 | ! - end_co2cloud: (only used in phys_state_var_init_mod.F90) |
---|
| 13 | !======================================================================================================================! |
---|
| 14 | module co2cloud_mod |
---|
| 15 | |
---|
| 16 | implicit none |
---|
| 17 | |
---|
| 18 | double precision, allocatable, save :: & |
---|
| 19 | mem_Mccn_co2(:,:), &! Memory of CCN mass of H2O and dust used by CO2 |
---|
| 20 | mem_Mh2o_co2(:,:), &! Memory of H2O mass integred into CO2 crystal |
---|
| 21 | mem_Nccn_co2(:,:) ! Memory of CCN number of H2O and dust used by CO2 |
---|
| 22 | |
---|
| 23 | contains |
---|
| 24 | !======================================================================================================================! |
---|
| 25 | ! SUBROUTINE: co2cloud ================================================================================================! |
---|
| 26 | !======================================================================================================================! |
---|
| 27 | ! Subject: |
---|
| 28 | !--------- |
---|
| 29 | ! Main subroutine of co2 cloud microphysics |
---|
| 30 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 31 | ! Comments: |
---|
| 32 | !---------- |
---|
| 33 | ! - Adaptation of the water ice clouds scheme (with specific microphysics) of Montmessin, Navarro et al. |
---|
| 34 | ! |
---|
| 35 | ! - Microphysics subroutine is improvedCO2clouds.F |
---|
| 36 | ! |
---|
| 37 | ! - There is a time loop specific to cloud formation due to timescales smaller than the GCM integration timestep |
---|
| 38 | ! |
---|
| 39 | ! - The microphysics time step is a fraction of the physical one |
---|
| 40 | ! |
---|
| 41 | ! - The CO2 clouds tracers (co2_ice, ccn mass and concentration) are sedimented at each microtimestep. pdqs_sedco2 |
---|
| 42 | ! keeps track of the CO2 flux at the surface |
---|
| 43 | ! |
---|
| 44 | ! - The subgrid Temperature distribution is modulated (0 or 1) by Spiga et al. (GRL 2012) |
---|
| 45 | ! |
---|
| 46 | ! - Saturation Index to account for GW propagation or dissipation upwards |
---|
| 47 | ! |
---|
| 48 | ! - 4D and column opacities are computed using Qext values at 1µm |
---|
| 49 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 50 | ! Papers: |
---|
| 51 | !-------- |
---|
| 52 | ! "Near-pure vapor condensation in the Martian atmosphere: CO2 ice crystal growth", Listowski et al. (2013), JGRE |
---|
| 53 | ! "Modeling the microphysics of CO2 ice clouds within wave-induced cold pockets in the martian mesosphere", Listowski |
---|
| 54 | ! et al. (2014), Icarus |
---|
| 55 | ! "Global climate modeling of the Martian water cycle with improved microphysics and radiatively active water ice |
---|
| 56 | ! clouds", Navarro et al. (2014), JGRE |
---|
| 57 | ! "Martian GCM with complete CO2 clouds microphysics", Audouard et al. (2017), EPSC abstract |
---|
| 58 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 59 | ! Algorithm: |
---|
| 60 | !----------- |
---|
| 61 | ! 0. Firstcall |
---|
| 62 | ! 0.1. Initialization of microtimestep from imicroco2 |
---|
| 63 | ! 0.2. Compute the radius grid of CO2 ice particles (rb_cldco2) |
---|
| 64 | ! 0.3. Read file 'optprop_co2ice_1mic.dat' to extract optical properties of CO2 ice at 1 micron (Qext) |
---|
| 65 | ! 0.4. Interpole the radius grid (rb_cldco2) to get the corresponding exctinction coefficients (Qext1bins) |
---|
| 66 | ! 0.5. Save the radius grid of CO2 particles (rb_cldco2) |
---|
| 67 | ! 1. Initialization |
---|
| 68 | ! 2. Compute mass and thickness layers |
---|
| 69 | ! 3. Define the sub-grid cloud (CLFvaryingCO2) |
---|
| 70 | ! 3.1. Representation of sub-grid CO2 ice clouds (CLFvaryingCO2 = True) |
---|
| 71 | ! 3.1.a. Saturation index CO2 |
---|
| 72 | ! 3.1.b. Compute tcond |
---|
| 73 | ! 3.1.c. Compute cloud fraction in cells |
---|
[2386] | 74 | ! 3.2. No sub-grid cloud representation (CLFvaryingCO2 = False) |
---|
[2362] | 75 | ! 4. Microphysics of CO2 cloud formation |
---|
| 76 | ! 4.1. Stepped entry for tendancies: At each micro timestep we add pdt in order to have a stepped entry |
---|
| 77 | ! 4.2. Effective tracers quantities in the cloud |
---|
| 78 | ! 4.3. Gravitational sedimentation |
---|
| 79 | ! 4.3.a. Compute cloud density |
---|
| 80 | ! 4.3.b. Save actualized tracer values to compute sedimentation tendancies |
---|
| 81 | ! 4.3.c. Sedimentation of co2 ice |
---|
| 82 | ! 4.3.d. Sedimentation for other tracers |
---|
| 83 | ! 4.3.e. Compute tendencies due to the sedimation process |
---|
| 84 | ! 4.4. Main call to the cloud scheme |
---|
| 85 | ! 4.5. Updating tendencies after cloud scheme |
---|
| 86 | ! 5. Compute final tendencies after time loop |
---|
| 87 | ! 6. Update clouds physical values in the cloud (for output) |
---|
| 88 | ! 6.1. Update density of co2 ice, riceco2 and opacity |
---|
| 89 | ! 6.2. Update rice and rdust |
---|
| 90 | ! 7. Correction if a lot of subliming CO2 fills the 1st layer |
---|
| 91 | ! 8. Compute water cloud sedimentation radius |
---|
| 92 | ! 9. CO2 saturated quantities |
---|
| 93 | ! 9.1 Compute CO2 saturation in layers |
---|
| 94 | ! 9.2 Compute CO2 saturated quantities in layers |
---|
| 95 | ! 10. Everything modified by CO2 microphysics must be wrt co2cloudfrac |
---|
| 96 | ! 11. Compute opacity at 1 micron |
---|
| 97 | ! 12. Write outputs in diagfi.nc |
---|
| 98 | !======================================================================================================================! |
---|
| 99 | subroutine co2cloud(ngrid, nlay, ptimestep, pplev, pplay, pdpsrf, pzlay, pt, pdt, pq, pdq, pdqcloudco2, pdtcloudco2, & |
---|
[2447] | 100 | nq, tau, tauscaling, rdust, rice, riceco2, nuice, rhocloud, rsedcloudco2, rhocloudco2, pzlev, pdqs_sedco2, pdu, & |
---|
[2362] | 101 | pu, pcondicea, co2ice) |
---|
| 102 | |
---|
| 103 | use ioipsl_getincom, only: getin |
---|
| 104 | use dimradmars_mod, only: naerkind |
---|
| 105 | use comcstfi_h, only: pi, g, cpp |
---|
| 106 | use updaterad, only: updaterice_microco2, updaterice_micro, updaterdust |
---|
| 107 | use conc_mod, only: mmean, rnew |
---|
| 108 | use tracer_mod, only: igcm_co2, igcm_co2_ice, igcm_dust_mass, igcm_dust_number, igcm_h2o_ice, & |
---|
| 109 | igcm_ccn_mass, igcm_ccn_number, igcm_ccnco2_mass, igcm_ccnco2_number, rho_dust, & |
---|
[2494] | 110 | nuiceco2_sed, nuiceco2_ref, r3n_q, rho_ice, nuice_sed |
---|
[2362] | 111 | |
---|
| 112 | use newsedim_mod, only: newsedim |
---|
| 113 | |
---|
| 114 | use datafile_mod, only: datadir |
---|
| 115 | |
---|
[2494] | 116 | use improvedCO2clouds_mod, only: improvedCO2clouds |
---|
[2362] | 117 | |
---|
[2447] | 118 | #ifndef MESOSCALE |
---|
| 119 | use vertical_layers_mod, only: ap, bp |
---|
| 120 | #endif |
---|
| 121 | |
---|
[2362] | 122 | implicit none |
---|
| 123 | |
---|
| 124 | include "callkeys.h" |
---|
| 125 | include "microphys.h" |
---|
| 126 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 127 | ! VARIABLES DECLARATION |
---|
| 128 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 129 | ! Input arguments: |
---|
| 130 | !----------------- |
---|
| 131 | integer, intent(in) ::& |
---|
| 132 | ngrid, &! Number of grid points |
---|
| 133 | nlay, &! Number of layers |
---|
| 134 | nq ! Number of tracers |
---|
| 135 | |
---|
| 136 | real, intent(in) :: & |
---|
| 137 | ptimestep, &! Physical time step (s) |
---|
| 138 | pplev(ngrid,nlay+1), &! Inter-layer pressures (Pa) |
---|
| 139 | pplay(ngrid,nlay), &! Mid-layer pressures (Pa) |
---|
| 140 | pdpsrf(ngrid), &! Tendency on surface pressure |
---|
| 141 | pzlay(ngrid,nlay), &! Altitude at the middle of the layers |
---|
| 142 | pt(ngrid,nlay), &! Temperature at the middle of the layers (K) |
---|
| 143 | pdt(ngrid,nlay), &! Tendency on temperature from other parametrizations |
---|
| 144 | pq(ngrid,nlay,nq), &! Tracers (kg/kg) |
---|
| 145 | pdq(ngrid,nlay,nq), &! Tendencies before condensation (kg/kg.s-1) |
---|
| 146 | tau(ngrid,naerkind), &! Column dust optical depth at each point |
---|
| 147 | tauscaling(ngrid), &! Convertion factor for dust amount |
---|
| 148 | pu(ngrid,nlay), &! Zonal Wind: zu = pu + (pdu * ptimestep) |
---|
| 149 | pdu(ngrid,nlay), &! Tendency of zonal wind before condensation |
---|
| 150 | pzlev(ngrid,nlay+1), &! Altitude at the boundaries of the layers |
---|
| 151 | nuice(ngrid,nlay), &! Estimated effective variance of the size distribution |
---|
| 152 | co2ice(ngrid) ! Amount of co2 ice at the surface |
---|
| 153 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 154 | ! Output arguments: |
---|
| 155 | !------------------ |
---|
| 156 | real, intent(out) :: & |
---|
| 157 | rice(ngrid,nlay), & ! Water Ice mass mean radius (m) |
---|
[2447] | 158 | ! rsedcloud(ngrid,nlay), & ! Water Cloud sedimentation radius |
---|
[2362] | 159 | rhocloud(ngrid,nlay), & ! Water Cloud density (kg.m-3) |
---|
| 160 | pdqs_sedco2(ngrid), & ! CO2 flux at the surface |
---|
| 161 | pdqcloudco2(ngrid,nlay,nq),& ! Tendency due to CO2 condensation (kg/kg.s-1) |
---|
| 162 | pcondicea(ngrid,nlay), & ! Rate of condensation/sublimation of co2 ice in layers |
---|
| 163 | pdtcloudco2(ngrid,nlay), & ! Tendency on temperature due to latent heat |
---|
[2447] | 164 | rsedcloudco2(ngrid,nlay) ! Cloud sedimentation radius |
---|
| 165 | |
---|
| 166 | real, intent(inout) :: & |
---|
| 167 | rdust(ngrid,nlay) ! Dust geometric mean radius (m) |
---|
| 168 | |
---|
[2456] | 169 | double precision, intent(out) :: & |
---|
| 170 | riceco2(ngrid,nlay) ! Ice mass mean radius (m) r_c in Montmessin et al. (2004) |
---|
[2362] | 171 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 172 | ! Local: |
---|
| 173 | !------- |
---|
| 174 | !-----1) Parameters: |
---|
| 175 | !------------------- |
---|
| 176 | integer, parameter :: & |
---|
| 177 | uQext = 555, &! file_qext unit ID |
---|
| 178 | var_dim_qext = 10000 ! Exact dimension of radv and qextv1mic from file_qext |
---|
| 179 | |
---|
| 180 | real, parameter :: & |
---|
| 181 | mincloud = 0.1, &! Minimum cloud fraction |
---|
| 182 | beta = 0.85, &! correction for the shape of the particles (see Murphy et al. JGR 1990 vol.95): |
---|
| 183 | ! beta = 1 for spheres |
---|
| 184 | ! beta = 0.85 for irregular particles |
---|
| 185 | ! beta = 0.5 for disk shaped particles |
---|
| 186 | threshold = 1e-30 ! limit value |
---|
| 187 | |
---|
| 188 | double precision, parameter :: & |
---|
| 189 | rmin_cld = 1.e-9, &! Minimum radius (m) |
---|
| 190 | rmax_cld = 5.e-6, &! Maximum radius (m) |
---|
| 191 | rbmin_cld = 1.e-10,&! Minimum boundary radius (m) |
---|
| 192 | rbmax_cld = 2.e-4, &! Maximum boundary radius (m) |
---|
| 193 | Fo = 7.5e-7, &! for sat index (J.m-3) |
---|
| 194 | lambdaH = 150.e3 ! for sat index (km) |
---|
| 195 | |
---|
| 196 | character(len=23), parameter :: & |
---|
| 197 | file_qext = 'optprop_co2ice_1mic.dat' ! File extinction coefficients of CO2 particles |
---|
| 198 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 199 | !-----2) Saved: |
---|
| 200 | !-------------- |
---|
| 201 | integer, save :: & |
---|
| 202 | imicroco2 ! Time subsampling for coupled water microphysics sedimentation microtimestep timeloop for microphysics: |
---|
| 203 | ! if imicroco2 = 1, subpdt is the same as pdt |
---|
| 204 | real, save :: & |
---|
| 205 | sigma_iceco2, &! Variance of the ice and CCN distributions |
---|
| 206 | microtimestep ! Integration timestep for coupled water microphysics & sedimentation |
---|
| 207 | |
---|
| 208 | double precision, save :: & |
---|
| 209 | dev2, &! 1. / ( sqrt(2.) * sigma_iceco2 ) |
---|
| 210 | Qext1bins(nbinco2_cld), &! Extinction coefficients for rb_cldco2 radius of CO2 ice particles |
---|
[2494] | 211 | Qextv1mic(var_dim_qext), & |
---|
| 212 | radv(var_dim_qext), & ! radius of CO2 ice at 1 µm (read from file_qext) |
---|
[2362] | 213 | rb_cldco2(nbinco2_cld+1) ! boundary values of each rad_cldco2 bin (m) |
---|
| 214 | logical, save :: & |
---|
| 215 | firstcall = .true. ! Used to compute saved variables |
---|
| 216 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 217 | !-----3) Variables: |
---|
| 218 | !------------------ |
---|
| 219 | integer :: & |
---|
| 220 | iq, &! loop on tracers |
---|
| 221 | ig, &! loop on grid points |
---|
| 222 | l, &! loop on layers |
---|
| 223 | i, &! loop on nbinco2_cld |
---|
| 224 | nelem, &! number of point between lebon1 and lebon2 => interpolation |
---|
| 225 | lebon1, &! bound limit for the interpolation |
---|
| 226 | lebon2, &! bound limit for the interpolation |
---|
| 227 | microstep ! Time subsampling step variable |
---|
| 228 | |
---|
| 229 | real :: & |
---|
| 230 | ! ---Tendency given by clouds inside the micro loop |
---|
| 231 | subpdqcloudco2(ngrid,nlay,nq), &! On tracers, cf. pdqcloud |
---|
| 232 | subpdtcloudco2(ngrid,nlay), &! On temperature, cf. pdtcloud |
---|
| 233 | ! ---Global tendency (clouds+physics) |
---|
| 234 | sum_subpdq(ngrid,nlay,nq), &! On tracers, cf. pdqcloud |
---|
| 235 | sum_subpdt(ngrid,nlay), &! On temperature, cf. pdtcloud |
---|
| 236 | ! ---Sedimentation |
---|
| 237 | ztsed(ngrid,nlay), &! Temperature with real-time value in microtimeloop |
---|
| 238 | zqsed(ngrid,nlay,nq), &! Tracers with real-time value in µloop |
---|
| 239 | zqsed0(ngrid,nlay,nq), &! For sedimentation tendancy |
---|
| 240 | subpdqsed(ngrid,nlay,nq), &! Tendancy due to sedimentation |
---|
| 241 | sum_subpdqs_sedco2(ngrid), &! CO2 flux at the surface |
---|
| 242 | ! ---For sub grid T distribution |
---|
| 243 | zt(ngrid,nlay), &! Local value of temperature |
---|
| 244 | zq_co2vap(ngrid, nlay), &! Local value of CO2 vap |
---|
| 245 | rhocloudco2t(ngrid, nlay), &! Cloud density (kg.m-3) |
---|
| 246 | ! ---For Saturation Index computation |
---|
| 247 | zdelt, &! Delta T for the temperature distribution |
---|
| 248 | co2cloudfrac(ngrid,nlay), &! Cloud fraction used only with CLFvarying is true |
---|
| 249 | ! ---Misc |
---|
| 250 | rhocloudco2(ngrid, nlay), &! Cloud density (kg.m-3) |
---|
| 251 | Nccnco2, &! buffer: number of ccn used for co2 condensation |
---|
| 252 | Qccnco2, &! buffer: mass of ccn used for co2 condensation |
---|
| 253 | Niceco2, &! buffer: mmr co2 ice |
---|
| 254 | epaisseur(ngrid,nlay), &! Layer thickness (m) |
---|
| 255 | masse(ngrid,nlay), &! Layer mass (kg.m-2) |
---|
| 256 | pteff(ngrid, nlay), &! Effective temperature in the cloud |
---|
| 257 | pqeff(ngrid, nlay, nq), &! Effective tracers quantities in the cloud |
---|
| 258 | wq(ngrid,nlay+1), &! Displaced tracer mass (kg.m-2) during microtimestep |
---|
| 259 | satuco2(ngrid,nlay), &! CO2 satu ratio for output diagfi |
---|
[2447] | 260 | zqsatco2(ngrid,nlay), &! Saturation co2 |
---|
| 261 | availco2,& |
---|
| 262 | masslayer, & |
---|
| 263 | tmp, a,b, & |
---|
| 264 | new_pdq(ngrid,nlay) |
---|
| 265 | |
---|
[2362] | 266 | double precision :: & |
---|
| 267 | ! ---Extinction coefficients at 1 micron of CO2 particles |
---|
| 268 | vrat_cld, &! Volume ratio |
---|
[2456] | 269 | n_derf, &! derf( (rb_cldco2(1)-log(riceco2(ig,l))) *dev2) |
---|
[2362] | 270 | Qtemp, &! mean value in the interval during the interpolation |
---|
| 271 | ltemp1(var_dim_qext), &! abs(radv(:)-rb_cldco2(i)) |
---|
| 272 | ltemp2(var_dim_qext), &! abs(radv(:)-rb_cldco2(i+1)) |
---|
| 273 | n_aer(nbinco2_cld), &! -0.5 * Nccnco2*tauscaling(ig) * n_derf |
---|
| 274 | tau1mic(ngrid), &! CO2 ice column opacity at 1µm |
---|
| 275 | Qext1bins2(ngrid,nlay), &! CO2 ice opacities |
---|
| 276 | ! ---For Saturation Index computation |
---|
| 277 | rho, &! background density |
---|
| 278 | zu, &! absolute value of zonal wind field |
---|
| 279 | NN, &! N^2 static stability |
---|
| 280 | gradT, &! thermal gradient |
---|
| 281 | SatIndex(ngrid,nlay), &! Saturation index S in Spiga 2012 paper, assuming like in the paper GW phase speed |
---|
| 282 | ! (stationary waves): c = 0 m.s-1, lambdaH = 150 km, Fo = 7.5e-7 J.m-3 |
---|
| 283 | SatIndexmap(ngrid), &! maxval(SatIndex(ig,12:26)) |
---|
| 284 | ! ---Misc |
---|
| 285 | myT, &! Temperature scalar for co2 density computation |
---|
[2494] | 286 | tcond(ngrid,nlay) ! CO2 condensation temperature |
---|
[2362] | 287 | |
---|
| 288 | logical :: & |
---|
| 289 | file_qext_ok ! Check if file_qext exists |
---|
| 290 | !======================================================================================================================! |
---|
| 291 | ! BEGIN ===============================================================================================================! |
---|
| 292 | !======================================================================================================================! |
---|
| 293 | ! 0. Firstcall |
---|
| 294 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 295 | if (firstcall) then |
---|
| 296 | firstcall=.false. |
---|
| 297 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 298 | ! 0.1. Initialization of microtimestep from imicroco2 |
---|
| 299 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 300 | #ifdef MESOSCALE |
---|
| 301 | imicroco2 = 2 |
---|
| 302 | #else |
---|
| 303 | imicroco2 = 30 |
---|
| 304 | #endif |
---|
| 305 | call getin("imicroco2", imicroco2) |
---|
| 306 | microtimestep = ptimestep/real(imicroco2) |
---|
| 307 | sigma_iceco2 = sqrt(log(1.+nuiceco2_sed)) |
---|
| 308 | dev2 = 1. / ( sqrt(2.) * sigma_iceco2 ) |
---|
| 309 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 310 | ! 0.2. Compute the radius grid of CO2 ice particles (rb_cldco2) |
---|
| 311 | ! > the grid spacing is computed assuming a constant volume ratio between two consecutive bins; i.e. vrat_cld. |
---|
| 312 | ! - rad_cldco2 is the primary radius grid used for microphysics computation. |
---|
| 313 | ! - The grid spacing is computed assuming a constant volume ratio between two consecutive bins; i.e. vrat_cld. |
---|
| 314 | ! - vrat_cld is determined from the boundary values of the size grid: rmin_cld and rmax_cld. |
---|
| 315 | ! - The rb_cldco2 array contains the boundary values of each rad_cldco2 bin. |
---|
| 316 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 317 | ! vrat_cld is determined from the boundary values of the size grid: rmin_cld and rmax_cld. |
---|
| 318 | vrat_cld = exp(log(rmax_cld/rmin_cld) / float(nbinco2_cld-1) * 3.) |
---|
| 319 | |
---|
| 320 | ! rad_cldco2 is the primary radius grid used for microphysics computation. |
---|
| 321 | rad_cldco2(1) = rmin_cld |
---|
| 322 | do i = 1, nbinco2_cld-1 |
---|
| 323 | rad_cldco2(i+1) = rad_cldco2(i) * vrat_cld**(1./3.) |
---|
| 324 | end do |
---|
| 325 | |
---|
| 326 | ! rb_cldco2 array contains the boundary values of each rad_cldco2 bin. |
---|
| 327 | rb_cldco2(1) = rbmin_cld |
---|
| 328 | do i = 1, nbinco2_cld |
---|
| 329 | rb_cldco2(i+1) = ( (2.*vrat_cld) / (vrat_cld+1.) )**(1./3.) * rad_cldco2(i) |
---|
| 330 | end do |
---|
| 331 | rb_cldco2(nbinco2_cld+1) = rbmax_cld |
---|
| 332 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 333 | ! 0.3. Read file 'optprop_co2ice_1mic.dat' to extract optical properties of CO2 ice at 1 micron (Qext) |
---|
| 334 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 335 | ! get information about file_qext |
---|
| 336 | inquire(file=trim(datadir)//'/'//file_qext, exist=file_qext_ok) |
---|
| 337 | |
---|
| 338 | ! if file_qext is missing then stop |
---|
| 339 | if (.not. file_qext_ok) then |
---|
| 340 | write(*,*)'file'//file_qext//'should be in ', trim(datadir) |
---|
| 341 | call abort_physic('co2cloud', 'file missing', 1) |
---|
| 342 | end if |
---|
| 343 | |
---|
| 344 | ! read file_qext |
---|
| 345 | open(unit=uQext,file=trim(datadir)//'/'//file_qext, form='formatted') |
---|
| 346 | |
---|
| 347 | ! skip 1 line |
---|
| 348 | read(uQext,*) |
---|
| 349 | |
---|
| 350 | ! extract radv |
---|
| 351 | do i = 1, var_dim_qext |
---|
| 352 | read(uQext,'(E12.5)')radv(i) |
---|
| 353 | end do |
---|
| 354 | |
---|
| 355 | ! skip 1 line |
---|
| 356 | read(uQext,*) |
---|
| 357 | |
---|
| 358 | ! Qextv1mic |
---|
| 359 | do i = 1 , var_dim_qext |
---|
| 360 | read(uQext,'(E12.5)')Qextv1mic(i) |
---|
| 361 | end do |
---|
| 362 | |
---|
| 363 | ! close file_qext |
---|
| 364 | close(uQext) |
---|
| 365 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 366 | ! 0.4. Interpole the radius grid (rb_cldco2) to get the corresponding exctinction coefficients (Qext1bins), using |
---|
| 367 | ! file_qext values (radv, Qextv1mic) |
---|
| 368 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 369 | do i = 1, nbinco2_cld |
---|
| 370 | ltemp1 = abs(radv(:)-rb_cldco2(i)) |
---|
| 371 | ltemp2 = abs(radv(:)-rb_cldco2(i+1)) |
---|
| 372 | lebon1 = minloc(ltemp1,DIM=1) |
---|
| 373 | lebon2 = min(minloc(ltemp2,DIM=1), var_dim_qext) |
---|
| 374 | nelem = lebon2 - lebon1 + 1. |
---|
| 375 | |
---|
| 376 | ! mean value in the interval |
---|
| 377 | Qtemp = 0d0 |
---|
| 378 | do l = 0, nelem |
---|
| 379 | Qtemp = Qtemp + Qextv1mic(min(lebon1+l, var_dim_qext)) |
---|
| 380 | end do |
---|
| 381 | |
---|
| 382 | Qext1bins(i) = Qtemp / nelem |
---|
| 383 | end do |
---|
| 384 | |
---|
| 385 | Qext1bins(:) = Qext1bins(:) * pi * (rad_cldco2(:)**2) |
---|
| 386 | |
---|
| 387 | ! print result of the interpolation |
---|
| 388 | write(*,*)'--------------------------------------------' |
---|
| 389 | write(*,*)'Microphysics co2: size bin-Qext information:' |
---|
| 390 | write(*,*)' i, rad_cldco2(i), Qext1bins(i)' |
---|
| 391 | do i = 1, nbinco2_cld |
---|
| 392 | write(*,'(i3,3x,3(e13.6,4x))')i, rad_cldco2(i), Qext1bins(i) |
---|
| 393 | end do |
---|
| 394 | write(*,*)'--------------------------------------------' |
---|
| 395 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 396 | ! 0.5. Save the radius grid of CO2 particles (rb_cldco2) |
---|
| 397 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 398 | do i = 1, nbinco2_cld+1 |
---|
| 399 | rb_cldco2(i) = log(rb_cldco2(i)) |
---|
| 400 | end do |
---|
| 401 | end if ! of IF (firstcall) |
---|
| 402 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 403 | ! 1. Initialization |
---|
| 404 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 405 | sum_subpdq(1:ngrid,1:nlay,1:nq) = 0. |
---|
| 406 | sum_subpdt(1:ngrid,1:nlay) = 0. |
---|
| 407 | |
---|
| 408 | subpdqcloudco2(1:ngrid,1:nlay,1:nq) = 0. |
---|
| 409 | subpdtcloudco2(1:ngrid,1:nlay) = 0. |
---|
| 410 | |
---|
| 411 | pdqcloudco2(1:ngrid,1:nlay,1:nq) = 0. |
---|
| 412 | pdtcloudco2(1:ngrid,1:nlay) = 0. |
---|
| 413 | |
---|
| 414 | ! default value if no ice |
---|
| 415 | rhocloudco2(1:ngrid,1:nlay) = rho_dust |
---|
| 416 | rhocloudco2t(1:ngrid,1:nlay) = rho_dust |
---|
| 417 | epaisseur(1:ngrid,1:nlay) = 0. |
---|
| 418 | masse(1:ngrid,1:nlay) = 0. |
---|
[2494] | 419 | riceco2(1:ngrid, 1:nlay) = 0. |
---|
[2362] | 420 | zqsed0(1:ngrid,1:nlay,1:nq) = 0. |
---|
| 421 | sum_subpdqs_sedco2(1:ngrid) = 0. |
---|
| 422 | subpdqsed(1:ngrid,1:nlay,1:nq) = 0. |
---|
| 423 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 424 | ! 2. Compute mass and thickness layers |
---|
| 425 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 426 | do l = 1, nlay |
---|
| 427 | do ig = 1, ngrid |
---|
[2460] | 428 | #ifndef MESOSCALE |
---|
[2447] | 429 | masse(ig,l) = (pplev(ig,l) - pplev(ig,l+1) + (bp(l)-bp(l+1)) ) / g |
---|
[2460] | 430 | #else |
---|
| 431 | masse(ig,l) = (pplev(ig,l) - pplev(ig,l+1)) / g |
---|
| 432 | #endif |
---|
[2362] | 433 | epaisseur(ig,l) = pzlev(ig,l+1) - pzlev(ig,l) |
---|
| 434 | end do |
---|
| 435 | end do |
---|
| 436 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 437 | ! 3. Define the sub-grid cloud (CLFvaryingCO2) |
---|
| 438 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 439 | ! 3.1. Representation of sub-grid CO2 ice clouds (CLFvaryingCO2 = True) |
---|
| 440 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 441 | if (CLFvaryingCO2) then |
---|
| 442 | ! effective temperature |
---|
| 443 | pteff(:,:) = pt(:,:) |
---|
| 444 | |
---|
| 445 | ! min co2cloudfrac when there is ice |
---|
| 446 | co2cloudfrac(:,:) = mincloud |
---|
| 447 | |
---|
| 448 | ! temperature |
---|
| 449 | do l=1,nlay |
---|
| 450 | do ig=1,ngrid |
---|
| 451 | zt(ig,l) = pt(ig,l) + pdt(ig,l)*ptimestep |
---|
| 452 | end do |
---|
| 453 | end do |
---|
| 454 | |
---|
| 455 | ! Quantities of traceurs |
---|
| 456 | if (igcm_co2 /= 0) then |
---|
| 457 | do l = 1, nlay |
---|
| 458 | do ig = 1, ngrid |
---|
| 459 | zq_co2vap(ig,l) = pq(ig,l,igcm_co2) + pdq(ig,l,igcm_co2)*ptimestep |
---|
| 460 | end do |
---|
| 461 | end do |
---|
| 462 | end if |
---|
| 463 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 464 | ! 3.1.a. Saturation index CO2 |
---|
| 465 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 466 | ! if saturation index co2 is true |
---|
| 467 | if (satindexco2) then |
---|
| 468 | ! layers 12 --> 26 ~ 12->85 km |
---|
| 469 | do l = 12, 26 |
---|
| 470 | do ig = 1, ngrid |
---|
| 471 | ! compute N^2 static stability |
---|
| 472 | gradT = (zt(ig,l+1)-zt(ig,l))/(pzlev(ig,l+1)-pzlev(ig,l)) |
---|
| 473 | NN = sqrt(g/zt(iq,l) * (max(gradT,-g/cpp) + g/cpp)) |
---|
| 474 | |
---|
| 475 | ! compute absolute value of zonal wind field |
---|
| 476 | zu = abs(pu(ig,l) + pdu(ig,l)*ptimestep) |
---|
| 477 | |
---|
| 478 | ! compute background density |
---|
| 479 | rho = pplay(ig,l) / (rnew(ig,l)*zt(ig,l)) |
---|
| 480 | |
---|
| 481 | ! saturation index: Modulate the DeltaT by GW propagation index: |
---|
| 482 | ! -------------------------------------------------------------- |
---|
| 483 | SatIndex(ig,l) = sqrt(Fo*lambdaH/(2.*pi)*NN / (rho*zu**3) ) |
---|
| 484 | end do |
---|
| 485 | end do |
---|
| 486 | |
---|
| 487 | ! Then compute Satindex map in layers 12 --> 26 ~ 12->85 km |
---|
| 488 | do ig = 1, ngrid |
---|
| 489 | SatIndexmap(ig) = maxval(SatIndex(ig,12:26)) |
---|
| 490 | end do |
---|
| 491 | |
---|
| 492 | ! Write outputs in diagfi.nc |
---|
| 493 | call WRITEDIAGFI(ngrid, "SatIndex", "SatIndex", " ", 3, SatIndex) |
---|
| 494 | |
---|
| 495 | call WRITEDIAGFI(ngrid, "SatIndexmap", "SatIndexmap", "km", 2, SatIndexmap) |
---|
| 496 | !------------------------------------------------------------------------------------------------------------------! |
---|
| 497 | ! if saturation index co2 is false, set saturation index to 0.05 |
---|
| 498 | !------------------------------------------------------------------------------------------------------------------! |
---|
| 499 | else |
---|
| 500 | do ig = 1, ngrid |
---|
| 501 | SatIndexmap(ig)=0.05 |
---|
| 502 | end do |
---|
| 503 | end if ! of if (satindexco2) |
---|
| 504 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 505 | ! 3.1.b. Compute tcond |
---|
| 506 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 507 | call tcondco2(ngrid,nlay,pplay,zq_co2vap,tcond) |
---|
| 508 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 509 | ! 3.1.c. Compute cloud fraction in cells |
---|
| 510 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 511 | do ig = 1, ngrid |
---|
| 512 | if (SatIndexmap(ig) <= 0.1) then |
---|
| 513 | do l = 1, nlay-1 |
---|
| 514 | |
---|
| 515 | ! The entire fraction is saturated |
---|
| 516 | if (tcond(ig,l) >= (zt(ig,l)+zdelt) .or. tcond(ig,l) <= 0.) then |
---|
| 517 | pteff(ig,l) = zt(ig,l) |
---|
| 518 | co2cloudfrac(ig,l) = 1. |
---|
| 519 | |
---|
| 520 | ! No saturation at all |
---|
| 521 | else if (tcond(ig,l) <= (zt(ig,l)-zdelt)) then |
---|
| 522 | pteff(ig,l) = zt(ig,l) - zdelt |
---|
| 523 | co2cloudfrac(ig,l) = mincloud |
---|
| 524 | |
---|
| 525 | ! Mean temperature of the cloud fraction |
---|
| 526 | else |
---|
| 527 | pteff(ig,l) = (tcond(ig,l)+zt(ig,l)-zdelt) / 2. |
---|
| 528 | co2cloudfrac(ig,l) = (tcond(ig,l)-zt(ig,l)+zdelt) / (2.0*zdelt) |
---|
| 529 | end if |
---|
| 530 | |
---|
| 531 | pteff(ig,l) = pteff(ig,l) - pdt(ig,l)*ptimestep |
---|
| 532 | |
---|
| 533 | ! check boundary values of co2cloudfrac |
---|
| 534 | if (co2cloudfrac(ig,l) <= mincloud) then |
---|
| 535 | co2cloudfrac(ig,l) = mincloud |
---|
| 536 | else if (co2cloudfrac(ig,l)> 1) then |
---|
| 537 | co2cloudfrac(ig,l) = 1. |
---|
| 538 | end if |
---|
| 539 | end do |
---|
| 540 | |
---|
| 541 | ! SatIndex not favorable for GW: leave pt untouched |
---|
| 542 | else |
---|
| 543 | pteff(ig,l) = pt(ig,l) |
---|
| 544 | co2cloudfrac(ig,l) = mincloud |
---|
| 545 | end if ! of if (SatIndexmap <= 0.1) |
---|
| 546 | end do ! of ngrid |
---|
| 547 | ! TODO: Totalcloud frac of the column missing here |
---|
| 548 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 549 | ! 3.2. No sub-grid cloud representation (CLFvarying = False) |
---|
| 550 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 551 | else |
---|
| 552 | do l = 1, nlay |
---|
| 553 | do ig = 1, ngrid |
---|
| 554 | pteff(ig,l) = pt(ig,l) |
---|
| 555 | end do |
---|
| 556 | end do |
---|
| 557 | end if ! end if (CLFvaryingco2) |
---|
| 558 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 559 | ! 4. Microphysics of CO2 cloud formation |
---|
| 560 | !----------------------------------------------------------------------------------------------------------------------! |
---|
[2447] | 561 | pqeff(:,:,:) = pq(:,:,:) |
---|
| 562 | pteff(:,:) = pt(:,:) |
---|
| 563 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 564 | ! 4.2. Effective tracers quantities in the cloud |
---|
| 565 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 566 | if (CLFvaryingCO2) then |
---|
| 567 | pqeff(:,:,igcm_ccnco2_mass) = pq(:,:,igcm_ccnco2_mass) / co2cloudfrac(:,:) |
---|
| 568 | |
---|
| 569 | pqeff(:,:,igcm_ccnco2_number) = pq(:,:,igcm_ccnco2_number) / co2cloudfrac(:,:) |
---|
| 570 | |
---|
| 571 | pqeff(:,:,igcm_co2_ice) = pq(:,:,igcm_co2_ice) / co2cloudfrac(:,:) |
---|
| 572 | end if |
---|
| 573 | !----------------------------------------------------------------------------------------------------------------------! |
---|
[2362] | 574 | do microstep = 1, imicroco2 |
---|
| 575 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 576 | ! 4.1. Stepped entry for tendancies: At each micro timestep we add pdt in order to have a stepped entry |
---|
| 577 | !----------------------------------------------------------------------------------------------------------------------! |
---|
[2447] | 578 | do l = 1, nlay |
---|
| 579 | do ig = 1, ngrid |
---|
| 580 | ! on temperature |
---|
| 581 | sum_subpdt(ig,l) = sum_subpdt(ig,l) + pdt(ig,l) |
---|
| 582 | |
---|
| 583 | ! on tracers |
---|
| 584 | sum_subpdq(ig,l,igcm_dust_mass) = sum_subpdq(ig,l,igcm_dust_mass) + pdq(ig,l,igcm_dust_mass) |
---|
| 585 | |
---|
| 586 | sum_subpdq(ig,l,igcm_dust_number) = sum_subpdq(ig,l,igcm_dust_number) + pdq(ig,l,igcm_dust_number) |
---|
| 587 | |
---|
| 588 | sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + pdq(ig,l,igcm_ccnco2_mass) |
---|
| 589 | |
---|
| 590 | sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + pdq(ig,l,igcm_ccnco2_number) |
---|
| 591 | |
---|
| 592 | sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + pdq(ig,l,igcm_co2_ice) |
---|
| 593 | |
---|
| 594 | sum_subpdq(ig,l,igcm_co2) = sum_subpdq(ig,l,igcm_co2) + pdq(ig,l,igcm_co2) |
---|
| 595 | |
---|
| 596 | if (co2useh2o) then |
---|
| 597 | sum_subpdq(ig,l,igcm_h2o_ice) = sum_subpdq(ig,l,igcm_h2o_ice) + pdq(ig,l,igcm_h2o_ice) |
---|
| 598 | |
---|
| 599 | sum_subpdq(ig,l,igcm_ccn_mass) = sum_subpdq(ig,l,igcm_ccn_mass) + pdq(ig,l,igcm_ccn_mass) |
---|
| 600 | |
---|
| 601 | sum_subpdq(ig,l,igcm_ccn_number) = sum_subpdq(ig,l,igcm_ccn_number) + pdq(ig,l,igcm_ccn_number) |
---|
| 602 | end if |
---|
| 603 | end do ! ngrid |
---|
| 604 | end do ! nlay |
---|
| 605 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 606 | ! 4.4. Main call to the cloud scheme |
---|
| 607 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 608 | call improvedco2clouds(ngrid, nlay, microtimestep, pplay, pplev, pteff, sum_subpdt, pqeff, sum_subpdq, & |
---|
| 609 | subpdqcloudco2, subpdtcloudco2, nq, tauscaling, mem_Mccn_co2, mem_Mh2o_co2, mem_Nccn_co2, & |
---|
| 610 | rb_cldco2, sigma_iceco2, dev2) |
---|
[2494] | 611 | |
---|
[2447] | 612 | do l = 1, nlay |
---|
| 613 | do ig = 1, ngrid |
---|
| 614 | if(pq(ig,l,igcm_co2_ice) + microtimestep*(sum_subpdq(ig,l,igcm_co2_ice)+subpdqcloudco2(ig,l,igcm_co2_ice)) & |
---|
| 615 | .le. 1.e-12) then |
---|
| 616 | subpdqcloudco2(ig,l,igcm_co2_ice) = -pq(ig,l,igcm_co2_ice)/microtimestep - sum_subpdq(ig,l,igcm_co2_ice) |
---|
| 617 | subpdqcloudco2(ig,l,igcm_co2) = -subpdqcloudco2(ig,l,igcm_co2_ice) |
---|
| 618 | end if |
---|
| 619 | |
---|
| 620 | if(pq(ig,l,igcm_co2) + microtimestep*(sum_subpdq(ig,l,igcm_co2)+subpdqcloudco2(ig,l,igcm_co2)) .le. 1.e-12) then |
---|
| 621 | subpdqcloudco2(ig,l,igcm_co2) = - pq(ig,l,igcm_co2)/microtimestep - sum_subpdq(ig,l,igcm_co2) |
---|
| 622 | subpdqcloudco2(ig,l,igcm_co2_ice) = -subpdqcloudco2(ig,l,igcm_co2) |
---|
| 623 | end if |
---|
| 624 | ! ccnco2_number and ccnco2_mass |
---|
| 625 | if (((pq(ig,l,igcm_ccnco2_number)+(sum_subpdq(ig,l,igcm_ccnco2_number)+subpdqcloudco2(ig,l,igcm_ccnco2_number)) & |
---|
| 626 | *microtimestep).le.1.) .or. & |
---|
| 627 | (pq(ig,l,igcm_ccnco2_mass)+(sum_subpdq(ig,l,igcm_ccnco2_mass)+subpdqcloudco2(ig,l,igcm_ccnco2_mass)) & |
---|
| 628 | *microtimestep.le.1e-20)) then |
---|
| 629 | subpdqcloudco2(ig,l,igcm_ccnco2_number) = - pq(ig,l,igcm_ccnco2_number)/microtimestep + 1. & |
---|
| 630 | - sum_subpdq(ig,l,igcm_ccnco2_number) |
---|
| 631 | subpdqcloudco2(ig,l,igcm_dust_number) = - subpdqcloudco2(ig,l,igcm_ccnco2_number) |
---|
| 632 | |
---|
| 633 | subpdqcloudco2(ig,l,igcm_ccnco2_mass) = - pq(ig,l,igcm_ccnco2_mass)/microtimestep + 1e-20 & |
---|
| 634 | - sum_subpdq(ig,l,igcm_ccnco2_mass) |
---|
| 635 | subpdqcloudco2(ig,l,igcm_dust_mass) = - subpdqcloudco2(ig,l,igcm_ccnco2_mass) |
---|
| 636 | end if |
---|
| 637 | end do |
---|
| 638 | end do |
---|
| 639 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 640 | ! 4.5. Updating tendencies after cloud scheme |
---|
| 641 | !----------------------------------------------------------------------------------------------------------------------! |
---|
[2362] | 642 | do l = 1, nlay |
---|
| 643 | do ig = 1, ngrid |
---|
[2447] | 644 | sum_subpdt(ig,l) = sum_subpdt(ig,l) + subpdtcloudco2(ig,l) |
---|
[2362] | 645 | |
---|
[2447] | 646 | sum_subpdq(ig,l,igcm_dust_mass) = sum_subpdq(ig,l,igcm_dust_mass) + subpdqcloudco2(ig,l,igcm_dust_mass) |
---|
[2362] | 647 | |
---|
[2447] | 648 | sum_subpdq(ig,l,igcm_dust_number) = sum_subpdq(ig,l,igcm_dust_number) + subpdqcloudco2(ig,l,igcm_dust_number) |
---|
[2362] | 649 | |
---|
[2447] | 650 | sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + subpdqcloudco2(ig,l,igcm_ccnco2_mass) |
---|
[2362] | 651 | |
---|
[2447] | 652 | sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + & |
---|
| 653 | subpdqcloudco2(ig,l,igcm_ccnco2_number) |
---|
[2362] | 654 | |
---|
[2447] | 655 | sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + subpdqcloudco2(ig,l,igcm_co2_ice) |
---|
[2362] | 656 | |
---|
[2447] | 657 | sum_subpdq(ig,l,igcm_co2) = sum_subpdq(ig,l,igcm_co2) + subpdqcloudco2(ig,l,igcm_co2) |
---|
[2362] | 658 | |
---|
| 659 | if (co2useh2o) then |
---|
[2447] | 660 | sum_subpdq(ig,l,igcm_h2o_ice) = sum_subpdq(ig,l,igcm_h2o_ice) + subpdqcloudco2(ig,l,igcm_h2o_ice) |
---|
[2362] | 661 | |
---|
[2447] | 662 | sum_subpdq(ig,l,igcm_ccn_mass) = sum_subpdq(ig,l,igcm_ccn_mass) + subpdqcloudco2(ig,l,igcm_ccn_mass) |
---|
[2362] | 663 | |
---|
[2447] | 664 | sum_subpdq(ig,l,igcm_ccn_number) = sum_subpdq(ig,l,igcm_ccn_number) + subpdqcloudco2(ig,l,igcm_ccn_number) |
---|
[2362] | 665 | end if |
---|
| 666 | end do ! ngrid |
---|
| 667 | end do ! nlay |
---|
| 668 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 669 | ! 4.3. Gravitational sedimentation |
---|
| 670 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 671 | if (sedimentation) then |
---|
| 672 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 673 | ! 4.3.a. Compute cloud density |
---|
| 674 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 675 | do l = 1, nlay |
---|
| 676 | do ig = 1, ngrid |
---|
| 677 | ! temperature during the sedimentation process |
---|
| 678 | ztsed(ig,l) = pteff(ig,l) + sum_subpdt(ig,l) * microtimestep |
---|
| 679 | |
---|
| 680 | ! quantities tracers during the sedimentation process |
---|
| 681 | zqsed(ig,l,:) = pqeff(ig,l,:) + sum_subpdq(ig,l,:) * microtimestep |
---|
| 682 | |
---|
| 683 | ! assure positive value of co2_ice mmr, ccnco2 number, ccnco2 mass |
---|
| 684 | Niceco2 = max(zqsed(ig,l,igcm_co2_ice), threshold) |
---|
| 685 | Nccnco2 = max(zqsed(ig,l,igcm_ccnco2_number), threshold) |
---|
| 686 | Qccnco2 = max(zqsed(ig,l,igcm_ccnco2_mass), threshold) |
---|
| 687 | |
---|
| 688 | ! Get density cloud and co2 ice particle radius |
---|
[2447] | 689 | if (Niceco2.ne.0d0) then |
---|
[2494] | 690 | call updaterice_microco2(dble(Niceco2), dble(Qccnco2), dble(Nccnco2), ztsed(ig,l), tauscaling(ig), & |
---|
| 691 | riceco2(ig,l), rhocloudco2t(ig,l)) |
---|
[2447] | 692 | else |
---|
| 693 | riceco2(ig,l) = 0. |
---|
| 694 | rhocloudco2t(ig,l) = 0. |
---|
[2362] | 695 | end if |
---|
| 696 | end do ! ngrid |
---|
| 697 | end do ! nlay |
---|
| 698 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 699 | ! 4.3.b. Save actualized tracer values to compute sedimentation tendancies |
---|
| 700 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 701 | zqsed0(:,:,igcm_co2_ice) = zqsed(:,:,igcm_co2_ice) |
---|
| 702 | zqsed0(:,:,igcm_ccnco2_mass) = zqsed(:,:,igcm_ccnco2_mass) |
---|
| 703 | zqsed0(:,:,igcm_ccnco2_number) = zqsed(:,:,igcm_ccnco2_number) |
---|
| 704 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 705 | ! 4.3.c. Sedimentation of co2 ice |
---|
| 706 | !----------------------------------------------------------------------------------------------------------------------! |
---|
[2447] | 707 | do ig = 1, ngrid |
---|
| 708 | do l = 1, nlay |
---|
| 709 | rsedcloudco2(ig,l) = max( riceco2(ig,l)*(1.+sigma_iceco2)*(1.+sigma_iceco2)*(1.+sigma_iceco2), & |
---|
| 710 | rdust(ig,l) ) |
---|
| 711 | end do |
---|
| 712 | end do |
---|
| 713 | |
---|
[2362] | 714 | wq(:,:) = 0. |
---|
| 715 | call newsedim(ngrid, nlay, ngrid*nlay, ngrid*nlay, microtimestep, pplev, masse, epaisseur, ztsed, & |
---|
| 716 | rsedcloudco2, rhocloudco2t, zqsed(:,:,igcm_co2_ice), wq, beta) |
---|
| 717 | |
---|
| 718 | do ig = 1, ngrid |
---|
[2447] | 719 | sum_subpdqs_sedco2(ig) = sum_subpdqs_sedco2(ig) + wq(ig,1) / microtimestep !wq est en kg.m-2 |
---|
[2362] | 720 | end do |
---|
| 721 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 722 | ! 4.3.d. Sedimentation for other tracers |
---|
| 723 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 724 | wq(:,:) = 0. |
---|
| 725 | ! for ccnco2_mass |
---|
| 726 | call newsedim(ngrid, nlay, ngrid*nlay, ngrid*nlay, microtimestep, pplev, masse, epaisseur, ztsed, & |
---|
| 727 | rsedcloudco2, rhocloudco2t, zqsed(:,:,igcm_ccnco2_mass), wq, beta) |
---|
| 728 | !TODO: ajouter le calcule de la tendance a la surface comme co2ice |
---|
| 729 | |
---|
| 730 | wq(:,:) = 0. |
---|
| 731 | ! for ccnco2_number |
---|
| 732 | call newsedim(ngrid, nlay, ngrid*nlay, ngrid*nlay,microtimestep, pplev, masse, epaisseur, ztsed, & |
---|
| 733 | rsedcloudco2, rhocloudco2t, zqsed(:,:,igcm_ccnco2_number), wq, beta) |
---|
| 734 | !TODO: ajouter le calcule de la tendance a la surface comme co2ice |
---|
| 735 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 736 | ! 4.3.e. Compute tendencies due to the sedimation process |
---|
| 737 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 738 | do l = 1, nlay |
---|
| 739 | do ig = 1, ngrid |
---|
| 740 | subpdqsed(ig,l,igcm_ccnco2_mass) = ( zqsed(ig,l,igcm_ccnco2_mass) - zqsed0(ig,l,igcm_ccnco2_mass) ) & |
---|
| 741 | / microtimestep |
---|
| 742 | |
---|
| 743 | subpdqsed(ig,l,igcm_ccnco2_number) = ( zqsed(ig,l,igcm_ccnco2_number) - zqsed0(ig,l,igcm_ccnco2_number) )& |
---|
| 744 | / microtimestep |
---|
| 745 | |
---|
| 746 | subpdqsed(ig,l,igcm_co2_ice) = ( zqsed(ig,l,igcm_co2_ice) - zqsed0(ig,l,igcm_co2_ice) ) / microtimestep |
---|
| 747 | end do |
---|
| 748 | end do |
---|
| 749 | ! update subtimestep tendencies with sedimentation input |
---|
| 750 | do l = 1, nlay |
---|
| 751 | do ig = 1, ngrid |
---|
| 752 | sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + subpdqsed(ig,l,igcm_ccnco2_mass) |
---|
| 753 | |
---|
| 754 | sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + subpdqsed(ig,l,igcm_ccnco2_number) |
---|
| 755 | |
---|
| 756 | sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + subpdqsed(ig,l,igcm_co2_ice) |
---|
| 757 | end do |
---|
| 758 | end do |
---|
| 759 | end if !(end if sedimentation) |
---|
| 760 | end do ! of do microstep = 1, imicroco2 |
---|
| 761 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 762 | ! 5. Compute final tendencies after time loop |
---|
| 763 | !----------------------------------------------------------------------------------------------------------------------! |
---|
[2447] | 764 | ! condensation/sublimation rate in the atmosphere (kg.kg-1.s-1) |
---|
[2362] | 765 | do l = nlay, 1, -1 |
---|
| 766 | do ig = 1, ngrid |
---|
| 767 | pcondicea(ig,l) = sum_subpdq(ig,l,igcm_co2_ice) / real(imicroco2) |
---|
| 768 | end do |
---|
| 769 | end do |
---|
| 770 | |
---|
| 771 | ! CO2 flux at surface (kg.m-2.s-1) |
---|
| 772 | do ig = 1, ngrid |
---|
| 773 | pdqs_sedco2(ig) = sum_subpdqs_sedco2(ig) / real(imicroco2) |
---|
| 774 | end do |
---|
[2447] | 775 | ! temperature tendency (T.s-1) |
---|
[2362] | 776 | do l = 1, nlay |
---|
| 777 | do ig = 1, ngrid |
---|
| 778 | pdtcloudco2(ig,l) = ( sum_subpdt(ig,l)/real(imicroco2) ) - pdt(ig,l) |
---|
| 779 | end do |
---|
| 780 | end do |
---|
| 781 | |
---|
| 782 | ! tracers tendencies |
---|
| 783 | do l = 1, nlay |
---|
| 784 | do ig = 1, ngrid |
---|
| 785 | pdqcloudco2(ig,l,igcm_co2) = 0. ! here is the trick, this tendency is computed in co2condens_mod4micro |
---|
| 786 | |
---|
| 787 | pdqcloudco2(ig,l,igcm_co2_ice) = ( sum_subpdq(ig,l,igcm_co2_ice) / real(imicroco2) ) - pdq(ig,l,igcm_co2_ice) |
---|
| 788 | |
---|
| 789 | pdqcloudco2(ig,l,igcm_ccnco2_mass) = ( sum_subpdq(ig,l,igcm_ccnco2_mass)/real(imicroco2) ) - & |
---|
| 790 | pdq(ig,l,igcm_ccnco2_mass) |
---|
| 791 | |
---|
| 792 | pdqcloudco2(ig,l,igcm_ccnco2_number) = ( sum_subpdq(ig,l,igcm_ccnco2_number) / real(imicroco2) ) - & |
---|
| 793 | pdq(ig,l,igcm_ccnco2_number) |
---|
| 794 | |
---|
| 795 | pdqcloudco2(ig,l,igcm_dust_mass) = ( sum_subpdq(ig,l,igcm_dust_mass) / real(imicroco2) ) - & |
---|
[2447] | 796 | pdq(ig,l,igcm_dust_mass) |
---|
[2362] | 797 | |
---|
| 798 | pdqcloudco2(ig,l,igcm_dust_number) = ( sum_subpdq(ig,l,igcm_dust_number)/real(imicroco2) ) - & |
---|
| 799 | pdq(ig,l,igcm_dust_number) |
---|
| 800 | |
---|
| 801 | if (co2useh2o) then |
---|
[2447] | 802 | pdqcloudco2(ig,l,igcm_h2o_ice) = ( sum_subpdq(ig,l,igcm_h2o_ice) / real(imicroco2) ) - & |
---|
| 803 | pdq(ig,l,igcm_h2o_ice) |
---|
[2362] | 804 | |
---|
| 805 | pdqcloudco2(ig,l,igcm_ccn_mass) = ( sum_subpdq(ig,l,igcm_ccn_mass) / real(imicroco2) ) - & |
---|
[2447] | 806 | pdq(ig,l,igcm_ccn_mass) |
---|
[2362] | 807 | |
---|
| 808 | pdqcloudco2(ig,l,igcm_ccn_number) = ( sum_subpdq(ig,l,igcm_ccn_number) / real(imicroco2) ) - & |
---|
| 809 | pdq(ig,l,igcm_ccn_number) |
---|
| 810 | end if |
---|
| 811 | end do ! ngrid |
---|
| 812 | end do ! nlay |
---|
| 813 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 814 | ! 6. Update clouds physical values in the cloud (for output) |
---|
| 815 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 816 | ! 6.1. Update density of co2 ice, riceco2 and opacity |
---|
| 817 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 818 | do l = 1, nlay |
---|
| 819 | do ig = 1, ngrid |
---|
| 820 | Niceco2 = pqeff(ig,l,igcm_co2_ice) + ( pdq(ig,l,igcm_co2_ice) + pdqcloudco2(ig,l,igcm_co2_ice) ) * ptimestep |
---|
[2447] | 821 | Niceco2 = max (Niceco2, threshold) |
---|
[2362] | 822 | |
---|
| 823 | Nccnco2 = max( (pqeff(ig,l,igcm_ccnco2_number) + (pdq(ig,l,igcm_ccnco2_number) + & |
---|
| 824 | pdqcloudco2(ig,l, igcm_ccnco2_number)) * ptimestep) & |
---|
| 825 | , threshold) |
---|
| 826 | |
---|
| 827 | Qccnco2 = max( (pqeff(ig,l,igcm_ccnco2_mass) + (pdq(ig,l,igcm_ccnco2_mass) + & |
---|
| 828 | pdqcloudco2(ig,l, igcm_ccnco2_mass)) * ptimestep)& |
---|
| 829 | , threshold) |
---|
| 830 | |
---|
| 831 | myT = pteff(ig,l) + (pdt(ig,l)+pdtcloudco2(ig,l))*ptimestep |
---|
| 832 | |
---|
| 833 | ! Compute particle size |
---|
[2494] | 834 | call updaterice_microco2(dble(Niceco2), dble(Qccnco2), dble(Nccnco2), myT, tauscaling(ig), riceco2(ig,l), & |
---|
| 835 | rhocloudco2(ig,l)) |
---|
[2362] | 836 | |
---|
| 837 | ! Compute opacities |
---|
| 838 | if ( (Niceco2 <= threshold .or. Nccnco2*tauscaling(ig) <= 1.) ) then |
---|
| 839 | riceco2(ig,l) = 0. |
---|
| 840 | Qext1bins2(ig,l) = 0. |
---|
| 841 | else |
---|
[2456] | 842 | n_derf = derf( (rb_cldco2(1)-log(riceco2(ig,l))) *dev2) |
---|
[2362] | 843 | Qext1bins2(ig,l) = 0. |
---|
| 844 | |
---|
| 845 | do i = 1, nbinco2_cld |
---|
| 846 | n_aer(i) = -0.5 * Nccnco2*tauscaling(ig) * n_derf |
---|
| 847 | |
---|
[2456] | 848 | n_derf = derf((rb_cldco2(i+1)-log(riceco2(ig,l))) *dev2) |
---|
[2362] | 849 | n_aer(i) = n_aer(i) + (0.5 * Nccnco2*tauscaling(ig) * n_derf) |
---|
| 850 | |
---|
| 851 | Qext1bins2(ig,l) = Qext1bins2(ig,l) + Qext1bins(i) * n_aer(i) |
---|
| 852 | end do |
---|
| 853 | end if |
---|
| 854 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 855 | ! 6.2. Update rice and rdust |
---|
| 856 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 857 | ! update rice water only if co2 use h2o ice as CCN |
---|
| 858 | if (co2useh2o) then |
---|
| 859 | call updaterice_micro( & |
---|
| 860 | pqeff(ig,l,igcm_h2o_ice) + (pdq(ig,l,igcm_h2o_ice) + pdqcloudco2(ig,l,igcm_h2o_ice))*ptimestep, & |
---|
| 861 | pqeff(ig,l,igcm_ccn_mass) + (pdq(ig,l,igcm_ccn_mass) + pdqcloudco2(ig,l,igcm_ccn_mass))*ptimestep, & |
---|
| 862 | pqeff(ig,l,igcm_ccn_number) + (pdq(ig,l,igcm_ccn_number) + pdqcloudco2(ig,l,igcm_ccn_number))*ptimestep, & |
---|
| 863 | tauscaling(ig),rice(ig,l),rhocloud(ig,l)) |
---|
| 864 | end if |
---|
| 865 | |
---|
| 866 | ! update rdust |
---|
| 867 | call updaterdust( & |
---|
| 868 | pqeff(ig,l,igcm_dust_mass) + (pdq(ig,l,igcm_dust_mass) + pdqcloudco2(ig,l,igcm_dust_mass))*ptimestep, & |
---|
| 869 | pqeff(ig,l,igcm_dust_number) + (pdq(ig,l,igcm_dust_number) + pdqcloudco2(ig,l,igcm_dust_number))*ptimestep, & |
---|
| 870 | rdust(ig,l)) |
---|
| 871 | end do ! ngrid |
---|
| 872 | end do ! nlay |
---|
| 873 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 874 | ! 7. A correction if a lot of subliming CO2 fills the 1st layer FF (04/2005). Then that should not affect the ice |
---|
| 875 | ! particle radius |
---|
| 876 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 877 | do ig = 1, ngrid |
---|
| 878 | if ( pdpsrf(ig)*ptimestep > 0.9*(pplev(ig,1)-pplev(ig,2))) then |
---|
| 879 | |
---|
| 880 | if ( pdpsrf(ig)*ptimestep > 0.9*(pplev(ig,1)-pplev(ig,3)) ) then |
---|
| 881 | riceco2(ig,2) = riceco2(ig,3) |
---|
| 882 | end if |
---|
| 883 | |
---|
| 884 | riceco2(ig,1) = riceco2(ig,2) |
---|
| 885 | end if |
---|
| 886 | end do |
---|
| 887 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 888 | ! 9. CO2 saturated quantities |
---|
| 889 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 890 | ! 9.1 Compute CO2 saturation in layers |
---|
| 891 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 892 | call co2sat(ngrid*nlay, pteff+(pdt+pdtcloudco2)*ptimestep, zqsatco2) |
---|
| 893 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 894 | ! 9.2 Compute CO2 saturated quantities in layers |
---|
| 895 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 896 | do l = 1, nlay |
---|
| 897 | do ig = 1, ngrid |
---|
| 898 | satuco2(ig,l) = ( pqeff(ig,l,igcm_co2) + (pdq(ig,l,igcm_co2) + pdqcloudco2(ig,l,igcm_co2))*ptimestep ) * & |
---|
| 899 | (mmean(ig,l)/(mco2*1e3)) * pplay(ig,l) / zqsatco2(ig,l) |
---|
| 900 | end do |
---|
| 901 | end do |
---|
| 902 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 903 | ! 10. Everything modified by CO2 microphysics must be wrt co2cloudfrac |
---|
| 904 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 905 | if (CLFvaryingCO2) then |
---|
| 906 | do l = 1, nlay |
---|
| 907 | do ig = 1, ngrid |
---|
| 908 | pdqcloudco2(ig,l,igcm_ccnco2_mass) = pdqcloudco2(ig,l,igcm_ccnco2_mass) * co2cloudfrac(ig,l) |
---|
| 909 | |
---|
| 910 | pdqcloudco2(ig,l,igcm_ccnco2_number) = pdqcloudco2(ig,l,igcm_ccnco2_number) * co2cloudfrac(ig,l) |
---|
| 911 | |
---|
| 912 | pdqcloudco2(ig,l,igcm_dust_mass) = pdqcloudco2(ig,l,igcm_dust_mass) * co2cloudfrac(ig,l) |
---|
| 913 | |
---|
| 914 | pdqcloudco2(ig,l,igcm_dust_number) = pdqcloudco2(ig,l,igcm_dust_number) * co2cloudfrac(ig,l) |
---|
| 915 | |
---|
| 916 | pdqcloudco2(ig,l,igcm_co2_ice) = pdqcloudco2(ig,l,igcm_co2_ice) * co2cloudfrac(ig,l) |
---|
| 917 | |
---|
| 918 | pdqcloudco2(ig,l,igcm_co2) = pdqcloudco2(ig,l,igcm_co2) * co2cloudfrac(ig,l) |
---|
| 919 | |
---|
| 920 | pdtcloudco2(ig,l) = pdtcloudco2(ig,l) * co2cloudfrac(ig,l) |
---|
| 921 | |
---|
| 922 | Qext1bins2(ig,l) = Qext1bins2(ig,l) * co2cloudfrac(ig,l) |
---|
| 923 | |
---|
| 924 | if (co2useh2o) then |
---|
| 925 | pdqcloudco2(ig,l,igcm_h2o_ice) = pdqcloudco2(ig,l,igcm_h2o_ice) * co2cloudfrac(ig,l) |
---|
| 926 | |
---|
| 927 | pdqcloudco2(ig,l,igcm_ccn_mass) = pdqcloudco2(ig,l,igcm_ccn_mass) * co2cloudfrac(ig,l) |
---|
| 928 | |
---|
| 929 | pdqcloudco2(ig,l,igcm_ccn_number) = pdqcloudco2(ig,l,igcm_ccn_number) * co2cloudfrac(ig,l) |
---|
| 930 | end if |
---|
| 931 | end do ! ngrid |
---|
| 932 | end do ! nlay |
---|
| 933 | end if ! if CLFvaryingCO2 is true |
---|
| 934 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 935 | ! 11. Compute opacity at 1 micron: Opacity in mesh ig is the sum over l of Qext1bins2. Is this true ? |
---|
| 936 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 937 | tau1mic(:)=0. |
---|
| 938 | do l = 1, nlay |
---|
| 939 | do ig = 1, ngrid |
---|
| 940 | tau1mic(ig) = tau1mic(ig) + Qext1bins2(ig,l) |
---|
| 941 | end do |
---|
| 942 | end do |
---|
| 943 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 944 | ! 12. Write outputs in diagfi.nc |
---|
| 945 | !----------------------------------------------------------------------------------------------------------------------! |
---|
| 946 | call WRITEDIAGFI(ngrid, "satuco2", "vap in satu", " ", 3, satuco2) |
---|
| 947 | |
---|
[2447] | 948 | if (CLFvaryingCO2) then |
---|
| 949 | call WRITEDIAGFI(ngrid, "co2cloudfrac", "co2 cloud fraction", " ", 3, co2cloudfrac) |
---|
| 950 | end if |
---|
[2362] | 951 | |
---|
| 952 | call writediagfi(ngrid, "riceco2", "ice radius", "m", 3, riceco2) |
---|
| 953 | |
---|
| 954 | call WRITEDIAGFI(ngrid, "Tau3D1mic", " co2 ice opacities", " ", 3, Qext1bins2) |
---|
| 955 | |
---|
| 956 | call WRITEDIAGFI(ngrid, "tau1mic", "co2 ice opacity 1 micron", " ", 2, tau1mic) |
---|
| 957 | |
---|
| 958 | call WRITEDIAGFI(ngrid, "mem_Nccn_co2", "CCN number used by CO2", "kg/kg", 3, mem_Nccn_co2) |
---|
| 959 | |
---|
| 960 | call WRITEDIAGFI(ngrid, "mem_Mccn_co2", "CCN mass used by CO2", "kg/kg", 3, mem_Mccn_co2) |
---|
| 961 | |
---|
| 962 | call WRITEDIAGFI(ngrid, "mem_Mh2o_co2", "H2O mass in CO2 crystal", "kg/kg", 3, mem_Mh2o_co2) |
---|
| 963 | !======================================================================================================================! |
---|
| 964 | ! END =================================================================================================================! |
---|
| 965 | !======================================================================================================================! |
---|
| 966 | end subroutine co2cloud |
---|
| 967 | |
---|
| 968 | |
---|
| 969 | !**********************************************************************************************************************! |
---|
| 970 | !**********************************************************************************************************************! |
---|
| 971 | |
---|
| 972 | |
---|
| 973 | !======================================================================================================================! |
---|
| 974 | ! SUBROUTINE: ini_co2cloud ============================================================================================! |
---|
| 975 | !======================================================================================================================! |
---|
| 976 | ! Subject: |
---|
| 977 | !--------- |
---|
| 978 | ! Allocate arrays used for co2 microphysics |
---|
| 979 | !======================================================================================================================! |
---|
| 980 | subroutine ini_co2cloud(ngrid,nlayer) |
---|
| 981 | |
---|
| 982 | implicit none |
---|
| 983 | |
---|
| 984 | integer, intent(in) :: & |
---|
| 985 | ngrid, &! number of atmospheric columns |
---|
| 986 | nlayer ! number of atmospheric layers |
---|
| 987 | |
---|
| 988 | allocate(mem_Nccn_co2(ngrid,nlayer)) |
---|
| 989 | allocate(mem_Mccn_co2(ngrid,nlayer)) |
---|
| 990 | allocate(mem_Mh2o_co2(ngrid,nlayer)) |
---|
| 991 | |
---|
| 992 | end subroutine ini_co2cloud |
---|
| 993 | |
---|
| 994 | !**********************************************************************************************************************! |
---|
| 995 | !**********************************************************************************************************************! |
---|
| 996 | |
---|
| 997 | !======================================================================================================================! |
---|
| 998 | ! SUBROUTINE: end_co2cloud ============================================================================================! |
---|
| 999 | !======================================================================================================================! |
---|
| 1000 | ! Subject: |
---|
| 1001 | !--------- |
---|
| 1002 | ! Deallocate arrays used for co2 microphysics |
---|
| 1003 | !======================================================================================================================! |
---|
| 1004 | subroutine end_co2cloud |
---|
| 1005 | |
---|
| 1006 | implicit none |
---|
| 1007 | |
---|
| 1008 | if (allocated(mem_Nccn_co2)) deallocate(mem_Nccn_co2) |
---|
| 1009 | if (allocated(mem_Mccn_co2)) deallocate(mem_Mccn_co2) |
---|
| 1010 | if (allocated(mem_Mh2o_co2)) deallocate(mem_Mh2o_co2) |
---|
| 1011 | |
---|
| 1012 | end subroutine end_co2cloud |
---|
| 1013 | |
---|
| 1014 | end module co2cloud_mod |
---|