1 module module_data_cam_mam_asect
3 !-----------------------------------------------------------------------
4 ! New in June 2010, by r.c.easter
5 ! This file is similar to module_data_mosaic_asect,
6 ! but works with the CAM modal aerosol packages in WRF-Chem.
8 ! Note that the position/index arrays in this file refer to the "chem" array,
9 ! while those in file module_data_cam_mam_aero refer to the "q" array
10 ! used in the CAM modal aerosol routines
12 ! *** Important note on units ***
14 ! aerosol densities here are g/cm3
15 ! aerosol sizes and volumes are cm and cm3
16 ! thus the density/size/volume variables in the file have the same units
17 ! as their counterparts in module_data_mosaic_asect.F and module_data_sorgam.F
18 ! in module_data_cam_mam_aero.F,
19 ! aerosol densities here are kg/m3
20 ! aerosol sizes and volumes are m and m3
21 !-----------------------------------------------------------------------
24 use shr_kind_mod, only: r8 => shr_kind_r8
26 use modal_aero_data, only: ntot_amode, maxd_aspectype
32 !-----------------------------------------------------------------------
34 ! The variables in this module provide a means of organizing and accessing
35 ! aerosol species in the "chem" array by their chemical component,
36 ! size bin (or mode), "type", and "phase"
38 ! Their purpose is to allow flexible coding of process modules,
39 ! compared to "hard-coding" using the chem array p_xxx indices
40 ! (e.g., p_so4_a01, p_so4_a02, ...; p_num_a01, ...)
42 !-----------------------------------------------------------------------
44 ! rce & sg 2004-dec-03 - added phase and type capability,
45 ! which changed this module almost completely
47 !-----------------------------------------------------------------------
49 ! maxd_atype = maximum allowable number of aerosol types
50 ! maxd_asize = maximum allowable number of aerosol size bins
51 ! maxd_acomp = maximum allowable number of chemical components
52 ! in each aerosol size bin
53 ! maxd_aphase = maximum allowable number of aerosol phases
54 ! (gas, cloud, ice, rain, ...)
56 ! ntype_aer = number of aerosol types
57 ! The aerosol type will allow treatment of an externally mixed
58 ! aerosol. The current MOSAIC code has only 1 type, with the implicit
59 ! assumption of internal mixing. Eventually, multiple types
60 ! could treat fresh primary BC/OC, fresh SO4 from nucleation,
61 ! aged BC/OC/SO4/... mixture, soil dust, sea salt, ...
63 ! nphase_aer = number of aerosol phases
65 ! ai_phase = phase (p) index for interstitial (unactivated) aerosol particles
66 ! cw_phase = phase (p) index for aerosol particles in cloud water
67 ! ci_phase = phase (p) index for aerosol particles in cloud ice
68 ! rn_phase = phase (p) index for aerosol particles in rain
69 ! sn_phase = phase (p) index for aerosol particles in snow
70 ! gr_phase = phase (p) index for aerosol particles in graupel
71 ! [Note: the value of "xx_phase" will be between 1 and nphase_aer
72 ! for phases that are active in a simulation. The others
73 ! will have non-positive values.]
75 ! nsize_aer(t) = number of aerosol size bins for aerosol type t
77 ! ncomp_aer(t) = number of "regular" chemical components for aerosol type t
78 ! ncomp_plustracer_aer(t) = number of "regular" plus "tracer"
79 ! chemical components for aerosol type t
80 ! [Note: only "regular" components are used for calculating
81 ! aerosol physical (mass, volume) and chemical properties.
82 ! "Tracer" components are optional, and can be used to track source
83 ! regions, source mechanisms, etc.]
84 ! [Note: for aerosol type t, all phases have the same number of size
85 ! bins, and all size bins have the same number of
86 ! both regular and tracer components.]
88 ! ntot_mastercomp_aer = number of aerosol chemical components defined
89 ! in the "master component list".
90 ! [Note: each aerosol type will use some but not necessarily all
91 ! of the components in the "master component list".]
93 ! mastercompptr_aer(c,t) = the position/index/i.d. in the
94 ! "master component list" for chemical component c of aerosol type t.
95 ! (1=sulfate, others to be defined by user.)
97 ! massptr_aer(c,s,t,p) = the position/index in the chem array for mixing-
98 ! ratio for chemical component c, size bin s, type t, and phase p.
100 ! lptr_so4_aer(s,t,p) = the position/index in the chem array for mixing-
101 ! ratio for sulfate for aerosol size bin s, type t, and phase p
102 ! (similar lptr's are defined for no3, cl, msa, co3,
103 ! nh4, na, ca, oin, oc, bc, ...)
104 ! [Note: the massptr_aer allow you to loop over all species of
105 ! an aerosol type. The lptr_so4_aer, etc., allow you to access
106 ! a specific chemical component.]
108 ! waterptr_aer(s,t) = the position/index in the chem array for mixing-
109 ! ratio of aerosol water content for size bin s, type t.
110 ! [Note: water content is only carried for the interstitial aerosol
111 ! phase, so there is no p dimension.]
113 ! hyswptr_aer(s,t) = the position/index in the chem array for mixing-
114 ! ratio of aerosol "hysteresis water" content for size bin s, type t.
115 ! This is used to determine if aerosol is in the dry or wet state, when
116 ! the ambient RH is between the crystallization and deliquescence RH.
117 ! [Note: hysteresis water content is only carried for the
118 ! interstitial aerosol phase, so there is no p dimension.]
120 ! numptr_aer(s,t,p) = the position/index in the chem array for mixing-
121 ! ratio of particle number for size bin s, type t, and phase p.
123 ! mprognum_aer(s,t,p) - if positive, number mixing-ratio for size s, type t,
124 ! and phase p will be prognosed. Otherwise, it is diagnosed using
125 ! mass mixing-ratio add assumed/prescribed size.
127 ! mixing ratio (moles-water/mole-air) for water
128 ! associated with aerosol size bin s and type t
131 ! mastercompindx_so4_aer = the position/index in the
132 ! "master component list" for sulfate.
133 ! (similar lptr's are defined for no3, cl, msa, co3,
134 ! nh4, na, ca, oin, oc, bc, ...)
135 ! [Note: the mastercompindx_xxx_aer are used primarily in
136 ! initialization routines, and generally aren't needed elsewhere.]
138 !-----------------------------------------------------------------------
140 ! dens_mastercomp_aer(mc) = dry density (g/cm^3) of component mc
141 ! of the master component list.
142 ! dens_aer(c,t) = dry density (g/cm^3) of aerosol chemical component
144 ! [Note: dens_aer(c,t) == dens_mastercomp_aer(mastercompptr_aer(c,t))
145 ! The dens_mastercomp_aer is used in some initialization routines.
146 ! The dens_aer is used in most other places because of convenience.]
148 ! mw_mastercomp_aer(mc) = molecular weight (g/mole) of component mc
149 ! of the master component list.
150 ! mw_aer(c,t) = molecular weight (g/mole) of aerosol chemical component
152 ! [Note: mw_aer(c,t) == mw_mastercomp_aer(mastercompptr_aer(c,t)) ]
154 ! name_mastercomp_aer(mc) = name of component mc of the
155 ! master component list (e.g., "sulfate", "nitrate", ...).
156 ! name_aer(c,t) = molecular weight (g/mole) of aerosol chemical component
158 ! [Note: name_aer(c,t) == name_mastercomp_aer(mastercompptr_aer(c,t)) ]
160 ! hygro_mastercomp_aer(mc) = bulk hygroscopicity (--) at dilute conditions
161 ! (RH near 100%) of component mc of the master component list.
162 ! hygro_aer(c,t) = bulk hygroscopicity (--) at dilute conditions
163 ! (RH near 100%) of aerosol chemical component c of type t
164 ! [For definition of bulk hygroscopicity,
165 ! see Abdul-Razzak and Ghan, 2004, J Geophys Res, V105, p. 6837-6844.]
166 ! [Note: hygro_aer(c,t) == hygro_mastercomp_aer(mastercompptr_aer(c,t)) ]
168 !-----------------------------------------------------------------------
170 ! volumlo_sect(s,t) = 1-particle volume (cm^3) at lower boundary of section m
171 ! volumhi_sect(s,t) = 1-particle volume (cm^3) at upper boundary of section m
172 ! volumcen_sect(s,t)= 1-particle volume (cm^3) at "center" of section m
174 ! dlo_sect(s,t) = 1-particle diameter (cm) at lower boundary of section m
175 ! dhi_sect(s,t) = 1-particle diameter (cm) at upper boundary of section m
176 ! dcen_sect(s,t) = 1-particle diameter (cm) at "center" section m
178 ! [Note: the "center" values are defined as follows:
179 ! volumcen_sect == 0.5*(volumlo_sect + volumhi_sect)
180 ! == (pi/6) * (dcen_sect**3) ]
182 !-----------------------------------------------------------------------
184 ! msectional - if positive, each aerosol size bin is a section.
185 ! if equals 10, use jacobson moving center
186 ! if equals 20, use tzivion mass-number advection
187 ! if zero/negative, each size bin is a mode (aitken, accumulation, ...)
189 ! maerosolincw - if positive, both unactivated/interstitial and activated
190 ! aerosol species are simulated. if zero/negative, only the
191 ! unactivated are simulated. [maerosolincw>0 only when cw_phase>0]
193 ! maerocoag - if positive, aerosol coagulation is done.
194 ! If zero/negative, it is skipped.
195 ! (This is not yet implemented in WRF-Chem.)
197 ! maerchem - if positive, aerosol gas-particle condensation/evaporation
198 ! of inorganic species is done. If zero/negative, it is skipped.
199 ! (This is not yet implemented in WRF-Chem.)
201 ! maerchem_boxtest_output - if positive, "boxtest" output is done from
202 ! the aerchemistry routine. If zero/negative, it is skipped.
203 ! (This is not yet implemented in WRF-Chem.)
205 ! maeroptical - if positive, aerosol optical properties are calculated.
206 ! If zero/negative, it is skipped.
207 ! (This is not yet implemented in WRF-Chem.)
209 !-----------------------------------------------------------------------
211 integer, parameter :: maxd_atype = ntot_amode
212 integer, parameter :: maxd_asize = 1
213 integer, parameter :: maxd_acomp = maxd_aspectype
214 integer, parameter :: maxd_aphase = 2
216 integer, save :: ai_phase = 1
217 integer, save :: cw_phase = 2
218 integer, save :: ci_phase = -999888777
219 integer, save :: rn_phase = -999888777
220 integer, save :: sn_phase = -999888777
221 integer, save :: gr_phase = -999888777
223 integer, save :: ntype_aer = 0 ! number of types
224 integer, save :: ntot_mastercomp_aer = 0 ! number of master components
225 integer, save :: nphase_aer = 0 ! number of phases
228 nsize_aer( maxd_atype ), & ! number of size bins
229 ncomp_aer( maxd_atype ), & ! number of chemical components
230 ncomp_plustracer_aer( maxd_atype ), &
231 mastercompptr_aer(maxd_acomp, maxd_atype), & ! mastercomp index
232 massptr_aer( maxd_acomp, maxd_asize, maxd_atype, maxd_aphase ), &
233 ! index for mixing ratio
234 waterptr_aer( maxd_asize, maxd_atype ), & ! index for aerosol water
235 hyswptr_aer( maxd_asize, maxd_atype ), &
236 numptr_aer( maxd_asize, maxd_atype, maxd_aphase ), &
237 ! index for the number mixing ratio
238 mprognum_aer(maxd_asize,maxd_atype,maxd_aphase)
241 ! these indices give the location in the "mastercomp list" of
242 ! the different aerosol chemical (or tracer) components
243 integer, save :: mastercompindx_so4_aer = -999888777
244 integer, save :: mastercompindx_nh4_aer = -999888777
245 integer, save :: mastercompindx_no3_aer = -999888777
246 integer, save :: mastercompindx_pom_aer = -999888777
247 integer, save :: mastercompindx_soa_aer = -999888777
248 integer, save :: mastercompindx_bc_aer = -999888777
249 integer, save :: mastercompindx_dust_aer = -999888777
250 integer, save :: mastercompindx_seas_aer = -999888777
254 dens_aer( maxd_acomp, maxd_atype ), &
255 dens_mastercomp_aer( maxd_acomp ), &
256 mw_mastercomp_aer( maxd_acomp ), &
257 mw_aer( maxd_acomp, maxd_atype ), &
258 hygro_mastercomp_aer( maxd_acomp ), &
259 hygro_aer( maxd_acomp, maxd_atype )
262 volumcen_sect( maxd_asize, maxd_atype ), &
263 volumlo_sect( maxd_asize, maxd_atype ), &
264 volumhi_sect( maxd_asize, maxd_atype ), &
265 dcen_sect( maxd_asize, maxd_atype ), &
266 dlo_sect( maxd_asize, maxd_atype ), &
267 dhi_sect( maxd_asize, maxd_atype ), &
268 sigmag_aer(maxd_asize, maxd_atype)
270 character*10, save :: &
271 name_mastercomp_aer( maxd_acomp ), &
272 namebb_mastercomp_aer( maxd_acomp ), &
273 name_aer( maxd_acomp, maxd_atype )
276 lptr_so4_aer(maxd_asize, maxd_atype, maxd_aphase), &
277 lptr_nh4_aer(maxd_asize, maxd_atype, maxd_aphase), &
278 lptr_no3_aer(maxd_asize, maxd_atype, maxd_aphase), &
279 lptr_pom_aer(maxd_asize, maxd_atype, maxd_aphase), &
280 lptr_soa_aer(maxd_asize, maxd_atype, maxd_aphase), &
281 lptr_bc_aer(maxd_asize, maxd_atype, maxd_aphase), &
282 lptr_dust_aer(maxd_asize, maxd_atype, maxd_aphase), &
283 lptr_seas_aer(maxd_asize, maxd_atype, maxd_aphase)
285 ! rce 11-sep-2004 - eliminated all of the "..._wrfch" pointers
286 ! so now there is only one set of pointers ("..._amode")
287 ! sg/rce nov-2004 - totally new pointer system - "..._aer"
290 ! the mw_xxx_aer and dens_xxx_aer will be set from
291 ! the values in module_data_cam_mam_aero
292 ! molecular weights (g/mol)
294 mw_so4_aer, mw_nh4_aer, &
295 mw_no3_aer, mw_pom_aer, &
296 mw_soa_aer, mw_bc_aer, &
297 mw_dust_aer, mw_seas_aer
299 ! dry densities (g/cm3)
301 dens_so4_aer, dens_nh4_aer, &
302 dens_no3_aer, dens_pom_aer, &
303 dens_soa_aer, dens_bc_aer, &
304 dens_dust_aer, dens_seas_aer
306 ! water density (g/cm3)
307 ! real, parameter :: dens_water_asize = 1.0
308 real, parameter :: dens_water_aer = 1.0
312 msectional, maerosolincw, &
313 maerocoag, maerchem, maeroptical, maerchem_boxtest_output
316 integer, allocatable :: &
317 lptr_chem_to_q(:), lptr_chem_to_qqcw(:)
318 ! for chem array species l, the corresponding q array species is lptr_chem_to_q(l)
319 ! for chem array species l, the corresponding qqcw array species is lptr_chem_to_qqcw(l)
321 real, allocatable :: &
322 factconv_chem_to_q(:), factconv_chem_to_qqcw(:)
323 ! factor for converting chem array species l to corresponding q array species is factconv_chem_to_q(l)
324 ! factor for converting chem array species l to corresponding qqcw array species is factconv_chem_to_qqcw(l)
326 ! real(r8), allocatable :: &
327 real, allocatable :: &
328 mw_chem_array(:), mw_q_array(:), mw_q_mo_array(:)
329 ! mw_chem_array = molecular weights for species in wrf-chem chem array (g)
330 ! mw_q_array = molecular weights for species in cam q array (g)
331 ! mw_q_mo_array = molecular weights for species in chemistry portion of the cam q array (g)
332 ! (trace gas and aerosol species, but no water species)
333 ! *** note - for gases, value is 1.0 currently, unless the gas is really used by cam_mam routines
334 ! (e.g., mw for nox/noy and vocs are 1.0)
337 end module module_data_cam_mam_asect