I believe this was a bug, no idea how it was even working before
[WRF.git] / chem / module_mosaic_sumpm.F
blobc35cc0b9f9d6ed42a0676b6788573289137b8b1a
1 ! hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 with
2 ! the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE
3 ! CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
4 ! LIABILITY FOR THE USE OF THIS SOFTWARE.
6 ! Aerosol Option:  MOSAIC (Model for Simulating Aerosol Interactions &
7 ! Chemistry)
8 ! * Primary investigator: Rahul A. Zaveri
9 ! * Co-investigator: Richard C. Easter, William I. Gustafson Jr.
10 ! Last update: February 2009
12 ! Contacts:
13 ! Rahul A. Zaveri, PhD                    Jerome D. Fast, PhD
14 ! Senior Research Scientist               Staff Scientist
15 ! Pacific Northwest National Laboratory   Pacific Northwest National Laboratory
16 ! P.O. Box 999, MSIN K9-30                P.O. Box 999, MSIN K9-30
17 ! Richland, WA 99352                      Richland, WA, 99352
18 ! Phone: (509) 372-6159                   Phone: (509) 372-6116
19 ! Email: Rahul.Zaveri@pnl.gov             Email: Jerome.Fast@pnl.gov
21 ! Please report any bugs or problems to Rahul Zaveri, the primary author
22 ! of the code, or Jerome Fast, the WRF-chem implementation team leader
23 ! for PNNL.
25 ! Terms of Use:
26 !  1) Users are requested to consult the primary author prior to
27 !     modifying the MOSAIC code or incorporating it or its submodules in
28 !     another code. This is meant to ensure that the any linkages and/or
29 !     assumptions will not adversely affect the operation of MOSAIC.
30 !  2) The MOSAIC source code is intended for research and educational
31 !     purposes. Users are requested to contact the primary author
32 !     regarding the use of MOSAIC code for any commercial application.
33 !  3) Users preparing publications resulting from the usage of MOSAIC are
34 !     requested to cite one or more of the references below (depending on
35 !     the application) for proper acknowledgement.
37 ! References for MOSAIC (The first one is the primary MOSAIC reference):
38 ! * Zaveri R.A., R.C. Easter, J.D. Fast, and L.K. Peters (2008), Model
39 !   for Simulating Aerosol Interactions and Chemistry (MOSAIC), J.
40 !   Geophys. Res., 113, D13204, doi:10.1029/2007JD008782.
41 ! * Zaveri R.A., R.C. Easter, and A.S. Wexler (2005), A new method for
42 !   multi-component activity coefficients of electrolytes in aqueous
43 !   atmospheric aerosols, J. Geophys. Res., 110, D02201,
44 !   doi:10.1029/2004JD004681.
45 ! * Zaveri R.A., R.C. Easter, and L.K. Peters (2005), A computationally
46 !   efficient multicomponent equilibrium solver for aerosols (MESA), J.
47 !   Geophys. Res., 110, D24203, doi:24203, doi:10.1029/2004JD005618.
49 ! Reference for volatility basis set SOA code:
50 ! * Shrivastava, M., J. Fast, R. Easter, W. I. Gustafson Jr., R. A.
51 !   Zaveri, J. L. Jimenez, P. Saide, and A. Hodzic, 2010: Modeling
52 !   organic aerosols in a megacity: comparison of simple and complex
53 !   representations of the volatility basis set approach. Atmos. Chem.
54 !   Phys., in review.
56 ! Reference for the alternative SOA treatment that is less expensive to run 
57 ! and is used in the package  mozart_mosaic_4bin_vbs0
58 ! SOA is treated using a simplified approach for anthropogenic and biomass burning species based on Hodzic and Jimenez, GMD, 2011
59 ! Hodzic, A. and Jimenez, J. L.: Modeling anthropogenically controlled secondary organic aerosols in a megacity: 
60 ! a simplified framework for global and climate models, Geosci. Model Dev., 4, 901-917, doi:10.5194/gmd-4-901-2011, 2011.
62 ! References for implementation of the aerosol optical properties and
63 ! direct effect in WRF-Chem:
64 ! * Fast, J.D., W.I. Gustafson Jr., R.C. Easter, R.A. Zaveri, J.C.
65 !   Barnard, E.G. Chapman, G.A. Grell, and S.E. Peckham (2005), Evolution
66 !   of ozone, particulates, and aerosol direct radiative forcing in the
67 !   vicinity of Houston using a fully-coupled meteorology-chemistry-
68 !   aerosol model, J. Geophys. Res., 111, D21305,
69 !   doi:10.1029/2005JD006721.
70 ! * Barnard, J.C., J.D. Fast, G. Paredes-Miranda, W.P. Arnott, and
71 !   A. Laskin (2010), Technical note: evaluation of the WRF-Chem
72 !   "aerosol chemical to aerosol optical properties" module using data
73 !   from the MILAGRO campaign, Atmos. Chem. Phys., 10, 7325-7340,
74 !   doi:10.5194/acp-10-7325-2010.
76 ! References for implementation of the aerosol-cloud interactions and
77 ! indirect effects in WRF-Chem:
78 ! * Gustafson, W. I., E. G. Chapman, S. J. Ghan, R. C. Easter, and J. D.
79 !   Fast (2007), Impact on modeled cloud characteristics due to
80 !   simplified treatment of uniform cloud condensation nuclei during
81 !   NEAQS 2004, Geophys. Res. Lett., 34, L19809, L19809,
82 !   doi:10.1029/2007GL0300321.
83 ! * Chapman, E.G., W. I. Gustafson Jr., R. C. Easter, J. C. Barnard,
84 !   S. J. Ghan, M. S. Pekour, and J. D. Fast (2009): Coupling aerosol-
85 !   cloud-radiative processes in the WRF-Chem model: Investigating the
86 !   radiative impact of elevated point sources, Atmos. Chem. Phys., 9,
87 !   945-964, www.atmos-chem-phys.net/9/945/2009/.
89 ! Contact Jerome Fast for updates on the status of manuscripts under
90 ! review.
92 ! Additional information:
93 ! * www.pnl.gov/atmospheric/research/wrf-chem
95 ! Support: 
96 ! Funding for developing and evaluating MOSAIC was provided by the U.S.
97 ! Department of Energy under the auspices of Atmospheric Science Program
98 ! of the Office of Biological and Environmental Research, the NASA Earth
99 ! Sciences Enterprise under grant NAGW 3367, and PNNL Laboratory Directed
100 ! Research and Development program.
101 !************************************************************************
102         module module_mosaic_sumpm
106 !   *** NOTE - when the cw species are NOT in the registry, then
107 !   then the p_xxx_cwnn variables are not in module_state_description,
108 !   and the following cpp directive should be commented out
110 #define cw_species_are_in_registry
113         contains
116 !-----------------------------------------------------------------------
117    subroutine sum_pm_mosaic (                                          &
118          alt, chem,                                                    &
119          pm2_5_dry, pm2_5_water, pm2_5_dry_ec, pm10,                   &
120          ids,ide, jds,jde, kds,kde,                                    &
121          ims,ime, jms,jme, kms,kme,                                    &
122          its,ite, jts,jte, kts,kte                                     )
124    USE module_state_description, only: num_chem
125    USE module_data_mosaic_asect
126    IMPLICIT NONE
128    INTEGER,      INTENT(IN   )    ::                                   &
129                                       ids,ide, jds,jde, kds,kde,       &
130                                       ims,ime, jms,jme, kms,kme,       &
131                                       its,ite, jts,jte, kts,kte
133    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
134          INTENT(IN) :: alt
136    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
137          INTENT(IN ) :: chem
139    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
140          INTENT(OUT) :: pm2_5_dry,pm2_5_water,pm2_5_dry_ec,pm10
142    REAL :: mass
144    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
146    imax = min(ite,ide-1)
147    jmax = min(jte,jde-1)
148    kmax = kte
150 ! Sum over bins with center diameter < 2.5e-4 cm for pm2_5_dry,
151 ! pm2_5_dry_ec, and pm2_5_water. All bins go into pm10
153    pm2_5_dry(its:imax,kts:kmax,jts:jmax)    = 0.
154    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = 0.
155    pm2_5_water(its:imax,kts:kmax,jts:jmax)  = 0.
156    pm10(its:imax,kts:kmax,jts:jmax)         = 0.
158    do iphase=1,nphase_aer
159    do itype=1,ntype_aer
160    do n = 1, nsize_aer(itype)
161       if (dcen_sect(n,itype) .le. 2.5e-4) then
162          do j=jts,jmax
163             do k=kts,kmax
164                do i=its,imax
165                   mass = chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
166                        + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
167                        + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
168                        + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
169                        + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
170                        + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
171                        + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
172                        + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
173                        + chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
174                        + chem(i,k,j,lptr_pcg2_b_c_aer(n,itype,iphase)) &
175                        + chem(i,k,j,lptr_pcg3_b_c_aer(n,itype,iphase)) &
176                        + chem(i,k,j,lptr_pcg4_b_c_aer(n,itype,iphase)) &
177                        + chem(i,k,j,lptr_pcg5_b_c_aer(n,itype,iphase)) &
178                        + chem(i,k,j,lptr_pcg6_b_c_aer(n,itype,iphase)) &
179                        + chem(i,k,j,lptr_pcg7_b_c_aer(n,itype,iphase)) &
180                        + chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
181                        + chem(i,k,j,lptr_pcg2_b_o_aer(n,itype,iphase)) &
182                        + chem(i,k,j,lptr_pcg3_b_o_aer(n,itype,iphase)) &
183                        + chem(i,k,j,lptr_pcg4_b_o_aer(n,itype,iphase)) &
184                        + chem(i,k,j,lptr_pcg5_b_o_aer(n,itype,iphase)) &
185                        + chem(i,k,j,lptr_pcg6_b_o_aer(n,itype,iphase)) &
186                        + chem(i,k,j,lptr_pcg7_b_o_aer(n,itype,iphase)) &
187                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)) &
188                        + chem(i,k,j,lptr_opcg2_b_c_aer(n,itype,iphase)) &
189                        + chem(i,k,j,lptr_opcg3_b_c_aer(n,itype,iphase)) &
190                        + chem(i,k,j,lptr_opcg4_b_c_aer(n,itype,iphase)) &
191                        + chem(i,k,j,lptr_opcg5_b_c_aer(n,itype,iphase)) &
192                        + chem(i,k,j,lptr_opcg6_b_c_aer(n,itype,iphase)) &
193                        + chem(i,k,j,lptr_opcg7_b_c_aer(n,itype,iphase)) &
194                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)) &
195                        + chem(i,k,j,lptr_opcg2_b_o_aer(n,itype,iphase)) &
196                        + chem(i,k,j,lptr_opcg3_b_o_aer(n,itype,iphase)) &
197                        + chem(i,k,j,lptr_opcg4_b_o_aer(n,itype,iphase)) &
198                        + chem(i,k,j,lptr_opcg5_b_o_aer(n,itype,iphase)) &
199                        + chem(i,k,j,lptr_opcg6_b_o_aer(n,itype,iphase)) &
200                        + chem(i,k,j,lptr_opcg7_b_o_aer(n,itype,iphase)) &
201                        + chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
202                        + chem(i,k,j,lptr_pcg2_f_c_aer(n,itype,iphase)) &
203                        + chem(i,k,j,lptr_pcg3_f_c_aer(n,itype,iphase)) &
204                        + chem(i,k,j,lptr_pcg4_f_c_aer(n,itype,iphase)) &
205                        + chem(i,k,j,lptr_pcg5_f_c_aer(n,itype,iphase)) &
206                        + chem(i,k,j,lptr_pcg6_f_c_aer(n,itype,iphase)) &
207                        + chem(i,k,j,lptr_pcg7_f_c_aer(n,itype,iphase)) &
208                        + chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
209                        + chem(i,k,j,lptr_pcg2_f_o_aer(n,itype,iphase)) &
210                        + chem(i,k,j,lptr_pcg3_f_o_aer(n,itype,iphase)) &
211                        + chem(i,k,j,lptr_pcg4_f_o_aer(n,itype,iphase)) &
212                        + chem(i,k,j,lptr_pcg5_f_o_aer(n,itype,iphase)) &
213                        + chem(i,k,j,lptr_pcg6_f_o_aer(n,itype,iphase)) &
214                        + chem(i,k,j,lptr_pcg7_f_o_aer(n,itype,iphase)) &
215                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)) &
216                        + chem(i,k,j,lptr_opcg2_f_c_aer(n,itype,iphase)) &
217                        + chem(i,k,j,lptr_opcg3_f_c_aer(n,itype,iphase)) &
218                        + chem(i,k,j,lptr_opcg4_f_c_aer(n,itype,iphase)) &
219                        + chem(i,k,j,lptr_opcg5_f_c_aer(n,itype,iphase)) &
220                        + chem(i,k,j,lptr_opcg6_f_c_aer(n,itype,iphase)) &
221                        + chem(i,k,j,lptr_opcg7_f_c_aer(n,itype,iphase)) &
222                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)) &
223                        + chem(i,k,j,lptr_opcg2_f_o_aer(n,itype,iphase)) &
224                        + chem(i,k,j,lptr_opcg3_f_o_aer(n,itype,iphase)) &
225                        + chem(i,k,j,lptr_opcg4_f_o_aer(n,itype,iphase)) &
226                        + chem(i,k,j,lptr_opcg5_f_o_aer(n,itype,iphase)) &
227                        + chem(i,k,j,lptr_opcg6_f_o_aer(n,itype,iphase)) &
228                        + chem(i,k,j,lptr_opcg7_f_o_aer(n,itype,iphase)) &
229                        + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
230                        + chem(i,k,j,lptr_ant2_c_aer(n,itype,iphase))    &
231                        + chem(i,k,j,lptr_ant3_c_aer(n,itype,iphase))    &
232                        + chem(i,k,j,lptr_ant4_c_aer(n,itype,iphase))    &
233                        + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))    &
234                        + chem(i,k,j,lptr_ant2_o_aer(n,itype,iphase))    &
235                        + chem(i,k,j,lptr_ant3_o_aer(n,itype,iphase))    &
236                        + chem(i,k,j,lptr_ant4_o_aer(n,itype,iphase))    &
237                        + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
238                        + chem(i,k,j,lptr_biog2_c_aer(n,itype,iphase))    &
239                        + chem(i,k,j,lptr_biog3_c_aer(n,itype,iphase))    &
240                        + chem(i,k,j,lptr_biog4_c_aer(n,itype,iphase))    &
241                        + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))    &
242                        + chem(i,k,j,lptr_biog2_o_aer(n,itype,iphase))    &
243                        + chem(i,k,j,lptr_biog3_o_aer(n,itype,iphase))    &
244                        + chem(i,k,j,lptr_biog4_o_aer(n,itype,iphase))    
252                   pm2_5_dry(i,k,j) = pm2_5_dry(i,k,j) + mass
254                   pm2_5_dry_ec(i,k,j) = pm2_5_dry_ec(i,k,j)            &
255                                       + chem(i,k,j,lptr_bc_aer(n,itype,iphase))
257                   pm2_5_water(i,k,j) = pm2_5_water(i,k,j)              &
258                                      + chem(i,k,j,waterptr_aer(n,itype))
260                   pm10(i,k,j) = pm10(i,k,j) + mass
261                enddo
262             enddo
263          enddo
264       else
265          do j=jts,jmax
266             do k=kts,kmax
267                do i=its,imax
268                   pm10(i,k,j) = pm10(i,k,j)                              &
269                               + chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
270                               + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
271                               + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
272                               + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
273                               + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
274                               + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
275                               + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
276                               + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
277                        + chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
278                        + chem(i,k,j,lptr_pcg2_b_c_aer(n,itype,iphase)) &
279                        + chem(i,k,j,lptr_pcg3_b_c_aer(n,itype,iphase)) &
280                        + chem(i,k,j,lptr_pcg4_b_c_aer(n,itype,iphase)) &
281                        + chem(i,k,j,lptr_pcg5_b_c_aer(n,itype,iphase)) &
282                        + chem(i,k,j,lptr_pcg6_b_c_aer(n,itype,iphase)) &
283                        + chem(i,k,j,lptr_pcg7_b_c_aer(n,itype,iphase)) &
284                        + chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
285                        + chem(i,k,j,lptr_pcg2_b_o_aer(n,itype,iphase)) &
286                        + chem(i,k,j,lptr_pcg3_b_o_aer(n,itype,iphase)) &
287                        + chem(i,k,j,lptr_pcg4_b_o_aer(n,itype,iphase)) &
288                        + chem(i,k,j,lptr_pcg5_b_o_aer(n,itype,iphase)) &
289                        + chem(i,k,j,lptr_pcg6_b_o_aer(n,itype,iphase)) &
290                        + chem(i,k,j,lptr_pcg7_b_o_aer(n,itype,iphase)) &
291                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)) &
292                        + chem(i,k,j,lptr_opcg2_b_c_aer(n,itype,iphase)) &
293                        + chem(i,k,j,lptr_opcg3_b_c_aer(n,itype,iphase)) &
294                        + chem(i,k,j,lptr_opcg4_b_c_aer(n,itype,iphase)) &
295                        + chem(i,k,j,lptr_opcg5_b_c_aer(n,itype,iphase)) &
296                        + chem(i,k,j,lptr_opcg6_b_c_aer(n,itype,iphase)) &
297                        + chem(i,k,j,lptr_opcg7_b_c_aer(n,itype,iphase)) &
298                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)) &
299                        + chem(i,k,j,lptr_opcg2_b_o_aer(n,itype,iphase)) &
300                        + chem(i,k,j,lptr_opcg3_b_o_aer(n,itype,iphase)) &
301                        + chem(i,k,j,lptr_opcg4_b_o_aer(n,itype,iphase)) &
302                        + chem(i,k,j,lptr_opcg5_b_o_aer(n,itype,iphase)) &
303                        + chem(i,k,j,lptr_opcg6_b_o_aer(n,itype,iphase)) &
304                        + chem(i,k,j,lptr_opcg7_b_o_aer(n,itype,iphase)) &
305                        + chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
306                        + chem(i,k,j,lptr_pcg2_f_c_aer(n,itype,iphase)) &
307                        + chem(i,k,j,lptr_pcg3_f_c_aer(n,itype,iphase)) &
308                        + chem(i,k,j,lptr_pcg4_f_c_aer(n,itype,iphase)) &
309                        + chem(i,k,j,lptr_pcg5_f_c_aer(n,itype,iphase)) &
310                        + chem(i,k,j,lptr_pcg6_f_c_aer(n,itype,iphase)) &
311                        + chem(i,k,j,lptr_pcg7_f_c_aer(n,itype,iphase)) &
312                        + chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
313                        + chem(i,k,j,lptr_pcg2_f_o_aer(n,itype,iphase)) &
314                        + chem(i,k,j,lptr_pcg3_f_o_aer(n,itype,iphase)) &
315                        + chem(i,k,j,lptr_pcg4_f_o_aer(n,itype,iphase)) &
316                        + chem(i,k,j,lptr_pcg5_f_o_aer(n,itype,iphase)) &
317                        + chem(i,k,j,lptr_pcg6_f_o_aer(n,itype,iphase)) &
318                        + chem(i,k,j,lptr_pcg7_f_o_aer(n,itype,iphase)) &
319                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)) &
320                        + chem(i,k,j,lptr_opcg2_f_c_aer(n,itype,iphase)) &
321                        + chem(i,k,j,lptr_opcg3_f_c_aer(n,itype,iphase)) &
322                        + chem(i,k,j,lptr_opcg4_f_c_aer(n,itype,iphase)) &
323                        + chem(i,k,j,lptr_opcg5_f_c_aer(n,itype,iphase)) &
324                        + chem(i,k,j,lptr_opcg6_f_c_aer(n,itype,iphase)) &
325                        + chem(i,k,j,lptr_opcg7_f_c_aer(n,itype,iphase)) &
326                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)) &
327                        + chem(i,k,j,lptr_opcg2_f_o_aer(n,itype,iphase)) &
328                        + chem(i,k,j,lptr_opcg3_f_o_aer(n,itype,iphase)) &
329                        + chem(i,k,j,lptr_opcg4_f_o_aer(n,itype,iphase)) &
330                        + chem(i,k,j,lptr_opcg5_f_o_aer(n,itype,iphase)) &
331                        + chem(i,k,j,lptr_opcg6_f_o_aer(n,itype,iphase)) &
332                        + chem(i,k,j,lptr_opcg7_f_o_aer(n,itype,iphase)) &
333                        + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
334                        + chem(i,k,j,lptr_ant2_c_aer(n,itype,iphase))    &
335                        + chem(i,k,j,lptr_ant3_c_aer(n,itype,iphase))    &
336                        + chem(i,k,j,lptr_ant4_c_aer(n,itype,iphase))    &
337                        + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))    &
338                        + chem(i,k,j,lptr_ant2_o_aer(n,itype,iphase))    &
339                        + chem(i,k,j,lptr_ant3_o_aer(n,itype,iphase))    &
340                        + chem(i,k,j,lptr_ant4_o_aer(n,itype,iphase))    &
341                        + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
342                        + chem(i,k,j,lptr_biog2_c_aer(n,itype,iphase))    &
343                        + chem(i,k,j,lptr_biog3_c_aer(n,itype,iphase))    &
344                        + chem(i,k,j,lptr_biog4_c_aer(n,itype,iphase))    &
345                        + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))    &
346                        + chem(i,k,j,lptr_biog2_o_aer(n,itype,iphase))    &
347                        + chem(i,k,j,lptr_biog3_o_aer(n,itype,iphase))    &
348                        + chem(i,k,j,lptr_biog4_o_aer(n,itype,iphase))
352                enddo
353             enddo
354          enddo
355       endif
356    enddo ! size
357    enddo ! type
358    enddo ! phase
360    !Convert the units from mixing ratio to concentration (ug m^-3)
361    pm2_5_dry(its:imax,kts:kmax,jts:jmax) = pm2_5_dry(its:imax,kts:kmax,jts:jmax) &
362                                            / alt(its:imax,kts:kmax,jts:jmax)
363    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) &
364                                               / alt(its:imax,kts:kmax,jts:jmax)
365    pm2_5_water(its:imax,kts:kmax,jts:jmax) = pm2_5_water(its:imax,kts:kmax,jts:jmax) &
366                                              / alt(its:imax,kts:kmax,jts:jmax)
367    pm10(its:imax,kts:kmax,jts:jmax) = pm10(its:imax,kts:kmax,jts:jmax) &
368                                       / alt(its:imax,kts:kmax,jts:jmax)
370    end subroutine sum_pm_mosaic
373 !-----------------------------------------------------------------------
374 !-----------------------------------------------------------------------
375    subroutine sum_pm_mosaic_vbs2 (                                      &
376          alt, chem,                                                    &
377          pm2_5_dry, pm2_5_water, pm2_5_dry_ec, pm10,                   &
378          ids,ide, jds,jde, kds,kde,                                    &
379          ims,ime, jms,jme, kms,kme,                                    &
380          its,ite, jts,jte, kts,kte                                     )
382    USE module_state_description, only: num_chem
383    USE module_data_mosaic_asect
384    IMPLICIT NONE
386    INTEGER,      INTENT(IN   )    ::                                   &
387                                       ids,ide, jds,jde, kds,kde,       &
388                                       ims,ime, jms,jme, kms,kme,       &
389                                       its,ite, jts,jte, kts,kte
391    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
392          INTENT(IN) :: alt
394    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
395          INTENT(IN ) :: chem
397    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
398          INTENT(OUT) :: pm2_5_dry,pm2_5_water,pm2_5_dry_ec,pm10
400    REAL :: mass
402    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
404    imax = min(ite,ide-1)
405    jmax = min(jte,jde-1)
406    kmax = kte
408 ! Sum over bins with center diameter < 2.5e-4 cm for pm2_5_dry,
409 ! pm2_5_dry_ec, and pm2_5_water. All bins go into pm10
411    pm2_5_dry(its:imax,kts:kmax,jts:jmax)    = 0.
412    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = 0.
413    pm2_5_water(its:imax,kts:kmax,jts:jmax)  = 0.
414    pm10(its:imax,kts:kmax,jts:jmax)         = 0.
415    do iphase=1,nphase_aer
416    do itype=1,ntype_aer
417    do n = 1, nsize_aer(itype)
418       if (dcen_sect(n,itype) .le. 2.5e-4) then
419          do j=jts,jmax
420             do k=kts,kmax
421                do i=its,imax
422                   mass = chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
423                        + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
424                        + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
425                        + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
426                        + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
427                        + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
428                        + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
429                        + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
430                        + chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
431                        + chem(i,k,j,lptr_pcg2_b_c_aer(n,itype,iphase)) &
432                        + chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
433                        + chem(i,k,j,lptr_pcg2_b_o_aer(n,itype,iphase)) &
434                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)) &
435                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)) &
436                        + chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
437                        + chem(i,k,j,lptr_pcg2_f_c_aer(n,itype,iphase)) &
438                        + chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
439                        + chem(i,k,j,lptr_pcg2_f_o_aer(n,itype,iphase)) &
440                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)) &
441                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)) &
442                        + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
443                        + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))    &
444                        + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
445                        + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
448                   pm2_5_dry(i,k,j) = pm2_5_dry(i,k,j) + mass
450                   pm2_5_dry_ec(i,k,j) = pm2_5_dry_ec(i,k,j)            &
451                                       + chem(i,k,j,lptr_bc_aer(n,itype,iphase))
453                   pm2_5_water(i,k,j) = pm2_5_water(i,k,j)              &
454                                      + chem(i,k,j,waterptr_aer(n,itype))
456                   pm10(i,k,j) = pm10(i,k,j) + mass
457                enddo
458             enddo
459          enddo
460       else
461          do j=jts,jmax
462             do k=kts,kmax
463                do i=its,imax
464                   pm10(i,k,j) = pm10(i,k,j)                              &
465                               + chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
466                                                           + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
467                                                           + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
468                                                           + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
469                                                           + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
470                                                           + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
471                                                           + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
472                                                           + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
473                        + chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
474                        + chem(i,k,j,lptr_pcg2_b_c_aer(n,itype,iphase)) &
475                        + chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
476                        + chem(i,k,j,lptr_pcg2_b_o_aer(n,itype,iphase)) &
477                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)) &
478                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)) &
479                        + chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
480                        + chem(i,k,j,lptr_pcg2_f_c_aer(n,itype,iphase)) &
481                        + chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
482                        + chem(i,k,j,lptr_pcg2_f_o_aer(n,itype,iphase)) &
483                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)) &
484                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)) &
485                        + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
486                        + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))    &
487                        + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
488                        + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
492                enddo
493             enddo
494          enddo
495       endif
496    enddo ! size
497    enddo ! type
498    enddo ! phase
500    !Convert the units from mixing ratio to concentration (ug m^-3)
501    pm2_5_dry(its:imax,kts:kmax,jts:jmax) = pm2_5_dry(its:imax,kts:kmax,jts:jmax) &
502                                            / alt(its:imax,kts:kmax,jts:jmax)
503    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) &
504                                               / alt(its:imax,kts:kmax,jts:jmax)
505    pm2_5_water(its:imax,kts:kmax,jts:jmax) = pm2_5_water(its:imax,kts:kmax,jts:jmax) &
506                                              / alt(its:imax,kts:kmax,jts:jmax)
507    pm10(its:imax,kts:kmax,jts:jmax) = pm10(its:imax,kts:kmax,jts:jmax) &
508                                       / alt(its:imax,kts:kmax,jts:jmax)
510    end subroutine sum_pm_mosaic_vbs2
513 !-----------------------------------------------------------------------
514 !-----------------------------------------------------------------------
515    subroutine sum_pm_mosaic_vbs0 (                                      &
516          alt, chem,                                                    &
517          pm2_5_dry, pm2_5_water, pm2_5_dry_ec, pm10,                   &
518          ids,ide, jds,jde, kds,kde,                                    &
519          ims,ime, jms,jme, kms,kme,                                    &
520          its,ite, jts,jte, kts,kte                                     )
522    USE module_state_description, only: num_chem
523    USE module_data_mosaic_asect
524    IMPLICIT NONE
526    INTEGER,      INTENT(IN   )    ::                                   &
527                                       ids,ide, jds,jde, kds,kde,       &
528                                       ims,ime, jms,jme, kms,kme,       &
529                                       its,ite, jts,jte, kts,kte
531    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
532          INTENT(IN) :: alt
534    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
535          INTENT(IN ) :: chem
537    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
538          INTENT(OUT) :: pm2_5_dry,pm2_5_water,pm2_5_dry_ec,pm10
540    REAL :: mass
542    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
544    imax = min(ite,ide-1)
545    jmax = min(jte,jde-1)
546    kmax = kte
549 ! Sum over bins with center diameter < 2.5e-4 cm for pm2_5_dry,
550 ! pm2_5_dry_ec, and pm2_5_water. All bins go into pm10
552    pm2_5_dry(its:imax,kts:kmax,jts:jmax)    = 0.
553    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = 0.
554    pm2_5_water(its:imax,kts:kmax,jts:jmax)  = 0.
555    pm10(its:imax,kts:kmax,jts:jmax)         = 0.
556    do iphase=1,nphase_aer
557    do itype=1,ntype_aer
558    do n = 1, nsize_aer(itype)
559       if (dcen_sect(n,itype) .le. 2.5e-4) then
560          do j=jts,jmax
561             do k=kts,kmax
562                do i=its,imax
563                   mass = chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
564                        + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
565                        + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
566                        + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
567                        + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
568                        + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
569                        + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
570                        + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
571                        + chem(i,k,j,lptr_glysoa_sfc_aer(n,itype,iphase)) &
572                        + chem(i,k,j,lptr_smpa_aer(n,itype,iphase)) &
573                        + chem(i,k,j,lptr_smpbb_aer(n,itype,iphase)) &
574                        + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
575                        + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
577 ! SMPA and SMPBB do not participate to pm2.5 mass
579                   pm2_5_dry(i,k,j) = pm2_5_dry(i,k,j) + mass
581                   pm2_5_dry_ec(i,k,j) = pm2_5_dry_ec(i,k,j)            &
582                                       + chem(i,k,j,lptr_bc_aer(n,itype,iphase))
584                   pm2_5_water(i,k,j) = pm2_5_water(i,k,j)              &
585                                      + chem(i,k,j,waterptr_aer(n,itype))
587                   pm10(i,k,j) = pm10(i,k,j) + mass
588                enddo
589             enddo
590          enddo
591       else
592          do j=jts,jmax
593             do k=kts,kmax
594                do i=its,imax
595                   pm10(i,k,j) = pm10(i,k,j)                              &
596                               + chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
597                                                           + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
598                                                           + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
599                                                           + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
600                                                           + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
601                                                           + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
602                                                           + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
603                                                           + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
604                        + chem(i,k,j,lptr_glysoa_sfc_aer(n,itype,iphase)) &
605                        + chem(i,k,j,lptr_smpa_aer(n,itype,iphase)) &
606                        + chem(i,k,j,lptr_smpbb_aer(n,itype,iphase)) &
607                        + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
608                        + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
610 ! SMPA and SMPBB do not participate to pm10 mass
612                enddo
613             enddo
614          enddo
615       endif
616    enddo ! size
617    enddo ! type
618    enddo ! phase
620    !Convert the units from mixing ratio to concentration (ug m^-3)
621    pm2_5_dry(its:imax,kts:kmax,jts:jmax) = pm2_5_dry(its:imax,kts:kmax,jts:jmax) &
622                                            / alt(its:imax,kts:kmax,jts:jmax)
623    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) &
624                                               / alt(its:imax,kts:kmax,jts:jmax)
625    pm2_5_water(its:imax,kts:kmax,jts:jmax) = pm2_5_water(its:imax,kts:kmax,jts:jmax) &
626                                              / alt(its:imax,kts:kmax,jts:jmax)
627    pm10(its:imax,kts:kmax,jts:jmax) = pm10(its:imax,kts:kmax,jts:jmax) &
628                                       / alt(its:imax,kts:kmax,jts:jmax)
630    end subroutine sum_pm_mosaic_vbs0
634 !-----------------------------------------------------------------------
635 !-----------------------------------------------------------------------
636    subroutine sum_pm_mosaic_vbs4 (                                      &
637          alt, chem,                                                    &
638          pm2_5_dry, pm2_5_water, pm2_5_dry_ec, pm10,                   &
639          ids,ide, jds,jde, kds,kde,                                    &
640          ims,ime, jms,jme, kms,kme,                                    &
641          its,ite, jts,jte, kts,kte                                     )
643    USE module_state_description, only: num_chem
644    USE module_data_mosaic_asect
645    IMPLICIT NONE
647    INTEGER,      INTENT(IN   )    ::                                   &
648                                       ids,ide, jds,jde, kds,kde,       &
649                                       ims,ime, jms,jme, kms,kme,       &
650                                       its,ite, jts,jte, kts,kte
652    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
653          INTENT(IN) :: alt
655    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
656          INTENT(IN ) :: chem
658    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
659          INTENT(OUT) :: pm2_5_dry,pm2_5_water,pm2_5_dry_ec,pm10
661    REAL :: mass
663    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
665    imax = min(ite,ide-1)
666    jmax = min(jte,jde-1)
667    kmax = kte
670 ! Sum over bins with center diameter < 2.5e-4 cm for pm2_5_dry,
671 ! pm2_5_dry_ec, and pm2_5_water. All bins go into pm10
673    pm2_5_dry(its:imax,kts:kmax,jts:jmax)    = 0.
674    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = 0.
675    pm2_5_water(its:imax,kts:kmax,jts:jmax)  = 0.
676    pm10(its:imax,kts:kmax,jts:jmax)         = 0.
677    do iphase=1,nphase_aer
678    do itype=1,ntype_aer
679    do n = 1, nsize_aer(itype)
680       if (dcen_sect(n,itype) .le. 2.5e-4) then
681          do j=jts,jmax
682             do k=kts,kmax
683                do i=its,imax
684                   mass = chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
685                        + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
686                        + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
687                        + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
688                        + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
689                        + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
690                        + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
691                        + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
692                        + chem(i,k,j,lptr_glysoa_r1_aer(n,itype,iphase)) &
693                        + chem(i,k,j,lptr_glysoa_r2_aer(n,itype,iphase)) &
694                        + chem(i,k,j,lptr_glysoa_oh_aer(n,itype,iphase)) &
695                        + chem(i,k,j,lptr_glysoa_sfc_aer(n,itype,iphase)) &
696                        + chem(i,k,j,lptr_glysoa_nh4_aer(n,itype,iphase)) &
697                        + chem(i,k,j,lptr_asoaX_aer(n,itype,iphase)) &
698                        + chem(i,k,j,lptr_asoa1_aer(n,itype,iphase)) &
699                        + chem(i,k,j,lptr_asoa2_aer(n,itype,iphase)) &
700                        + chem(i,k,j,lptr_asoa3_aer(n,itype,iphase)) &
701                        + chem(i,k,j,lptr_asoa4_aer(n,itype,iphase)) &
702                        + chem(i,k,j,lptr_bsoaX_aer(n,itype,iphase)) &
703                        + chem(i,k,j,lptr_bsoa1_aer(n,itype,iphase)) &
704                        + chem(i,k,j,lptr_bsoa2_aer(n,itype,iphase)) &
705                        + chem(i,k,j,lptr_bsoa3_aer(n,itype,iphase)) &
706                        + chem(i,k,j,lptr_bsoa4_aer(n,itype,iphase))
708 ! SMPA and SMPBB do not participate to pm2.5 mass
710                   pm2_5_dry(i,k,j) = pm2_5_dry(i,k,j) + mass
712                   pm2_5_dry_ec(i,k,j) = pm2_5_dry_ec(i,k,j)            &
713                                       + chem(i,k,j,lptr_bc_aer(n,itype,iphase))
715                   pm2_5_water(i,k,j) = pm2_5_water(i,k,j)              &
716                                      + chem(i,k,j,waterptr_aer(n,itype))
718                   pm10(i,k,j) = pm10(i,k,j) + mass
719                enddo
720             enddo
721          enddo
722       else
723          do j=jts,jmax
724             do k=kts,kmax
725                do i=its,imax
726                   pm10(i,k,j) = pm10(i,k,j)                              &
727                               + chem(i,k,j,lptr_so4_aer(n,itype,iphase)) &
728                                                           + chem(i,k,j,lptr_no3_aer(n,itype,iphase)) &
729                                                           + chem(i,k,j,lptr_cl_aer(n,itype,iphase))  &
730                                                           + chem(i,k,j,lptr_nh4_aer(n,itype,iphase)) &
731                                                           + chem(i,k,j,lptr_na_aer(n,itype,iphase))  &
732                                                           + chem(i,k,j,lptr_oin_aer(n,itype,iphase)) &
733                                                           + chem(i,k,j,lptr_oc_aer(n,itype,iphase))  &
734                                                           + chem(i,k,j,lptr_bc_aer(n,itype,iphase))  &
735                        + chem(i,k,j,lptr_glysoa_r1_aer(n,itype,iphase)) &
736                        + chem(i,k,j,lptr_glysoa_r2_aer(n,itype,iphase)) &
737                        + chem(i,k,j,lptr_glysoa_sfc_aer(n,itype,iphase)) &
738                        + chem(i,k,j,lptr_glysoa_oh_aer(n,itype,iphase)) &
739                        + chem(i,k,j,lptr_glysoa_nh4_aer(n,itype,iphase)) &
740                        + chem(i,k,j,lptr_asoaX_aer(n,itype,iphase)) &
741                        + chem(i,k,j,lptr_asoa1_aer(n,itype,iphase)) &
742                        + chem(i,k,j,lptr_asoa2_aer(n,itype,iphase)) &
743                        + chem(i,k,j,lptr_asoa3_aer(n,itype,iphase)) &
744                        + chem(i,k,j,lptr_asoa4_aer(n,itype,iphase)) &
745                        + chem(i,k,j,lptr_bsoaX_aer(n,itype,iphase)) &
746                        + chem(i,k,j,lptr_bsoa1_aer(n,itype,iphase)) &
747                        + chem(i,k,j,lptr_bsoa2_aer(n,itype,iphase)) &
748                        + chem(i,k,j,lptr_bsoa3_aer(n,itype,iphase)) &
749                        + chem(i,k,j,lptr_bsoa4_aer(n,itype,iphase))
751 ! SMPA and SMPBB do not participate to pm10 mass
753                enddo
754             enddo
755          enddo
756       endif
757    enddo ! size
758    enddo ! type
759    enddo ! phase
761    !Convert the units from mixing ratio to concentration (ug m^-3)
762    pm2_5_dry(its:imax,kts:kmax,jts:jmax) = pm2_5_dry(its:imax,kts:kmax,jts:jmax) &
763                                            / alt(its:imax,kts:kmax,jts:jmax)
764    pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) = pm2_5_dry_ec(its:imax,kts:kmax,jts:jmax) &
765                                               / alt(its:imax,kts:kmax,jts:jmax)
766    pm2_5_water(its:imax,kts:kmax,jts:jmax) = pm2_5_water(its:imax,kts:kmax,jts:jmax) &
767                                              / alt(its:imax,kts:kmax,jts:jmax)
768    pm10(its:imax,kts:kmax,jts:jmax) = pm10(its:imax,kts:kmax,jts:jmax) &
769                                       / alt(its:imax,kts:kmax,jts:jmax)
771    end subroutine sum_pm_mosaic_vbs4
774 !-----------------------------------------------------------------------
777        subroutine  sum_vbs0 ( aero_diag_opt,                           &
778              alt, chem,                                                &
779              hoa_a01,hoa_a02,hoa_a03,hoa_a04,                          &
780              bboa_a01,bboa_a02,bboa_a03,bboa_a04,                      &
781              soa_a01,soa_a02,soa_a03,soa_a04,                          &
782              bbsoa_a01,bbsoa_a02,bbsoa_a03,bbsoa_a04,                  &
783              biog_a01,biog_a02,biog_a03,biog_a04,                      &
784              asmpsoa_a01,asmpsoa_a02,asmpsoa_a03,asmpsoa_a04,                      &
785              arosoa_a01,arosoa_a02,arosoa_a03,arosoa_a04,              &
786              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
787              biog_v1,biog_v2,biog_v3,biog_v4,                          &
788              ant_v1,ant_v2,ant_v3,ant_v4,                              &
789              smpa_v1,smpbb_v1,                              &
790              ids,ide, jds,jde, kds,kde,                                &
791              ims,ime, jms,jme, kms,kme,                                &
792              its,ite, jts,jte, kts,kte                                  )
794    USE module_state_description, only: num_chem
795    USE module_data_mosaic_asect
796    IMPLICIT NONE
798    INTEGER,      INTENT(IN   )    ::  aero_diag_opt
799    INTEGER,      INTENT(IN   )    ::                                   &
800                                       ids,ide, jds,jde, kds,kde,       &
801                                       ims,ime, jms,jme, kms,kme,       &
802                                       its,ite, jts,jte, kts,kte
804    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
805          INTENT(IN) :: alt
807    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
808          INTENT(IN ) :: chem
809    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
810          INTENT(OUT) :: hoa_a01,hoa_a02,hoa_a03,hoa_a04,               &
811              bboa_a01,bboa_a02,bboa_a03,bboa_a04,                      &
812              soa_a01,soa_a02,soa_a03,soa_a04,                          &
813              bbsoa_a01,bbsoa_a02,bbsoa_a03,bbsoa_a04,                  &
814              biog_a01,biog_a02,biog_a03,biog_a04,                      &
815              asmpsoa_a01,asmpsoa_a02,asmpsoa_a03,asmpsoa_a04,                      &
816              arosoa_a01,arosoa_a02,arosoa_a03,arosoa_a04,                      &
817              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
818              biog_v1,biog_v2,biog_v3,biog_v4,                          &
819              ant_v1,ant_v2,ant_v3,ant_v4,smpa_v1,smpbb_v1
823    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
825    imax = min(ite,ide-1)
826    jmax = min(jte,jde-1)
827    kmax = kte
829     totoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
830     totoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
831     totoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
832     totoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
834    if( aero_diag_opt > 0 ) then
835     hoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
836     soa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
837     bboa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
838     bbsoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
839     biog_a01(its:imax,kts:kmax,jts:jmax)    = 0.
840     asmpsoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
841     arosoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
843     hoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
844     soa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
845     bboa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
846     bbsoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
847     asmpsoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
848     arosoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
849     biog_a02(its:imax,kts:kmax,jts:jmax)    = 0.
851     hoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
852     soa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
853     bboa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
854     bbsoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
855     asmpsoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
856     arosoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
857     biog_a03(its:imax,kts:kmax,jts:jmax)    = 0.
859     hoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
860     soa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
861     bboa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
862     bbsoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
863     asmpsoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
864     arosoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
865     biog_a04(its:imax,kts:kmax,jts:jmax)    = 0.
867 ! Species to calculate O:C ratios
868      biog_v1(its:imax,kts:kmax,jts:jmax)    = 0.
869      biog_v2(its:imax,kts:kmax,jts:jmax)    = 0.
870      biog_v3(its:imax,kts:kmax,jts:jmax)    = 0.
871      biog_v4(its:imax,kts:kmax,jts:jmax)    = 0.
872      smpa_v1(its:imax,kts:kmax,jts:jmax)    = 0.
873      smpbb_v1(its:imax,kts:kmax,jts:jmax)    = 0.
874      ant_v1(its:imax,kts:kmax,jts:jmax)    = 0.
875      ant_v2(its:imax,kts:kmax,jts:jmax)    = 0.
876      ant_v3(its:imax,kts:kmax,jts:jmax)    = 0.
877      ant_v4(its:imax,kts:kmax,jts:jmax)    = 0.
878    endif
882    do iphase=1,nphase_aer
883       do itype=1,ntype_aer
884          do j=jts,jmax
885             do k=kts,kmax
886                do i=its,imax
887                  totoa_a01(i,k,j)= totoa_a01(i,k,j) &
888                        + chem(i,k,j,lptr_smpa_aer(1,itype,iphase)) &
889                        + chem(i,k,j,lptr_smpbb_aer(1,itype,iphase)) &
890                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
891                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))    &
892                        + chem(i,k,j,lptr_glysoa_sfc_aer(1,itype,iphase)) &
893                        + chem(i,k,j,lptr_oc_aer(1,itype,iphase))
894                  totoa_a02(i,k,j)= totoa_a02(i,k,j) &
895                         + chem(i,k,j,lptr_oc_aer(2,itype,iphase)) &
896                         + chem(i,k,j,lptr_glysoa_sfc_aer(2,itype,iphase))    &
897                         + chem(i,k,j,lptr_smpa_aer(2,itype,iphase))    &
898                         + chem(i,k,j,lptr_smpbb_aer(2,itype,iphase))    &
899                         + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
900                         + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))
901                  totoa_a03(i,k,j)= totoa_a03(i,k,j)  &
902                        + chem(i,k,j,lptr_smpa_aer(3,itype,iphase))    &
903                        + chem(i,k,j,lptr_smpbb_aer(3,itype,iphase))    &
904                        + chem(i,k,j,lptr_glysoa_sfc_aer(3,itype,iphase)) &
905                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
906                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))    &
907                        + chem(i,k,j,lptr_oc_aer(3,itype,iphase))
908                  totoa_a04(i,k,j)= totoa_a04(i,k,j) &
909                        + chem(i,k,j,lptr_smpa_aer(4,itype,iphase))    &
910                        + chem(i,k,j,lptr_smpbb_aer(4,itype,iphase))    &
911                        + chem(i,k,j,lptr_glysoa_sfc_aer(4,itype,iphase)) &
912                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
913                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))    &
914                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase))
915                enddo
916             enddo
917          enddo
918       enddo ! type
919    enddo ! phase
921    if( aero_diag_opt > 0 ) then
922    do iphase=1,nphase_aer
923    do itype=1,ntype_aer
924    do n = 1, nsize_aer(itype) !The 4th bin is 2.5-10um and outside the AMS measurements
925          do j=jts,jmax
926             do k=kts,kmax
927                do i=its,imax
929         biog_v1(i,k,j)= biog_v1(i,k,j) &
930                          + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
931                          + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
933         ant_v1(i,k,j)=  ant_v1(i,k,j) &
934                          + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
935                          + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))
937         smpa_v1(i,k,j)=  smpa_v1(i,k,j) &
938                          + chem(i,k,j,lptr_smpa_aer(n,itype,iphase))
939         smpbb_v1(i,k,j)=  smpbb_v1(i,k,j) &
940                          + chem(i,k,j,lptr_smpbb_aer(n,itype,iphase))
942                  enddo
943                enddo
944              enddo
945                     enddo
946                   enddo
947                enddo
949       biog_v1(its:imax,kts:kmax,jts:jmax) = biog_v1(its:imax,kts:kmax,jts:jmax) &
950                                            / alt(its:imax,kts:kmax,jts:jmax)
951       ant_v1(its:imax,kts:kmax,jts:jmax) = ant_v1(its:imax,kts:kmax,jts:jmax) &
952                                            / alt(its:imax,kts:kmax,jts:jmax)
953       smpa_v1(its:imax,kts:kmax,jts:jmax) = smpa_v1(its:imax,kts:kmax,jts:jmax) &
954                                            / alt(its:imax,kts:kmax,jts:jmax)
955       smpbb_v1(its:imax,kts:kmax,jts:jmax) = smpbb_v1(its:imax,kts:kmax,jts:jmax) &
956                                            / alt(its:imax,kts:kmax,jts:jmax)
959    do iphase=1,nphase_aer
960    do itype=1,ntype_aer
961          do j=jts,jmax
962             do k=kts,kmax
963                do i=its,imax
964 ! missing summation! (hoa = hoa + x ...)
965 !        hoa_a01(i,k,j)= chem(i,k,j,lptr_oc_aer(1,itype,iphase))
968 !        soa_a01(i,k,j)= (chem(i,k,j,lptr_smpa_aer(1,itype,iphase)) &
969 !                       + chem(i,k,j,lptr_smpbb_aer(1,itype,iphase)) &
970 !                       + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
971 !                       + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase)))
974 !        bbsoa_a01(i,k,j)= chem(i,k,j,lptr_smpbb_aer(1,itype,iphase))
977 !        biog_a01(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
978 !                       + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase)))
980 !        asmpsoa_a01(i,k,j)= chem(i,k,j,lptr_smpa_aer(1,itype,iphase))
982 !        totoa_a01(i,k,j)= (  &
983 !                       + chem(i,k,j,lptr_smpa_aer(1,itype,iphase)) &
984 !                       + chem(i,k,j,lptr_smpbb_aer(1,itype,iphase)) &
985 !                       + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
986 !                      + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))    &
987 !                       + chem(i,k,j,lptr_oc_aer(1,itype,iphase)))
989         hoa_a01(i,k,j)= hoa_a01(i,k,j) &
990                        + chem(i,k,j,lptr_oc_aer(1,itype,iphase))
993         soa_a01(i,k,j)= soa_a01(i,k,j) &
994                        + chem(i,k,j,lptr_smpa_aer(1,itype,iphase)) &
995                        + chem(i,k,j,lptr_smpbb_aer(1,itype,iphase)) &
996                        + chem(i,k,j,lptr_glysoa_sfc_aer(1,itype,iphase)) &
997                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
998                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))
1001         bbsoa_a01(i,k,j)= bbsoa_a01(i,k,j) &
1002                        + chem(i,k,j,lptr_smpbb_aer(1,itype,iphase))
1005         biog_a01(i,k,j)= biog_a01(i,k,j) &
1006                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
1007                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))
1009         asmpsoa_a01(i,k,j)= asmpsoa_a01(i,k,j) &
1010                        + chem(i,k,j,lptr_smpa_aer(1,itype,iphase))
1012                enddo
1013             enddo
1014          enddo
1015    enddo ! type
1016    enddo ! phase
1018    do iphase=1,nphase_aer
1019    do itype=1,ntype_aer
1020          do j=jts,jmax
1021             do k=kts,kmax
1022                do i=its,imax
1023 ! missing summation! (hoa = hoa + x ...)
1024 !          hoa_a02(i,k,j)= (chem(i,k,j,lptr_oc_aer(2,itype,iphase)))
1027 !          soa_a02(i,k,j)= (chem(i,k,j,lptr_smpa_aer(2,itype,iphase)) &
1028 !                       + chem(i,k,j,lptr_smpbb_aer(2,itype,iphase)) &
1029 !                       + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1030 !                       + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase)))
1033 !          bbsoa_a02(i,k,j)= (chem(i,k,j,lptr_smpbb_aer(2,itype,iphase)))
1036 !          biog_a02(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1037 !                         + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase)))
1040 !          asmpsoa_a02(i,k,j)= chem(i,k,j,lptr_smpa_aer(2,itype,iphase))
1042 !          totoa_a02(i,k,j)= ( chem(i,k,j,lptr_oc_aer(2,itype,iphase)) &
1043 !                        + chem(i,k,j,lptr_smpa_aer(2,itype,iphase))    &
1044 !                        + chem(i,k,j,lptr_smpbb_aer(2,itype,iphase))    &
1045 !                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1046 !                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase)))
1047           hoa_a02(i,k,j)= hoa_a02(i,k,j) &
1048                        + chem(i,k,j,lptr_oc_aer(2,itype,iphase))
1051           soa_a02(i,k,j)= soa_a02(i,k,j) &
1052                        + chem(i,k,j,lptr_smpa_aer(2,itype,iphase)) &
1053                        + chem(i,k,j,lptr_smpbb_aer(2,itype,iphase)) &
1054                        + chem(i,k,j,lptr_glysoa_sfc_aer(2,itype,iphase)) &
1055                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1056                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))
1059           bbsoa_a02(i,k,j)= bbsoa_a02(i,k,j) &
1060                        + chem(i,k,j,lptr_smpbb_aer(2,itype,iphase))
1063           biog_a02(i,k,j)= biog_a02(i,k,j) &
1064                         + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase)) &
1065                         + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))
1068           asmpsoa_a02(i,k,j)= asmpsoa_a02(i,k,j) &
1069                         + chem(i,k,j,lptr_smpa_aer(2,itype,iphase))
1071                enddo
1072             enddo
1073          enddo
1074    enddo ! type
1075    enddo ! phase
1077    do iphase=1,nphase_aer
1078    do itype=1,ntype_aer
1079          do j=jts,jmax
1080             do k=kts,kmax
1081                do i=its,imax
1082 ! missing summation! (hoa = hoa + x ...)
1083 !          hoa_a03(i,k,j)= (chem(i,k,j,lptr_oc_aer(3,itype,iphase)))
1085 !          soa_a03(i,k,j)= (chem(i,k,j,lptr_smpa_aer(3,itype,iphase)) &
1086 !                       + chem(i,k,j,lptr_smpbb_aer(3,itype,iphase)) &
1087 !                       + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1088 !                       + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase)))
1091 !          bbsoa_a03(i,k,j)= (chem(i,k,j,lptr_smpbb_aer(3,itype,iphase)))
1093 !          biog_a03(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1094 !                         + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase)))
1096 !          asmpsoa_a03(i,k,j)= chem(i,k,j,lptr_smpa_aer(3,itype,iphase))
1099 !          totoa_a03(i,k,j)= ( &
1100 !                       + chem(i,k,j,lptr_smpa_aer(3,itype,iphase))    &
1101 !                       + chem(i,k,j,lptr_smpbb_aer(3,itype,iphase))    &
1102 !                       + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1103 !                       + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))    &
1104 !                       + chem(i,k,j,lptr_oc_aer(3,itype,iphase)))
1105           hoa_a03(i,k,j)= hoa_a03(i,k,j) &
1106                        + (chem(i,k,j,lptr_oc_aer(3,itype,iphase)))
1108           soa_a03(i,k,j)= soa_a03(i,k,j) &
1109                        + chem(i,k,j,lptr_smpa_aer(3,itype,iphase)) &
1110                        + chem(i,k,j,lptr_smpbb_aer(3,itype,iphase)) &
1111                        + chem(i,k,j,lptr_glysoa_sfc_aer(3,itype,iphase)) &
1112                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1113                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))
1116           bbsoa_a03(i,k,j)= bbsoa_a03(i,k,j) &
1117                        + chem(i,k,j,lptr_smpbb_aer(3,itype,iphase))
1119           biog_a03(i,k,j)= biog_a03(i,k,j) &
1120                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1121                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))
1123           asmpsoa_a03(i,k,j)= asmpsoa_a03(i,k,j) &
1124                        + chem(i,k,j,lptr_smpa_aer(3,itype,iphase))
1126                enddo
1127             enddo
1128          enddo
1129    enddo ! type
1130    enddo ! phase
1132    do iphase=1,nphase_aer
1133    do itype=1,ntype_aer
1134          do j=jts,jmax
1135             do k=kts,kmax
1136                do i=its,imax
1137 ! missing summation! (hoa = hoa + x ...)
1138 !          hoa_a04(i,k,j)= (chem(i,k,j,lptr_oc_aer(4,itype,iphase)))
1141 !          soa_a04(i,k,j)= (chem(i,k,j,lptr_smpa_aer(4,itype,iphase)) &
1142 !                       + chem(i,k,j,lptr_smpbb_aer(4,itype,iphase)) &
1143 !                       + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1144 !                       + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase)))
1147 !         bbsoa_a04(i,k,j)= (chem(i,k,j,lptr_smpbb_aer(4,itype,iphase)))
1150 !         biog_a04(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1151 !                       + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase)))
1153 !         asmpsoa_a04(i,k,j)= chem(i,k,j,lptr_smpa_aer(4,itype,iphase))
1157 !         totoa_a04(i,k,j)= (  &
1158 !                       + chem(i,k,j,lptr_smpa_aer(4,itype,iphase))    &
1159 !                       + chem(i,k,j,lptr_smpbb_aer(4,itype,iphase))    &
1160 !                       + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1161 !                       + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))    &
1162 !                       + chem(i,k,j,lptr_oc_aer(4,itype,iphase)))
1163           hoa_a04(i,k,j)= hoa_a04(i,k,j) &
1164                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase))
1167           soa_a04(i,k,j)= soa_a04(i,k,j) &
1168                        + chem(i,k,j,lptr_smpa_aer(4,itype,iphase)) &
1169                        + chem(i,k,j,lptr_smpbb_aer(4,itype,iphase)) &
1170                        + chem(i,k,j,lptr_glysoa_sfc_aer(4,itype,iphase)) &
1171                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1172                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))
1175          bbsoa_a04(i,k,j)= bbsoa_a04(i,k,j) &
1176                        + chem(i,k,j,lptr_smpbb_aer(4,itype,iphase))
1179          biog_a04(i,k,j)= biog_a04(i,k,j) &
1180                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1181                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))
1183          asmpsoa_a04(i,k,j)= asmpsoa_a04(i,k,j) &
1184                        + chem(i,k,j,lptr_smpa_aer(4,itype,iphase))
1186                enddo
1187             enddo
1188          enddo
1189    enddo ! type
1190    enddo ! phase
1191    endif
1193 !Factor of 1.4 used below to convert OC to OA
1194         totoa_a01(its:imax,kts:kmax,jts:jmax) =totoa_a01(its:imax,kts:kmax,jts:jmax) &
1195                                            / alt(its:imax,kts:kmax,jts:jmax)
1196         totoa_a02(its:imax,kts:kmax,jts:jmax) =totoa_a02(its:imax,kts:kmax,jts:jmax) &
1197                                            / alt(its:imax,kts:kmax,jts:jmax)
1198         totoa_a03(its:imax,kts:kmax,jts:jmax) =totoa_a03(its:imax,kts:kmax,jts:jmax) &
1199                                            / alt(its:imax,kts:kmax,jts:jmax)
1200         totoa_a04(its:imax,kts:kmax,jts:jmax) =totoa_a04(its:imax,kts:kmax,jts:jmax) &
1201                                            / alt(its:imax,kts:kmax,jts:jmax)
1203         if( aero_diag_opt > 0 ) then
1204         hoa_a01(its:imax,kts:kmax,jts:jmax) =hoa_a01(its:imax,kts:kmax,jts:jmax) &
1205                                            / alt(its:imax,kts:kmax,jts:jmax)
1206         soa_a01(its:imax,kts:kmax,jts:jmax) =soa_a01(its:imax,kts:kmax,jts:jmax) &
1207                                            / alt(its:imax,kts:kmax,jts:jmax)
1208         bboa_a01(its:imax,kts:kmax,jts:jmax) =bboa_a01(its:imax,kts:kmax,jts:jmax) &
1209                                            / alt(its:imax,kts:kmax,jts:jmax)
1210         bbsoa_a01(its:imax,kts:kmax,jts:jmax) =bbsoa_a01(its:imax,kts:kmax,jts:jmax) &
1211                                            / alt(its:imax,kts:kmax,jts:jmax)
1214         biog_a01(its:imax,kts:kmax,jts:jmax) =biog_a01(its:imax,kts:kmax,jts:jmax) &
1215                                            / alt(its:imax,kts:kmax,jts:jmax)
1217         asmpsoa_a01(its:imax,kts:kmax,jts:jmax) =asmpsoa_a01(its:imax,kts:kmax,jts:jmax) &
1218                                            / alt(its:imax,kts:kmax,jts:jmax)
1222         hoa_a02(its:imax,kts:kmax,jts:jmax) =hoa_a02(its:imax,kts:kmax,jts:jmax) &
1223                                            / alt(its:imax,kts:kmax,jts:jmax)
1224         soa_a02(its:imax,kts:kmax,jts:jmax) =soa_a02(its:imax,kts:kmax,jts:jmax) &
1225                                            / alt(its:imax,kts:kmax,jts:jmax)
1226         bboa_a02(its:imax,kts:kmax,jts:jmax) =bboa_a02(its:imax,kts:kmax,jts:jmax) &
1227                                            / alt(its:imax,kts:kmax,jts:jmax)
1228         bbsoa_a02(its:imax,kts:kmax,jts:jmax) =bbsoa_a02(its:imax,kts:kmax,jts:jmax) &
1229                                            / alt(its:imax,kts:kmax,jts:jmax)
1231         biog_a02(its:imax,kts:kmax,jts:jmax) =biog_a02(its:imax,kts:kmax,jts:jmax) &
1232                                            / alt(its:imax,kts:kmax,jts:jmax)
1234         asmpsoa_a02(its:imax,kts:kmax,jts:jmax) =asmpsoa_a02(its:imax,kts:kmax,jts:jmax) &
1235                                            / alt(its:imax,kts:kmax,jts:jmax)
1238         hoa_a03(its:imax,kts:kmax,jts:jmax) =hoa_a03(its:imax,kts:kmax,jts:jmax) &
1239                                            / alt(its:imax,kts:kmax,jts:jmax)
1240         soa_a03(its:imax,kts:kmax,jts:jmax) =soa_a03(its:imax,kts:kmax,jts:jmax) &
1241                                            / alt(its:imax,kts:kmax,jts:jmax)
1242         bboa_a03(its:imax,kts:kmax,jts:jmax) =bboa_a03(its:imax,kts:kmax,jts:jmax) &
1243                                            / alt(its:imax,kts:kmax,jts:jmax)
1244         bbsoa_a03(its:imax,kts:kmax,jts:jmax) =bbsoa_a03(its:imax,kts:kmax,jts:jmax) &
1245                                            / alt(its:imax,kts:kmax,jts:jmax)
1247         biog_a03(its:imax,kts:kmax,jts:jmax) =biog_a03(its:imax,kts:kmax,jts:jmax) &
1248                                            / alt(its:imax,kts:kmax,jts:jmax)
1249         asmpsoa_a03(its:imax,kts:kmax,jts:jmax) =asmpsoa_a03(its:imax,kts:kmax,jts:jmax) &
1250                                            / alt(its:imax,kts:kmax,jts:jmax)
1253         hoa_a04(its:imax,kts:kmax,jts:jmax) =hoa_a04(its:imax,kts:kmax,jts:jmax) &
1254                                            / alt(its:imax,kts:kmax,jts:jmax)
1255         soa_a04(its:imax,kts:kmax,jts:jmax) =soa_a04(its:imax,kts:kmax,jts:jmax) &
1256                                            / alt(its:imax,kts:kmax,jts:jmax)
1257         bboa_a04(its:imax,kts:kmax,jts:jmax) =bboa_a04(its:imax,kts:kmax,jts:jmax) &
1258                                            / alt(its:imax,kts:kmax,jts:jmax)
1259         bbsoa_a04(its:imax,kts:kmax,jts:jmax) =bbsoa_a04(its:imax,kts:kmax,jts:jmax) &
1260                                            / alt(its:imax,kts:kmax,jts:jmax)
1262         biog_a04(its:imax,kts:kmax,jts:jmax) =biog_a04(its:imax,kts:kmax,jts:jmax) &
1263                                            / alt(its:imax,kts:kmax,jts:jmax)
1264         asmpsoa_a04(its:imax,kts:kmax,jts:jmax) =asmpsoa_a04(its:imax,kts:kmax,jts:jmax) &
1265                                            / alt(its:imax,kts:kmax,jts:jmax)
1266         endif
1269    end subroutine sum_vbs0
1272 !-----------------------------------------------------------------------
1274        subroutine  sum_vbs2 ( aero_diag_opt,                           &
1275              alt, chem,                                                &
1276              hoa_a01,hoa_a02,hoa_a03,hoa_a04,                          &
1277              hoa_a05,hoa_a06,hoa_a07,hoa_a08,                          & !BSINGH(12/04/2013): Added 4 more bins(5 to 8) for all apecies
1278              bboa_a01,bboa_a02,bboa_a03,bboa_a04,                      &
1279              bboa_a05,bboa_a06,bboa_a07,bboa_a08,                      &
1280              soa_a01,soa_a02,soa_a03,soa_a04,                          &
1281              soa_a05,soa_a06,soa_a07,soa_a08,                          &
1282              bbsoa_a01,bbsoa_a02,bbsoa_a03,bbsoa_a04,                  &
1283              bbsoa_a05,bbsoa_a06,bbsoa_a07,bbsoa_a08,                  &
1284              hsoa_a01,hsoa_a02,hsoa_a03,hsoa_a04,                      &
1285              hsoa_a05,hsoa_a06,hsoa_a07,hsoa_a08,                      &
1286              biog_a01,biog_a02,biog_a03,biog_a04,                      &
1287              biog_a05,biog_a06,biog_a07,biog_a08,                      &
1288              arosoa_a01,arosoa_a02,arosoa_a03,arosoa_a04,              &
1289              arosoa_a05,arosoa_a06,arosoa_a07,arosoa_a08,              &
1290              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
1291              totoa_a05,totoa_a06,totoa_a07,totoa_a08,                  &
1292              hsoa_c,hsoa_o,bbsoa_c,bbsoa_o,                            &
1293              biog_v1,biog_v2,biog_v3,biog_v4,                          &
1294              ant_v1,ant_v2,ant_v3,ant_v4,                              &
1295              ids,ide, jds,jde, kds,kde,                                &
1296              ims,ime, jms,jme, kms,kme,                                &
1297              its,ite, jts,jte, kts,kte                                  )
1299    USE module_state_description, only: num_chem
1300    USE module_data_mosaic_asect
1301    IMPLICIT NONE
1303    INTEGER,      INTENT(IN   )    ::  aero_diag_opt
1304    INTEGER,      INTENT(IN   )    ::                                   &
1305                                       ids,ide, jds,jde, kds,kde,       &
1306                                       ims,ime, jms,jme, kms,kme,       &
1307                                       its,ite, jts,jte, kts,kte
1309    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
1310          INTENT(IN) :: alt
1312    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
1313          INTENT(IN ) :: chem
1314    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
1315          INTENT(OUT) :: hoa_a01,hoa_a02,hoa_a03,hoa_a04,               &
1316          hoa_a05,hoa_a06,hoa_a07,hoa_a08,                              &
1317              bboa_a01,bboa_a02,bboa_a03,bboa_a04,                      &
1318              bboa_a05,bboa_a06,bboa_a07,bboa_a08,                      &
1319              soa_a01,soa_a02,soa_a03,soa_a04,                          &
1320              soa_a05,soa_a06,soa_a07,soa_a08,                          &
1321              bbsoa_a01,bbsoa_a02,bbsoa_a03,bbsoa_a04,                  &
1322              bbsoa_a05,bbsoa_a06,bbsoa_a07,bbsoa_a08,                  &
1323              biog_a01,biog_a02,biog_a03,biog_a04,                      &
1324              biog_a05,biog_a06,biog_a07,biog_a08,                      &
1325              hsoa_a01,hsoa_a02,hsoa_a03,hsoa_a04,                      &
1326              hsoa_a05,hsoa_a06,hsoa_a07,hsoa_a08,                      &
1327              arosoa_a01,arosoa_a02,arosoa_a03,arosoa_a04,              &
1328              arosoa_a05,arosoa_a06,arosoa_a07,arosoa_a08,              &
1329              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
1330              totoa_a05,totoa_a06,totoa_a07,totoa_a08,                  &
1331              hsoa_c,hsoa_o,bbsoa_c,bbsoa_o,                            &
1332              biog_v1,biog_v2,biog_v3,biog_v4,                          &
1333              ant_v1,ant_v2,ant_v3,ant_v4
1337    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
1339    imax = min(ite,ide-1)
1340    jmax = min(jte,jde-1)
1341    kmax = kte
1343     totoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1344     totoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1345     totoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1346     totoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1347     totoa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1348     totoa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1349     totoa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1350     totoa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1352    if( aero_diag_opt > 0 ) then
1353     hoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1354     soa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1355     bboa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1356     bbsoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1357     hsoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1358     biog_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1359     arosoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
1361     hoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1362     soa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1363     bboa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1364     bbsoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1365     hsoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1366     arosoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1367     biog_a02(its:imax,kts:kmax,jts:jmax)    = 0.
1369     hoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1370     soa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1371     bboa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1372     bbsoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1373     hsoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1374     arosoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1375     biog_a03(its:imax,kts:kmax,jts:jmax)    = 0.
1377     hoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1378     soa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1379     bboa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1380     bbsoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1381     hsoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1382     arosoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1383     biog_a04(its:imax,kts:kmax,jts:jmax)    = 0.
1385     
1386     hoa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1387     soa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1388     bboa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1389     bbsoa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1390     hsoa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1391     arosoa_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1392     biog_a05(its:imax,kts:kmax,jts:jmax)    = 0.
1394     hoa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1395     soa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1396     bboa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1397     bbsoa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1398     hsoa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1399     arosoa_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1400     biog_a06(its:imax,kts:kmax,jts:jmax)    = 0.
1402     hoa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1403     soa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1404     bboa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1405     bbsoa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1406     hsoa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1407     arosoa_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1408     biog_a07(its:imax,kts:kmax,jts:jmax)    = 0.
1410     hoa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1411     soa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1412     bboa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1413     bbsoa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1414     hsoa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1415     arosoa_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1416     biog_a08(its:imax,kts:kmax,jts:jmax)    = 0.
1420 ! Species to calculate O:C ratios
1421      hsoa_c(its:imax,kts:kmax,jts:jmax)    = 0.
1422      hsoa_o(its:imax,kts:kmax,jts:jmax)    = 0.
1423      bbsoa_c(its:imax,kts:kmax,jts:jmax)    = 0.
1424      bbsoa_o(its:imax,kts:kmax,jts:jmax)    = 0.
1425      biog_v1(its:imax,kts:kmax,jts:jmax)    = 0.
1426      biog_v2(its:imax,kts:kmax,jts:jmax)    = 0.
1427      biog_v3(its:imax,kts:kmax,jts:jmax)    = 0.
1428      biog_v4(its:imax,kts:kmax,jts:jmax)    = 0.
1429      ant_v1(its:imax,kts:kmax,jts:jmax)    = 0.
1430      ant_v2(its:imax,kts:kmax,jts:jmax)    = 0.
1431      ant_v3(its:imax,kts:kmax,jts:jmax)    = 0.
1432      ant_v4(its:imax,kts:kmax,jts:jmax)    = 0.
1433    endif
1435 ! NOTE - summation seems to be wrong for code below, but not my code so did not fix...
1436    iphase = 1
1437    do itype=1,ntype_aer
1438          do j=jts,jmax
1439             do k=kts,kmax
1440                do i=its,imax
1441                  totoa_a01(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(1,itype,iphase)) &
1442                        + chem(i,k,j,lptr_pcg2_b_c_aer(1,itype,iphase)) &
1443                        + chem(i,k,j,lptr_pcg1_b_o_aer(1,itype,iphase)) &
1444                        + chem(i,k,j,lptr_pcg2_b_o_aer(1,itype,iphase)) &
1445                        + chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
1446                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
1447                        + chem(i,k,j,lptr_pcg1_f_c_aer(1,itype,iphase)) &
1448                        + chem(i,k,j,lptr_pcg2_f_c_aer(1,itype,iphase)) &
1449                        + chem(i,k,j,lptr_pcg1_f_o_aer(1,itype,iphase)) &
1450                        + chem(i,k,j,lptr_pcg2_f_o_aer(1,itype,iphase)) &
1451                        + chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
1452                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
1453                        + chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
1454                        + chem(i,k,j,lptr_ant1_o_aer(1,itype,iphase))    &
1455                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
1456                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))    &
1457                        + chem(i,k,j,lptr_oc_aer(1,itype,iphase)))
1458                  totoa_a02(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(2,itype,iphase)) &
1459                        + chem(i,k,j,lptr_pcg2_b_c_aer(2,itype,iphase)) &
1460                        + chem(i,k,j,lptr_pcg1_b_o_aer(2,itype,iphase)) &
1461                        + chem(i,k,j,lptr_pcg2_b_o_aer(2,itype,iphase)) &
1462                        + chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
1463                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
1464                        + chem(i,k,j,lptr_pcg1_f_c_aer(2,itype,iphase)) &
1465                        + chem(i,k,j,lptr_pcg2_f_c_aer(2,itype,iphase)) &
1466                        + chem(i,k,j,lptr_pcg1_f_o_aer(2,itype,iphase)) &
1467                        + chem(i,k,j,lptr_pcg2_f_o_aer(2,itype,iphase)) &
1468                        + chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
1469                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
1470                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
1471                        + chem(i,k,j,lptr_ant1_o_aer(2,itype,iphase))    &
1472                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1473                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))    &
1474                        + chem(i,k,j,lptr_oc_aer(2,itype,iphase)))
1475                  totoa_a03(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(3,itype,iphase)) &
1476                        + chem(i,k,j,lptr_pcg2_b_c_aer(3,itype,iphase)) &
1477                        + chem(i,k,j,lptr_pcg1_b_o_aer(3,itype,iphase)) &
1478                        + chem(i,k,j,lptr_pcg2_b_o_aer(3,itype,iphase)) &
1479                        + chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
1480                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
1481                        + chem(i,k,j,lptr_pcg1_f_c_aer(3,itype,iphase)) &
1482                        + chem(i,k,j,lptr_pcg2_f_c_aer(3,itype,iphase)) &
1483                        + chem(i,k,j,lptr_pcg1_f_o_aer(3,itype,iphase)) &
1484                        + chem(i,k,j,lptr_pcg2_f_o_aer(3,itype,iphase)) &
1485                        + chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
1486                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
1487                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
1488                        + chem(i,k,j,lptr_ant1_o_aer(3,itype,iphase))    &
1489                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1490                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))    &
1491                        + chem(i,k,j,lptr_oc_aer(3,itype,iphase)))
1492                  totoa_a04(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(4,itype,iphase)) &
1493                        + chem(i,k,j,lptr_pcg2_b_c_aer(4,itype,iphase)) &
1494                        + chem(i,k,j,lptr_pcg1_b_o_aer(4,itype,iphase)) &
1495                        + chem(i,k,j,lptr_pcg2_b_o_aer(4,itype,iphase)) &
1496                        + chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
1497                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
1498                        + chem(i,k,j,lptr_pcg1_f_c_aer(4,itype,iphase)) &
1499                        + chem(i,k,j,lptr_pcg2_f_c_aer(4,itype,iphase)) &
1500                        + chem(i,k,j,lptr_pcg1_f_o_aer(4,itype,iphase)) &
1501                        + chem(i,k,j,lptr_pcg2_f_o_aer(4,itype,iphase)) &
1502                        + chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
1503                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
1504                        + chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
1505                        + chem(i,k,j,lptr_ant1_o_aer(4,itype,iphase))    &
1506                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1507                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))    &
1508                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase)))
1509                  totoa_a05(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(5,itype,iphase)) &
1510                        + chem(i,k,j,lptr_pcg2_b_c_aer(5,itype,iphase)) &
1511                        + chem(i,k,j,lptr_pcg1_b_o_aer(5,itype,iphase)) &
1512                        + chem(i,k,j,lptr_pcg2_b_o_aer(5,itype,iphase)) &
1513                        + chem(i,k,j,lptr_opcg1_b_c_aer(5,itype,iphase)) &
1514                        + chem(i,k,j,lptr_opcg1_b_o_aer(5,itype,iphase)) &
1515                        + chem(i,k,j,lptr_pcg1_f_c_aer(5,itype,iphase)) &
1516                        + chem(i,k,j,lptr_pcg2_f_c_aer(5,itype,iphase)) &
1517                        + chem(i,k,j,lptr_pcg1_f_o_aer(5,itype,iphase)) &
1518                        + chem(i,k,j,lptr_pcg2_f_o_aer(5,itype,iphase)) &
1519                        + chem(i,k,j,lptr_opcg1_f_c_aer(5,itype,iphase)) &
1520                        + chem(i,k,j,lptr_opcg1_f_o_aer(5,itype,iphase)) &
1521                        + chem(i,k,j,lptr_ant1_c_aer(5,itype,iphase))    &
1522                        + chem(i,k,j,lptr_ant1_o_aer(5,itype,iphase))    &
1523                        + chem(i,k,j,lptr_biog1_c_aer(5,itype,iphase))    &
1524                        + chem(i,k,j,lptr_biog1_o_aer(5,itype,iphase))    &
1525                        + chem(i,k,j,lptr_oc_aer(5,itype,iphase)))
1526                  totoa_a06(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(6,itype,iphase)) &
1527                        + chem(i,k,j,lptr_pcg2_b_c_aer(6,itype,iphase)) &
1528                        + chem(i,k,j,lptr_pcg1_b_o_aer(6,itype,iphase)) &
1529                        + chem(i,k,j,lptr_pcg2_b_o_aer(6,itype,iphase)) &
1530                        + chem(i,k,j,lptr_opcg1_b_c_aer(6,itype,iphase)) &
1531                        + chem(i,k,j,lptr_opcg1_b_o_aer(6,itype,iphase)) &
1532                        + chem(i,k,j,lptr_pcg1_f_c_aer(6,itype,iphase)) &
1533                        + chem(i,k,j,lptr_pcg2_f_c_aer(6,itype,iphase)) &
1534                        + chem(i,k,j,lptr_pcg1_f_o_aer(6,itype,iphase)) &
1535                        + chem(i,k,j,lptr_pcg2_f_o_aer(6,itype,iphase)) &
1536                        + chem(i,k,j,lptr_opcg1_f_c_aer(6,itype,iphase)) &
1537                        + chem(i,k,j,lptr_opcg1_f_o_aer(6,itype,iphase)) &
1538                        + chem(i,k,j,lptr_ant1_c_aer(6,itype,iphase))    &
1539                        + chem(i,k,j,lptr_ant1_o_aer(6,itype,iphase))    &
1540                        + chem(i,k,j,lptr_biog1_c_aer(6,itype,iphase))    &
1541                        + chem(i,k,j,lptr_biog1_o_aer(6,itype,iphase))    &
1542                        + chem(i,k,j,lptr_oc_aer(6,itype,iphase)))
1543                  totoa_a07(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(7,itype,iphase)) &
1544                        + chem(i,k,j,lptr_pcg2_b_c_aer(7,itype,iphase)) &
1545                        + chem(i,k,j,lptr_pcg1_b_o_aer(7,itype,iphase)) &
1546                        + chem(i,k,j,lptr_pcg2_b_o_aer(7,itype,iphase)) &
1547                        + chem(i,k,j,lptr_opcg1_b_c_aer(7,itype,iphase)) &
1548                        + chem(i,k,j,lptr_opcg1_b_o_aer(7,itype,iphase)) &
1549                        + chem(i,k,j,lptr_pcg1_f_c_aer(7,itype,iphase)) &
1550                        + chem(i,k,j,lptr_pcg2_f_c_aer(7,itype,iphase)) &
1551                        + chem(i,k,j,lptr_pcg1_f_o_aer(7,itype,iphase)) &
1552                        + chem(i,k,j,lptr_pcg2_f_o_aer(7,itype,iphase)) &
1553                        + chem(i,k,j,lptr_opcg1_f_c_aer(7,itype,iphase)) &
1554                        + chem(i,k,j,lptr_opcg1_f_o_aer(7,itype,iphase)) &
1555                        + chem(i,k,j,lptr_ant1_c_aer(7,itype,iphase))    &
1556                        + chem(i,k,j,lptr_ant1_o_aer(7,itype,iphase))    &
1557                        + chem(i,k,j,lptr_biog1_c_aer(7,itype,iphase))    &
1558                        + chem(i,k,j,lptr_biog1_o_aer(7,itype,iphase))    &
1559                        + chem(i,k,j,lptr_oc_aer(7,itype,iphase)))
1560                  totoa_a08(i,k,j) = (chem(i,k,j,lptr_pcg1_b_c_aer(8,itype,iphase)) &
1561                        + chem(i,k,j,lptr_pcg2_b_c_aer(8,itype,iphase)) &
1562                        + chem(i,k,j,lptr_pcg1_b_o_aer(8,itype,iphase)) &
1563                        + chem(i,k,j,lptr_pcg2_b_o_aer(8,itype,iphase)) &
1564                        + chem(i,k,j,lptr_opcg1_b_c_aer(8,itype,iphase)) &
1565                        + chem(i,k,j,lptr_opcg1_b_o_aer(8,itype,iphase)) &
1566                        + chem(i,k,j,lptr_pcg1_f_c_aer(8,itype,iphase)) &
1567                        + chem(i,k,j,lptr_pcg2_f_c_aer(8,itype,iphase)) &
1568                        + chem(i,k,j,lptr_pcg1_f_o_aer(8,itype,iphase)) &
1569                        + chem(i,k,j,lptr_pcg2_f_o_aer(8,itype,iphase)) &
1570                        + chem(i,k,j,lptr_opcg1_f_c_aer(8,itype,iphase)) &
1571                        + chem(i,k,j,lptr_opcg1_f_o_aer(8,itype,iphase)) &
1572                        + chem(i,k,j,lptr_ant1_c_aer(8,itype,iphase))    &
1573                        + chem(i,k,j,lptr_ant1_o_aer(8,itype,iphase))    &
1574                        + chem(i,k,j,lptr_biog1_c_aer(8,itype,iphase))    &
1575                        + chem(i,k,j,lptr_biog1_o_aer(8,itype,iphase))    &
1576                        + chem(i,k,j,lptr_oc_aer(8,itype,iphase)))
1577                enddo
1578             enddo
1579          enddo
1580    enddo ! type
1582    if( aero_diag_opt > 0 ) then
1583    !do iphase=1,nphase_aer!BSINGH - Commented out as we need to add only phase 1 (interstitial) values species
1584    iphase = 1
1585    do itype=1,ntype_aer
1586    do n = 1, nsize_aer(itype) !The 4th bin is 2.5-10um and outside the AMS measurements
1587          do j=jts,jmax
1588             do k=kts,kmax
1589                do i=its,imax
1591           hsoa_c(i,k,j)=hsoa_c(i,k,j) &
1592                        + (chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
1593                        + chem(i,k,j,lptr_pcg2_f_c_aer(n,itype,iphase)) &
1594                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)))*180/211
1596          hsoa_o(i,k,j)= hsoa_o(i,k,j) &
1597                        + (chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
1598                        + chem(i,k,j,lptr_pcg2_f_o_aer(n,itype,iphase)) &
1599                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)))
1601           bbsoa_c(i,k,j)= bbsoa_c(i,k,j) &
1602                        + (chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
1603                        + chem(i,k,j,lptr_pcg2_b_c_aer(n,itype,iphase)) &
1604                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)))*180/211
1606          bbsoa_o(i,k,j)=bbsoa_o(i,k,j) &
1607                        +(chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
1608                        + chem(i,k,j,lptr_pcg2_b_o_aer(n,itype,iphase)) &
1609                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)))
1611         biog_v1(i,k,j)= biog_v1(i,k,j) &
1612                          + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
1613                          + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
1615         ant_v1(i,k,j)=  ant_v1(i,k,j) &
1616                          + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
1617                          + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))
1619                  enddo
1620                enddo
1621              enddo
1622                     enddo
1623                   enddo
1626 ! NOTE - summation also wrong for code below, but not my code so did not fix...
1628    !do iphase=1,nphase_aer !BSINGH - Commented out as we need to add only phase 1 (interstitial) values species
1630    iphase = 1
1631    do itype=1,ntype_aer
1632          do j=jts,jmax
1633             do k=kts,kmax
1634                do i=its,imax
1635          hoa_a01(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(1,itype,iphase)) &
1636                        + chem(i,k,j,lptr_pcg2_f_c_aer(1,itype,iphase)) &
1637                        + chem(i,k,j,lptr_pcg1_f_o_aer(1,itype,iphase)) &
1638                        + chem(i,k,j,lptr_pcg2_f_o_aer(1,itype,iphase)))
1640           bboa_a01(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(1,itype,iphase)) &
1641                        + chem(i,k,j,lptr_pcg2_b_c_aer(1,itype,iphase)) &
1642                        + chem(i,k,j,lptr_pcg1_b_o_aer(1,itype,iphase)) &
1643                        + chem(i,k,j,lptr_pcg2_b_o_aer(1,itype,iphase)))
1645           soa_a01(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
1646                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
1647                        + chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
1648                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
1649                        + chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
1650                        + chem(i,k,j,lptr_ant1_o_aer(1,itype,iphase))    &
1651                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
1652                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase)))
1654         arosoa_a01(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(1,itype,iphase))    &
1655                        + chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))
1658         bbsoa_a01(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
1659                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)))
1661         hsoa_a01(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
1662                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)))
1664         biog_a01(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
1665                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase)))
1670                enddo
1671             enddo
1672          enddo
1673    enddo ! type
1676    !do iphase=1,nphase_aer!BSINGH - Commented out as we need to add only phase 1 (interstitial) values species
1677    iphase = 1
1678    do itype=1,ntype_aer
1679          do j=jts,jmax
1680             do k=kts,kmax
1681                do i=its,imax
1682          hoa_a02(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(2,itype,iphase)) &
1683                        + chem(i,k,j,lptr_pcg2_f_c_aer(2,itype,iphase)) &
1684                        + chem(i,k,j,lptr_pcg1_f_o_aer(2,itype,iphase)) &
1685                        + chem(i,k,j,lptr_pcg2_f_o_aer(2,itype,iphase)))
1687           bboa_a02(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(2,itype,iphase)) &
1688                        + chem(i,k,j,lptr_pcg2_b_c_aer(2,itype,iphase)) &
1689                        + chem(i,k,j,lptr_pcg1_b_o_aer(2,itype,iphase)) &
1690                        + chem(i,k,j,lptr_pcg2_b_o_aer(2,itype,iphase)))
1692           soa_a02(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
1693                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
1694                        + chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
1695                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
1696                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
1697                        + chem(i,k,j,lptr_ant1_o_aer(2,itype,iphase))    &
1698                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1699                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase)))
1701         arosoa_a02(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(2,itype,iphase))    &
1702                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))
1705         bbsoa_a02(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
1706                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)))
1708         hsoa_a02(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
1709                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)))
1711         biog_a02(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
1712                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase)))
1714                enddo
1715             enddo
1716          enddo
1717    enddo ! type
1720    !do iphase=1,nphase_aer!BSINGH - Commented out as we need to add only phase 1 (interstitial) values species
1721    iphase = 1
1722    do itype=1,ntype_aer
1723          do j=jts,jmax
1724             do k=kts,kmax
1725                do i=its,imax
1726          hoa_a03(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(3,itype,iphase)) &
1727                        + chem(i,k,j,lptr_pcg2_f_c_aer(3,itype,iphase)) &
1728                        + chem(i,k,j,lptr_pcg1_f_o_aer(3,itype,iphase)) &
1729                        + chem(i,k,j,lptr_pcg2_f_o_aer(3,itype,iphase)))
1731           bboa_a03(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(3,itype,iphase)) &
1732                        + chem(i,k,j,lptr_pcg2_b_c_aer(3,itype,iphase)) &
1733                        + chem(i,k,j,lptr_pcg1_b_o_aer(3,itype,iphase)) &
1734                        + chem(i,k,j,lptr_pcg2_b_o_aer(3,itype,iphase)))
1736           soa_a03(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
1737                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
1738                        + chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
1739                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
1740                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
1741                        + chem(i,k,j,lptr_ant1_o_aer(3,itype,iphase))    &
1742                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1743                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase)))
1745         arosoa_a03(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(3,itype,iphase))    &
1746                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))
1749         bbsoa_a03(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
1750                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)))
1752         hsoa_a03(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
1753                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)))
1755         biog_a03(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
1756                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase)))
1758                enddo
1759             enddo
1760          enddo
1761    enddo ! type
1764    !do iphase=1,nphase_aer!BSINGH - Commented out as we need to add only phase 1 (interstitial) values species
1765    iphase = 1
1766    do itype=1,ntype_aer
1767          do j=jts,jmax
1768             do k=kts,kmax
1769                do i=its,imax
1770          hoa_a04(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(4,itype,iphase)) &
1771                        + chem(i,k,j,lptr_pcg2_f_c_aer(4,itype,iphase)) &
1772                        + chem(i,k,j,lptr_pcg1_f_o_aer(4,itype,iphase)) &
1773                        + chem(i,k,j,lptr_pcg2_f_o_aer(4,itype,iphase)))
1775           bboa_a04(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(4,itype,iphase)) &
1776                        + chem(i,k,j,lptr_pcg2_b_c_aer(4,itype,iphase)) &
1777                        + chem(i,k,j,lptr_pcg1_b_o_aer(4,itype,iphase)) &
1778                        + chem(i,k,j,lptr_pcg2_b_o_aer(4,itype,iphase)))
1780           soa_a04(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
1781                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
1782                        + chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
1783                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
1784                        + chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
1785                        + chem(i,k,j,lptr_ant1_o_aer(4,itype,iphase))    &
1786                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1787                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase)))
1789         arosoa_a04(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(4,itype,iphase))    &
1790                        + chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))
1793         bbsoa_a04(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
1794                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)))
1796         hsoa_a04(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
1797                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)))
1799         biog_a04(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
1800                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase)))
1802                enddo
1803             enddo
1804          enddo
1805    enddo ! type
1806    iphase = 1
1807    do itype=1,ntype_aer
1808          do j=jts,jmax
1809             do k=kts,kmax
1810                do i=its,imax
1811          hoa_a05(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(5,itype,iphase)) &
1812                        + chem(i,k,j,lptr_pcg2_f_c_aer(5,itype,iphase)) &
1813                        + chem(i,k,j,lptr_pcg1_f_o_aer(5,itype,iphase)) &
1814                        + chem(i,k,j,lptr_pcg2_f_o_aer(5,itype,iphase)))
1816           bboa_a05(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(5,itype,iphase)) &
1817                        + chem(i,k,j,lptr_pcg2_b_c_aer(5,itype,iphase)) &
1818                        + chem(i,k,j,lptr_pcg1_b_o_aer(5,itype,iphase)) &
1819                        + chem(i,k,j,lptr_pcg2_b_o_aer(5,itype,iphase)))
1821           soa_a05(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(5,itype,iphase)) &
1822                        + chem(i,k,j,lptr_opcg1_b_o_aer(5,itype,iphase)) &
1823                        + chem(i,k,j,lptr_opcg1_f_c_aer(5,itype,iphase)) &
1824                        + chem(i,k,j,lptr_opcg1_f_o_aer(5,itype,iphase)) &
1825                        + chem(i,k,j,lptr_ant1_c_aer(5,itype,iphase))    &
1826                        + chem(i,k,j,lptr_ant1_o_aer(5,itype,iphase))    &
1827                        + chem(i,k,j,lptr_biog1_c_aer(5,itype,iphase))    &
1828                        + chem(i,k,j,lptr_biog1_o_aer(5,itype,iphase)))
1830         arosoa_a05(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(5,itype,iphase))    &
1831                        + chem(i,k,j,lptr_ant1_c_aer(5,itype,iphase))
1834         bbsoa_a05(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(5,itype,iphase)) &
1835                        + chem(i,k,j,lptr_opcg1_b_o_aer(5,itype,iphase)))
1837         hsoa_a05(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(5,itype,iphase)) &
1838                        + chem(i,k,j,lptr_opcg1_f_o_aer(5,itype,iphase)))
1840         biog_a05(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(5,itype,iphase))    &
1841                        + chem(i,k,j,lptr_biog1_o_aer(5,itype,iphase)))
1843                enddo
1844             enddo
1845          enddo
1846    enddo ! type
1849    iphase = 1
1850    do itype=1,ntype_aer
1851          do j=jts,jmax
1852             do k=kts,kmax
1853                do i=its,imax
1854          hoa_a06(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(6,itype,iphase)) &
1855                        + chem(i,k,j,lptr_pcg2_f_c_aer(6,itype,iphase)) &
1856                        + chem(i,k,j,lptr_pcg1_f_o_aer(6,itype,iphase)) &
1857                        + chem(i,k,j,lptr_pcg2_f_o_aer(6,itype,iphase)))
1859           bboa_a06(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(6,itype,iphase)) &
1860                        + chem(i,k,j,lptr_pcg2_b_c_aer(6,itype,iphase)) &
1861                        + chem(i,k,j,lptr_pcg1_b_o_aer(6,itype,iphase)) &
1862                        + chem(i,k,j,lptr_pcg2_b_o_aer(6,itype,iphase)))
1864           soa_a06(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(6,itype,iphase)) &
1865                        + chem(i,k,j,lptr_opcg1_b_o_aer(6,itype,iphase)) &
1866                        + chem(i,k,j,lptr_opcg1_f_c_aer(6,itype,iphase)) &
1867                        + chem(i,k,j,lptr_opcg1_f_o_aer(6,itype,iphase)) &
1868                        + chem(i,k,j,lptr_ant1_c_aer(6,itype,iphase))    &
1869                        + chem(i,k,j,lptr_ant1_o_aer(6,itype,iphase))    &
1870                        + chem(i,k,j,lptr_biog1_c_aer(6,itype,iphase))    &
1871                        + chem(i,k,j,lptr_biog1_o_aer(6,itype,iphase)))
1873         arosoa_a06(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(6,itype,iphase))    &
1874                        + chem(i,k,j,lptr_ant1_c_aer(6,itype,iphase))
1877         bbsoa_a06(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(6,itype,iphase)) &
1878                        + chem(i,k,j,lptr_opcg1_b_o_aer(6,itype,iphase)))
1880         hsoa_a06(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(6,itype,iphase)) &
1881                        + chem(i,k,j,lptr_opcg1_f_o_aer(6,itype,iphase)))
1883         biog_a06(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(6,itype,iphase))    &
1884                        + chem(i,k,j,lptr_biog1_o_aer(6,itype,iphase)))
1886                enddo
1887             enddo
1888          enddo
1889    enddo ! type
1892    iphase = 1
1893    do itype=1,ntype_aer
1894          do j=jts,jmax
1895             do k=kts,kmax
1896                do i=its,imax
1897          hoa_a07(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(7,itype,iphase)) &
1898                        + chem(i,k,j,lptr_pcg2_f_c_aer(7,itype,iphase)) &
1899                        + chem(i,k,j,lptr_pcg1_f_o_aer(7,itype,iphase)) &
1900                        + chem(i,k,j,lptr_pcg2_f_o_aer(7,itype,iphase)))
1902           bboa_a07(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(7,itype,iphase)) &
1903                        + chem(i,k,j,lptr_pcg2_b_c_aer(7,itype,iphase)) &
1904                        + chem(i,k,j,lptr_pcg1_b_o_aer(7,itype,iphase)) &
1905                        + chem(i,k,j,lptr_pcg2_b_o_aer(7,itype,iphase)))
1907           soa_a07(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(7,itype,iphase)) &
1908                        + chem(i,k,j,lptr_opcg1_b_o_aer(7,itype,iphase)) &
1909                        + chem(i,k,j,lptr_opcg1_f_c_aer(7,itype,iphase)) &
1910                        + chem(i,k,j,lptr_opcg1_f_o_aer(7,itype,iphase)) &
1911                        + chem(i,k,j,lptr_ant1_c_aer(7,itype,iphase))    &
1912                        + chem(i,k,j,lptr_ant1_o_aer(7,itype,iphase))    &
1913                        + chem(i,k,j,lptr_biog1_c_aer(7,itype,iphase))    &
1914                        + chem(i,k,j,lptr_biog1_o_aer(7,itype,iphase)))
1916         arosoa_a07(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(7,itype,iphase))    &
1917                        + chem(i,k,j,lptr_ant1_c_aer(7,itype,iphase))
1920         bbsoa_a07(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(7,itype,iphase)) &
1921                        + chem(i,k,j,lptr_opcg1_b_o_aer(7,itype,iphase)))
1923         hsoa_a07(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(7,itype,iphase)) &
1924                        + chem(i,k,j,lptr_opcg1_f_o_aer(7,itype,iphase)))
1926         biog_a07(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(7,itype,iphase))    &
1927                        + chem(i,k,j,lptr_biog1_o_aer(7,itype,iphase)))
1929                enddo
1930             enddo
1931          enddo
1932    enddo ! type
1935    iphase = 1
1936    do itype=1,ntype_aer
1937          do j=jts,jmax
1938             do k=kts,kmax
1939                do i=its,imax
1940          hoa_a08(i,k,j)= (chem(i,k,j,lptr_pcg1_f_c_aer(8,itype,iphase)) &
1941                        + chem(i,k,j,lptr_pcg2_f_c_aer(8,itype,iphase)) &
1942                        + chem(i,k,j,lptr_pcg1_f_o_aer(8,itype,iphase)) &
1943                        + chem(i,k,j,lptr_pcg2_f_o_aer(8,itype,iphase)))
1945           bboa_a08(i,k,j)= (chem(i,k,j,lptr_pcg1_b_c_aer(8,itype,iphase)) &
1946                        + chem(i,k,j,lptr_pcg2_b_c_aer(8,itype,iphase)) &
1947                        + chem(i,k,j,lptr_pcg1_b_o_aer(8,itype,iphase)) &
1948                        + chem(i,k,j,lptr_pcg2_b_o_aer(8,itype,iphase)))
1950           soa_a08(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(8,itype,iphase)) &
1951                        + chem(i,k,j,lptr_opcg1_b_o_aer(8,itype,iphase)) &
1952                        + chem(i,k,j,lptr_opcg1_f_c_aer(8,itype,iphase)) &
1953                        + chem(i,k,j,lptr_opcg1_f_o_aer(8,itype,iphase)) &
1954                        + chem(i,k,j,lptr_ant1_c_aer(8,itype,iphase))    &
1955                        + chem(i,k,j,lptr_ant1_o_aer(8,itype,iphase))    &
1956                        + chem(i,k,j,lptr_biog1_c_aer(8,itype,iphase))    &
1957                        + chem(i,k,j,lptr_biog1_o_aer(8,itype,iphase)))
1959         arosoa_a08(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(8,itype,iphase))    &
1960                        + chem(i,k,j,lptr_ant1_c_aer(8,itype,iphase))
1963         bbsoa_a08(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(8,itype,iphase)) &
1964                        + chem(i,k,j,lptr_opcg1_b_o_aer(8,itype,iphase)))
1966         hsoa_a08(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(8,itype,iphase)) &
1967                        + chem(i,k,j,lptr_opcg1_f_o_aer(8,itype,iphase)))
1969         biog_a08(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(8,itype,iphase))    &
1970                        + chem(i,k,j,lptr_biog1_o_aer(8,itype,iphase)))
1972                enddo
1973             enddo
1974          enddo
1975    enddo ! type
1976    endif
1979    end subroutine sum_vbs2
1982 !BSINGH(12/12/2013): Added following function for SAPRC 8 bin
1983    !----------------------------------------------------------------------
1986        subroutine  sum_aq_vbs2 (                                          &
1987              alt, chem,                                                &
1988              hoa_cw01,hoa_cw02,hoa_cw03,hoa_cw04,hoa_cw05,hoa_cw06,hoa_cw07,hoa_cw08,                          &
1989              bboa_cw01,bboa_cw02,bboa_cw03,bboa_cw04,bboa_cw05,bboa_cw06,bboa_cw07,bboa_cw08,                  &
1990              soa_cw01,soa_cw02,soa_cw03,soa_cw04,soa_cw05,soa_cw06,soa_cw07,soa_cw08,                          &
1991              bbsoa_cw01,bbsoa_cw02,bbsoa_cw03,bbsoa_cw04,bbsoa_cw05,bbsoa_cw06,bbsoa_cw07,bbsoa_cw08,          &
1992              hsoa_cw01,hsoa_cw02,hsoa_cw03,hsoa_cw04,hsoa_cw05,hsoa_cw06,hsoa_cw07,hsoa_cw08,                  &
1993              biog_cw01,biog_cw02,biog_cw03,biog_cw04,biog_cw05,biog_cw06,biog_cw07,biog_cw08,                  &
1994              arosoa_cw01,arosoa_cw02,arosoa_cw03,arosoa_cw04,arosoa_cw05,arosoa_cw06,arosoa_cw07,arosoa_cw08,  &
1995              totoa_cw01,totoa_cw02,totoa_cw03,totoa_cw04,totoa_cw05,totoa_cw06,totoa_cw07,totoa_cw08,          &
1996              hsoa_cw_c,hsoa_cw_o,bbsoa_cw_c,bbsoa_cw_o,                            &
1997              biog_cw_v1,                                                  &
1998              ant_cw_v1,                                                   &
1999              ids,ide, jds,jde, kds,kde,                                &
2000              ims,ime, jms,jme, kms,kme,                                &
2001              its,ite, jts,jte, kts,kte                                  )
2003    USE module_state_description, only: num_chem
2004    USE module_data_mosaic_asect
2005    IMPLICIT NONE
2007    INTEGER,      INTENT(IN   )    ::                                   &
2008                                       ids,ide, jds,jde, kds,kde,       &
2009                                       ims,ime, jms,jme, kms,kme,       &
2010                                       its,ite, jts,jte, kts,kte
2012    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
2013          INTENT(IN) :: alt
2014    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
2015          INTENT(IN ) :: chem
2016    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
2017          INTENT(OUT) :: hoa_cw01,hoa_cw02,hoa_cw03,hoa_cw04,               &
2018                         hoa_cw05,hoa_cw06,hoa_cw07,hoa_cw08,               & 
2019              bboa_cw01,bboa_cw02,bboa_cw03,bboa_cw04,                      &
2020              bboa_cw05,bboa_cw06,bboa_cw07,bboa_cw08,                      &
2021              soa_cw01,soa_cw02,soa_cw03,soa_cw04,                          &
2022              soa_cw05,soa_cw06,soa_cw07,soa_cw08,                          &
2023              bbsoa_cw01,bbsoa_cw02,bbsoa_cw03,bbsoa_cw04,                  &
2024              bbsoa_cw05,bbsoa_cw06,bbsoa_cw07,bbsoa_cw08,                  &
2025              biog_cw01,biog_cw02,biog_cw03,biog_cw04,                      &
2026              biog_cw05,biog_cw06,biog_cw07,biog_cw08,                      &
2027              hsoa_cw01,hsoa_cw02,hsoa_cw03,hsoa_cw04,                      &
2028              hsoa_cw05,hsoa_cw06,hsoa_cw07,hsoa_cw08,                      &
2029              arosoa_cw01,arosoa_cw02,arosoa_cw03,arosoa_cw04,              &
2030              arosoa_cw05,arosoa_cw06,arosoa_cw07,arosoa_cw08,              &
2031              totoa_cw01,totoa_cw02,totoa_cw03,totoa_cw04,                  &
2032              totoa_cw05,totoa_cw06,totoa_cw07,totoa_cw08,                  &
2033              hsoa_cw_c,hsoa_cw_o,bbsoa_cw_c,bbsoa_cw_o,                    &
2034              biog_cw_v1,                                                  &
2035              ant_cw_v1
2039    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
2041    imax = min(ite,ide-1)
2042    jmax = min(jte,jde-1)
2043    kmax = kte
2045     hoa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2046     soa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2047     bboa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2048     bbsoa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2049     hsoa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2050     biog_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2051     arosoa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2052     totoa_cw01(its:imax,kts:kmax,jts:jmax)    = 0.
2054     hoa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2055     soa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2056     bboa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2057     bbsoa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2058     hsoa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2059     arosoa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2060     biog_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2061     totoa_cw02(its:imax,kts:kmax,jts:jmax)    = 0.
2063     hoa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2064     soa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2065     bboa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2066     bbsoa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2067     hsoa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2068     arosoa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2069     biog_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2070     totoa_cw03(its:imax,kts:kmax,jts:jmax)    = 0.
2071     hoa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2072     soa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2073     bboa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2074     bbsoa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2075     hsoa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2076     arosoa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2077     biog_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2078     totoa_cw04(its:imax,kts:kmax,jts:jmax)    = 0.
2080     hoa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2081     soa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2082     bboa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2083     bbsoa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2084     hsoa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2085     arosoa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2086     biog_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2087     totoa_cw05(its:imax,kts:kmax,jts:jmax)    = 0.
2089     hoa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2090     soa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2091     bboa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2092     bbsoa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2093     hsoa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2094     arosoa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2095     biog_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2096     totoa_cw06(its:imax,kts:kmax,jts:jmax)    = 0.
2098     hoa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2099     soa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2100     bboa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2101     bbsoa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2102     hsoa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2103     arosoa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2104     biog_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2105     totoa_cw07(its:imax,kts:kmax,jts:jmax)    = 0.
2107     hoa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2108     soa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2109     bboa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2110     bbsoa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2111     hsoa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2112     arosoa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2113     biog_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2114     totoa_cw08(its:imax,kts:kmax,jts:jmax)    = 0.
2118 ! Species to calculate O:C ratios
2119      hsoa_cw_c(its:imax,kts:kmax,jts:jmax)    = 0.
2120      hsoa_cw_o(its:imax,kts:kmax,jts:jmax)    = 0.
2121      bbsoa_cw_c(its:imax,kts:kmax,jts:jmax)    = 0.
2122      bbsoa_cw_o(its:imax,kts:kmax,jts:jmax)    = 0.
2123      biog_cw_v1(its:imax,kts:kmax,jts:jmax)    = 0.
2124      ant_cw_v1(its:imax,kts:kmax,jts:jmax)    = 0.
2127    !do iphase=2,2 !set nphase_aer=2 for cloud-borne aerosols !BSINGH - Commented out 
2128    iphase = 2
2129    do itype=1,ntype_aer
2130    do n = 1, nsize_aer(itype) !The 4th bin is 2.5-10um and outside the AMS measurements
2131          do j=jts,jmax
2132             do k=kts,kmax
2133                do i=its,imax
2135           hsoa_cw_c(i,k,j)=hsoa_cw_c(i,k,j) &
2136                        + (chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
2137                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)))*180/211
2139          hsoa_cw_o(i,k,j)= hsoa_cw_o(i,k,j) &
2140                        + (chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
2141                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)))
2143           bbsoa_cw_c(i,k,j)= bbsoa_cw_c(i,k,j) &
2144                        + (chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
2145                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)))*180/211
2147          bbsoa_cw_o(i,k,j)=bbsoa_cw_o(i,k,j) &
2148                        +(chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
2149                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)))
2151         biog_cw_v1(i,k,j)= biog_cw_v1(i,k,j) &
2152                          + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))
2154         ant_cw_v1(i,k,j)=  ant_cw_v1(i,k,j) &
2155                          + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))
2157                  enddo
2158                enddo
2159              enddo
2160                     enddo
2161                   enddo
2167    !do iphase=2,2 !set nphase_aer=2 for cloud-borne aerosols !BSINGH - Commented out 
2168    iphase = 2
2169    do itype=1,ntype_aer
2170          do j=jts,jmax
2171             do k=kts,kmax
2172                do i=its,imax
2173          hoa_cw01(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(1,itype,iphase)) &
2174                        + chem(i,k,j,lptr_pcg1_f_o_aer(1,itype,iphase))
2176           bboa_cw01(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(1,itype,iphase)) &
2177                        + chem(i,k,j,lptr_pcg1_b_o_aer(1,itype,iphase))
2179           soa_cw01(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
2180                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
2181                        + chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
2182                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
2183                        + chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
2184                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))
2186         arosoa_cw01(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))
2189         bbsoa_cw01(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
2190                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)))
2192         hsoa_cw01(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
2193                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)))
2195         biog_cw01(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))
2199          totoa_cw01(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(1,itype,iphase)) &
2200                        + chem(i,k,j,lptr_pcg1_b_o_aer(1,itype,iphase)) &
2201                        + chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
2202                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
2203                        + chem(i,k,j,lptr_pcg1_f_c_aer(1,itype,iphase)) &
2204                        + chem(i,k,j,lptr_pcg1_f_o_aer(1,itype,iphase)) &
2205                        + chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
2206                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
2207                        + chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
2208                        + chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
2209                        + chem(i,k,j,lptr_oc_aer(1,itype,iphase)))
2212                enddo
2213             enddo
2214          enddo
2215    enddo ! type
2219    !do iphase=2,2 !set nphase_aer=2 for cloud-borne aerosols!BSINGH - Commented out 
2220    iphase = 2
2221    do itype=1,ntype_aer
2222          do j=jts,jmax
2223             do k=kts,kmax
2224                do i=its,imax
2225          hoa_cw02(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(2,itype,iphase)) &
2226                        + chem(i,k,j,lptr_pcg1_f_o_aer(2,itype,iphase))
2228           bboa_cw02(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(2,itype,iphase)) &
2229                        + chem(i,k,j,lptr_pcg1_b_o_aer(2,itype,iphase))
2231           soa_cw02(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
2232                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
2233                        + chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
2234                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
2235                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
2236                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))
2238         arosoa_cw02(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))
2241         bbsoa_cw02(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
2242                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)))
2244         hsoa_cw02(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
2245                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)))
2247         biog_cw02(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))
2251          totoa_cw02(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(2,itype,iphase)) &
2252                        + chem(i,k,j,lptr_pcg1_b_o_aer(2,itype,iphase)) &
2253                        + chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
2254                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
2255                        + chem(i,k,j,lptr_pcg1_f_c_aer(2,itype,iphase)) &
2256                        + chem(i,k,j,lptr_pcg1_f_o_aer(2,itype,iphase)) &
2257                        + chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
2258                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
2259                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
2260                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
2261                        + chem(i,k,j,lptr_oc_aer(2,itype,iphase)))
2264                enddo
2265             enddo
2266          enddo
2267    enddo ! type
2271    !do iphase=2,2 !set nphase_aer=2 for cloud-borne aerosols!BSINGH - Commented out 
2272    iphase = 2
2273    do itype=1,ntype_aer
2274          do j=jts,jmax
2275             do k=kts,kmax
2276                do i=its,imax
2277          hoa_cw03(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(3,itype,iphase)) &
2278                        + chem(i,k,j,lptr_pcg1_f_o_aer(3,itype,iphase))
2280           bboa_cw03(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(3,itype,iphase)) &
2281                        + chem(i,k,j,lptr_pcg1_b_o_aer(3,itype,iphase))
2283           soa_cw03(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
2284                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
2285                        + chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
2286                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
2287                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
2288                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))
2290         arosoa_cw03(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))
2293         bbsoa_cw03(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
2294                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)))
2296         hsoa_cw03(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
2297                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)))
2299         biog_cw03(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))
2303          totoa_cw03(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(3,itype,iphase)) &
2304                        + chem(i,k,j,lptr_pcg1_b_o_aer(3,itype,iphase)) &
2305                        + chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
2306                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
2307                        + chem(i,k,j,lptr_pcg1_f_c_aer(3,itype,iphase)) &
2308                        + chem(i,k,j,lptr_pcg1_f_o_aer(3,itype,iphase)) &
2309                        + chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
2310                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
2311                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
2312                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
2313                        + chem(i,k,j,lptr_oc_aer(3,itype,iphase)))
2316                enddo
2317             enddo
2318          enddo
2319    enddo ! type
2323    !do iphase=2,2 !set nphase_aer=2 for cloud-borne aerosols!BSINGH - Commented out 
2324    iphase = 2
2325    do itype=1,ntype_aer
2326          do j=jts,jmax
2327             do k=kts,kmax
2328                do i=its,imax
2329          hoa_cw04(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(4,itype,iphase)) &
2330                        + chem(i,k,j,lptr_pcg1_f_o_aer(4,itype,iphase))
2332           bboa_cw04(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(4,itype,iphase)) &
2333                        + chem(i,k,j,lptr_pcg1_b_o_aer(4,itype,iphase))
2335           soa_cw04(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
2336                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
2337                        + chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
2338                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
2339                        + chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
2340                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))
2342         arosoa_cw04(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))
2345         bbsoa_cw04(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
2346                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)))
2348         hsoa_cw04(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
2349                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)))
2351         biog_cw04(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))
2355          totoa_cw04(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(4,itype,iphase)) &
2356                        + chem(i,k,j,lptr_pcg1_b_o_aer(4,itype,iphase)) &
2357                        + chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
2358                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
2359                        + chem(i,k,j,lptr_pcg1_f_c_aer(4,itype,iphase)) &
2360                        + chem(i,k,j,lptr_pcg1_f_o_aer(4,itype,iphase)) &
2361                        + chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
2362                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
2363                        + chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
2364                        + chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
2365                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase)))
2368                enddo
2369             enddo
2370          enddo
2371    enddo ! type
2372    
2374    !do iphase=2,2 !set nphase_aer=1 for interstitial aerosols!BSINGH - Commented out 
2375    iphase = 2
2376    do itype=1,ntype_aer
2377          if(nsize_aer(itype).ge.5) then
2378          do j=jts,jmax
2379             do k=kts,kmax
2380                do i=its,imax
2381          hoa_cw05(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(5,itype,iphase)) &
2382                        + chem(i,k,j,lptr_pcg1_f_o_aer(5,itype,iphase))
2384           bboa_cw05(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(5,itype,iphase)) &
2385                        + chem(i,k,j,lptr_pcg1_b_o_aer(5,itype,iphase))
2387           soa_cw05(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(5,itype,iphase)) &
2388                        + chem(i,k,j,lptr_opcg1_b_o_aer(5,itype,iphase)) &
2389                        + chem(i,k,j,lptr_opcg1_f_c_aer(5,itype,iphase)) &
2390                        + chem(i,k,j,lptr_opcg1_f_o_aer(5,itype,iphase)) &
2391                        + chem(i,k,j,lptr_ant1_c_aer(5,itype,iphase))    &
2392                        + chem(i,k,j,lptr_biog1_c_aer(5,itype,iphase))
2394         arosoa_cw05(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(5,itype,iphase))
2397         bbsoa_cw05(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(5,itype,iphase)) &
2398                        + chem(i,k,j,lptr_opcg1_b_o_aer(5,itype,iphase)))
2400         hsoa_cw05(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(5,itype,iphase)) &
2401                        + chem(i,k,j,lptr_opcg1_f_o_aer(5,itype,iphase)))
2403         biog_cw05(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(5,itype,iphase))
2407          totoa_cw05(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(5,itype,iphase)) &
2408                        + chem(i,k,j,lptr_pcg1_b_o_aer(5,itype,iphase)) &
2409                        + chem(i,k,j,lptr_opcg1_b_c_aer(5,itype,iphase)) &
2410                        + chem(i,k,j,lptr_opcg1_b_o_aer(5,itype,iphase)) &
2411                        + chem(i,k,j,lptr_pcg1_f_c_aer(5,itype,iphase)) &
2412                        + chem(i,k,j,lptr_pcg1_f_o_aer(5,itype,iphase)) &
2413                        + chem(i,k,j,lptr_opcg1_f_c_aer(5,itype,iphase)) &
2414                        + chem(i,k,j,lptr_opcg1_f_o_aer(5,itype,iphase)) &
2415                        + chem(i,k,j,lptr_ant1_c_aer(5,itype,iphase))    &
2416                        + chem(i,k,j,lptr_biog1_c_aer(5,itype,iphase))    &
2417                        + chem(i,k,j,lptr_oc_aer(5,itype,iphase)))
2420                enddo
2421             enddo
2422          enddo
2423         endif  ! check for number of size bins
2424    enddo ! type
2425    
2428    !do iphase=2,2 !set nphase_aer=1 for interstitial aerosols!BSINGH - Commented out 
2429    iphase = 2
2430    do itype=1,ntype_aer
2431          if(nsize_aer(itype).ge.6) then
2432          do j=jts,jmax
2433             do k=kts,kmax
2434                do i=its,imax
2435          hoa_cw06(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(6,itype,iphase)) &
2436                        + chem(i,k,j,lptr_pcg1_f_o_aer(6,itype,iphase))
2438           bboa_cw06(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(6,itype,iphase)) &
2439                        + chem(i,k,j,lptr_pcg1_b_o_aer(6,itype,iphase))
2441           soa_cw06(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(6,itype,iphase)) &
2442                        + chem(i,k,j,lptr_opcg1_b_o_aer(6,itype,iphase)) &
2443                        + chem(i,k,j,lptr_opcg1_f_c_aer(6,itype,iphase)) &
2444                        + chem(i,k,j,lptr_opcg1_f_o_aer(6,itype,iphase)) &
2445                        + chem(i,k,j,lptr_ant1_c_aer(6,itype,iphase))    &
2446                        + chem(i,k,j,lptr_biog1_c_aer(6,itype,iphase))
2448         arosoa_cw06(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(6,itype,iphase))
2451         bbsoa_cw06(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(6,itype,iphase)) &
2452                        + chem(i,k,j,lptr_opcg1_b_o_aer(6,itype,iphase)))
2454         hsoa_cw06(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(6,itype,iphase)) &
2455                        + chem(i,k,j,lptr_opcg1_f_o_aer(6,itype,iphase)))
2457         biog_cw06(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(6,itype,iphase))
2461          totoa_cw06(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(6,itype,iphase)) &
2462                        + chem(i,k,j,lptr_pcg1_b_o_aer(6,itype,iphase)) &
2463                        + chem(i,k,j,lptr_opcg1_b_c_aer(6,itype,iphase)) &
2464                        + chem(i,k,j,lptr_opcg1_b_o_aer(6,itype,iphase)) &
2465                        + chem(i,k,j,lptr_pcg1_f_c_aer(6,itype,iphase)) &
2466                        + chem(i,k,j,lptr_pcg1_f_o_aer(6,itype,iphase)) &
2467                        + chem(i,k,j,lptr_opcg1_f_c_aer(6,itype,iphase)) &
2468                        + chem(i,k,j,lptr_opcg1_f_o_aer(6,itype,iphase)) &
2469                        + chem(i,k,j,lptr_ant1_c_aer(6,itype,iphase))    &
2470                        + chem(i,k,j,lptr_biog1_c_aer(6,itype,iphase))    &
2471                        + chem(i,k,j,lptr_oc_aer(6,itype,iphase)))
2474                enddo
2475             enddo
2476          enddo
2477          endif ! size bins
2478    enddo ! type
2479    
2481    !do iphase=2,2 !set nphase_aer=1 for interstitial aerosols!BSINGH - Commented out 
2482    iphase = 2
2483    do itype=1,ntype_aer
2484         if(nsize_aer(itype).ge.7) then
2485          do j=jts,jmax
2486             do k=kts,kmax
2487                do i=its,imax
2488          hoa_cw07(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(7,itype,iphase)) &
2489                        + chem(i,k,j,lptr_pcg1_f_o_aer(7,itype,iphase))
2491           bboa_cw07(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(7,itype,iphase)) &
2492                        + chem(i,k,j,lptr_pcg1_b_o_aer(7,itype,iphase))
2494           soa_cw07(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(7,itype,iphase)) &
2495                        + chem(i,k,j,lptr_opcg1_b_o_aer(7,itype,iphase)) &
2496                        + chem(i,k,j,lptr_opcg1_f_c_aer(7,itype,iphase)) &
2497                        + chem(i,k,j,lptr_opcg1_f_o_aer(7,itype,iphase)) &
2498                        + chem(i,k,j,lptr_ant1_c_aer(7,itype,iphase))    &
2499                        + chem(i,k,j,lptr_biog1_c_aer(7,itype,iphase))
2501         arosoa_cw07(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(7,itype,iphase))
2504         bbsoa_cw07(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(7,itype,iphase)) &
2505                        + chem(i,k,j,lptr_opcg1_b_o_aer(7,itype,iphase)))
2507         hsoa_cw07(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(7,itype,iphase)) &
2508                        + chem(i,k,j,lptr_opcg1_f_o_aer(7,itype,iphase)))
2510         biog_cw07(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(7,itype,iphase))
2514          totoa_cw07(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(7,itype,iphase)) &
2515                        + chem(i,k,j,lptr_pcg1_b_o_aer(7,itype,iphase)) &
2516                        + chem(i,k,j,lptr_opcg1_b_c_aer(7,itype,iphase)) &
2517                        + chem(i,k,j,lptr_opcg1_b_o_aer(7,itype,iphase)) &
2518                        + chem(i,k,j,lptr_pcg1_f_c_aer(7,itype,iphase)) &
2519                        + chem(i,k,j,lptr_pcg1_f_o_aer(7,itype,iphase)) &
2520                        + chem(i,k,j,lptr_opcg1_f_c_aer(7,itype,iphase)) &
2521                        + chem(i,k,j,lptr_opcg1_f_o_aer(7,itype,iphase)) &
2522                        + chem(i,k,j,lptr_ant1_c_aer(7,itype,iphase))    &
2523                        + chem(i,k,j,lptr_biog1_c_aer(7,itype,iphase))    &
2524                        + chem(i,k,j,lptr_oc_aer(7,itype,iphase)))
2527                enddo
2528             enddo
2529          enddo
2530           endif ! size bins
2531    enddo ! type
2532    
2534    !do iphase=2,2 !set nphase_aer=1 for interstitial aerosols!BSINGH - Commented out 
2535    iphase = 2
2536    do itype=1,ntype_aer
2537          if(nsize_aer(itype).ge.8) then
2538          do j=jts,jmax
2539             do k=kts,kmax
2540                do i=its,imax
2541          hoa_cw08(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(8,itype,iphase)) &
2542                        + chem(i,k,j,lptr_pcg1_f_o_aer(8,itype,iphase))
2544           bboa_cw08(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(8,itype,iphase)) &
2545                        + chem(i,k,j,lptr_pcg1_b_o_aer(8,itype,iphase))
2547           soa_cw08(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(8,itype,iphase)) &
2548                        + chem(i,k,j,lptr_opcg1_b_o_aer(8,itype,iphase)) &
2549                        + chem(i,k,j,lptr_opcg1_f_c_aer(8,itype,iphase)) &
2550                        + chem(i,k,j,lptr_opcg1_f_o_aer(8,itype,iphase)) &
2551                        + chem(i,k,j,lptr_ant1_c_aer(8,itype,iphase))    &
2552                        + chem(i,k,j,lptr_biog1_c_aer(8,itype,iphase))
2554         arosoa_cw08(i,k,j)= chem(i,k,j,lptr_ant1_c_aer(8,itype,iphase))
2557         bbsoa_cw08(i,k,j)= (chem(i,k,j,lptr_opcg1_b_c_aer(8,itype,iphase)) &
2558                        + chem(i,k,j,lptr_opcg1_b_o_aer(8,itype,iphase)))
2560         hsoa_cw08(i,k,j)= ( chem(i,k,j,lptr_opcg1_f_c_aer(8,itype,iphase)) &
2561                        + chem(i,k,j,lptr_opcg1_f_o_aer(8,itype,iphase)))
2563         biog_cw08(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(8,itype,iphase))
2567          totoa_cw08(i,k,j)= ( chem(i,k,j,lptr_pcg1_b_c_aer(8,itype,iphase)) &
2568                        + chem(i,k,j,lptr_pcg1_b_o_aer(8,itype,iphase)) &
2569                        + chem(i,k,j,lptr_opcg1_b_c_aer(8,itype,iphase)) &
2570                        + chem(i,k,j,lptr_opcg1_b_o_aer(8,itype,iphase)) &
2571                        + chem(i,k,j,lptr_pcg1_f_c_aer(8,itype,iphase)) &
2572                        + chem(i,k,j,lptr_pcg1_f_o_aer(8,itype,iphase)) &
2573                        + chem(i,k,j,lptr_opcg1_f_c_aer(8,itype,iphase)) &
2574                        + chem(i,k,j,lptr_opcg1_f_o_aer(8,itype,iphase)) &
2575                        + chem(i,k,j,lptr_ant1_c_aer(8,itype,iphase))    &
2576                        + chem(i,k,j,lptr_biog1_c_aer(8,itype,iphase))    &
2577                        + chem(i,k,j,lptr_oc_aer(8,itype,iphase)))
2580                enddo
2581             enddo
2582          enddo
2583            endif ! size bins
2584    enddo ! type
2585    
2591    end subroutine sum_aq_vbs2
2593 !BSINGH -ENDS
2595 !----------------------------------------------------------------------
2597 !-----------------------------------------------------------------------
2600        subroutine  sum_vbs4 ( aero_diag_opt,                           &
2601              alt, chem,                                                &
2602              hoa_a01,hoa_a02,hoa_a03,hoa_a04,                          &
2603              soa_a01,soa_a02,soa_a03,soa_a04,                          &
2604              biog_a01,biog_a02,biog_a03,biog_a04,                      &
2605              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
2606              biog_v1,biog_v2,biog_v3,biog_v4,                          &
2607              ant_v1,ant_v2,ant_v3,ant_v4,                              &
2608              ids,ide, jds,jde, kds,kde,                                &
2609              ims,ime, jms,jme, kms,kme,                                &
2610              its,ite, jts,jte, kts,kte                                  )
2612    USE module_state_description, only: num_chem
2613    USE module_data_mosaic_asect
2614    IMPLICIT NONE
2616    INTEGER,      INTENT(IN   )    ::  aero_diag_opt
2617    INTEGER,      INTENT(IN   )    ::                                   &
2618                                       ids,ide, jds,jde, kds,kde,       &
2619                                       ims,ime, jms,jme, kms,kme,       &
2620                                       its,ite, jts,jte, kts,kte
2622    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
2623          INTENT(IN) :: alt
2625    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
2626          INTENT(IN ) :: chem
2627    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
2628          INTENT(OUT) :: hoa_a01,hoa_a02,hoa_a03,hoa_a04,               &
2629              soa_a01,soa_a02,soa_a03,soa_a04,                          &
2630              biog_a01,biog_a02,biog_a03,biog_a04,                      &
2631              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
2632              biog_v1,biog_v2,biog_v3,biog_v4,                          &
2633              ant_v1,ant_v2,ant_v3,ant_v4
2637    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
2639    imax = min(ite,ide-1)
2640    jmax = min(jte,jde-1)
2641    kmax = kte
2643     totoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
2644     totoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
2645     totoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
2646     totoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
2648    if( aero_diag_opt > 0 ) then
2649     hoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
2650     soa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
2651     biog_a01(its:imax,kts:kmax,jts:jmax)    = 0.
2653     hoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
2654     soa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
2655     biog_a02(its:imax,kts:kmax,jts:jmax)    = 0.
2657     hoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
2658     soa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
2659     biog_a03(its:imax,kts:kmax,jts:jmax)    = 0.
2661     hoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
2662     soa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
2663     biog_a04(its:imax,kts:kmax,jts:jmax)    = 0.
2665 ! Species to calculate O:C ratios
2666      biog_v1(its:imax,kts:kmax,jts:jmax)    = 0.
2667      biog_v2(its:imax,kts:kmax,jts:jmax)    = 0.
2668      biog_v3(its:imax,kts:kmax,jts:jmax)    = 0.
2669      biog_v4(its:imax,kts:kmax,jts:jmax)    = 0.
2670      ant_v1(its:imax,kts:kmax,jts:jmax)    = 0.
2671      ant_v2(its:imax,kts:kmax,jts:jmax)    = 0.
2672      ant_v3(its:imax,kts:kmax,jts:jmax)    = 0.
2673      ant_v4(its:imax,kts:kmax,jts:jmax)    = 0.
2674    endif
2676    do iphase=1,nphase_aer
2677       do itype=1,ntype_aer
2678          do j=jts,jmax
2679             do k=kts,kmax
2680                do i=its,imax
2681                  totoa_a01(i,k,j)= totoa_a01(i,k,j) &
2682                        + chem(i,k,j,lptr_asoaX_aer(1,itype,iphase)) &
2683                        + chem(i,k,j,lptr_asoa1_aer(1,itype,iphase)) &
2684                        + chem(i,k,j,lptr_asoa2_aer(1,itype,iphase)) &
2685                        + chem(i,k,j,lptr_asoa3_aer(1,itype,iphase)) &
2686                        + chem(i,k,j,lptr_asoa4_aer(1,itype,iphase)) &
2687                        + chem(i,k,j,lptr_bsoaX_aer(1,itype,iphase)) &
2688                        + chem(i,k,j,lptr_bsoa1_aer(1,itype,iphase)) &
2689                        + chem(i,k,j,lptr_bsoa2_aer(1,itype,iphase)) &
2690                        + chem(i,k,j,lptr_bsoa3_aer(1,itype,iphase)) &
2691                        + chem(i,k,j,lptr_bsoa4_aer(1,itype,iphase)) &
2692                        + chem(i,k,j,lptr_glysoa_r1_aer(1,itype,iphase)) &
2693                        + chem(i,k,j,lptr_glysoa_r2_aer(1,itype,iphase)) &
2694                        + chem(i,k,j,lptr_glysoa_oh_aer(1,itype,iphase)) &
2695                        + chem(i,k,j,lptr_glysoa_sfc_aer(1,itype,iphase)) &
2696                        + chem(i,k,j,lptr_glysoa_nh4_aer(1,itype,iphase)) &
2697                        + chem(i,k,j,lptr_oc_aer(1,itype,iphase))
2698                  totoa_a02(i,k,j)= totoa_a02(i,k,j) &
2699                        + chem(i,k,j,lptr_asoaX_aer(2,itype,iphase)) &
2700                        + chem(i,k,j,lptr_asoa1_aer(2,itype,iphase)) &
2701                        + chem(i,k,j,lptr_asoa2_aer(2,itype,iphase)) &
2702                        + chem(i,k,j,lptr_asoa3_aer(2,itype,iphase)) &
2703                        + chem(i,k,j,lptr_asoa4_aer(2,itype,iphase)) &
2704                        + chem(i,k,j,lptr_bsoaX_aer(2,itype,iphase)) &
2705                        + chem(i,k,j,lptr_bsoa1_aer(2,itype,iphase)) &
2706                        + chem(i,k,j,lptr_bsoa2_aer(2,itype,iphase)) &
2707                        + chem(i,k,j,lptr_bsoa3_aer(2,itype,iphase)) &
2708                        + chem(i,k,j,lptr_bsoa4_aer(2,itype,iphase)) &
2709                        + chem(i,k,j,lptr_glysoa_r1_aer(2,itype,iphase)) &
2710                        + chem(i,k,j,lptr_glysoa_r2_aer(2,itype,iphase)) &
2711                        + chem(i,k,j,lptr_glysoa_oh_aer(2,itype,iphase)) &
2712                        + chem(i,k,j,lptr_glysoa_sfc_aer(2,itype,iphase)) &
2713                        + chem(i,k,j,lptr_glysoa_nh4_aer(2,itype,iphase)) &
2714                        + chem(i,k,j,lptr_oc_aer(2,itype,iphase))
2715                  totoa_a03(i,k,j)= totoa_a03(i,k,j) &
2716                        + chem(i,k,j,lptr_asoaX_aer(3,itype,iphase)) &
2717                        + chem(i,k,j,lptr_asoa1_aer(3,itype,iphase)) &
2718                        + chem(i,k,j,lptr_asoa2_aer(3,itype,iphase)) &
2719                        + chem(i,k,j,lptr_asoa3_aer(3,itype,iphase)) &
2720                        + chem(i,k,j,lptr_asoa4_aer(3,itype,iphase)) &
2721                        + chem(i,k,j,lptr_bsoaX_aer(3,itype,iphase)) &
2722                        + chem(i,k,j,lptr_bsoa1_aer(3,itype,iphase)) &
2723                        + chem(i,k,j,lptr_bsoa2_aer(3,itype,iphase)) &
2724                        + chem(i,k,j,lptr_bsoa3_aer(3,itype,iphase)) &
2725                        + chem(i,k,j,lptr_bsoa4_aer(3,itype,iphase)) &
2726                        + chem(i,k,j,lptr_glysoa_r1_aer(3,itype,iphase)) &
2727                        + chem(i,k,j,lptr_glysoa_r2_aer(3,itype,iphase)) &
2728                        + chem(i,k,j,lptr_glysoa_oh_aer(3,itype,iphase)) &
2729                        + chem(i,k,j,lptr_glysoa_sfc_aer(3,itype,iphase)) &
2730                        + chem(i,k,j,lptr_glysoa_nh4_aer(3,itype,iphase)) &
2731                        + chem(i,k,j,lptr_oc_aer(3,itype,iphase))
2732                  totoa_a04(i,k,j)= totoa_a04(i,k,j) &
2733                        + chem(i,k,j,lptr_asoaX_aer(4,itype,iphase)) &
2734                        + chem(i,k,j,lptr_asoa1_aer(4,itype,iphase)) &
2735                        + chem(i,k,j,lptr_asoa2_aer(4,itype,iphase)) &
2736                        + chem(i,k,j,lptr_asoa3_aer(4,itype,iphase)) &
2737                        + chem(i,k,j,lptr_asoa4_aer(4,itype,iphase)) &
2738                        + chem(i,k,j,lptr_bsoaX_aer(4,itype,iphase)) &
2739                        + chem(i,k,j,lptr_bsoa1_aer(4,itype,iphase)) &
2740                        + chem(i,k,j,lptr_bsoa2_aer(4,itype,iphase)) &
2741                        + chem(i,k,j,lptr_bsoa3_aer(4,itype,iphase)) &
2742                        + chem(i,k,j,lptr_bsoa4_aer(4,itype,iphase)) &
2743                        + chem(i,k,j,lptr_glysoa_r1_aer(4,itype,iphase)) &
2744                        + chem(i,k,j,lptr_glysoa_r2_aer(4,itype,iphase)) &
2745                        + chem(i,k,j,lptr_glysoa_oh_aer(4,itype,iphase)) &
2746                        + chem(i,k,j,lptr_glysoa_sfc_aer(4,itype,iphase)) &
2747                        + chem(i,k,j,lptr_glysoa_nh4_aer(4,itype,iphase)) &
2748                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase))
2749                enddo
2750             enddo
2751          enddo
2752       enddo ! type
2753    enddo ! phase
2755    if( aero_diag_opt > 0 ) then
2756    do iphase=1,nphase_aer
2757    do itype=1,ntype_aer
2758    do n = 1, nsize_aer(itype) !The 4th bin is 2.5-10um and outside the AMS measurements
2759          do j=jts,jmax
2760             do k=kts,kmax
2761                do i=its,imax
2763         biog_v1(i,k,j)= biog_v1(i,k,j) &
2764                          + chem(i,k,j,lptr_bsoaX_aer(n,itype,iphase))    &
2765                          + chem(i,k,j,lptr_bsoa1_aer(n,itype,iphase))    &
2766                          + chem(i,k,j,lptr_bsoa2_aer(n,itype,iphase))    &
2767                          + chem(i,k,j,lptr_bsoa3_aer(n,itype,iphase))    &
2768                          + chem(i,k,j,lptr_bsoa4_aer(n,itype,iphase))
2770         ant_v1(i,k,j)=  ant_v1(i,k,j) &
2771                          + chem(i,k,j,lptr_asoaX_aer(n,itype,iphase))    &
2772                          + chem(i,k,j,lptr_asoa1_aer(n,itype,iphase))    &
2773                          + chem(i,k,j,lptr_asoa2_aer(n,itype,iphase))    &
2774                          + chem(i,k,j,lptr_asoa3_aer(n,itype,iphase))    &
2775                          + chem(i,k,j,lptr_asoa4_aer(n,itype,iphase))
2777                  enddo
2778                enddo
2779              enddo
2780                     enddo
2781                   enddo
2782                enddo
2784       biog_v1(its:imax,kts:kmax,jts:jmax) = biog_v1(its:imax,kts:kmax,jts:jmax) &
2785                                            / alt(its:imax,kts:kmax,jts:jmax)
2786       ant_v1(its:imax,kts:kmax,jts:jmax) = ant_v1(its:imax,kts:kmax,jts:jmax) &
2787                                            / alt(its:imax,kts:kmax,jts:jmax)
2789    do iphase=1,nphase_aer
2790    do itype=1,ntype_aer
2791          do j=jts,jmax
2792             do k=kts,kmax
2793                do i=its,imax
2794         hoa_a01(i,k,j)= hoa_a01(i,k,j) &
2795                        +chem(i,k,j,lptr_oc_aer(1,itype,iphase))
2797         soa_a01(i,k,j)= soa_a01(i,k,j) &
2798                        + chem(i,k,j,lptr_asoaX_aer(1,itype,iphase)) &
2799                        + chem(i,k,j,lptr_asoa1_aer(1,itype,iphase)) &
2800                        + chem(i,k,j,lptr_asoa2_aer(1,itype,iphase)) &
2801                        + chem(i,k,j,lptr_asoa3_aer(1,itype,iphase)) &
2802                        + chem(i,k,j,lptr_asoa4_aer(1,itype,iphase)) &
2803                        + chem(i,k,j,lptr_bsoaX_aer(1,itype,iphase)) &
2804                        + chem(i,k,j,lptr_bsoa1_aer(1,itype,iphase)) &
2805                        + chem(i,k,j,lptr_bsoa2_aer(1,itype,iphase)) &
2806                        + chem(i,k,j,lptr_bsoa3_aer(1,itype,iphase)) &
2807                        + chem(i,k,j,lptr_bsoa4_aer(1,itype,iphase)) &
2808                        + chem(i,k,j,lptr_glysoa_r1_aer(1,itype,iphase)) &
2809                        + chem(i,k,j,lptr_glysoa_r2_aer(1,itype,iphase)) &
2810                        + chem(i,k,j,lptr_glysoa_sfc_aer(1,itype,iphase)) &
2811                        + chem(i,k,j,lptr_glysoa_oh_aer(1,itype,iphase)) &
2812                        + chem(i,k,j,lptr_glysoa_nh4_aer(1,itype,iphase))
2814         biog_a01(i,k,j)= biog_a01(i,k,j) &
2815                        + chem(i,k,j,lptr_bsoa1_aer(1,itype,iphase)) &
2816                        + chem(i,k,j,lptr_bsoa2_aer(1,itype,iphase)) &
2817                        + chem(i,k,j,lptr_bsoa3_aer(1,itype,iphase)) &
2818                        + chem(i,k,j,lptr_bsoa4_aer(1,itype,iphase))
2819                enddo
2820             enddo
2821          enddo
2822    enddo ! type
2823    enddo ! phase
2825    do iphase=1,nphase_aer
2826    do itype=1,ntype_aer
2827          do j=jts,jmax
2828             do k=kts,kmax
2829                do i=its,imax
2830         hoa_a02(i,k,j)= hoa_a02(i,k,j) &
2831                        +chem(i,k,j,lptr_oc_aer(2,itype,iphase))
2833         soa_a02(i,k,j)= soa_a02(i,k,j) &
2834                        + chem(i,k,j,lptr_asoaX_aer(2,itype,iphase)) &
2835                        + chem(i,k,j,lptr_asoa1_aer(2,itype,iphase)) &
2836                        + chem(i,k,j,lptr_asoa2_aer(2,itype,iphase)) &
2837                        + chem(i,k,j,lptr_asoa3_aer(2,itype,iphase)) &
2838                        + chem(i,k,j,lptr_asoa4_aer(2,itype,iphase)) &
2839                        + chem(i,k,j,lptr_bsoaX_aer(2,itype,iphase)) &
2840                        + chem(i,k,j,lptr_bsoa1_aer(2,itype,iphase)) &
2841                        + chem(i,k,j,lptr_bsoa2_aer(2,itype,iphase)) &
2842                        + chem(i,k,j,lptr_bsoa3_aer(2,itype,iphase)) &
2843                        + chem(i,k,j,lptr_bsoa4_aer(2,itype,iphase)) &
2844                        + chem(i,k,j,lptr_glysoa_r1_aer(2,itype,iphase)) &
2845                        + chem(i,k,j,lptr_glysoa_r2_aer(2,itype,iphase)) &
2846                        + chem(i,k,j,lptr_glysoa_sfc_aer(2,itype,iphase)) &
2847                        + chem(i,k,j,lptr_glysoa_oh_aer(2,itype,iphase)) &
2848                        + chem(i,k,j,lptr_glysoa_nh4_aer(2,itype,iphase))
2850         biog_a02(i,k,j)= biog_a02(i,k,j) &
2851                        + chem(i,k,j,lptr_bsoa1_aer(2,itype,iphase)) &
2852                        + chem(i,k,j,lptr_bsoa2_aer(2,itype,iphase)) &
2853                        + chem(i,k,j,lptr_bsoa3_aer(2,itype,iphase)) &
2854                        + chem(i,k,j,lptr_bsoa4_aer(2,itype,iphase))
2855                enddo
2856             enddo
2857          enddo
2858    enddo ! type
2859    enddo ! phase
2861    do iphase=1,nphase_aer
2862    do itype=1,ntype_aer
2863          do j=jts,jmax
2864             do k=kts,kmax
2865                do i=its,imax
2866         hoa_a03(i,k,j)= hoa_a03(i,k,j) &
2867                        + chem(i,k,j,lptr_oc_aer(3,itype,iphase))
2869         soa_a03(i,k,j)= soa_a03(i,k,j) &
2870                        + chem(i,k,j,lptr_asoaX_aer(3,itype,iphase)) &
2871                        + chem(i,k,j,lptr_asoa1_aer(3,itype,iphase)) &
2872                        + chem(i,k,j,lptr_asoa2_aer(3,itype,iphase)) &
2873                        + chem(i,k,j,lptr_asoa3_aer(3,itype,iphase)) &
2874                        + chem(i,k,j,lptr_asoa4_aer(3,itype,iphase)) &
2875                        + chem(i,k,j,lptr_bsoaX_aer(3,itype,iphase)) &
2876                        + chem(i,k,j,lptr_bsoa1_aer(3,itype,iphase)) &
2877                        + chem(i,k,j,lptr_bsoa2_aer(3,itype,iphase)) &
2878                        + chem(i,k,j,lptr_bsoa3_aer(3,itype,iphase)) &
2879                        + chem(i,k,j,lptr_bsoa4_aer(3,itype,iphase)) &
2880                        + chem(i,k,j,lptr_glysoa_r1_aer(3,itype,iphase)) &
2881                        + chem(i,k,j,lptr_glysoa_r2_aer(3,itype,iphase)) &
2882                        + chem(i,k,j,lptr_glysoa_sfc_aer(3,itype,iphase)) &
2883                        + chem(i,k,j,lptr_glysoa_oh_aer(3,itype,iphase)) &
2884                        + chem(i,k,j,lptr_glysoa_nh4_aer(3,itype,iphase))
2886         biog_a03(i,k,j)= biog_a03(i,k,j) &
2887                        + chem(i,k,j,lptr_bsoa1_aer(3,itype,iphase)) &
2888                        + chem(i,k,j,lptr_bsoa2_aer(3,itype,iphase)) &
2889                        + chem(i,k,j,lptr_bsoa3_aer(3,itype,iphase)) &
2890                        + chem(i,k,j,lptr_bsoa4_aer(3,itype,iphase))
2891                enddo
2892             enddo
2893          enddo
2894    enddo ! type
2895    enddo ! phase
2897    do iphase=1,nphase_aer
2898    do itype=1,ntype_aer
2899          do j=jts,jmax
2900             do k=kts,kmax
2901                do i=its,imax
2902         hoa_a04(i,k,j)= hoa_a04(i,k,j) &
2903                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase))
2905         soa_a04(i,k,j)= soa_a04(i,k,j) &
2906                        + chem(i,k,j,lptr_asoaX_aer(4,itype,iphase)) &
2907                        + chem(i,k,j,lptr_asoa1_aer(4,itype,iphase)) &
2908                        + chem(i,k,j,lptr_asoa2_aer(4,itype,iphase)) &
2909                        + chem(i,k,j,lptr_asoa3_aer(4,itype,iphase)) &
2910                        + chem(i,k,j,lptr_asoa4_aer(4,itype,iphase)) &
2911                        + chem(i,k,j,lptr_bsoaX_aer(4,itype,iphase)) &
2912                        + chem(i,k,j,lptr_bsoa1_aer(4,itype,iphase)) &
2913                        + chem(i,k,j,lptr_bsoa2_aer(4,itype,iphase)) &
2914                        + chem(i,k,j,lptr_bsoa3_aer(4,itype,iphase)) &
2915                        + chem(i,k,j,lptr_bsoa4_aer(4,itype,iphase)) &
2916                        + chem(i,k,j,lptr_glysoa_r1_aer(4,itype,iphase)) &
2917                        + chem(i,k,j,lptr_glysoa_r2_aer(4,itype,iphase)) &
2918                        + chem(i,k,j,lptr_glysoa_sfc_aer(4,itype,iphase)) &
2919                        + chem(i,k,j,lptr_glysoa_oh_aer(4,itype,iphase)) &
2920                        + chem(i,k,j,lptr_glysoa_nh4_aer(4,itype,iphase))
2922         biog_a04(i,k,j)= biog_a04(i,k,j) &
2923                        + chem(i,k,j,lptr_bsoa1_aer(4,itype,iphase)) &
2924                        + chem(i,k,j,lptr_bsoa2_aer(4,itype,iphase)) &
2925                        + chem(i,k,j,lptr_bsoa3_aer(4,itype,iphase)) &
2926                        + chem(i,k,j,lptr_bsoa4_aer(4,itype,iphase))
2927                enddo
2928             enddo
2929          enddo
2930    enddo ! type
2931    enddo ! phase
2932    endif
2934 !Factor of 1.4 used below to convert OC to OA
2935         totoa_a01(its:imax,kts:kmax,jts:jmax) =totoa_a01(its:imax,kts:kmax,jts:jmax) &
2936                                            / alt(its:imax,kts:kmax,jts:jmax)
2937         totoa_a02(its:imax,kts:kmax,jts:jmax) =totoa_a02(its:imax,kts:kmax,jts:jmax) &
2938                                            / alt(its:imax,kts:kmax,jts:jmax)
2939         totoa_a03(its:imax,kts:kmax,jts:jmax) =totoa_a03(its:imax,kts:kmax,jts:jmax) &
2940                                            / alt(its:imax,kts:kmax,jts:jmax)
2941         totoa_a04(its:imax,kts:kmax,jts:jmax) =totoa_a04(its:imax,kts:kmax,jts:jmax) &
2942                                            / alt(its:imax,kts:kmax,jts:jmax)
2943       if( aero_diag_opt > 0 ) then
2944         hoa_a01(its:imax,kts:kmax,jts:jmax) =hoa_a01(its:imax,kts:kmax,jts:jmax) &
2945                                            / alt(its:imax,kts:kmax,jts:jmax)
2946         soa_a01(its:imax,kts:kmax,jts:jmax) =soa_a01(its:imax,kts:kmax,jts:jmax) &
2947                                            / alt(its:imax,kts:kmax,jts:jmax)
2948         biog_a01(its:imax,kts:kmax,jts:jmax) =biog_a01(its:imax,kts:kmax,jts:jmax) &
2949                                            / alt(its:imax,kts:kmax,jts:jmax)
2951         hoa_a02(its:imax,kts:kmax,jts:jmax) =hoa_a02(its:imax,kts:kmax,jts:jmax) &
2952                                            / alt(its:imax,kts:kmax,jts:jmax)
2953         soa_a02(its:imax,kts:kmax,jts:jmax) =soa_a02(its:imax,kts:kmax,jts:jmax) &
2954                                            / alt(its:imax,kts:kmax,jts:jmax)
2955         biog_a02(its:imax,kts:kmax,jts:jmax) =biog_a02(its:imax,kts:kmax,jts:jmax) &
2956                                            / alt(its:imax,kts:kmax,jts:jmax)
2959         hoa_a03(its:imax,kts:kmax,jts:jmax) =hoa_a03(its:imax,kts:kmax,jts:jmax) &
2960                                            / alt(its:imax,kts:kmax,jts:jmax)
2961         soa_a03(its:imax,kts:kmax,jts:jmax) =soa_a03(its:imax,kts:kmax,jts:jmax) &
2962                                            / alt(its:imax,kts:kmax,jts:jmax)
2963         biog_a03(its:imax,kts:kmax,jts:jmax) =biog_a03(its:imax,kts:kmax,jts:jmax) &
2964                                            / alt(its:imax,kts:kmax,jts:jmax)
2966         hoa_a04(its:imax,kts:kmax,jts:jmax) =hoa_a04(its:imax,kts:kmax,jts:jmax) &
2967                                            / alt(its:imax,kts:kmax,jts:jmax)
2968         soa_a04(its:imax,kts:kmax,jts:jmax) =soa_a04(its:imax,kts:kmax,jts:jmax) &
2969                                            / alt(its:imax,kts:kmax,jts:jmax)
2970         biog_a04(its:imax,kts:kmax,jts:jmax) =biog_a04(its:imax,kts:kmax,jts:jmax) &
2971                                            / alt(its:imax,kts:kmax,jts:jmax)
2972       endif
2974    end subroutine sum_vbs4
2980 !----------------------------------------------------------------------
2981       subroutine  sum_vbs9 (                                           &
2982              alt, chem,                                                &
2983              hoa_a01,hoa_a02,hoa_a03,hoa_a04,                          &
2984              bboa_a01,bboa_a02,bboa_a03,bboa_a04,                      &
2985              soa_a01,soa_a02,soa_a03,soa_a04,                          &
2986              bbsoa_a01,bbsoa_a02,bbsoa_a03,bbsoa_a04,                  &
2987              hsoa_a01,hsoa_a02,hsoa_a03,hsoa_a04,                      &
2988              biog_a01,biog_a02,biog_a03,biog_a04,                      &
2989              arosoa_a01,arosoa_a02,arosoa_a03,arosoa_a04,              &
2990              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
2991              hsoa_c,hsoa_o,bbsoa_c,bbsoa_o,                            &
2992              biog_v1,biog_v2,biog_v3,biog_v4,                          &
2993              ant_v1,ant_v2,ant_v3,ant_v4,                              &
2994              ids,ide, jds,jde, kds,kde,                                &
2995              ims,ime, jms,jme, kms,kme,                                &
2996              its,ite, jts,jte, kts,kte                                  )
2998    USE module_state_description, only: num_chem
2999    USE module_data_mosaic_asect
3000    IMPLICIT NONE
3002    INTEGER,      INTENT(IN   )    ::                                   &
3003                                       ids,ide, jds,jde, kds,kde,       &
3004                                       ims,ime, jms,jme, kms,kme,       &
3005                                       its,ite, jts,jte, kts,kte
3007    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
3008          INTENT(IN) :: alt
3010    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
3011          INTENT(IN ) :: chem
3012    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
3013          INTENT(OUT) :: hoa_a01,hoa_a02,hoa_a03,hoa_a04,               &
3014              bboa_a01,bboa_a02,bboa_a03,bboa_a04,                      &
3015              soa_a01,soa_a02,soa_a03,soa_a04,                          &
3016              bbsoa_a01,bbsoa_a02,bbsoa_a03,bbsoa_a04,                  &
3017              biog_a01,biog_a02,biog_a03,biog_a04,                      &
3018              hsoa_a01,hsoa_a02,hsoa_a03,hsoa_a04,                      &
3019              arosoa_a01,arosoa_a02,arosoa_a03,arosoa_a04,                      &
3020              totoa_a01,totoa_a02,totoa_a03,totoa_a04,                  &
3021              hsoa_c,hsoa_o,bbsoa_c,bbsoa_o,                            &
3022              biog_v1,biog_v2,biog_v3,biog_v4,                          &
3023              ant_v1,ant_v2,ant_v3,ant_v4
3027    INTEGER :: i,imax,j,jmax,k,kmax,n,itype,iphase
3029    imax = min(ite,ide-1)
3030    jmax = min(jte,jde-1)
3031    kmax = kte
3033     hoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3034     soa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3035     bboa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3036     bbsoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3037     hsoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3038     biog_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3039     arosoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3040     totoa_a01(its:imax,kts:kmax,jts:jmax)    = 0.
3042     hoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3043     soa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3044     bboa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3045     bbsoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3046     hsoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3047     arosoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3048     biog_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3049     totoa_a02(its:imax,kts:kmax,jts:jmax)    = 0.
3051     hoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3052     soa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3053     bboa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3054     bbsoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3055     hsoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3056     arosoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3057     biog_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3058     totoa_a03(its:imax,kts:kmax,jts:jmax)    = 0.
3060     hoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3061     soa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3062     bboa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3063     bbsoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3064     hsoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3065     arosoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3066     biog_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3067     totoa_a04(its:imax,kts:kmax,jts:jmax)    = 0.
3069 ! Species to calculate O:C ratios
3070      hsoa_c(its:imax,kts:kmax,jts:jmax)    = 0.
3071      hsoa_o(its:imax,kts:kmax,jts:jmax)    = 0.
3072      bbsoa_c(its:imax,kts:kmax,jts:jmax)    = 0.
3073      bbsoa_o(its:imax,kts:kmax,jts:jmax)    = 0.
3074      biog_v1(its:imax,kts:kmax,jts:jmax)    = 0.
3075      biog_v2(its:imax,kts:kmax,jts:jmax)    = 0.
3076      biog_v3(its:imax,kts:kmax,jts:jmax)    = 0.
3077      biog_v4(its:imax,kts:kmax,jts:jmax)    = 0.
3078      ant_v1(its:imax,kts:kmax,jts:jmax)    = 0.
3079      ant_v2(its:imax,kts:kmax,jts:jmax)    = 0.
3080      ant_v3(its:imax,kts:kmax,jts:jmax)    = 0.
3081      ant_v4(its:imax,kts:kmax,jts:jmax)    = 0.
3084    do iphase=1,nphase_aer
3085    do itype=1,ntype_aer
3086    do n = 1, nsize_aer(itype) !The 4th bin is 2.5-10um and outside the AMS measurements
3087          do j=jts,jmax
3088             do k=kts,kmax
3089                do i=its,imax
3091           hsoa_c(i,k,j)=hsoa_c(i,k,j) &
3092                        + (chem(i,k,j,lptr_pcg1_f_c_aer(n,itype,iphase)) &
3093                        + chem(i,k,j,lptr_pcg2_f_c_aer(n,itype,iphase)) &
3094                        + chem(i,k,j,lptr_pcg3_f_c_aer(n,itype,iphase)) &
3095                        + chem(i,k,j,lptr_pcg4_f_c_aer(n,itype,iphase)) &
3096                        + chem(i,k,j,lptr_pcg5_f_c_aer(n,itype,iphase)) &
3097                        + chem(i,k,j,lptr_pcg6_f_c_aer(n,itype,iphase)) &
3098                        + chem(i,k,j,lptr_pcg7_f_c_aer(n,itype,iphase)) &
3099                        + chem(i,k,j,lptr_opcg1_f_c_aer(n,itype,iphase)) &
3100                        + chem(i,k,j,lptr_opcg2_f_c_aer(n,itype,iphase)) &
3101                        + chem(i,k,j,lptr_opcg3_f_c_aer(n,itype,iphase)) &
3102                        + chem(i,k,j,lptr_opcg4_f_c_aer(n,itype,iphase)) &
3103                        + chem(i,k,j,lptr_opcg5_f_c_aer(n,itype,iphase)) &
3104                        + chem(i,k,j,lptr_opcg6_f_c_aer(n,itype,iphase)) &
3105                        + chem(i,k,j,lptr_opcg7_f_c_aer(n,itype,iphase)))*180/211 
3107          hsoa_o(i,k,j)= hsoa_o(i,k,j) &
3108                        + chem(i,k,j,lptr_pcg1_f_o_aer(n,itype,iphase)) &
3109                        + chem(i,k,j,lptr_pcg2_f_o_aer(n,itype,iphase)) &
3110                        + chem(i,k,j,lptr_pcg3_f_o_aer(n,itype,iphase)) &
3111                        + chem(i,k,j,lptr_pcg4_f_o_aer(n,itype,iphase)) &
3112                        + chem(i,k,j,lptr_pcg5_f_o_aer(n,itype,iphase)) &
3113                        + chem(i,k,j,lptr_pcg6_f_o_aer(n,itype,iphase)) &
3114                        + chem(i,k,j,lptr_pcg7_f_o_aer(n,itype,iphase)) &
3115                        + chem(i,k,j,lptr_opcg1_f_o_aer(n,itype,iphase)) &
3116                        + chem(i,k,j,lptr_opcg2_f_o_aer(n,itype,iphase)) &
3117                        + chem(i,k,j,lptr_opcg3_f_o_aer(n,itype,iphase)) &
3118                        + chem(i,k,j,lptr_opcg4_f_o_aer(n,itype,iphase)) &
3119                        + chem(i,k,j,lptr_opcg5_f_o_aer(n,itype,iphase)) &
3120                        + chem(i,k,j,lptr_opcg6_f_o_aer(n,itype,iphase)) &
3121                        + chem(i,k,j,lptr_opcg7_f_o_aer(n,itype,iphase)) 
3123           bbsoa_c(i,k,j)= bbsoa_c(i,k,j) &
3124                        + (chem(i,k,j,lptr_pcg1_b_c_aer(n,itype,iphase)) &
3125                        + chem(i,k,j,lptr_pcg2_b_c_aer(n,itype,iphase)) &
3126                        + chem(i,k,j,lptr_pcg3_b_c_aer(n,itype,iphase)) &
3127                        + chem(i,k,j,lptr_pcg4_b_c_aer(n,itype,iphase)) &
3128                        + chem(i,k,j,lptr_pcg5_b_c_aer(n,itype,iphase)) &
3129                        + chem(i,k,j,lptr_pcg6_b_c_aer(n,itype,iphase)) &
3130                        + chem(i,k,j,lptr_pcg7_b_c_aer(n,itype,iphase)) &
3131                        + chem(i,k,j,lptr_opcg1_b_c_aer(n,itype,iphase)) &
3132                        + chem(i,k,j,lptr_opcg2_b_c_aer(n,itype,iphase)) &
3133                        + chem(i,k,j,lptr_opcg3_b_c_aer(n,itype,iphase)) &
3134                        + chem(i,k,j,lptr_opcg4_b_c_aer(n,itype,iphase)) &
3135                        + chem(i,k,j,lptr_opcg5_b_c_aer(n,itype,iphase)) &
3136                        + chem(i,k,j,lptr_opcg6_b_c_aer(n,itype,iphase)) &
3137                        + chem(i,k,j,lptr_opcg7_b_c_aer(n,itype,iphase)))*180/211 
3139          bbsoa_o(i,k,j)=bbsoa_o(i,k,j) &
3140                        + chem(i,k,j,lptr_pcg1_b_o_aer(n,itype,iphase)) &
3141                        + chem(i,k,j,lptr_pcg2_b_o_aer(n,itype,iphase)) &
3142                        + chem(i,k,j,lptr_pcg3_b_o_aer(n,itype,iphase)) &
3143                        + chem(i,k,j,lptr_pcg4_b_o_aer(n,itype,iphase)) &
3144                        + chem(i,k,j,lptr_pcg5_b_o_aer(n,itype,iphase)) &
3145                        + chem(i,k,j,lptr_pcg6_b_o_aer(n,itype,iphase)) &
3146                        + chem(i,k,j,lptr_pcg7_b_o_aer(n,itype,iphase)) &
3147                        + chem(i,k,j,lptr_opcg1_b_o_aer(n,itype,iphase)) &
3148                        + chem(i,k,j,lptr_opcg2_b_o_aer(n,itype,iphase)) &
3149                        + chem(i,k,j,lptr_opcg3_b_o_aer(n,itype,iphase)) &
3150                        + chem(i,k,j,lptr_opcg4_b_o_aer(n,itype,iphase)) &
3151                        + chem(i,k,j,lptr_opcg5_b_o_aer(n,itype,iphase)) &
3152                        + chem(i,k,j,lptr_opcg6_b_o_aer(n,itype,iphase)) &
3153                        + chem(i,k,j,lptr_opcg7_b_o_aer(n,itype,iphase)) 
3155         biog_v1(i,k,j)= biog_v1(i,k,j) &
3156                          + chem(i,k,j,lptr_biog1_c_aer(n,itype,iphase))    &
3157                          + chem(i,k,j,lptr_biog1_o_aer(n,itype,iphase))
3158         biog_v2(i,k,j)=  biog_v2(i,k,j) &
3159                          + chem(i,k,j,lptr_biog2_c_aer(n,itype,iphase))    &
3160                          + chem(i,k,j,lptr_biog2_o_aer(n,itype,iphase))
3161         biog_v3(i,k,j)=  biog_v3(i,k,j) &
3162                          + chem(i,k,j,lptr_biog3_c_aer(n,itype,iphase))    &
3163                          + chem(i,k,j,lptr_biog3_o_aer(n,itype,iphase))
3164         biog_v4(i,k,j)=  biog_v4(i,k,j) &
3165                          +chem(i,k,j,lptr_biog4_c_aer(n,itype,iphase))    &
3166                          + chem(i,k,j,lptr_biog4_o_aer(n,itype,iphase))
3168         ant_v1(i,k,j)=  ant_v1(i,k,j) &
3169                          + chem(i,k,j,lptr_ant1_c_aer(n,itype,iphase))    &
3170                          + chem(i,k,j,lptr_ant1_o_aer(n,itype,iphase))
3171         ant_v2(i,k,j)=  ant_v2(i,k,j) &
3172                          + chem(i,k,j,lptr_ant2_c_aer(n,itype,iphase))    &
3173                          + chem(i,k,j,lptr_ant2_o_aer(n,itype,iphase))
3174         ant_v3(i,k,j)=   ant_v3(i,k,j) &
3175                          + chem(i,k,j,lptr_ant3_c_aer(n,itype,iphase))    &
3176                          + chem(i,k,j,lptr_ant3_o_aer(n,itype,iphase))
3177         ant_v4(i,k,j)=  ant_v4(i,k,j) &
3178                          + chem(i,k,j,lptr_ant4_c_aer(n,itype,iphase))    &
3179                          + chem(i,k,j,lptr_ant4_o_aer(n,itype,iphase))
3181                  enddo
3182                enddo
3183              enddo
3184                     enddo
3185                   enddo
3186                enddo
3188 ! NOTE - summation also wrong for code below, but not my code so did not fix...
3190    do iphase=1,nphase_aer
3191    do itype=1,ntype_aer
3192          do j=jts,jmax
3193             do k=kts,kmax
3194                do i=its,imax
3195          hoa_a01(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(1,itype,iphase)) &
3196                        + chem(i,k,j,lptr_pcg2_f_c_aer(1,itype,iphase)) &
3197                        + chem(i,k,j,lptr_pcg3_f_c_aer(1,itype,iphase)) &
3198                        + chem(i,k,j,lptr_pcg4_f_c_aer(1,itype,iphase)) &
3199                        + chem(i,k,j,lptr_pcg5_f_c_aer(1,itype,iphase)) &
3200                        + chem(i,k,j,lptr_pcg6_f_c_aer(1,itype,iphase)) &
3201                        + chem(i,k,j,lptr_pcg7_f_c_aer(1,itype,iphase)) &
3202                        + chem(i,k,j,lptr_pcg1_f_o_aer(1,itype,iphase)) &
3203                        + chem(i,k,j,lptr_pcg2_f_o_aer(1,itype,iphase)) &
3204                        + chem(i,k,j,lptr_pcg3_f_o_aer(1,itype,iphase)) &
3205                        + chem(i,k,j,lptr_pcg4_f_o_aer(1,itype,iphase)) &
3206                        + chem(i,k,j,lptr_pcg5_f_o_aer(1,itype,iphase)) &
3207                        + chem(i,k,j,lptr_pcg6_f_o_aer(1,itype,iphase)) &
3208                        + chem(i,k,j,lptr_pcg7_f_o_aer(1,itype,iphase)) 
3210           bboa_a01(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(1,itype,iphase)) &
3211                        + chem(i,k,j,lptr_pcg2_b_c_aer(1,itype,iphase)) &
3212                        + chem(i,k,j,lptr_pcg3_b_c_aer(1,itype,iphase)) &
3213                        + chem(i,k,j,lptr_pcg4_b_c_aer(1,itype,iphase)) &
3214                        + chem(i,k,j,lptr_pcg5_b_c_aer(1,itype,iphase)) &
3215                        + chem(i,k,j,lptr_pcg6_b_c_aer(1,itype,iphase)) &
3216                        + chem(i,k,j,lptr_pcg7_b_c_aer(1,itype,iphase)) &
3217                        + chem(i,k,j,lptr_pcg1_b_o_aer(1,itype,iphase)) &
3218                        + chem(i,k,j,lptr_pcg2_b_o_aer(1,itype,iphase)) &
3219                        + chem(i,k,j,lptr_pcg3_b_o_aer(1,itype,iphase)) &
3220                        + chem(i,k,j,lptr_pcg4_b_o_aer(1,itype,iphase)) &
3221                        + chem(i,k,j,lptr_pcg5_b_o_aer(1,itype,iphase)) &
3222                        + chem(i,k,j,lptr_pcg6_b_o_aer(1,itype,iphase)) &
3223                        + chem(i,k,j,lptr_pcg7_b_o_aer(1,itype,iphase)) 
3225           soa_a01(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
3226                        + chem(i,k,j,lptr_opcg2_b_c_aer(1,itype,iphase)) &
3227                        + chem(i,k,j,lptr_opcg3_b_c_aer(1,itype,iphase)) &
3228                        + chem(i,k,j,lptr_opcg4_b_c_aer(1,itype,iphase)) &
3229                        + chem(i,k,j,lptr_opcg5_b_c_aer(1,itype,iphase)) &
3230                        + chem(i,k,j,lptr_opcg6_b_c_aer(1,itype,iphase)) &
3231                        + chem(i,k,j,lptr_opcg7_b_c_aer(1,itype,iphase)) &
3232                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
3233                        + chem(i,k,j,lptr_opcg2_b_o_aer(1,itype,iphase)) &
3234                        + chem(i,k,j,lptr_opcg3_b_o_aer(1,itype,iphase)) &
3235                        + chem(i,k,j,lptr_opcg4_b_o_aer(1,itype,iphase)) &
3236                        + chem(i,k,j,lptr_opcg5_b_o_aer(1,itype,iphase)) &
3237                        + chem(i,k,j,lptr_opcg6_b_o_aer(1,itype,iphase)) &
3238                        + chem(i,k,j,lptr_opcg7_b_o_aer(1,itype,iphase)) &
3239                        + chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
3240                        + chem(i,k,j,lptr_opcg2_f_c_aer(1,itype,iphase)) &
3241                        + chem(i,k,j,lptr_opcg3_f_c_aer(1,itype,iphase)) &
3242                        + chem(i,k,j,lptr_opcg4_f_c_aer(1,itype,iphase)) &
3243                        + chem(i,k,j,lptr_opcg5_f_c_aer(1,itype,iphase)) &
3244                        + chem(i,k,j,lptr_opcg6_f_c_aer(1,itype,iphase)) &
3245                        + chem(i,k,j,lptr_opcg7_f_c_aer(1,itype,iphase)) &
3246                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
3247                        + chem(i,k,j,lptr_opcg2_f_o_aer(1,itype,iphase)) &
3248                        + chem(i,k,j,lptr_opcg3_f_o_aer(1,itype,iphase)) &
3249                        + chem(i,k,j,lptr_opcg4_f_o_aer(1,itype,iphase)) &
3250                        + chem(i,k,j,lptr_opcg5_f_o_aer(1,itype,iphase)) &
3251                        + chem(i,k,j,lptr_opcg6_f_o_aer(1,itype,iphase)) &
3252                        + chem(i,k,j,lptr_opcg7_f_o_aer(1,itype,iphase)) &
3253                        + (chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
3254                        + chem(i,k,j,lptr_ant2_c_aer(1,itype,iphase))    &
3255                        + chem(i,k,j,lptr_ant3_c_aer(1,itype,iphase))    &
3256                        + chem(i,k,j,lptr_ant4_c_aer(1,itype,iphase)))    &
3257                        + chem(i,k,j,lptr_ant1_o_aer(1,itype,iphase))    &
3258                        + chem(i,k,j,lptr_ant2_o_aer(1,itype,iphase))    &
3259                        + chem(i,k,j,lptr_ant3_o_aer(1,itype,iphase))    &
3260                        + chem(i,k,j,lptr_ant4_o_aer(1,itype,iphase))    &
3261                        + (chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
3262                        + chem(i,k,j,lptr_biog2_c_aer(1,itype,iphase))    &
3263                        + chem(i,k,j,lptr_biog3_c_aer(1,itype,iphase))    &
3264                        + chem(i,k,j,lptr_biog4_c_aer(1,itype,iphase)))    &
3265                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))    &
3266                        + chem(i,k,j,lptr_biog2_o_aer(1,itype,iphase))    &
3267                        + chem(i,k,j,lptr_biog3_o_aer(1,itype,iphase))    &
3268                        + chem(i,k,j,lptr_biog4_o_aer(1,itype,iphase))
3270         arosoa_a01(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(1,itype,iphase))    &
3271                        + chem(i,k,j,lptr_ant2_o_aer(1,itype,iphase))    &
3272                        + chem(i,k,j,lptr_ant3_o_aer(1,itype,iphase))    &
3273                        + chem(i,k,j,lptr_ant4_o_aer(1,itype,iphase))    &
3274                        + chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
3275                        + chem(i,k,j,lptr_ant2_c_aer(1,itype,iphase))    &
3276                        + chem(i,k,j,lptr_ant3_c_aer(1,itype,iphase))    &
3277                        + chem(i,k,j,lptr_ant4_c_aer(1,itype,iphase))
3281         bbsoa_a01(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
3282                        + chem(i,k,j,lptr_opcg2_b_c_aer(1,itype,iphase)) &
3283                        + chem(i,k,j,lptr_opcg3_b_c_aer(1,itype,iphase)) &
3284                        + chem(i,k,j,lptr_opcg4_b_c_aer(1,itype,iphase)) &
3285                        + chem(i,k,j,lptr_opcg5_b_c_aer(1,itype,iphase)) &
3286                        + chem(i,k,j,lptr_opcg6_b_c_aer(1,itype,iphase)) &
3287                        + chem(i,k,j,lptr_opcg7_b_c_aer(1,itype,iphase)) &
3288                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
3289                        + chem(i,k,j,lptr_opcg2_b_o_aer(1,itype,iphase)) &
3290                        + chem(i,k,j,lptr_opcg3_b_o_aer(1,itype,iphase)) &
3291                        + chem(i,k,j,lptr_opcg4_b_o_aer(1,itype,iphase)) &
3292                        + chem(i,k,j,lptr_opcg5_b_o_aer(1,itype,iphase)) &
3293                        + chem(i,k,j,lptr_opcg6_b_o_aer(1,itype,iphase)) &
3294                        + chem(i,k,j,lptr_opcg7_b_o_aer(1,itype,iphase)) 
3296         hsoa_a01(i,k,j)= chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
3297                        + chem(i,k,j,lptr_opcg2_f_c_aer(1,itype,iphase)) &
3298                        + chem(i,k,j,lptr_opcg3_f_c_aer(1,itype,iphase)) &
3299                        + chem(i,k,j,lptr_opcg4_f_c_aer(1,itype,iphase)) &
3300                        + chem(i,k,j,lptr_opcg5_f_c_aer(1,itype,iphase)) &
3301                        + chem(i,k,j,lptr_opcg6_f_c_aer(1,itype,iphase)) &
3302                        + chem(i,k,j,lptr_opcg7_f_c_aer(1,itype,iphase)) &
3303                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
3304                        + chem(i,k,j,lptr_opcg2_f_o_aer(1,itype,iphase)) &
3305                        + chem(i,k,j,lptr_opcg3_f_o_aer(1,itype,iphase)) &
3306                        + chem(i,k,j,lptr_opcg4_f_o_aer(1,itype,iphase)) &
3307                        + chem(i,k,j,lptr_opcg5_f_o_aer(1,itype,iphase)) &
3308                        + chem(i,k,j,lptr_opcg6_f_o_aer(1,itype,iphase)) &
3309                        + chem(i,k,j,lptr_opcg7_f_o_aer(1,itype,iphase)) 
3311         biog_a01(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
3312                        + chem(i,k,j,lptr_biog2_c_aer(1,itype,iphase))    &
3313                        + chem(i,k,j,lptr_biog3_c_aer(1,itype,iphase))    &
3314                        + chem(i,k,j,lptr_biog4_c_aer(1,itype,iphase)))    &
3315                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))    &
3316                        + chem(i,k,j,lptr_biog2_o_aer(1,itype,iphase))    &
3317                        + chem(i,k,j,lptr_biog3_o_aer(1,itype,iphase))    &
3318                        + chem(i,k,j,lptr_biog4_o_aer(1,itype,iphase))
3322          totoa_a01(i,k,j)=  chem(i,k,j,lptr_pcg1_b_c_aer(1,itype,iphase)) &
3323                        + chem(i,k,j,lptr_pcg2_b_c_aer(1,itype,iphase)) &
3324                        + chem(i,k,j,lptr_pcg3_b_c_aer(1,itype,iphase)) &
3325                        + chem(i,k,j,lptr_pcg4_b_c_aer(1,itype,iphase)) &
3326                        + chem(i,k,j,lptr_pcg5_b_c_aer(1,itype,iphase)) &
3327                        + chem(i,k,j,lptr_pcg6_b_c_aer(1,itype,iphase)) &
3328                        + chem(i,k,j,lptr_pcg7_b_c_aer(1,itype,iphase)) &
3329                        + chem(i,k,j,lptr_pcg1_b_o_aer(1,itype,iphase)) &
3330                        + chem(i,k,j,lptr_pcg2_b_o_aer(1,itype,iphase)) &
3331                        + chem(i,k,j,lptr_pcg3_b_o_aer(1,itype,iphase)) &
3332                        + chem(i,k,j,lptr_pcg4_b_o_aer(1,itype,iphase)) &
3333                        + chem(i,k,j,lptr_pcg5_b_o_aer(1,itype,iphase)) &
3334                        + chem(i,k,j,lptr_pcg6_b_o_aer(1,itype,iphase)) &
3335                        + chem(i,k,j,lptr_pcg7_b_o_aer(1,itype,iphase)) &
3336                        + chem(i,k,j,lptr_opcg1_b_c_aer(1,itype,iphase)) &
3337                        + chem(i,k,j,lptr_opcg2_b_c_aer(1,itype,iphase)) &
3338                        + chem(i,k,j,lptr_opcg3_b_c_aer(1,itype,iphase)) &
3339                        + chem(i,k,j,lptr_opcg4_b_c_aer(1,itype,iphase)) &
3340                        + chem(i,k,j,lptr_opcg5_b_c_aer(1,itype,iphase)) &
3341                        + chem(i,k,j,lptr_opcg6_b_c_aer(1,itype,iphase)) &
3342                        + chem(i,k,j,lptr_opcg7_b_c_aer(1,itype,iphase)) &
3343                        + chem(i,k,j,lptr_opcg1_b_o_aer(1,itype,iphase)) &
3344                        + chem(i,k,j,lptr_opcg2_b_o_aer(1,itype,iphase)) &
3345                        + chem(i,k,j,lptr_opcg3_b_o_aer(1,itype,iphase)) &
3346                        + chem(i,k,j,lptr_opcg4_b_o_aer(1,itype,iphase)) &
3347                        + chem(i,k,j,lptr_opcg5_b_o_aer(1,itype,iphase)) &
3348                        + chem(i,k,j,lptr_opcg6_b_o_aer(1,itype,iphase)) &
3349                        + chem(i,k,j,lptr_opcg7_b_o_aer(1,itype,iphase)) &
3350                        + chem(i,k,j,lptr_pcg1_f_c_aer(1,itype,iphase)) &
3351                        + chem(i,k,j,lptr_pcg2_f_c_aer(1,itype,iphase)) &
3352                        + chem(i,k,j,lptr_pcg3_f_c_aer(1,itype,iphase)) &
3353                        + chem(i,k,j,lptr_pcg4_f_c_aer(1,itype,iphase)) &
3354                        + chem(i,k,j,lptr_pcg5_f_c_aer(1,itype,iphase)) &
3355                        + chem(i,k,j,lptr_pcg6_f_c_aer(1,itype,iphase)) &
3356                        + chem(i,k,j,lptr_pcg7_f_c_aer(1,itype,iphase)) &
3357                        + chem(i,k,j,lptr_pcg1_f_o_aer(1,itype,iphase)) &
3358                        + chem(i,k,j,lptr_pcg2_f_o_aer(1,itype,iphase)) &
3359                        + chem(i,k,j,lptr_pcg3_f_o_aer(1,itype,iphase)) &
3360                        + chem(i,k,j,lptr_pcg4_f_o_aer(1,itype,iphase)) &
3361                        + chem(i,k,j,lptr_pcg5_f_o_aer(1,itype,iphase)) &
3362                        + chem(i,k,j,lptr_pcg6_f_o_aer(1,itype,iphase)) &
3363                        + chem(i,k,j,lptr_pcg7_f_o_aer(1,itype,iphase)) &
3364                        + chem(i,k,j,lptr_opcg1_f_c_aer(1,itype,iphase)) &
3365                        + chem(i,k,j,lptr_opcg2_f_c_aer(1,itype,iphase)) &
3366                        + chem(i,k,j,lptr_opcg3_f_c_aer(1,itype,iphase)) &
3367                        + chem(i,k,j,lptr_opcg4_f_c_aer(1,itype,iphase)) &
3368                        + chem(i,k,j,lptr_opcg5_f_c_aer(1,itype,iphase)) &
3369                        + chem(i,k,j,lptr_opcg6_f_c_aer(1,itype,iphase)) &
3370                        + chem(i,k,j,lptr_opcg7_f_c_aer(1,itype,iphase)) &
3371                        + chem(i,k,j,lptr_opcg1_f_o_aer(1,itype,iphase)) &
3372                        + chem(i,k,j,lptr_opcg2_f_o_aer(1,itype,iphase)) &
3373                        + chem(i,k,j,lptr_opcg3_f_o_aer(1,itype,iphase)) &
3374                        + chem(i,k,j,lptr_opcg4_f_o_aer(1,itype,iphase)) &
3375                        + chem(i,k,j,lptr_opcg5_f_o_aer(1,itype,iphase)) &
3376                        + chem(i,k,j,lptr_opcg6_f_o_aer(1,itype,iphase)) &
3377                        + chem(i,k,j,lptr_opcg7_f_o_aer(1,itype,iphase)) &
3378                        + (chem(i,k,j,lptr_ant1_c_aer(1,itype,iphase))    &
3379                        + chem(i,k,j,lptr_ant2_c_aer(1,itype,iphase))    &
3380                        + chem(i,k,j,lptr_ant3_c_aer(1,itype,iphase))    &
3381                        + chem(i,k,j,lptr_ant4_c_aer(1,itype,iphase)))    &
3382                        + chem(i,k,j,lptr_ant1_o_aer(1,itype,iphase))    &
3383                        + chem(i,k,j,lptr_ant2_o_aer(1,itype,iphase))    &
3384                        + chem(i,k,j,lptr_ant3_o_aer(1,itype,iphase))    &
3385                        + chem(i,k,j,lptr_ant4_o_aer(1,itype,iphase))    &
3386                        + (chem(i,k,j,lptr_biog1_c_aer(1,itype,iphase))    &
3387                        + chem(i,k,j,lptr_biog2_c_aer(1,itype,iphase))    &
3388                        + chem(i,k,j,lptr_biog3_c_aer(1,itype,iphase))    &
3389                        + chem(i,k,j,lptr_biog4_c_aer(1,itype,iphase)))    &
3390                        + chem(i,k,j,lptr_biog1_o_aer(1,itype,iphase))    &
3391                        + chem(i,k,j,lptr_biog2_o_aer(1,itype,iphase))    &
3392                        + chem(i,k,j,lptr_biog3_o_aer(1,itype,iphase))    &
3393                        + chem(i,k,j,lptr_biog4_o_aer(1,itype,iphase))    &
3394                        + chem(i,k,j,lptr_oc_aer(1,itype,iphase))
3397                enddo
3398             enddo
3399          enddo
3400    enddo ! type
3401    enddo ! phase
3403    do iphase=1,nphase_aer
3404    do itype=1,ntype_aer
3405          do j=jts,jmax
3406             do k=kts,kmax
3407                do i=its,imax
3408          hoa_a02(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(2,itype,iphase)) &
3409                        + chem(i,k,j,lptr_pcg2_f_c_aer(2,itype,iphase)) &
3410                        + chem(i,k,j,lptr_pcg3_f_c_aer(2,itype,iphase)) &
3411                        + chem(i,k,j,lptr_pcg4_f_c_aer(2,itype,iphase)) &
3412                        + chem(i,k,j,lptr_pcg5_f_c_aer(2,itype,iphase)) &
3413                        + chem(i,k,j,lptr_pcg6_f_c_aer(2,itype,iphase)) &
3414                        + chem(i,k,j,lptr_pcg7_f_c_aer(2,itype,iphase)) &
3415                        + chem(i,k,j,lptr_pcg1_f_o_aer(2,itype,iphase)) &
3416                        + chem(i,k,j,lptr_pcg2_f_o_aer(2,itype,iphase)) &
3417                        + chem(i,k,j,lptr_pcg3_f_o_aer(2,itype,iphase)) &
3418                        + chem(i,k,j,lptr_pcg4_f_o_aer(2,itype,iphase)) &
3419                        + chem(i,k,j,lptr_pcg5_f_o_aer(2,itype,iphase)) &
3420                        + chem(i,k,j,lptr_pcg6_f_o_aer(2,itype,iphase)) &
3421                        + chem(i,k,j,lptr_pcg7_f_o_aer(2,itype,iphase)) 
3423           bboa_a02(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(2,itype,iphase)) &
3424                        + chem(i,k,j,lptr_pcg2_b_c_aer(2,itype,iphase)) &
3425                        + chem(i,k,j,lptr_pcg3_b_c_aer(2,itype,iphase)) &
3426                        + chem(i,k,j,lptr_pcg4_b_c_aer(2,itype,iphase)) &
3427                        + chem(i,k,j,lptr_pcg5_b_c_aer(2,itype,iphase)) &
3428                        + chem(i,k,j,lptr_pcg6_b_c_aer(2,itype,iphase)) &
3429                        + chem(i,k,j,lptr_pcg7_b_c_aer(2,itype,iphase)) &
3430                        + chem(i,k,j,lptr_pcg1_b_o_aer(2,itype,iphase)) &
3431                        + chem(i,k,j,lptr_pcg2_b_o_aer(2,itype,iphase)) &
3432                        + chem(i,k,j,lptr_pcg3_b_o_aer(2,itype,iphase)) &
3433                        + chem(i,k,j,lptr_pcg4_b_o_aer(2,itype,iphase)) &
3434                        + chem(i,k,j,lptr_pcg5_b_o_aer(2,itype,iphase)) &
3435                        + chem(i,k,j,lptr_pcg6_b_o_aer(2,itype,iphase)) &
3436                        + chem(i,k,j,lptr_pcg7_b_o_aer(2,itype,iphase)) 
3438           soa_a02(i,k,j)=     chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
3439                        + chem(i,k,j,lptr_opcg2_b_c_aer(2,itype,iphase)) &
3440                        + chem(i,k,j,lptr_opcg3_b_c_aer(2,itype,iphase)) &
3441                        + chem(i,k,j,lptr_opcg4_b_c_aer(2,itype,iphase)) &
3442                        + chem(i,k,j,lptr_opcg5_b_c_aer(2,itype,iphase)) &
3443                        + chem(i,k,j,lptr_opcg6_b_c_aer(2,itype,iphase)) &
3444                        + chem(i,k,j,lptr_opcg7_b_c_aer(2,itype,iphase)) &
3445                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
3446                        + chem(i,k,j,lptr_opcg2_b_o_aer(2,itype,iphase)) &
3447                        + chem(i,k,j,lptr_opcg3_b_o_aer(2,itype,iphase)) &
3448                        + chem(i,k,j,lptr_opcg4_b_o_aer(2,itype,iphase)) &
3449                        + chem(i,k,j,lptr_opcg5_b_o_aer(2,itype,iphase)) &
3450                        + chem(i,k,j,lptr_opcg6_b_o_aer(2,itype,iphase)) &
3451                        + chem(i,k,j,lptr_opcg7_b_o_aer(2,itype,iphase)) &
3452                        + chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
3453                        + chem(i,k,j,lptr_opcg2_f_c_aer(2,itype,iphase)) &
3454                        + chem(i,k,j,lptr_opcg3_f_c_aer(2,itype,iphase)) &
3455                        + chem(i,k,j,lptr_opcg4_f_c_aer(2,itype,iphase)) &
3456                        + chem(i,k,j,lptr_opcg5_f_c_aer(2,itype,iphase)) &
3457                        + chem(i,k,j,lptr_opcg6_f_c_aer(2,itype,iphase)) &
3458                        + chem(i,k,j,lptr_opcg7_f_c_aer(2,itype,iphase)) &
3459                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
3460                        + chem(i,k,j,lptr_opcg2_f_o_aer(2,itype,iphase)) &
3461                        + chem(i,k,j,lptr_opcg3_f_o_aer(2,itype,iphase)) &
3462                        + chem(i,k,j,lptr_opcg4_f_o_aer(2,itype,iphase)) &
3463                        + chem(i,k,j,lptr_opcg5_f_o_aer(2,itype,iphase)) &
3464                        + chem(i,k,j,lptr_opcg6_f_o_aer(2,itype,iphase)) &
3465                        + chem(i,k,j,lptr_opcg7_f_o_aer(2,itype,iphase)) &
3466                        + (chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
3467                        + chem(i,k,j,lptr_ant2_c_aer(2,itype,iphase))    &
3468                        + chem(i,k,j,lptr_ant3_c_aer(2,itype,iphase))    &
3469                        + chem(i,k,j,lptr_ant4_c_aer(2,itype,iphase)))    &
3470                        + chem(i,k,j,lptr_ant1_o_aer(2,itype,iphase))    &
3471                        + chem(i,k,j,lptr_ant2_o_aer(2,itype,iphase))    &
3472                        + chem(i,k,j,lptr_ant3_o_aer(2,itype,iphase))    &
3473                        + chem(i,k,j,lptr_ant4_o_aer(2,itype,iphase))    &
3474                        + (chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
3475                        + chem(i,k,j,lptr_biog2_c_aer(2,itype,iphase))    &
3476                        + chem(i,k,j,lptr_biog3_c_aer(2,itype,iphase))    &
3477                        + chem(i,k,j,lptr_biog4_c_aer(2,itype,iphase)))    &
3478                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))    &
3479                        + chem(i,k,j,lptr_biog2_o_aer(2,itype,iphase))    &
3480                        + chem(i,k,j,lptr_biog3_o_aer(2,itype,iphase))    &
3481                        + chem(i,k,j,lptr_biog4_o_aer(2,itype,iphase))
3483         arosoa_a02(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(2,itype,iphase))    &
3484                        + chem(i,k,j,lptr_ant2_o_aer(2,itype,iphase))    &
3485                        + chem(i,k,j,lptr_ant3_o_aer(2,itype,iphase))    &
3486                        + chem(i,k,j,lptr_ant4_o_aer(2,itype,iphase))    &
3487                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
3488                        + chem(i,k,j,lptr_ant2_c_aer(2,itype,iphase))    &
3489                        + chem(i,k,j,lptr_ant3_c_aer(2,itype,iphase))    &
3490                        + chem(i,k,j,lptr_ant4_c_aer(2,itype,iphase))
3493         bbsoa_a02(i,k,j)= chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
3494                        + chem(i,k,j,lptr_opcg2_b_c_aer(2,itype,iphase)) &
3495                        + chem(i,k,j,lptr_opcg3_b_c_aer(2,itype,iphase)) &
3496                        + chem(i,k,j,lptr_opcg4_b_c_aer(2,itype,iphase)) &
3497                        + chem(i,k,j,lptr_opcg5_b_c_aer(2,itype,iphase)) &
3498                        + chem(i,k,j,lptr_opcg6_b_c_aer(2,itype,iphase)) &
3499                        + chem(i,k,j,lptr_opcg7_b_c_aer(2,itype,iphase)) &
3500                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
3501                        + chem(i,k,j,lptr_opcg2_b_o_aer(2,itype,iphase)) &
3502                        + chem(i,k,j,lptr_opcg3_b_o_aer(2,itype,iphase)) &
3503                        + chem(i,k,j,lptr_opcg4_b_o_aer(2,itype,iphase)) &
3504                        + chem(i,k,j,lptr_opcg5_b_o_aer(2,itype,iphase)) &
3505                        + chem(i,k,j,lptr_opcg6_b_o_aer(2,itype,iphase)) &
3506                        + chem(i,k,j,lptr_opcg7_b_o_aer(2,itype,iphase)) 
3508         hsoa_a02(i,k,j)=  chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
3509                        + chem(i,k,j,lptr_opcg2_f_c_aer(2,itype,iphase)) &
3510                        + chem(i,k,j,lptr_opcg3_f_c_aer(2,itype,iphase)) &
3511                        + chem(i,k,j,lptr_opcg4_f_c_aer(2,itype,iphase)) &
3512                        + chem(i,k,j,lptr_opcg5_f_c_aer(2,itype,iphase)) &
3513                        + chem(i,k,j,lptr_opcg6_f_c_aer(2,itype,iphase)) &
3514                        + chem(i,k,j,lptr_opcg7_f_c_aer(2,itype,iphase)) &
3515                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
3516                        + chem(i,k,j,lptr_opcg2_f_o_aer(2,itype,iphase)) &
3517                        + chem(i,k,j,lptr_opcg3_f_o_aer(2,itype,iphase)) &
3518                        + chem(i,k,j,lptr_opcg4_f_o_aer(2,itype,iphase)) &
3519                        + chem(i,k,j,lptr_opcg5_f_o_aer(2,itype,iphase)) &
3520                        + chem(i,k,j,lptr_opcg6_f_o_aer(2,itype,iphase)) &
3521                        + chem(i,k,j,lptr_opcg7_f_o_aer(2,itype,iphase)) 
3524        biog_a02(i,k,j)= chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
3525                        + chem(i,k,j,lptr_biog2_c_aer(2,itype,iphase))    &
3526                        + chem(i,k,j,lptr_biog3_c_aer(2,itype,iphase))    &
3527                        + chem(i,k,j,lptr_biog4_c_aer(2,itype,iphase))    &
3528                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))    &
3529                        + chem(i,k,j,lptr_biog2_o_aer(2,itype,iphase))    &
3530                        + chem(i,k,j,lptr_biog3_o_aer(2,itype,iphase))    &
3531                        + chem(i,k,j,lptr_biog4_o_aer(2,itype,iphase))
3534          totoa_a02(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(2,itype,iphase)) &
3535                        + chem(i,k,j,lptr_pcg2_b_c_aer(2,itype,iphase)) &
3536                        + chem(i,k,j,lptr_pcg3_b_c_aer(2,itype,iphase)) &
3537                        + chem(i,k,j,lptr_pcg4_b_c_aer(2,itype,iphase)) &
3538                        + chem(i,k,j,lptr_pcg5_b_c_aer(2,itype,iphase)) &
3539                        + chem(i,k,j,lptr_pcg6_b_c_aer(2,itype,iphase)) &
3540                        + chem(i,k,j,lptr_pcg7_b_c_aer(2,itype,iphase)) &
3541                        + chem(i,k,j,lptr_pcg1_b_o_aer(2,itype,iphase)) &
3542                        + chem(i,k,j,lptr_pcg2_b_o_aer(2,itype,iphase)) &
3543                        + chem(i,k,j,lptr_pcg3_b_o_aer(2,itype,iphase)) &
3544                        + chem(i,k,j,lptr_pcg4_b_o_aer(2,itype,iphase)) &
3545                        + chem(i,k,j,lptr_pcg5_b_o_aer(2,itype,iphase)) &
3546                        + chem(i,k,j,lptr_pcg6_b_o_aer(2,itype,iphase)) &
3547                        + chem(i,k,j,lptr_pcg7_b_o_aer(2,itype,iphase)) &
3548                        + chem(i,k,j,lptr_opcg1_b_c_aer(2,itype,iphase)) &
3549                        + chem(i,k,j,lptr_opcg2_b_c_aer(2,itype,iphase)) &
3550                        + chem(i,k,j,lptr_opcg3_b_c_aer(2,itype,iphase)) &
3551                        + chem(i,k,j,lptr_opcg4_b_c_aer(2,itype,iphase)) &
3552                        + chem(i,k,j,lptr_opcg5_b_c_aer(2,itype,iphase)) &
3553                        + chem(i,k,j,lptr_opcg6_b_c_aer(2,itype,iphase)) &
3554                        + chem(i,k,j,lptr_opcg7_b_c_aer(2,itype,iphase)) &
3555                        + chem(i,k,j,lptr_opcg1_b_o_aer(2,itype,iphase)) &
3556                        + chem(i,k,j,lptr_opcg2_b_o_aer(2,itype,iphase)) &
3557                        + chem(i,k,j,lptr_opcg3_b_o_aer(2,itype,iphase)) &
3558                        + chem(i,k,j,lptr_opcg4_b_o_aer(2,itype,iphase)) &
3559                        + chem(i,k,j,lptr_opcg5_b_o_aer(2,itype,iphase)) &
3560                        + chem(i,k,j,lptr_opcg6_b_o_aer(2,itype,iphase)) &
3561                        + chem(i,k,j,lptr_opcg7_b_o_aer(2,itype,iphase)) &
3562                        + chem(i,k,j,lptr_pcg1_f_c_aer(2,itype,iphase)) &
3563                        + chem(i,k,j,lptr_pcg2_f_c_aer(2,itype,iphase)) &
3564                        + chem(i,k,j,lptr_pcg3_f_c_aer(2,itype,iphase)) &
3565                        + chem(i,k,j,lptr_pcg4_f_c_aer(2,itype,iphase)) &
3566                        + chem(i,k,j,lptr_pcg5_f_c_aer(2,itype,iphase)) &
3567                        + chem(i,k,j,lptr_pcg6_f_c_aer(2,itype,iphase)) &
3568                        + chem(i,k,j,lptr_pcg7_f_c_aer(2,itype,iphase)) &
3569                        + chem(i,k,j,lptr_pcg1_f_o_aer(2,itype,iphase)) &
3570                        + chem(i,k,j,lptr_pcg2_f_o_aer(2,itype,iphase)) &
3571                        + chem(i,k,j,lptr_pcg3_f_o_aer(2,itype,iphase)) &
3572                        + chem(i,k,j,lptr_pcg4_f_o_aer(2,itype,iphase)) &
3573                        + chem(i,k,j,lptr_pcg5_f_o_aer(2,itype,iphase)) &
3574                        + chem(i,k,j,lptr_pcg6_f_o_aer(2,itype,iphase)) &
3575                        + chem(i,k,j,lptr_pcg7_f_o_aer(2,itype,iphase)) &
3576                        + chem(i,k,j,lptr_opcg1_f_c_aer(2,itype,iphase)) &
3577                        + chem(i,k,j,lptr_opcg2_f_c_aer(2,itype,iphase)) &
3578                        + chem(i,k,j,lptr_opcg3_f_c_aer(2,itype,iphase)) &
3579                        + chem(i,k,j,lptr_opcg4_f_c_aer(2,itype,iphase)) &
3580                        + chem(i,k,j,lptr_opcg5_f_c_aer(2,itype,iphase)) &
3581                        + chem(i,k,j,lptr_opcg6_f_c_aer(2,itype,iphase)) &
3582                        + chem(i,k,j,lptr_opcg7_f_c_aer(2,itype,iphase)) &
3583                        + chem(i,k,j,lptr_opcg1_f_o_aer(2,itype,iphase)) &
3584                        + chem(i,k,j,lptr_opcg2_f_o_aer(2,itype,iphase)) &
3585                        + chem(i,k,j,lptr_opcg3_f_o_aer(2,itype,iphase)) &
3586                        + chem(i,k,j,lptr_opcg4_f_o_aer(2,itype,iphase)) &
3587                        + chem(i,k,j,lptr_opcg5_f_o_aer(2,itype,iphase)) &
3588                        + chem(i,k,j,lptr_opcg6_f_o_aer(2,itype,iphase)) &
3589                        + chem(i,k,j,lptr_opcg7_f_o_aer(2,itype,iphase)) &
3590                        + chem(i,k,j,lptr_ant1_c_aer(2,itype,iphase))    &
3591                        + chem(i,k,j,lptr_ant2_c_aer(2,itype,iphase))    &
3592                        + chem(i,k,j,lptr_ant3_c_aer(2,itype,iphase))    &
3593                        + chem(i,k,j,lptr_ant4_c_aer(2,itype,iphase))    &
3594                        + chem(i,k,j,lptr_ant1_o_aer(2,itype,iphase))    &
3595                        + chem(i,k,j,lptr_ant2_o_aer(2,itype,iphase))    &
3596                        + chem(i,k,j,lptr_ant3_o_aer(2,itype,iphase))    &
3597                        + chem(i,k,j,lptr_ant4_o_aer(2,itype,iphase))    &
3598                        + chem(i,k,j,lptr_biog1_c_aer(2,itype,iphase))    &
3599                        + chem(i,k,j,lptr_biog2_c_aer(2,itype,iphase))    &
3600                        + chem(i,k,j,lptr_biog3_c_aer(2,itype,iphase))    &
3601                        + chem(i,k,j,lptr_biog4_c_aer(2,itype,iphase))    &
3602                        + chem(i,k,j,lptr_biog1_o_aer(2,itype,iphase))    &
3603                        + chem(i,k,j,lptr_biog2_o_aer(2,itype,iphase))    &
3604                        + chem(i,k,j,lptr_biog3_o_aer(2,itype,iphase))    &
3605                        + chem(i,k,j,lptr_biog4_o_aer(2,itype,iphase))    &
3606                        + chem(i,k,j,lptr_oc_aer(2,itype,iphase))
3608                enddo
3609             enddo
3610          enddo
3611    enddo ! type
3612    enddo ! phase
3614    do iphase=1,nphase_aer
3615    do itype=1,ntype_aer
3616          do j=jts,jmax
3617             do k=kts,kmax
3618                do i=its,imax
3619          hoa_a03(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(3,itype,iphase)) &
3620                        + chem(i,k,j,lptr_pcg2_f_c_aer(3,itype,iphase)) &
3621                        + chem(i,k,j,lptr_pcg3_f_c_aer(3,itype,iphase)) &
3622                        + chem(i,k,j,lptr_pcg4_f_c_aer(3,itype,iphase)) &
3623                        + chem(i,k,j,lptr_pcg5_f_c_aer(3,itype,iphase)) &
3624                        + chem(i,k,j,lptr_pcg6_f_c_aer(3,itype,iphase)) &
3625                        + chem(i,k,j,lptr_pcg7_f_c_aer(3,itype,iphase)) &
3626                        + chem(i,k,j,lptr_pcg1_f_o_aer(3,itype,iphase)) &
3627                        + chem(i,k,j,lptr_pcg2_f_o_aer(3,itype,iphase)) &
3628                        + chem(i,k,j,lptr_pcg3_f_o_aer(3,itype,iphase)) &
3629                        + chem(i,k,j,lptr_pcg4_f_o_aer(3,itype,iphase)) &
3630                        + chem(i,k,j,lptr_pcg5_f_o_aer(3,itype,iphase)) &
3631                        + chem(i,k,j,lptr_pcg6_f_o_aer(3,itype,iphase)) &
3632                        + chem(i,k,j,lptr_pcg7_f_o_aer(3,itype,iphase)) 
3634           bboa_a03(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(3,itype,iphase)) &
3635                        + chem(i,k,j,lptr_pcg2_b_c_aer(3,itype,iphase)) &
3636                        + chem(i,k,j,lptr_pcg3_b_c_aer(3,itype,iphase)) &
3637                        + chem(i,k,j,lptr_pcg4_b_c_aer(3,itype,iphase)) &
3638                        + chem(i,k,j,lptr_pcg5_b_c_aer(3,itype,iphase)) &
3639                        + chem(i,k,j,lptr_pcg6_b_c_aer(3,itype,iphase)) &
3640                        + chem(i,k,j,lptr_pcg7_b_c_aer(3,itype,iphase)) &
3641                        + chem(i,k,j,lptr_pcg1_b_o_aer(3,itype,iphase)) &
3642                        + chem(i,k,j,lptr_pcg2_b_o_aer(3,itype,iphase)) &
3643                        + chem(i,k,j,lptr_pcg3_b_o_aer(3,itype,iphase)) &
3644                        + chem(i,k,j,lptr_pcg4_b_o_aer(3,itype,iphase)) &
3645                        + chem(i,k,j,lptr_pcg5_b_o_aer(3,itype,iphase)) &
3646                        + chem(i,k,j,lptr_pcg6_b_o_aer(3,itype,iphase)) &
3647                        + chem(i,k,j,lptr_pcg7_b_o_aer(3,itype,iphase)) 
3649           soa_a03(i,k,j)=  chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
3650                        + chem(i,k,j,lptr_opcg2_b_c_aer(3,itype,iphase)) &
3651                        + chem(i,k,j,lptr_opcg3_b_c_aer(3,itype,iphase)) &
3652                        + chem(i,k,j,lptr_opcg4_b_c_aer(3,itype,iphase)) &
3653                        + chem(i,k,j,lptr_opcg5_b_c_aer(3,itype,iphase)) &
3654                        + chem(i,k,j,lptr_opcg6_b_c_aer(3,itype,iphase)) &
3655                        + chem(i,k,j,lptr_opcg7_b_c_aer(3,itype,iphase)) &
3656                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
3657                        + chem(i,k,j,lptr_opcg2_b_o_aer(3,itype,iphase)) &
3658                        + chem(i,k,j,lptr_opcg3_b_o_aer(3,itype,iphase)) &
3659                        + chem(i,k,j,lptr_opcg4_b_o_aer(3,itype,iphase)) &
3660                        + chem(i,k,j,lptr_opcg5_b_o_aer(3,itype,iphase)) &
3661                        + chem(i,k,j,lptr_opcg6_b_o_aer(3,itype,iphase)) &
3662                        + chem(i,k,j,lptr_opcg7_b_o_aer(3,itype,iphase)) &
3663                        + chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
3664                        + chem(i,k,j,lptr_opcg2_f_c_aer(3,itype,iphase)) &
3665                        + chem(i,k,j,lptr_opcg3_f_c_aer(3,itype,iphase)) &
3666                        + chem(i,k,j,lptr_opcg4_f_c_aer(3,itype,iphase)) &
3667                        + chem(i,k,j,lptr_opcg5_f_c_aer(3,itype,iphase)) &
3668                        + chem(i,k,j,lptr_opcg6_f_c_aer(3,itype,iphase)) &
3669                        + chem(i,k,j,lptr_opcg7_f_c_aer(3,itype,iphase)) &
3670                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
3671                        + chem(i,k,j,lptr_opcg2_f_o_aer(3,itype,iphase)) &
3672                        + chem(i,k,j,lptr_opcg3_f_o_aer(3,itype,iphase)) &
3673                        + chem(i,k,j,lptr_opcg4_f_o_aer(3,itype,iphase)) &
3674                        + chem(i,k,j,lptr_opcg5_f_o_aer(3,itype,iphase)) &
3675                        + chem(i,k,j,lptr_opcg6_f_o_aer(3,itype,iphase)) &
3676                        + chem(i,k,j,lptr_opcg7_f_o_aer(3,itype,iphase)) &
3677                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
3678                        + chem(i,k,j,lptr_ant2_c_aer(3,itype,iphase))    &
3679                        + chem(i,k,j,lptr_ant3_c_aer(3,itype,iphase))    &
3680                        + chem(i,k,j,lptr_ant4_c_aer(3,itype,iphase))    &
3681                        + chem(i,k,j,lptr_ant1_o_aer(3,itype,iphase))    &
3682                        + chem(i,k,j,lptr_ant2_o_aer(3,itype,iphase))    &
3683                        + chem(i,k,j,lptr_ant3_o_aer(3,itype,iphase))    &
3684                        + chem(i,k,j,lptr_ant4_o_aer(3,itype,iphase))    &
3685                        + chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
3686                        + chem(i,k,j,lptr_biog2_c_aer(3,itype,iphase))    &
3687                        + chem(i,k,j,lptr_biog3_c_aer(3,itype,iphase))    &
3688                        + chem(i,k,j,lptr_biog4_c_aer(3,itype,iphase))    &
3689                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))    &
3690                        + chem(i,k,j,lptr_biog2_o_aer(3,itype,iphase))    &
3691                        + chem(i,k,j,lptr_biog3_o_aer(3,itype,iphase))    &
3692                        + chem(i,k,j,lptr_biog4_o_aer(3,itype,iphase))
3694        arosoa_a03(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(3,itype,iphase))    &
3695                        + chem(i,k,j,lptr_ant2_o_aer(3,itype,iphase))    &
3696                        + chem(i,k,j,lptr_ant3_o_aer(3,itype,iphase))    &
3697                        + chem(i,k,j,lptr_ant4_o_aer(3,itype,iphase))    &
3698                        + chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
3699                        + chem(i,k,j,lptr_ant2_c_aer(3,itype,iphase))    &
3700                        + chem(i,k,j,lptr_ant3_c_aer(3,itype,iphase))    &
3701                        + chem(i,k,j,lptr_ant4_c_aer(3,itype,iphase))
3704         bbsoa_a03(i,k,j)=  chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
3705                        + chem(i,k,j,lptr_opcg2_b_c_aer(3,itype,iphase)) &
3706                        + chem(i,k,j,lptr_opcg3_b_c_aer(3,itype,iphase)) &
3707                        + chem(i,k,j,lptr_opcg4_b_c_aer(3,itype,iphase)) &
3708                        + chem(i,k,j,lptr_opcg5_b_c_aer(3,itype,iphase)) &
3709                        + chem(i,k,j,lptr_opcg6_b_c_aer(3,itype,iphase)) &
3710                        + chem(i,k,j,lptr_opcg7_b_c_aer(3,itype,iphase)) &
3711                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
3712                        + chem(i,k,j,lptr_opcg2_b_o_aer(3,itype,iphase)) &
3713                        + chem(i,k,j,lptr_opcg3_b_o_aer(3,itype,iphase)) &
3714                        + chem(i,k,j,lptr_opcg4_b_o_aer(3,itype,iphase)) &
3715                        + chem(i,k,j,lptr_opcg5_b_o_aer(3,itype,iphase)) &
3716                        + chem(i,k,j,lptr_opcg6_b_o_aer(3,itype,iphase)) &
3717                        + chem(i,k,j,lptr_opcg7_b_o_aer(3,itype,iphase)) 
3719         hsoa_a03(i,k,j)=   chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
3720                        + chem(i,k,j,lptr_opcg2_f_c_aer(3,itype,iphase)) &
3721                        + chem(i,k,j,lptr_opcg3_f_c_aer(3,itype,iphase)) &
3722                        + chem(i,k,j,lptr_opcg4_f_c_aer(3,itype,iphase)) &
3723                        + chem(i,k,j,lptr_opcg5_f_c_aer(3,itype,iphase)) &
3724                        + chem(i,k,j,lptr_opcg6_f_c_aer(3,itype,iphase)) &
3725                        + chem(i,k,j,lptr_opcg7_f_c_aer(3,itype,iphase)) &
3726                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
3727                        + chem(i,k,j,lptr_opcg2_f_o_aer(3,itype,iphase)) &
3728                        + chem(i,k,j,lptr_opcg3_f_o_aer(3,itype,iphase)) &
3729                        + chem(i,k,j,lptr_opcg4_f_o_aer(3,itype,iphase)) &
3730                        + chem(i,k,j,lptr_opcg5_f_o_aer(3,itype,iphase)) &
3731                        + chem(i,k,j,lptr_opcg6_f_o_aer(3,itype,iphase)) &
3732                        + chem(i,k,j,lptr_opcg7_f_o_aer(3,itype,iphase)) 
3734        biog_a03(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
3735                        + chem(i,k,j,lptr_biog2_c_aer(3,itype,iphase))    &
3736                        + chem(i,k,j,lptr_biog3_c_aer(3,itype,iphase))    &
3737                        + chem(i,k,j,lptr_biog4_c_aer(3,itype,iphase)))    &
3738                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))    &
3739                        + chem(i,k,j,lptr_biog2_o_aer(3,itype,iphase))    &
3740                        + chem(i,k,j,lptr_biog3_o_aer(3,itype,iphase))    &
3741                        + chem(i,k,j,lptr_biog4_o_aer(3,itype,iphase))
3744          totoa_a03(i,k,j)=  chem(i,k,j,lptr_pcg1_b_c_aer(3,itype,iphase)) &
3745                        + chem(i,k,j,lptr_pcg2_b_c_aer(3,itype,iphase)) &
3746                        + chem(i,k,j,lptr_pcg3_b_c_aer(3,itype,iphase)) &
3747                        + chem(i,k,j,lptr_pcg4_b_c_aer(3,itype,iphase)) &
3748                        + chem(i,k,j,lptr_pcg5_b_c_aer(3,itype,iphase)) &
3749                        + chem(i,k,j,lptr_pcg6_b_c_aer(3,itype,iphase)) &
3750                        + chem(i,k,j,lptr_pcg7_b_c_aer(3,itype,iphase)) &
3751                        + chem(i,k,j,lptr_pcg1_b_o_aer(3,itype,iphase)) &
3752                        + chem(i,k,j,lptr_pcg2_b_o_aer(3,itype,iphase)) &
3753                        + chem(i,k,j,lptr_pcg3_b_o_aer(3,itype,iphase)) &
3754                        + chem(i,k,j,lptr_pcg4_b_o_aer(3,itype,iphase)) &
3755                        + chem(i,k,j,lptr_pcg5_b_o_aer(3,itype,iphase)) &
3756                        + chem(i,k,j,lptr_pcg6_b_o_aer(3,itype,iphase)) &
3757                        + chem(i,k,j,lptr_pcg7_b_o_aer(3,itype,iphase)) &
3758                        + chem(i,k,j,lptr_opcg1_b_c_aer(3,itype,iphase)) &
3759                        + chem(i,k,j,lptr_opcg2_b_c_aer(3,itype,iphase)) &
3760                        + chem(i,k,j,lptr_opcg3_b_c_aer(3,itype,iphase)) &
3761                        + chem(i,k,j,lptr_opcg4_b_c_aer(3,itype,iphase)) &
3762                        + chem(i,k,j,lptr_opcg5_b_c_aer(3,itype,iphase)) &
3763                        + chem(i,k,j,lptr_opcg6_b_c_aer(3,itype,iphase)) &
3764                        + chem(i,k,j,lptr_opcg7_b_c_aer(3,itype,iphase)) &
3765                        + chem(i,k,j,lptr_opcg1_b_o_aer(3,itype,iphase)) &
3766                        + chem(i,k,j,lptr_opcg2_b_o_aer(3,itype,iphase)) &
3767                        + chem(i,k,j,lptr_opcg3_b_o_aer(3,itype,iphase)) &
3768                        + chem(i,k,j,lptr_opcg4_b_o_aer(3,itype,iphase)) &
3769                        + chem(i,k,j,lptr_opcg5_b_o_aer(3,itype,iphase)) &
3770                        + chem(i,k,j,lptr_opcg6_b_o_aer(3,itype,iphase)) &
3771                        + chem(i,k,j,lptr_opcg7_b_o_aer(3,itype,iphase)) &
3772                        + chem(i,k,j,lptr_pcg1_f_c_aer(3,itype,iphase)) &
3773                        + chem(i,k,j,lptr_pcg2_f_c_aer(3,itype,iphase)) &
3774                        + chem(i,k,j,lptr_pcg3_f_c_aer(3,itype,iphase)) &
3775                        + chem(i,k,j,lptr_pcg4_f_c_aer(3,itype,iphase)) &
3776                        + chem(i,k,j,lptr_pcg5_f_c_aer(3,itype,iphase)) &
3777                        + chem(i,k,j,lptr_pcg6_f_c_aer(3,itype,iphase)) &
3778                        + chem(i,k,j,lptr_pcg7_f_c_aer(3,itype,iphase)) &
3779                        + chem(i,k,j,lptr_pcg1_f_o_aer(3,itype,iphase)) &
3780                        + chem(i,k,j,lptr_pcg2_f_o_aer(3,itype,iphase)) &
3781                        + chem(i,k,j,lptr_pcg3_f_o_aer(3,itype,iphase)) &
3782                        + chem(i,k,j,lptr_pcg4_f_o_aer(3,itype,iphase)) &
3783                        + chem(i,k,j,lptr_pcg5_f_o_aer(3,itype,iphase)) &
3784                        + chem(i,k,j,lptr_pcg6_f_o_aer(3,itype,iphase)) &
3785                        + chem(i,k,j,lptr_pcg7_f_o_aer(3,itype,iphase)) &
3786                        + chem(i,k,j,lptr_opcg1_f_c_aer(3,itype,iphase)) &
3787                        + chem(i,k,j,lptr_opcg2_f_c_aer(3,itype,iphase)) &
3788                        + chem(i,k,j,lptr_opcg3_f_c_aer(3,itype,iphase)) &
3789                        + chem(i,k,j,lptr_opcg4_f_c_aer(3,itype,iphase)) &
3790                        + chem(i,k,j,lptr_opcg5_f_c_aer(3,itype,iphase)) &
3791                        + chem(i,k,j,lptr_opcg6_f_c_aer(3,itype,iphase)) &
3792                        + chem(i,k,j,lptr_opcg7_f_c_aer(3,itype,iphase)) &
3793                        + chem(i,k,j,lptr_opcg1_f_o_aer(3,itype,iphase)) &
3794                        + chem(i,k,j,lptr_opcg2_f_o_aer(3,itype,iphase)) &
3795                        + chem(i,k,j,lptr_opcg3_f_o_aer(3,itype,iphase)) &
3796                        + chem(i,k,j,lptr_opcg4_f_o_aer(3,itype,iphase)) &
3797                        + chem(i,k,j,lptr_opcg5_f_o_aer(3,itype,iphase)) &
3798                        + chem(i,k,j,lptr_opcg6_f_o_aer(3,itype,iphase)) &
3799                        + chem(i,k,j,lptr_opcg7_f_o_aer(3,itype,iphase)) &
3800                        + (chem(i,k,j,lptr_ant1_c_aer(3,itype,iphase))    &
3801                        + chem(i,k,j,lptr_ant2_c_aer(3,itype,iphase))    &
3802                        + chem(i,k,j,lptr_ant3_c_aer(3,itype,iphase))    &
3803                        + chem(i,k,j,lptr_ant4_c_aer(3,itype,iphase)))    &
3804                        + chem(i,k,j,lptr_ant1_o_aer(3,itype,iphase))    &
3805                        + chem(i,k,j,lptr_ant2_o_aer(3,itype,iphase))    &
3806                        + chem(i,k,j,lptr_ant3_o_aer(3,itype,iphase))    &
3807                        + chem(i,k,j,lptr_ant4_o_aer(3,itype,iphase))    &
3808                        + (chem(i,k,j,lptr_biog1_c_aer(3,itype,iphase))    &
3809                        + chem(i,k,j,lptr_biog2_c_aer(3,itype,iphase))    &
3810                        + chem(i,k,j,lptr_biog3_c_aer(3,itype,iphase))    &
3811                        + chem(i,k,j,lptr_biog4_c_aer(3,itype,iphase)))    &
3812                        + chem(i,k,j,lptr_biog1_o_aer(3,itype,iphase))    &
3813                        + chem(i,k,j,lptr_biog2_o_aer(3,itype,iphase))    &
3814                        + chem(i,k,j,lptr_biog3_o_aer(3,itype,iphase))    &
3815                        + chem(i,k,j,lptr_biog4_o_aer(3,itype,iphase))    &
3816                        + chem(i,k,j,lptr_oc_aer(3,itype,iphase))
3818                enddo
3819             enddo
3820          enddo
3821    enddo ! type
3822    enddo ! phase
3824    do iphase=1,nphase_aer
3825    do itype=1,ntype_aer
3826          do j=jts,jmax
3827             do k=kts,kmax
3828                do i=its,imax
3829          hoa_a04(i,k,j)= chem(i,k,j,lptr_pcg1_f_c_aer(4,itype,iphase)) &
3830                        + chem(i,k,j,lptr_pcg2_f_c_aer(4,itype,iphase)) &
3831                        + chem(i,k,j,lptr_pcg3_f_c_aer(4,itype,iphase)) &
3832                        + chem(i,k,j,lptr_pcg4_f_c_aer(4,itype,iphase)) &
3833                        + chem(i,k,j,lptr_pcg5_f_c_aer(4,itype,iphase)) &
3834                        + chem(i,k,j,lptr_pcg6_f_c_aer(4,itype,iphase)) &
3835                        + chem(i,k,j,lptr_pcg7_f_c_aer(4,itype,iphase)) &
3836                        + chem(i,k,j,lptr_pcg1_f_o_aer(4,itype,iphase)) &
3837                        + chem(i,k,j,lptr_pcg2_f_o_aer(4,itype,iphase)) &
3838                        + chem(i,k,j,lptr_pcg3_f_o_aer(4,itype,iphase)) &
3839                        + chem(i,k,j,lptr_pcg4_f_o_aer(4,itype,iphase)) &
3840                        + chem(i,k,j,lptr_pcg5_f_o_aer(4,itype,iphase)) &
3841                        + chem(i,k,j,lptr_pcg6_f_o_aer(4,itype,iphase)) &
3842                        + chem(i,k,j,lptr_pcg7_f_o_aer(4,itype,iphase)) 
3844           bboa_a04(i,k,j)= chem(i,k,j,lptr_pcg1_b_c_aer(4,itype,iphase)) &
3845                        + chem(i,k,j,lptr_pcg2_b_c_aer(4,itype,iphase)) &
3846                        + chem(i,k,j,lptr_pcg3_b_c_aer(4,itype,iphase)) &
3847                        + chem(i,k,j,lptr_pcg4_b_c_aer(4,itype,iphase)) &
3848                        + chem(i,k,j,lptr_pcg5_b_c_aer(4,itype,iphase)) &
3849                        + chem(i,k,j,lptr_pcg6_b_c_aer(4,itype,iphase)) &
3850                        + chem(i,k,j,lptr_pcg7_b_c_aer(4,itype,iphase)) &
3851                        + chem(i,k,j,lptr_pcg1_b_o_aer(4,itype,iphase)) &
3852                        + chem(i,k,j,lptr_pcg2_b_o_aer(4,itype,iphase)) &
3853                        + chem(i,k,j,lptr_pcg3_b_o_aer(4,itype,iphase)) &
3854                        + chem(i,k,j,lptr_pcg4_b_o_aer(4,itype,iphase)) &
3855                        + chem(i,k,j,lptr_pcg5_b_o_aer(4,itype,iphase)) &
3856                        + chem(i,k,j,lptr_pcg6_b_o_aer(4,itype,iphase)) &
3857                        + chem(i,k,j,lptr_pcg7_b_o_aer(4,itype,iphase)) 
3859           soa_a04(i,k,j)=  chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
3860                        + chem(i,k,j,lptr_opcg2_b_c_aer(4,itype,iphase)) &
3861                        + chem(i,k,j,lptr_opcg3_b_c_aer(4,itype,iphase)) &
3862                        + chem(i,k,j,lptr_opcg4_b_c_aer(4,itype,iphase)) &
3863                        + chem(i,k,j,lptr_opcg5_b_c_aer(4,itype,iphase)) &
3864                        + chem(i,k,j,lptr_opcg6_b_c_aer(4,itype,iphase)) &
3865                        + chem(i,k,j,lptr_opcg7_b_c_aer(4,itype,iphase)) &
3866                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
3867                        + chem(i,k,j,lptr_opcg2_b_o_aer(4,itype,iphase)) &
3868                        + chem(i,k,j,lptr_opcg3_b_o_aer(4,itype,iphase)) &
3869                        + chem(i,k,j,lptr_opcg4_b_o_aer(4,itype,iphase)) &
3870                        + chem(i,k,j,lptr_opcg5_b_o_aer(4,itype,iphase)) &
3871                        + chem(i,k,j,lptr_opcg6_b_o_aer(4,itype,iphase)) &
3872                        + chem(i,k,j,lptr_opcg7_b_o_aer(4,itype,iphase)) &
3873                        + chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
3874                        + chem(i,k,j,lptr_opcg2_f_c_aer(4,itype,iphase)) &
3875                        + chem(i,k,j,lptr_opcg3_f_c_aer(4,itype,iphase)) &
3876                        + chem(i,k,j,lptr_opcg4_f_c_aer(4,itype,iphase)) &
3877                        + chem(i,k,j,lptr_opcg5_f_c_aer(4,itype,iphase)) &
3878                        + chem(i,k,j,lptr_opcg6_f_c_aer(4,itype,iphase)) &
3879                        + chem(i,k,j,lptr_opcg7_f_c_aer(4,itype,iphase)) &
3880                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
3881                        + chem(i,k,j,lptr_opcg2_f_o_aer(4,itype,iphase)) &
3882                        + chem(i,k,j,lptr_opcg3_f_o_aer(4,itype,iphase)) &
3883                        + chem(i,k,j,lptr_opcg4_f_o_aer(4,itype,iphase)) &
3884                        + chem(i,k,j,lptr_opcg5_f_o_aer(4,itype,iphase)) &
3885                        + chem(i,k,j,lptr_opcg6_f_o_aer(4,itype,iphase)) &
3886                        + chem(i,k,j,lptr_opcg7_f_o_aer(4,itype,iphase)) &
3887                        + (chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
3888                        + chem(i,k,j,lptr_ant2_c_aer(4,itype,iphase))    &
3889                        + chem(i,k,j,lptr_ant3_c_aer(4,itype,iphase))    &
3890                        + chem(i,k,j,lptr_ant4_c_aer(4,itype,iphase)))    &
3891                        + chem(i,k,j,lptr_ant1_o_aer(4,itype,iphase))    &
3892                        + chem(i,k,j,lptr_ant2_o_aer(4,itype,iphase))    &
3893                        + chem(i,k,j,lptr_ant3_o_aer(4,itype,iphase))    &
3894                        + chem(i,k,j,lptr_ant4_o_aer(4,itype,iphase))    &
3895                        + (chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
3896                        + chem(i,k,j,lptr_biog2_c_aer(4,itype,iphase))    &
3897                        + chem(i,k,j,lptr_biog3_c_aer(4,itype,iphase))    &
3898                        + chem(i,k,j,lptr_biog4_c_aer(4,itype,iphase)))    &
3899                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))    &
3900                        + chem(i,k,j,lptr_biog2_o_aer(4,itype,iphase))    &
3901                        + chem(i,k,j,lptr_biog3_o_aer(4,itype,iphase))    &
3902                        + chem(i,k,j,lptr_biog4_o_aer(4,itype,iphase))
3904        arosoa_a04(i,k,j)= chem(i,k,j,lptr_ant1_o_aer(4,itype,iphase))   &
3905                        + chem(i,k,j,lptr_ant2_o_aer(4,itype,iphase))    &
3906                        + chem(i,k,j,lptr_ant3_o_aer(4,itype,iphase))    &
3907                        + chem(i,k,j,lptr_ant4_o_aer(4,itype,iphase))    &
3908                        + chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
3909                        + chem(i,k,j,lptr_ant2_c_aer(4,itype,iphase))    &
3910                        + chem(i,k,j,lptr_ant3_c_aer(4,itype,iphase))    &
3911                        + chem(i,k,j,lptr_ant4_c_aer(4,itype,iphase))
3914         bbsoa_a04(i,k,j)=  chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
3915                        + chem(i,k,j,lptr_opcg2_b_c_aer(4,itype,iphase)) &
3916                        + chem(i,k,j,lptr_opcg3_b_c_aer(4,itype,iphase)) &
3917                        + chem(i,k,j,lptr_opcg4_b_c_aer(4,itype,iphase)) &
3918                        + chem(i,k,j,lptr_opcg5_b_c_aer(4,itype,iphase)) &
3919                        + chem(i,k,j,lptr_opcg6_b_c_aer(4,itype,iphase)) &
3920                        + chem(i,k,j,lptr_opcg7_b_c_aer(4,itype,iphase)) &
3921                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
3922                        + chem(i,k,j,lptr_opcg2_b_o_aer(4,itype,iphase)) &
3923                        + chem(i,k,j,lptr_opcg3_b_o_aer(4,itype,iphase)) &
3924                        + chem(i,k,j,lptr_opcg4_b_o_aer(4,itype,iphase)) &
3925                        + chem(i,k,j,lptr_opcg5_b_o_aer(4,itype,iphase)) &
3926                        + chem(i,k,j,lptr_opcg6_b_o_aer(4,itype,iphase)) &
3927                        + chem(i,k,j,lptr_opcg7_b_o_aer(4,itype,iphase)) 
3929         hsoa_a04(i,k,j)=  chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
3930                        + chem(i,k,j,lptr_opcg2_f_c_aer(4,itype,iphase)) &
3931                        + chem(i,k,j,lptr_opcg3_f_c_aer(4,itype,iphase)) &
3932                        + chem(i,k,j,lptr_opcg4_f_c_aer(4,itype,iphase)) &
3933                        + chem(i,k,j,lptr_opcg5_f_c_aer(4,itype,iphase)) &
3934                        + chem(i,k,j,lptr_opcg6_f_c_aer(4,itype,iphase)) &
3935                        + chem(i,k,j,lptr_opcg7_f_c_aer(4,itype,iphase)) &
3936                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
3937                        + chem(i,k,j,lptr_opcg2_f_o_aer(4,itype,iphase)) &
3938                        + chem(i,k,j,lptr_opcg3_f_o_aer(4,itype,iphase)) &
3939                        + chem(i,k,j,lptr_opcg4_f_o_aer(4,itype,iphase)) &
3940                        + chem(i,k,j,lptr_opcg5_f_o_aer(4,itype,iphase)) &
3941                        + chem(i,k,j,lptr_opcg6_f_o_aer(4,itype,iphase)) &
3942                        + chem(i,k,j,lptr_opcg7_f_o_aer(4,itype,iphase)) 
3944         biog_a04(i,k,j)= (chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
3945                        + chem(i,k,j,lptr_biog2_c_aer(4,itype,iphase))    &
3946                        + chem(i,k,j,lptr_biog3_c_aer(4,itype,iphase))    &
3947                        + chem(i,k,j,lptr_biog4_c_aer(4,itype,iphase)))    &
3948                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))    &
3949                        + chem(i,k,j,lptr_biog2_o_aer(4,itype,iphase))    &
3950                        + chem(i,k,j,lptr_biog3_o_aer(4,itype,iphase))    &
3951                        + chem(i,k,j,lptr_biog4_o_aer(4,itype,iphase))
3955          totoa_a04(i,k,j)=  chem(i,k,j,lptr_pcg1_b_c_aer(4,itype,iphase)) &
3956                        + chem(i,k,j,lptr_pcg2_b_c_aer(4,itype,iphase)) &
3957                        + chem(i,k,j,lptr_pcg3_b_c_aer(4,itype,iphase)) &
3958                        + chem(i,k,j,lptr_pcg4_b_c_aer(4,itype,iphase)) &
3959                        + chem(i,k,j,lptr_pcg5_b_c_aer(4,itype,iphase)) &
3960                        + chem(i,k,j,lptr_pcg6_b_c_aer(4,itype,iphase)) &
3961                        + chem(i,k,j,lptr_pcg7_b_c_aer(4,itype,iphase)) &
3962                        + chem(i,k,j,lptr_pcg1_b_o_aer(4,itype,iphase)) &
3963                        + chem(i,k,j,lptr_pcg2_b_o_aer(4,itype,iphase)) &
3964                        + chem(i,k,j,lptr_pcg3_b_o_aer(4,itype,iphase)) &
3965                        + chem(i,k,j,lptr_pcg4_b_o_aer(4,itype,iphase)) &
3966                        + chem(i,k,j,lptr_pcg5_b_o_aer(4,itype,iphase)) &
3967                        + chem(i,k,j,lptr_pcg6_b_o_aer(4,itype,iphase)) &
3968                        + chem(i,k,j,lptr_pcg7_b_o_aer(4,itype,iphase)) &
3969                        + chem(i,k,j,lptr_opcg1_b_c_aer(4,itype,iphase)) &
3970                        + chem(i,k,j,lptr_opcg2_b_c_aer(4,itype,iphase)) &
3971                        + chem(i,k,j,lptr_opcg3_b_c_aer(4,itype,iphase)) &
3972                        + chem(i,k,j,lptr_opcg4_b_c_aer(4,itype,iphase)) &
3973                        + chem(i,k,j,lptr_opcg5_b_c_aer(4,itype,iphase)) &
3974                        + chem(i,k,j,lptr_opcg6_b_c_aer(4,itype,iphase)) &
3975                        + chem(i,k,j,lptr_opcg7_b_c_aer(4,itype,iphase)) &
3976                        + chem(i,k,j,lptr_opcg1_b_o_aer(4,itype,iphase)) &
3977                        + chem(i,k,j,lptr_opcg2_b_o_aer(4,itype,iphase)) &
3978                        + chem(i,k,j,lptr_opcg3_b_o_aer(4,itype,iphase)) &
3979                        + chem(i,k,j,lptr_opcg4_b_o_aer(4,itype,iphase)) &
3980                        + chem(i,k,j,lptr_opcg5_b_o_aer(4,itype,iphase)) &
3981                        + chem(i,k,j,lptr_opcg6_b_o_aer(4,itype,iphase)) &
3982                        + chem(i,k,j,lptr_opcg7_b_o_aer(4,itype,iphase)) &
3983                        + chem(i,k,j,lptr_pcg1_f_c_aer(4,itype,iphase)) &
3984                        + chem(i,k,j,lptr_pcg2_f_c_aer(4,itype,iphase)) &
3985                        + chem(i,k,j,lptr_pcg3_f_c_aer(4,itype,iphase)) &
3986                        + chem(i,k,j,lptr_pcg4_f_c_aer(4,itype,iphase)) &
3987                        + chem(i,k,j,lptr_pcg5_f_c_aer(4,itype,iphase)) &
3988                        + chem(i,k,j,lptr_pcg6_f_c_aer(4,itype,iphase)) &
3989                        + chem(i,k,j,lptr_pcg7_f_c_aer(4,itype,iphase)) &
3990                        + chem(i,k,j,lptr_pcg1_f_o_aer(4,itype,iphase)) &
3991                        + chem(i,k,j,lptr_pcg2_f_o_aer(4,itype,iphase)) &
3992                        + chem(i,k,j,lptr_pcg3_f_o_aer(4,itype,iphase)) &
3993                        + chem(i,k,j,lptr_pcg4_f_o_aer(4,itype,iphase)) &
3994                        + chem(i,k,j,lptr_pcg5_f_o_aer(4,itype,iphase)) &
3995                        + chem(i,k,j,lptr_pcg6_f_o_aer(4,itype,iphase)) &
3996                        + chem(i,k,j,lptr_pcg7_f_o_aer(4,itype,iphase)) &
3997                        + chem(i,k,j,lptr_opcg1_f_c_aer(4,itype,iphase)) &
3998                        + chem(i,k,j,lptr_opcg2_f_c_aer(4,itype,iphase)) &
3999                        + chem(i,k,j,lptr_opcg3_f_c_aer(4,itype,iphase)) &
4000                        + chem(i,k,j,lptr_opcg4_f_c_aer(4,itype,iphase)) &
4001                        + chem(i,k,j,lptr_opcg5_f_c_aer(4,itype,iphase)) &
4002                        + chem(i,k,j,lptr_opcg6_f_c_aer(4,itype,iphase)) &
4003                        + chem(i,k,j,lptr_opcg7_f_c_aer(4,itype,iphase)) &
4004                        + chem(i,k,j,lptr_opcg1_f_o_aer(4,itype,iphase)) &
4005                        + chem(i,k,j,lptr_opcg2_f_o_aer(4,itype,iphase)) &
4006                        + chem(i,k,j,lptr_opcg3_f_o_aer(4,itype,iphase)) &
4007                        + chem(i,k,j,lptr_opcg4_f_o_aer(4,itype,iphase)) &
4008                        + chem(i,k,j,lptr_opcg5_f_o_aer(4,itype,iphase)) &
4009                        + chem(i,k,j,lptr_opcg6_f_o_aer(4,itype,iphase)) &
4010                        + chem(i,k,j,lptr_opcg7_f_o_aer(4,itype,iphase)) &
4011                        + (chem(i,k,j,lptr_ant1_c_aer(4,itype,iphase))    &
4012                        + chem(i,k,j,lptr_ant2_c_aer(4,itype,iphase))    &
4013                        + chem(i,k,j,lptr_ant3_c_aer(4,itype,iphase))    &
4014                        + chem(i,k,j,lptr_ant4_c_aer(4,itype,iphase)))    &
4015                        + chem(i,k,j,lptr_ant1_o_aer(4,itype,iphase))    &
4016                        + chem(i,k,j,lptr_ant2_o_aer(4,itype,iphase))    &
4017                        + chem(i,k,j,lptr_ant3_o_aer(4,itype,iphase))    &
4018                        + chem(i,k,j,lptr_ant4_o_aer(4,itype,iphase))    &
4019                        + (chem(i,k,j,lptr_biog1_c_aer(4,itype,iphase))    &
4020                        + chem(i,k,j,lptr_biog2_c_aer(4,itype,iphase))    &
4021                        + chem(i,k,j,lptr_biog3_c_aer(4,itype,iphase))    &
4022                        + chem(i,k,j,lptr_biog4_c_aer(4,itype,iphase)))    &
4023                        + chem(i,k,j,lptr_biog1_o_aer(4,itype,iphase))    &
4024                        + chem(i,k,j,lptr_biog2_o_aer(4,itype,iphase))    &
4025                        + chem(i,k,j,lptr_biog3_o_aer(4,itype,iphase))    &
4026                        + chem(i,k,j,lptr_biog4_o_aer(4,itype,iphase))    &
4027                        + chem(i,k,j,lptr_oc_aer(4,itype,iphase))
4030                enddo
4031             enddo
4032          enddo
4033    enddo ! type
4034    enddo ! phase
4037    end subroutine sum_vbs9
4040 !-----------------------------------------------------------------------
4041         end module module_mosaic_sumpm