1 ! etodos - things to do
3 ! etodos - get the print_mosaic_stats working with mosaic2
6 !************************************************************************
7 ! This computer software was prepared by Battelle Memorial Institute,
8 ! hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 with
9 ! the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE
10 ! CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
11 ! LIABILITY FOR THE USE OF THIS SOFTWARE.
13 ! Aerosol Option: MOSAIC (Model for Simulating Aerosol Interactions &
15 ! * Primary investigator: Rahul A. Zaveri
16 ! * Co-investigator: Richard C. Easter, William I. Gustafson Jr.
17 ! Last update: February 2009
20 ! Rahul A. Zaveri, PhD Jerome D. Fast, PhD
21 ! Senior Research Scientist Staff Scientist
22 ! Pacific Northwest National Laboratory Pacific Northwest National Laboratory
23 ! P.O. Box 999, MSIN K9-30 P.O. Box 999, MSIN K9-30
24 ! Richland, WA 99352 Richland, WA, 99352
25 ! Phone: (509) 372-6159 Phone: (509) 372-6116
26 ! Email: Rahul.Zaveri@pnl.gov Email: Jerome.Fast@pnl.gov
28 ! Please report any bugs or problems to Rahul Zaveri, the primary author
29 ! of the code, or Jerome Fast, the WRF-chem implementation team leader
33 ! 1) Users are requested to consult the primary author prior to
34 ! modifying the MOSAIC code or incorporating it or its submodules in
35 ! another code. This is meant to ensure that the any linkages and/or
36 ! assumptions will not adversely affect the operation of MOSAIC.
37 ! 2) The MOSAIC source code is intended for research and educational
38 ! purposes. Users are requested to contact the primary author
39 ! regarding the use of MOSAIC code for any commercial application.
40 ! 3) Users preparing publications resulting from the usage of MOSAIC are
41 ! requested to cite one or more of the references below (depending on
42 ! the application) for proper acknowledgement.
44 ! References for MOSAIC (The first one is the primary MOSAIC reference):
45 ! * Zaveri R.A., R.C. Easter, J.D. Fast, and L.K. Peters (2008), Model
46 ! for Simulating Aerosol Interactions and Chemistry (MOSAIC), J.
47 ! Geophys. Res., 113, D13204, doi:10.1029/2007JD008782.
48 ! * Zaveri R.A., R.C. Easter, and A.S. Wexler (2005), A new method for
49 ! multi-component activity coefficients of electrolytes in aqueous
50 ! atmospheric aerosols, J. Geophys. Res., 110, D02201,
51 ! doi:10.1029/2004JD004681.
52 ! * Zaveri R.A., R.C. Easter, and L.K. Peters (2005), A computationally
53 ! efficient multicomponent equilibrium solver for aerosols (MESA), J.
54 ! Geophys. Res., 110, D24203, doi:24203, doi:10.1029/2004JD005618.
56 ! References for implementation of the aerosol optical properties and
57 ! direct effect in WRF-Chem:
58 ! * Fast, J.D., W.I. Gustafson Jr., R.C. Easter, R.A. Zaveri, J.C.
59 ! Barnard, E.G. Chapman, G.A. Grell, and S.E. Peckham (2005), Evolution
60 ! of ozone, particulates, and aerosol direct radiative forcing in the
61 ! vicinity of Houston using a fully-coupled meteorology-chemistry-
62 ! aerosol model, J. Geophys. Res., 111, D21305,
63 ! doi:10.1029/2005JD006721.
64 ! * Barnard, J.C., J.D. Fast, G. Paredes-Miranda, W.P. Arnott, et al.
65 ! (2009), Closure on the single scattering albedo in the WRF-Chem
66 ! framework using data from the MILAGRO campaign, Atmos. Chem. Phys.,
69 ! References for implementation of the aerosol-cloud interactions and
70 ! indirect effects in WRF-Chem:
71 ! * Gustafson, W. I., E. G. Chapman, S. J. Ghan, R. C. Easter, and J. D.
72 ! Fast (2007), Impact on modeled cloud characteristics due to
73 ! simplified treatment of uniform cloud condensation nuclei during
74 ! NEAQS 2004, Geophys. Res. Lett., 34, L19809, L19809,
75 ! doi:10.1029/2007GL0300321.
76 ! * Chapman, E.G., W. I. Gustafson Jr., R. C. Easter, J. C. Barnard,
77 ! S. J. Ghan, M. S. Pekour, and J. D. Fast (2009): Coupling aerosol-
78 ! cloud-radiative processes in the WRF-Chem model: Investigating the
79 ! radiative impact of elevated point sources, Atmos. Chem. Phys., 9,
80 ! 945-964, www.atmos-chem-phys.net/9/945/2009/.
82 ! Contact Jerome Fast for updates on the status of manuscripts under
85 ! Additional information:
86 ! * www.pnl.gov/atmospheric/research/wrf-chem
89 ! Funding for developing and evaluating MOSAIC was provided by the U.S.
90 ! Department of Energy under the auspices of Atmospheric Science Program
91 ! of the Office of Biological and Environmental Research, the NASA Earth
92 ! Sciences Enterprise under grant NAGW 3367, and PNNL Laboratory Directed
93 ! Research and Development program.
94 !************************************************************************
95 module module_mosaic2_driver
99 ! *** NOTE - when the cw species are NOT in the registry, then
100 ! then the p_xxx_cwnn variables are not in module_state_description,
101 ! and the following cpp directive should be commented out
103 #define cw_species_are_in_registry
109 !-----------------------------------------------------------------------
111 ! rce 2005-feb-18 - one fix involving dcen_sect indices [now (isize,itype)]
113 ! rce 2004-dec-03 - many changes associated with the new aerosol "pointer"
114 ! variables in module_data_mosaic_asect
115 ! nov-04 sg ! replaced amode with aer and expanded aerosol dimension
116 ! to include type and phase
118 ! rce 11-sep-2004 - numerous changes
119 ! eliminated use of the _wrfch pointers (lptr_xxx_a_wrfch,
120 ! lwaterptr_wrfch, numptr_wrfch); use only the _aer pointers now
121 ! aboxtest_... variables are now in module_data_mosaic_other
123 !-----------------------------------------------------------------------
125 subroutine mosaic2_aerchem_driver( &
126 id, curr_secs, ktau, dtstep, ktauc, dtstepc, &
128 t_phy, rho_phy, p_phy, &
130 ids,ide, jds,jde, kds,kde, &
131 ims,ime, jms,jme, kms,kme, &
132 its,ite, jts,jte, kts,kte )
135 use module_configure, only: grid_config_rec_type, &
136 p_qv, p_so2, p_ho2, p_so4aj, p_corn, p_hcl, p_mtf, &
137 p_so4_a01, p_water_a01, p_num_a01, &
138 p_so4_a04, p_water_a04, p_num_a04
139 use module_state_description, only: num_moist, num_chem, param_first_scalar
141 use module_data_mosaic_kind, only: r8
142 ! use module_data_mosaic_aero, only: nbin_a_max
143 use module_data_mosaic_aero, only: nbin_a_max, msoa_flag1, msoa_vbs_info
144 use module_data_mosaic_main, only: ntot_used
146 use module_mosaic_aerdynam_intr, only: aerosoldynamics
148 ! use module_mosaic_therm, only: print_mosaic_stats, &
149 ! iprint_mosaic_fe1, iprint_mosaic_perform_stats, &
150 ! iprint_mosaic_diag1, iprint_mosaic_input_ok
151 use module_peg_util, only: peg_error_fatal, peg_message
155 !-----------------------------------------------------------------------
158 ! mosaic_aerchem_driver is the interface between wrf-chem and the
159 ! mosaic aerosol-chemistry routine cat computes condensation/evaporation
160 ! of trace gases to/from aerosol particles (AP). It currently treats
161 ! water vapor and the 4 inorganic trace gases (nh3, h2so4, hno3, and hcl).
162 ! The aerosol-chemistry routine can work with either a sectional
163 ! (multiple size bins) or modal (multiple modes) representation.
165 ! In both cases, condensation/evaporation to/from each bins/mode is
166 ! first computed. For sectional representation, AP mass and number
167 ! are then transferred between size bins as a result of AP
168 ! positive/negative growth. Either a moving-center or two-moment
169 ! algorithm can be used to compute this transfer.
171 ! mosaic_aerchem_driver is organized as follows
173 ! call mapaer_tofrom_host to map 1 column of gas and aerosol mixing
174 ! ratios from the chem array to the rsub array (and convert units)
175 ! call aerchemistry to do the aerosol chemistry calculations
176 ! for timestep = dtstepc
177 ! call mapaer_tofrom_host to map 1 column of gas and aerosol mixing
178 ! ratios from the rsub array back to the chem array
180 !-----------------------------------------------------------------------
183 integer, intent(in) :: &
185 ids, ide, jds, jde, kds, kde, &
186 ims, ime, jms, jme, kms, kme, &
187 its, ite, jts, jte, kts, kte
189 ! ktau - time step number
190 ! ktauc - gas and aerosol chemistry time step number
192 ! [ids:ide, kds:kde, jds:jde] - spatial (x,z,y) indices for "domain"
193 ! [ims:ime, kms:kme, jms:jme] - spatial (x,z,y) indices for "memory"
194 ! Most arrays that are arguments to chem_driver
195 ! are dimensioned with these spatial indices.
196 ! [its:ite, kts:kte, jts:jte] - spatial (x,z,y) indices for "tile"
197 ! chem_driver and routines under it do calculations
198 ! over these spatial indices.
200 real(kind=8), intent(in) :: curr_secs
201 real, intent(in) :: dtstep, dtstepc
202 ! dtstep - main model time step (s)
203 ! dtstepc - time step for gas and aerosol chemistry(s)
206 dimension( ims:ime, kms:kme, jms:jme ) :: &
207 t_phy, rho_phy, p_phy
208 ! t_phy - temperature (K)
209 ! rho_phy - air density (kg/m^3)
210 ! p_phy - air pressure (Pa)
213 dimension( ims:ime, kms:kme, jms:jme, 1:num_moist ) :: &
215 ! moist - mixing ratios of moisture species (water vapor,
216 ! cloud water, ...) (kg/kg for mass species, #/kg for number species)
218 real, intent(inout), &
219 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
221 ! chem - mixing ratios of trace gase (ppm) and aerosol species
222 ! (ug/kg for mass species, #/kg for number species)
224 type(grid_config_rec_type), intent(in) :: config_flags
225 ! config_flags - configuration and control parameters
227 !-----------------------------------------------------------------------
229 integer, parameter :: debug_level=0
230 integer :: i, itmpa, istat, it, j, jt, jtmpa, k, kt, l, n
231 integer :: levdbg_err, levdbg_info
232 integer :: i_force_dump, mode_force_dump
233 integer :: idiagaa, idiagbb, ijkcount
234 integer :: iter_mesa(nbin_a_max), jaerosolstate(nbin_a_max)
237 real(r8) :: tempbox, presbox, airdenbox, relhumbox, swdownbox
238 real(r8) :: rbox(ntot_used), rbox0(ntot_used)
239 real(r8) :: dp_dry_a(nbin_a_max), dp_wet_a(nbin_a_max)
240 real, dimension( ims:ime, jms:jme ) :: swdown
245 if ( config_flags%aerchem_onoff <= 0 ) return ! aerosol chem/dynam turned off
249 swdown = 0.0 ! in wrf 3.5 this was passed in from chem_driver
250 ! in wrf 3.9 it is currently not passed in and so is set to zero
253 ! set some variables to their wrf-chem "standard" values
258 if ((jde-jds > 2) .or. (ide-ids > 2)) then
259 idiagaa = 0 ! not single column - set to 0 to disable all diagnostics
262 idiagaa = 100 ! single column run
266 if (idiagaa > 0) print 93010, 'entered mosaic2_aerchem_driver - ktau =', ktau
269 !rcetestc diagnostics --------------------------------------------------
270 if (debug_level .ge. 15 .or. idiagaa >= 100) then
271 if (ktauc .le. 2) then
273 print 93010, 'rcetestc diagnostics from mosaic2_aerchem_driver'
274 print '(a,5i9)', 'msoa_flag1, msoa_vbs_info(1:3)', msoa_flag1, msoa_vbs_info(1:3)
275 print 93010, 'id, chem_opt, ktau, ktauc ', &
276 id, config_flags%chem_opt, ktau, ktauc
277 print 93020, 'dtstep, dtstepc ', &
279 print 93010, 'ids/e, j, k', ids, ide, jds, jde, kds, kde
280 print 93010, 'ims/e, j, k', ims, ime, jms, jme, kms, kme
281 print 93010, 'its/e, j, k', its, ite, jts, jte, kts, kte
282 print 93010, 'num_chem, param_first_scalar ', num_chem, param_first_scalar
283 print 93010, 'p_so2, p_ho2 ', p_so2, p_ho2
284 print 93010, 'p_so4aj, p_corn, p_hcl, p_mtf', p_so4aj, p_corn, p_hcl, p_mtf
285 print 93010, 'p_so4_a01, p_water, p_num_a01', p_so4_a01, p_water_a01, p_num_a01
286 print 93010, 'p_so4_a04, p_water, p_num_a04', p_so4_a04, p_water_a04, p_num_a04
289 print 93020, 't, p, rho, qv at its/kts /jts', t_phy(its,k,jts), &
290 p_phy(its,k,jts), rho_phy(its,k,jts), moist(its,k,jts,p_qv)
292 print 93020, 't, p, rho, qv at its/ktmi/jts', t_phy(its,k,jts), &
293 p_phy(its,k,jts), rho_phy(its,k,jts), moist(its,k,jts,p_qv)
295 print 93020, 't, p, rho, qv at its/kte /jts', t_phy(its,k,jts), &
296 p_phy(its,k,jts), rho_phy(its,k,jts), moist(its,k,jts,p_qv)
297 93010 format( a, 8(1x,i6) )
298 93020 format( a, 8(1p,e14.6) )
301 !rcetestc diagnostics --------------------------------------------------
304 ! using wrf timing routines
305 ! iymdcur = 1 + int( curr_secs/86400._8 )
306 ! ihmscur = nint( mod( curr_secs, 86400._8 ) )
309 ! call print_mosaic_stats( 0 )
319 ijkcount = ijkcount + 1
323 ! mode_force_dump selects a detailed dump of gaschem at either
324 ! first ijk grid, first ij column, all ijk, or no ijk
326 ! if (mode_force_dump .eq. 10) then
327 ! if ((it.eq.its) .and. (jt.eq.jts)) i_force_dump = 1
328 ! else if (mode_force_dump .eq. 100) then
330 ! else if (mode_force_dump .eq. 77) then
331 ! if ( (it .eq. (its+ite)/2) .and. &
332 ! (jt .eq. (jts+jte)/2) ) i_force_dump = 1
336 if (idiagaa >= 100) print 93010, &
337 'calling mosaic2_map 0 - ktau,ktauc,id,i,k,j =', ktau, ktauc, id, it, kt, jt
338 call mosaic2_map_tofrom_host( 0, &
339 ids,ide, jds,jde, kds,kde, &
340 ims,ime, jms,jme, kms,kme, &
341 its,ite, jts,jte, kts,kte, &
343 t_phy, p_phy, rho_phy, swdown, moist, chem, &
344 rbox, tempbox, presbox, airdenbox, &
345 relhumbox, swdownbox )
347 ! save initial mixrats
348 rbox0(1:nbin_a_max) = rbox(1:nbin_a_max)
350 ! if (i_force_dump > 0) call aerchem_debug_dump( 1, it, jt, dtchem )
351 if (idiagaa >= 100) print 93010, &
352 'calling aerosoldynamics - ktau,ktauc,id,i,k,j =', ktau, ktauc, id, it, kt, jt
354 call aerosoldynamics( & !intent-ins
357 ktau, ktauc, dtchem, &
358 tempbox, presbox, airdenbox, relhumbox, &
360 rbox, iter_mesa, jaerosolstate, & !intent-inouts
363 call wrf_debug(300,"mosaic_aerchem_driver: back from aerchemistry")
364 ! if (i_force_dump > 0) call aerchem_debug_dump( 3, it, jt, dtchem )
367 if (idiagaa >= 100) print 93010, &
368 'calling mosaic2_map 1 - ktau,ktauc,id,i,k,j =', ktau, ktauc, id, it, kt, jt
369 call mosaic2_map_tofrom_host( 1, &
370 ids,ide, jds,jde, kds,kde, &
371 ims,ime, jms,jme, kms,kme, &
372 its,ite, jts,jte, kts,kte, &
374 t_phy, p_phy, rho_phy, swdown, moist, chem, &
375 rbox, tempbox, presbox, airdenbox, &
376 relhumbox, swdownbox )
384 ! call print_mosaic_stats( 1 )
385 if (idiagaa > 0) print 93010, 'leaving mosaic2_aerchem_driver - ktau =', ktau
388 end subroutine mosaic2_aerchem_driver
391 !-----------------------------------------------------------------------
393 subroutine mosaic2_map_tofrom_host( imap, &
394 ids,ide, jds,jde, kds,kde, &
395 ims,ime, jms,jme, kms,kme, &
396 its,ite, jts,jte, kts,kte, &
398 t_phy, p_phy, rho_phy, swdown, moist, chem, &
399 rbox, tempbox, presbox, airdenbox, &
400 relhumbox, swdownbox )
402 use module_data_mosaic_kind, only: r8
403 use module_data_mosaic_main, only: ntot_used
404 use module_mosaic_csuesat, only: esat_gchm
405 use module_configure, only: p_qv, p_qc
406 use module_state_description, only: num_moist, num_chem, param_first_scalar
407 use module_peg_util, only: peg_error_fatal, peg_message
413 ! imap determines mapping direction (chem-->rsub if <=0, rsub-->chem if >0)
414 integer, intent(in) :: imap
415 ! wrf array dimensions
416 integer, intent(in) :: ids, ide, jds, jde, kds, kde
417 integer, intent(in) :: ims, ime, jms, jme, kms, kme
418 integer, intent(in) :: its, ite, jts, jte, kts, kte
419 ! do mapping for wrf i,k,j grid points = [it,kt,jt]
420 integer, intent(in) :: it, jt, kt
422 real, intent(in), dimension( ims:ime, kms:kme, jms:jme ) :: &
423 t_phy, rho_phy, p_phy
425 real, intent(in), dimension( ims:ime, jms:jme ) :: swdown
428 dimension( ims:ime, kms:kme, jms:jme, 1:num_moist ) :: &
431 real, intent(inout), &
432 dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
435 real(r8), intent(inout), dimension( ntot_used ) :: rbox
437 real(r8), intent(inout) :: tempbox, presbox, airdenbox, relhumbox, swdownbox
442 real, parameter :: eps=0.622
443 real :: tmp_esat, tmp_pres, tmp_rh, tmp_temp, tmp_vap, tmp_vapsat
446 if (imap >= 1) go to 20000
447 ! map from chem to rbox
449 if (l >= param_first_scalar .and. l <= num_chem) then
450 rbox(l) = max( chem(it,kt,jt,l), 0.0_r8 )
456 ! map state variables
457 tempbox = t_phy(it,kt,jt)
458 presbox = p_phy(it,kt,jt)
459 airdenbox = rho_phy(it,kt,jt)
460 swdownbox = swdown(it,jt)
463 tmp_temp = t_phy(it,kt,jt) ! (deg k)
464 tmp_pres = p_phy(it,kt,jt)*10.0 ! air pressure (dyne/cm2)
465 tmp_esat = esat_gchm( tmp_temp ) ! saturation vapor pressure (dyne/cm2)
466 tmp_vapsat = tmp_esat / (tmp_pres - (1.0-eps)*tmp_esat) ! sat. mix ratio (mol-h2o/mol-air)
467 tmp_vap = moist(it,kt,jt,p_qv) / eps ! ambient mix ratio (mol-h2o/mol-air)
468 tmp_rh = tmp_vap / max( tmp_vapsat, 1.0e-20 )
470 tmp_rh = max( 0.0, min( 0.98, tmp_rh ) ) !rce 2017.11.24
473 ! what about cloud water, and sw radiation ???
478 ! map from rbox to chem
480 if (l >= param_first_scalar .and. l <= num_chem) then
481 chem(it,kt,jt,l) = max( rbox(l), 0.0_r8 )
486 end subroutine mosaic2_map_tofrom_host
490 !-----------------------------------------------------------------------
491 subroutine init_data_mosaic2_asect( id, config_flags, is_aerosol, vbs_nbin)
493 ! major refactoring in jun-2015 to clean up this very old code
494 ! before implementing external mixing
496 use module_configure, only: grid_config_rec_type
497 use module_state_description, only: num_chem
498 use module_peg_util, only: peg_error_fatal, peg_message
500 use module_data_mosaic_aero, only: &
501 mcoag_flag1, mmovesect_flag1, mnewnuc_flag1, &
503 use module_data_mosaic_asecthp
504 use module_data_mosaic_main, only: &
505 naerbin, naerbin_used, naer_max, naer_tot, &
507 use module_data_mosaic_boxmod, only: name_rbox
511 integer, intent(in) :: id
512 integer, intent(in) :: vbs_nbin(*)
513 type(grid_config_rec_type), intent(in) :: config_flags
514 logical, intent(out) :: is_aerosol(num_chem)
517 integer :: i, itype, itmpa, j, jtmpa, l, n
518 integer :: vbs_uq_aqsoa, vbs_uq_par
519 character(len=200) :: msg
522 ! dimension of rbox array (and copies of it)
526 ! these were used in wrfscmee but may not be needed in wrf39
530 ! allocate and initialize name_rbox()
531 if ( .not. allocated( name_rbox ) ) allocate( name_rbox(ntot_used) )
533 write( name_rbox(l), '(a,i4.4,15x)' ) 'r', l
538 ! inititialize some mosaic2 variables
540 call mosaic2_wrfchem_init( 1, vbs_nbin, vbs_uq_aqsoa, vbs_uq_par )
543 ! set mastercomp info
544 call peg_message( lunerr, 'call mosaic2_set_mastercomp' )
545 call mosaic2_set_mastercomp( )
548 ! set number of aerosol types
549 call peg_message( lunerr, 'call mosaic2_set_ntype' )
550 call mosaic2_set_ntype( config_flags%chem_opt, lunerr )
553 ! set number of aerosol phases and some other phase-related variables
554 call peg_message( lunerr, 'call mosaic2_set_nphase' )
555 call mosaic2_set_nphase( config_flags%chem_opt, lunerr )
558 ! set number of aerosol bins
559 call peg_message( lunerr, 'call mosaic2_set_nsize' )
560 call mosaic2_set_nsize( config_flags%chem_opt, lunerr )
564 ! set nbin_a to total number of aerosol bins (for all types)
567 do itype = 1, ntype_aer
568 n = n + nsize_aer(itype)
571 if (nbin_a .gt. nbin_a_max) then
572 call peg_error_fatal( lunerr, &
573 'init_data_mosaic2_asect - nbin_a > nbin_a_maxd' )
576 naerbin_used = nbin_a
577 naer_max = naer_tot*naerbin
580 call peg_message( lunerr, 'mosaic2_set_3dbin_1dbin_ptrs' )
581 ! *** aer_extmix_opt has not been put into wrfscmee/Registry/registry.chem
582 ! call mosaic2_set_3dbin_1dbin_ptrs( config_flags%chem_opt, config_flags%aer_extmix_opt, lunerr )
583 call mosaic2_set_3dbin_1dbin_ptrs( config_flags%chem_opt, 0, lunerr )
587 ! set section size arrays
589 ! set bin (section) sizes
590 call peg_message( lunerr, 'call mosaic2_set_bin_sizes' )
591 call mosaic2_set_bin_sizes( config_flags%chem_opt, lunerr )
595 ! set pointers to wrf chem-array species
597 call init_data_mosaic2_ptr( id, config_flags%chem_opt, is_aerosol )
601 ! inititialize some mosaic2 variables
603 call mosaic2_wrfchem_init( 2, vbs_nbin, vbs_uq_aqsoa, vbs_uq_par )
607 ! set pointers for mapping between rbox array and gas, aer, num_a, water_a arrays
609 call set_rbox_gas_ptrs
610 call set_rbox_aer_ptrs
614 ! reset some "mosaic2" control variables using config_flags%mosaic_aerchem_optaa
616 itmpa = max( config_flags%mosaic_aerchem_optaa, 0 )
617 if (itmpa >= 10000) then
618 jtmpa = mod(itmpa,100)/10 ! 10s digit controls movesect
619 if (jtmpa == 0) mmovesect_flag1 = 0 ! no movesect -- this turns off newnuc and coag ****
620 if (jtmpa == 1) mmovesect_flag1 = 10 ! 1d moving-center
621 if (jtmpa == 2) mmovesect_flag1 = 20 ! 1d linear-discrete
622 if (jtmpa == 5) mmovesect_flag1 = 50 ! 3d moving-center
623 if (jtmpa == 6) mmovesect_flag1 = 60 ! 3d linear-discrete for size and moving-center for wbc and kappa
625 jtmpa = mod(itmpa,1000)/100 ! 100s digit controls newnuc
626 if (jtmpa == 0) mnewnuc_flag1 = 0 ! no newnuc
627 if (jtmpa == 1) mnewnuc_flag1 = 1 ! merikanto (2007) ternary
628 if (jtmpa == 2) mnewnuc_flag1 = 2 ! vehkamaki (2002) binary
629 if (jtmpa == 3) mnewnuc_flag1 = 3 ! wexler (1994)
630 if (jtmpa == 5) mnewnuc_flag1 = 11 ! empirical 1st-order for pbl
631 if (jtmpa == 6) mnewnuc_flag1 = 12 ! empirical 2nd-order for pbl
633 jtmpa = mod(itmpa,10000)/1000 ! 1000s digit controls coag
634 if (jtmpa == 0) mcoag_flag1 = 0 ! no coag
635 if (jtmpa == 1) mcoag_flag1 = 1 ! 1d moving-center implicit in time (jacobson)
636 if (jtmpa == 2) mcoag_flag1 = 10 ! 1d moving-center explicit in time
637 if (jtmpa == 6) mcoag_flag1 = 60 ! 3d moving-center explicit in time
639 if (ntype_aer > 1) then
640 ! movesect and coag must use 3d methods unless they are off
641 if (mmovesect_flag1 == 10) mmovesect_flag1 = 50
642 if (mmovesect_flag1 == 20) mmovesect_flag1 = 60
643 if (mcoag_flag1 == 1) mcoag_flag1 = 60
644 if (mcoag_flag1 == 10) mcoag_flag1 = 60
646 end if ! (itmpa /= 1) then
647 write(msg,'(a,4i10)') &
648 'mosaic_aerchem_optaa, mmovesect_flag1, mnewnuc_flag1, mcoag_flag1 =', &
649 config_flags%mosaic_aerchem_optaa, mmovesect_flag1, mnewnuc_flag1, mcoag_flag1
650 call peg_message( lunerr, 'call mosaic2_set_bin_sizes' )
654 ! csuesat initialization
659 ! below cloud scavenging initialization
662 ! ntype_aer, nsize_aer, ncomp_aer, &
663 ! massptr_aer, dens_aer, numptr_aer, &
664 ! maxd_acomp, maxd_asize,maxd_atype, maxd_aphase, &
665 ! dcen_sect, sigmag_aer, &
666 ! waterptr_aer, dens_water_aer, &
667 ! scavimptblvol, scavimptblnum, nimptblgrow_mind, &
668 ! nimptblgrow_maxd, dlndg_nimptblgrow)
671 ! move_sect initialization (and testing)
673 ! subr move_sections( iflag, iclm, jclm, k, m )
674 ! call move_sections( -1, 1, 1, 1, 1 )
676 ! call test_move_sections( 1, 1, 1, 1, 1 )
679 end subroutine init_data_mosaic2_asect
682 !-----------------------------------------------------------------------
683 subroutine init_data_mosaic2_ptr( id, chem_opt, is_aerosol )
685 ! major refactoring in jun-2015 to clean up this very old code
686 ! before implementing external mixing
689 use module_state_description, only: num_chem, p1st => param_first_scalar
691 use module_data_mosaic_asecthp
692 use module_data_mosaic_main, only: ntot_used
693 use module_peg_util, only: peg_error_fatal, peg_message
699 integer, intent(in) :: id, chem_opt
700 logical, intent(out) :: is_aerosol(num_chem)
704 integer icomp, isize, itype, iphase
709 ! set up pointers to aerosol species in the wrf-chem "chem" array
710 ! note: lptr=1 points to the first chem species which is "unused"
712 call peg_message( lunerr, 'call mosaic2_set_all_lnw_ptr' )
713 call mosaic2_set_all_lnw_ptr( chem_opt, ntot_used, lunerr )
716 ! define the mastercompptr_aer pointers and the ncomp_aer
718 call peg_message( lunerr, 'call mosaic2_set_ncomp' )
719 call mosaic2_set_ncomp( chem_opt, lunerr )
722 ! define the massptr_aer pointers species names
724 call peg_message( lunerr, 'call mosaic2_set_massptr' )
725 call mosaic2_set_massptr( chem_opt, ntot_used, lunerr )
726 call peg_message( lunerr, 'done mosaic2_set_massptr' )
730 ! output wrfchem pointers
732 call mosaic2_output_wrfchem_pointers( id )
736 ! check aerosol species pointers for "validity"
738 ! *** this code is no longer needed
739 ! the mosaic2_set_massptr, mosaic2_set_one_wptr, and mosaic2_set_one_lptr routines
740 ! now check that the various pointers (massptr, numptr, waterptr, hywsptr, lptr_xxx)
742 ! all sizes, phases, and types for required things
744 ! all OR no sizes, phases, and types for non-required things
747 end if ! ( 1 == 0 ) then
751 ! set the "k pointer" and name_rbox() for gas species used by mosaic routines
753 call mosaic2_set_gas_kptrs_names
758 ! name_rbox() for aerosol species
760 call mosaic2_set_otheraa( chem_opt, is_aerosol )
764 end subroutine init_data_mosaic2_ptr
767 !-----------------------------------------------------------------------
768 subroutine mosaic2_wrfchem_init( ipass, vbs_nbin, vbs_uq_aqsoa, vbs_uq_par )
770 !---------------------------------------------------------------------------------------!
771 ! this routine is based on Balwinders mosaic_cam_init
773 ! BSINGH: This subroutine initialzies some Mosaic conastans and inpput parameters
774 ! Called by: modal_aero_initialize_data.F90
775 !---------------------------------------------------------------------------------------!
776 ! use spmd_utils, only: masterproc
777 ! use cam_logfile, only: iulog
778 ! use modal_aero_amicphys, only: max_mode
780 use module_data_mosaic_kind, only: r8
781 use module_data_mosaic_aero, only: &
782 alpha_ASTEM, ptol_mol_ASTEM, rtol_eqb_ASTEM, &
783 mGAS_AER_XFER, mDYNAMIC_SOLVER, &
784 mhyst_method, mhyst_uporlo_waterhyst, &
785 msize_framework, msectional, &
786 method_bcfrac, method_kappa, &
787 maersize_init_flag1, mcoag_flag1, ifreq_coag, &
788 mmovesect_flag1, mnewnuc_flag1, msectional_flag1, msectional_flag2, &
789 msoa_flag1, msoa_vbs_info, &
790 use_cam5mam_soa_params, use_cam5mam_accom_coefs
792 use module_data_mosaic_main, only: &
793 ipmcmos, m_partmc_mosaic, maer, mcld, mgas, &
794 maeroptic, mphoto, mshellcore, msolar
796 use module_data_mosaic_asecthp, only: ntype_aer, ntype_md1_aer, ntype_md2_aer
798 use module_data_mosaic_constants, only: pi, piover4, piover6, deg2rad, third, avogad
799 ! use physconst, only: pi_cam => pi
801 use module_mosaic_init_aerpar, only: mosaic_init_aer_params
803 integer, intent(in) :: ipass
804 integer, intent(in) :: vbs_nbin(*), vbs_uq_aqsoa, vbs_uq_par
807 ! do ipass=1 stuff so that msoa_flag1 is set at the very start
809 msoa_vbs_info(:) = -99
810 msoa_vbs_info(1) = vbs_nbin(1)
812 if (vbs_nbin(1) > 0) then !rce 2017.11.24
814 msoa_vbs_info(2) = vbs_uq_aqsoa
815 msoa_vbs_info(3) = vbs_uq_par
818 msoa_flag1 = 0 ! for testing
821 print '(/a,5i9)', 'msoa_flag1, msoa_vbs_info(1:3)', msoa_flag1, msoa_vbs_info(1:3)
826 ! Initialize Mosaic constants with values from CAM constants
827 ! nbin_a_max = max_mode !*BALLI* Ask Dick about it
828 ! nbin_a = max_mode !Maximum # of modes is equal to # of bins in Mosaic
829 ! if(masterproc) then
830 ! write(iulog,*) 'mosaic_cam_init: nbin_a_max=', nbin_a_max
833 ! pi = pi_cam !Pi value from CAM
834 ! pi = 3.14159265358979323846_r8 ! from shr_const_mod.F90 of CAM
835 ! piover4 = 0.25_r8 * pi
836 ! piover6 = pi/6.0_r8
837 ! deg2rad = pi/180.0_r8
838 ! third = 1.0_r8/3.0_r8
839 ! avogad = 6.022e23_r8
841 ! use_cam5mam_soa_params = 1 ! use cam5-mam soa/soag parameter values
842 ! use_cam5mam_accom_coefs = 1 ! use cam5-mam accomodation coefficient values
843 use_cam5mam_soa_params = 0 ! use cam5-mam soa/soag parameter values
844 use_cam5mam_accom_coefs = 0 ! use cam5-mam accomodation coefficient values
846 ! BSINGH - Initialize other constants which sit in the input file of Mosaic
847 ! and are used in the present code(**BALLI Ask Dick about it)
848 ! mhyst_method = mhyst_force_up !rceaster !mhyst_method (1=uporlo_jhyst, 2=uporlo_waterhyst, 3=force_up, 4=force_low)
849 mhyst_method = mhyst_uporlo_waterhyst !rceaster !mhyst_method (1=uporlo_jhyst, 2=uporlo_waterhyst, 3=force_up, 4=force_low)
850 mGAS_AER_XFER = 1 !mGAS_AER_XFER: 1=do gas-aerosol partitioning 0=do not partition
851 mDYNAMIC_SOLVER = 1 !mDYNAMIC_SOLVER: 1=astem 2=lsodes
852 ! msize_framework = mmodal ! rceaster (1=modal, 2=unstructured, 3=sectional)
853 msize_framework = msectional ! rceaster (1=modal, 2=unstructured, 3=sectional)
854 alpha_ASTEM = 0.05 !Solver parameter. range: 0.01 - 1.0
855 rtol_eqb_ASTEM = 0.01 !Relative eqb tolerance. range: 0.01 - 0.03
856 ptol_mol_ASTEM = 0.01 !Percent mol tolerance. range: 0.01 - 1.0
857 ipmcmos = 0 !Additional inputs needed when ipmcmos > 0
858 m_partmc_mosaic = 0 !Always 0 except when in the PartMC-MOSAIC model
861 ! BSINGH - Initialize constants to 'bigint' which sit in the input file of Mosaic
862 ! and are NOT used in the present code(**BALLI Ask Dick about it)
863 ! 'bigint' initialized variables will cause the code to halt on their first use
865 ! in the cam routine, all these are set to bigint
866 ! ntype_md1_aer = bigint !(number of aerosol types) - set this elsewhere
867 ! ntype_md2_aer = bigint !(number of aerosol types) - set this elsewhere
868 method_bcfrac = 1 !(only used for sectional and ntype>1)
869 method_kappa = 11 !(only used for sectional and ntype>1)
870 maersize_init_flag1 = 0 !(only used for sectional and ntype>1 in offline box model)
872 ifreq_coag = 1 !(only used for sectional) do coag only when mod(itmosaic,ifreq_coag) = 0
873 if (ntype_aer <= 1) then
874 mcoag_flag1 = 10 !(only used for sectional) 0=off, 10=1d jacobsen, 20=1d moving-center, 60=2-3d hybrid
875 mmovesect_flag1 = 20 !(only used for sectional) 0=off, 10=1d moving-center, 20=1d linear-discrete, 60=2-3d hybrid
877 mcoag_flag1 = 60 !(only used for sectional) 0=off, 10=1d jacobsen, 20=1d moving-center, 60=2-3d hybrid
878 mmovesect_flag1 = 60 !(only used for sectional) 0=off, 10=1d moving-center, 20=1d linear-discrete, 60=2-3d hybrid
880 mnewnuc_flag1 = 3 !(only used for sectional) 0=off, 1 = merikanto (2007) ternary, 2 = vehkamaki (2002) binary
881 ! 3 = wexler (1994), 11 = empirical 1st-order for pbl, 12 = empirical 2nd-order for pbl
882 msectional_flag1 = 1 !(currently not used)
885 if (ntype_aer > 1) msectional_flag2 = 1
887 mgas = 0 !: 1=gas chem on, 0=gas chem off**
888 maer = 1 !: 1=aer chem on, 0=aer chem off**
889 mcld = 0 !: 1=cld chem on, 0=cld chem off**
890 maeroptic = 0 !: 1=aer_optical on, 0=aer_optical off **
891 mshellcore = 0 !: 0=no shellcore, 1=core is BC only, 2=core is BC and DUST **
892 msolar = 0 !: 1=diurnally varying phot, 2=fixed phot**
893 mphoto = 0 !: 1=Rick's param 2=Yang's param**
895 call mosaic_init_aer_params
897 end subroutine mosaic2_wrfchem_init
900 !-----------------------------------------------------------------------
901 subroutine mosaic2_output_wrfchem_pointers( id )
903 use module_data_mosaic_asecthp
904 use module_peg_util, only: peg_error_fatal, peg_message
905 use module_scalar_tables, only: chem_dname_table
910 integer, intent(in) :: id
913 integer l, ll, lu, n, ns
914 integer icomp, isize, itype, iphase, jt, jp
919 ! output wrfch pointers
921 9350 format( a, 32(1x,i4) )
923 call peg_message( lunout, msg )
924 msg = 'output from subr mosaic2_output_wrfchem_pointers'
925 call peg_message( lunout, trim(msg) )
926 write(msg,9350) 'nphase_aer = ', nphase_aer
927 call peg_message( lunout, trim(msg) )
929 do iphase=1,nphase_aer
931 write(msg,9350) 'iphase = ', iphase
932 call peg_message( lunout, trim(msg) )
933 write(msg,9350) 'ntype_aer = ', ntype_aer
934 call peg_message( lunout, trim(msg) )
935 write(msg,9350) 'ncomp_aer = ', ncomp_aer
936 call peg_message( lunout, trim(msg) )
940 write(msg,9350) 'itype = ', itype
941 call peg_message( lunout, trim(msg) )
942 write(msg,9350) 'nsize_aer = ', nsize_aer(itype)
943 call peg_message( lunout, trim(msg) )
947 ns = nsize_aer(itype)
950 call mosaic2_out1ptraa( "numptr_aer ", numptr_aer(1:ns,jt,jp), ns, lu )
951 call mosaic2_out1ptraa( "hyswptr_aer ", hyswptr_aer(1:ns,jt), ns, lu )
952 call mosaic2_out1ptraa( "waterptr_aer ", waterptr_aer(1:ns,jt), ns, lu )
954 call mosaic2_out1ptraa( "lptr_so4_aer ", lptr_so4_aer(1:ns,jt,jp), ns, lu )
955 call mosaic2_out1ptraa( "lptr_no3_aer ", lptr_no3_aer(1:ns,jt,jp), ns, lu )
956 call mosaic2_out1ptraa( "lptr_cl_aer ", lptr_cl_aer(1:ns,jt,jp), ns, lu )
957 call mosaic2_out1ptraa( "lptr_msa_aer ", lptr_msa_aer(1:ns,jt,jp), ns, lu )
958 call mosaic2_out1ptraa( "lptr_co3_aer ", lptr_co3_aer(1:ns,jt,jp), ns, lu )
959 call mosaic2_out1ptraa( "lptr_nh4_aer ", lptr_nh4_aer(1:ns,jt,jp), ns, lu )
960 call mosaic2_out1ptraa( "lptr_na_aer ", lptr_na_aer(1:ns,jt,jp), ns, lu )
961 call mosaic2_out1ptraa( "lptr_ca_aer ", lptr_ca_aer(1:ns,jt,jp), ns, lu )
962 call mosaic2_out1ptraa( "lptr_oin_aer ", lptr_oin_aer(1:ns,jt,jp), ns, lu )
963 call mosaic2_out1ptraa( "lptr_aro1_aer ", lptr_aro1_aer(1:ns,jt,jp), ns, lu )
964 call mosaic2_out1ptraa( "lptr_aro2_aer ", lptr_aro2_aer(1:ns,jt,jp), ns, lu )
965 call mosaic2_out1ptraa( "lptr_alk1_aer ", lptr_alk1_aer(1:ns,jt,jp), ns, lu )
966 call mosaic2_out1ptraa( "lptr_ole1_aer ", lptr_ole1_aer(1:ns,jt,jp), ns, lu )
967 call mosaic2_out1ptraa( "lptr_api1_aer ", lptr_api1_aer(1:ns,jt,jp), ns, lu )
968 call mosaic2_out1ptraa( "lptr_api2_aer ", lptr_api2_aer(1:ns,jt,jp), ns, lu )
969 call mosaic2_out1ptraa( "lptr_lim1_aer ", lptr_lim1_aer(1:ns,jt,jp), ns, lu )
970 call mosaic2_out1ptraa( "lptr_lim2_aer ", lptr_lim2_aer(1:ns,jt,jp), ns, lu )
971 ! call mosaic2_out1ptraa( "lptr_dust_aer ", lptr_dust_aer(1:ns,jt,jp), ns, lu )
972 ! call mosaic2_out1ptraa( "lptr_tr1r1_aer ", lptr_tr1r1_aer(1:ns,jt,jp), ns, lu )
973 call mosaic2_out1ptraa( "lptr_oc_aer ", lptr_oc_aer(1:ns,jt,jp), ns, lu )
974 call mosaic2_out1ptraa( "lptr_bc_aer ", lptr_bc_aer(1:ns,jt,jp), ns, lu )
975 ! call mosaic2_out1ptraa( "lptr_tanv_aer ", lptr_tanv_aer(1:ns,jt,jp), ns, lu )
976 ! call mosaic2_out1ptraa( "lptr_sopnv_aer ", lptr_sopnv_aer(1:ns,jt,jp), ns, lu )
977 ! call mosaic2_out1ptraa( "lptr_ternv_aer ", lptr_ternv_aer(1:ns,jt,jp), ns, lu )
978 ! call mosaic2_out1ptraa( "lptr_seqnv_aer ", lptr_seqnv_aer(1:ns,jt,jp), ns, lu )
979 ! call mosaic2_out1ptraa( "lptr_sianv_aer ", lptr_sianv_aer(1:ns,jt,jp), ns, lu )
980 call mosaic2_out1ptraa( "lptr_pcg1_b_c_aer ", lptr_pcg1_b_c_aer(1:ns,jt,jp), ns, lu )
981 call mosaic2_out1ptraa( "lptr_pcg2_b_c_aer ", lptr_pcg2_b_c_aer(1:ns,jt,jp), ns, lu )
982 call mosaic2_out1ptraa( "lptr_pcg3_b_c_aer ", lptr_pcg3_b_c_aer(1:ns,jt,jp), ns, lu )
983 call mosaic2_out1ptraa( "lptr_pcg4_b_c_aer ", lptr_pcg4_b_c_aer(1:ns,jt,jp), ns, lu )
984 call mosaic2_out1ptraa( "lptr_pcg5_b_c_aer ", lptr_pcg5_b_c_aer(1:ns,jt,jp), ns, lu )
985 call mosaic2_out1ptraa( "lptr_pcg6_b_c_aer ", lptr_pcg6_b_c_aer(1:ns,jt,jp), ns, lu )
986 call mosaic2_out1ptraa( "lptr_pcg7_b_c_aer ", lptr_pcg7_b_c_aer(1:ns,jt,jp), ns, lu )
987 call mosaic2_out1ptraa( "lptr_pcg8_b_c_aer ", lptr_pcg8_b_c_aer(1:ns,jt,jp), ns, lu )
988 call mosaic2_out1ptraa( "lptr_pcg9_b_c_aer ", lptr_pcg9_b_c_aer(1:ns,jt,jp), ns, lu )
989 call mosaic2_out1ptraa( "lptr_pcg1_b_o_aer ", lptr_pcg1_b_o_aer(1:ns,jt,jp), ns, lu )
990 call mosaic2_out1ptraa( "lptr_pcg2_b_o_aer ", lptr_pcg2_b_o_aer(1:ns,jt,jp), ns, lu )
991 call mosaic2_out1ptraa( "lptr_pcg3_b_o_aer ", lptr_pcg3_b_o_aer(1:ns,jt,jp), ns, lu )
992 call mosaic2_out1ptraa( "lptr_pcg4_b_o_aer ", lptr_pcg4_b_o_aer(1:ns,jt,jp), ns, lu )
993 call mosaic2_out1ptraa( "lptr_pcg5_b_o_aer ", lptr_pcg5_b_o_aer(1:ns,jt,jp), ns, lu )
994 call mosaic2_out1ptraa( "lptr_pcg6_b_o_aer ", lptr_pcg6_b_o_aer(1:ns,jt,jp), ns, lu )
995 call mosaic2_out1ptraa( "lptr_pcg7_b_o_aer ", lptr_pcg7_b_o_aer(1:ns,jt,jp), ns, lu )
996 call mosaic2_out1ptraa( "lptr_pcg8_b_o_aer ", lptr_pcg8_b_o_aer(1:ns,jt,jp), ns, lu )
997 call mosaic2_out1ptraa( "lptr_pcg9_b_o_aer ", lptr_pcg9_b_o_aer(1:ns,jt,jp), ns, lu )
998 call mosaic2_out1ptraa( "lptr_opcg1_b_c_aer ", lptr_opcg1_b_c_aer(1:ns,jt,jp), ns, lu )
999 call mosaic2_out1ptraa( "lptr_opcg2_b_c_aer ", lptr_opcg2_b_c_aer(1:ns,jt,jp), ns, lu )
1000 call mosaic2_out1ptraa( "lptr_opcg3_b_c_aer ", lptr_opcg3_b_c_aer(1:ns,jt,jp), ns, lu )
1001 call mosaic2_out1ptraa( "lptr_opcg4_b_c_aer ", lptr_opcg4_b_c_aer(1:ns,jt,jp), ns, lu )
1002 call mosaic2_out1ptraa( "lptr_opcg5_b_c_aer ", lptr_opcg5_b_c_aer(1:ns,jt,jp), ns, lu )
1003 call mosaic2_out1ptraa( "lptr_opcg6_b_c_aer ", lptr_opcg6_b_c_aer(1:ns,jt,jp), ns, lu )
1004 call mosaic2_out1ptraa( "lptr_opcg7_b_c_aer ", lptr_opcg7_b_c_aer(1:ns,jt,jp), ns, lu )
1005 call mosaic2_out1ptraa( "lptr_opcg8_b_c_aer ", lptr_opcg8_b_c_aer(1:ns,jt,jp), ns, lu )
1006 call mosaic2_out1ptraa( "lptr_opcg1_b_o_aer ", lptr_opcg1_b_o_aer(1:ns,jt,jp), ns, lu )
1007 call mosaic2_out1ptraa( "lptr_opcg2_b_o_aer ", lptr_opcg2_b_o_aer(1:ns,jt,jp), ns, lu )
1008 call mosaic2_out1ptraa( "lptr_opcg3_b_o_aer ", lptr_opcg3_b_o_aer(1:ns,jt,jp), ns, lu )
1009 call mosaic2_out1ptraa( "lptr_opcg4_b_o_aer ", lptr_opcg4_b_o_aer(1:ns,jt,jp), ns, lu )
1010 call mosaic2_out1ptraa( "lptr_opcg5_b_o_aer ", lptr_opcg5_b_o_aer(1:ns,jt,jp), ns, lu )
1011 call mosaic2_out1ptraa( "lptr_opcg6_b_o_aer ", lptr_opcg6_b_o_aer(1:ns,jt,jp), ns, lu )
1012 call mosaic2_out1ptraa( "lptr_opcg7_b_o_aer ", lptr_opcg7_b_o_aer(1:ns,jt,jp), ns, lu )
1013 call mosaic2_out1ptraa( "lptr_opcg8_b_o_aer ", lptr_opcg8_b_o_aer(1:ns,jt,jp), ns, lu )
1014 call mosaic2_out1ptraa( "lptr_pcg1_f_c_aer ", lptr_pcg1_f_c_aer(1:ns,jt,jp), ns, lu )
1015 call mosaic2_out1ptraa( "lptr_pcg2_f_c_aer ", lptr_pcg2_f_c_aer(1:ns,jt,jp), ns, lu )
1016 call mosaic2_out1ptraa( "lptr_pcg3_f_c_aer ", lptr_pcg3_f_c_aer(1:ns,jt,jp), ns, lu )
1017 call mosaic2_out1ptraa( "lptr_pcg4_f_c_aer ", lptr_pcg4_f_c_aer(1:ns,jt,jp), ns, lu )
1018 call mosaic2_out1ptraa( "lptr_pcg5_f_c_aer ", lptr_pcg5_f_c_aer(1:ns,jt,jp), ns, lu )
1019 call mosaic2_out1ptraa( "lptr_pcg6_f_c_aer ", lptr_pcg6_f_c_aer(1:ns,jt,jp), ns, lu )
1020 call mosaic2_out1ptraa( "lptr_pcg7_f_c_aer ", lptr_pcg7_f_c_aer(1:ns,jt,jp), ns, lu )
1021 call mosaic2_out1ptraa( "lptr_pcg8_f_c_aer ", lptr_pcg8_f_c_aer(1:ns,jt,jp), ns, lu )
1022 call mosaic2_out1ptraa( "lptr_pcg9_f_c_aer ", lptr_pcg9_f_c_aer(1:ns,jt,jp), ns, lu )
1023 call mosaic2_out1ptraa( "lptr_pcg1_f_o_aer ", lptr_pcg1_f_o_aer(1:ns,jt,jp), ns, lu )
1024 call mosaic2_out1ptraa( "lptr_pcg2_f_o_aer ", lptr_pcg2_f_o_aer(1:ns,jt,jp), ns, lu )
1025 call mosaic2_out1ptraa( "lptr_pcg3_f_o_aer ", lptr_pcg3_f_o_aer(1:ns,jt,jp), ns, lu )
1026 call mosaic2_out1ptraa( "lptr_pcg4_f_o_aer ", lptr_pcg4_f_o_aer(1:ns,jt,jp), ns, lu )
1027 call mosaic2_out1ptraa( "lptr_pcg5_f_o_aer ", lptr_pcg5_f_o_aer(1:ns,jt,jp), ns, lu )
1028 call mosaic2_out1ptraa( "lptr_pcg6_f_o_aer ", lptr_pcg6_f_o_aer(1:ns,jt,jp), ns, lu )
1029 call mosaic2_out1ptraa( "lptr_pcg7_f_o_aer ", lptr_pcg7_f_o_aer(1:ns,jt,jp), ns, lu )
1030 call mosaic2_out1ptraa( "lptr_pcg8_f_o_aer ", lptr_pcg8_f_o_aer(1:ns,jt,jp), ns, lu )
1031 call mosaic2_out1ptraa( "lptr_pcg9_f_o_aer ", lptr_pcg9_f_o_aer(1:ns,jt,jp), ns, lu )
1032 call mosaic2_out1ptraa( "lptr_opcg1_f_c_aer ", lptr_opcg1_f_c_aer(1:ns,jt,jp), ns, lu )
1033 call mosaic2_out1ptraa( "lptr_opcg2_f_c_aer ", lptr_opcg2_f_c_aer(1:ns,jt,jp), ns, lu )
1034 call mosaic2_out1ptraa( "lptr_opcg3_f_c_aer ", lptr_opcg3_f_c_aer(1:ns,jt,jp), ns, lu )
1035 call mosaic2_out1ptraa( "lptr_opcg4_f_c_aer ", lptr_opcg4_f_c_aer(1:ns,jt,jp), ns, lu )
1036 call mosaic2_out1ptraa( "lptr_opcg5_f_c_aer ", lptr_opcg5_f_c_aer(1:ns,jt,jp), ns, lu )
1037 call mosaic2_out1ptraa( "lptr_opcg6_f_c_aer ", lptr_opcg6_f_c_aer(1:ns,jt,jp), ns, lu )
1038 call mosaic2_out1ptraa( "lptr_opcg7_f_c_aer ", lptr_opcg7_f_c_aer(1:ns,jt,jp), ns, lu )
1039 call mosaic2_out1ptraa( "lptr_opcg8_f_c_aer ", lptr_opcg8_f_c_aer(1:ns,jt,jp), ns, lu )
1040 call mosaic2_out1ptraa( "lptr_opcg1_f_o_aer ", lptr_opcg1_f_o_aer(1:ns,jt,jp), ns, lu )
1041 call mosaic2_out1ptraa( "lptr_opcg2_f_o_aer ", lptr_opcg2_f_o_aer(1:ns,jt,jp), ns, lu )
1042 call mosaic2_out1ptraa( "lptr_opcg3_f_o_aer ", lptr_opcg3_f_o_aer(1:ns,jt,jp), ns, lu )
1043 call mosaic2_out1ptraa( "lptr_opcg4_f_o_aer ", lptr_opcg4_f_o_aer(1:ns,jt,jp), ns, lu )
1044 call mosaic2_out1ptraa( "lptr_opcg5_f_o_aer ", lptr_opcg5_f_o_aer(1:ns,jt,jp), ns, lu )
1045 call mosaic2_out1ptraa( "lptr_opcg6_f_o_aer ", lptr_opcg6_f_o_aer(1:ns,jt,jp), ns, lu )
1046 call mosaic2_out1ptraa( "lptr_opcg7_f_o_aer ", lptr_opcg7_f_o_aer(1:ns,jt,jp), ns, lu )
1047 call mosaic2_out1ptraa( "lptr_opcg8_f_o_aer ", lptr_opcg8_f_o_aer(1:ns,jt,jp), ns, lu )
1048 call mosaic2_out1ptraa( "ant1_c_aer ", lptr_ant1_c_aer(1:ns,jt,jp), ns, lu )
1049 call mosaic2_out1ptraa( "ant2_c_aer ", lptr_ant2_c_aer(1:ns,jt,jp), ns, lu )
1050 call mosaic2_out1ptraa( "ant3_c_aer ", lptr_ant3_c_aer(1:ns,jt,jp), ns, lu )
1051 call mosaic2_out1ptraa( "ant4_c_aer ", lptr_ant4_c_aer(1:ns,jt,jp), ns, lu )
1052 call mosaic2_out1ptraa( "ant1_o_aer ", lptr_ant1_o_aer(1:ns,jt,jp), ns, lu )
1053 call mosaic2_out1ptraa( "ant2_o_aer ", lptr_ant2_o_aer(1:ns,jt,jp), ns, lu )
1054 call mosaic2_out1ptraa( "ant3_o_aer ", lptr_ant3_o_aer(1:ns,jt,jp), ns, lu )
1055 call mosaic2_out1ptraa( "ant4_o_aer ", lptr_ant4_o_aer(1:ns,jt,jp), ns, lu )
1056 call mosaic2_out1ptraa( "biog1_c_aer ", lptr_biog1_c_aer(1:ns,jt,jp), ns, lu )
1057 call mosaic2_out1ptraa( "biog2_c_aer ", lptr_biog2_c_aer(1:ns,jt,jp), ns, lu )
1058 call mosaic2_out1ptraa( "biog3_c_aer ", lptr_biog3_c_aer(1:ns,jt,jp), ns, lu )
1059 call mosaic2_out1ptraa( "biog4_c_aer ", lptr_biog4_c_aer(1:ns,jt,jp), ns, lu )
1060 call mosaic2_out1ptraa( "biog1_o_aer ", lptr_biog1_o_aer(1:ns,jt,jp), ns, lu )
1061 call mosaic2_out1ptraa( "biog2_o_aer ", lptr_biog2_o_aer(1:ns,jt,jp), ns, lu )
1062 call mosaic2_out1ptraa( "biog3_o_aer ", lptr_biog3_o_aer(1:ns,jt,jp), ns, lu )
1063 call mosaic2_out1ptraa( "biog4_o_aer ", lptr_biog4_o_aer(1:ns,jt,jp), ns, lu )
1064 ! call mosaic2_out1ptraa( "iepox_aer ", lptr_iepox_aer(1:ns,jt,jp), ns, lu )
1065 ! call mosaic2_out1ptraa( "iepoxos_aer ", lptr_iepoxos_aer(1:ns,jt,jp), ns, lu )
1066 ! call mosaic2_out1ptraa( "tetrol_aer ", lptr_tetrol_aer(1:ns,jt,jp), ns, lu )
1067 ! call mosaic2_out1ptraa( "gly_aer ", lptr_gly_aer(1:ns,jt,jp), ns, lu )
1070 do ll = 1, ncomp_plustracer_aer(itype)
1071 write(msg,9350) 'massptr_aer(), ll', &
1072 (massptr_aer(ll,n,itype,iphase), n=1,nsize_aer(itype)), ll
1073 call peg_message( lunout, trim(msg) )
1075 write(msg,9352) 'chem_dname_table = ', &
1076 (chem_dname_table(id,(massptr_aer(ll,n,itype,iphase)))(1:14),n=1,4)
1077 call peg_message( lunout, trim(msg) )
1084 end subroutine mosaic2_output_wrfchem_pointers
1087 !-----------------------------------------------------------------------
1088 subroutine mosaic2_out1ptraa( lptrname, lptr, nsz, lunout )
1090 use module_peg_util, only: peg_message
1092 integer, intent(in) :: nsz, lunout, lptr(1:nsz)
1093 character(len=*), intent(in) :: lptrname
1097 9350 format( a, 32(1x,i4) )
1098 write(msg,9350) lptrname, lptr(1:nsz)
1099 call peg_message( lunout, trim(msg) )
1102 end subroutine mosaic2_out1ptraa
1105 !-----------------------------------------------------------------------
1106 subroutine mosaic2_set_gas_kptrs_names
1108 ! set k-pointer & name_rbox() for gases used in mosaic aerosol and lcloud chemistry routine
1110 use module_state_description, only: num_chem, p1st => param_first_scalar
1111 use module_configure, only: p_h2so4, p_sulf
1112 use module_peg_util, only: peg_error_fatal, peg_message
1114 use module_data_mosaic_main, only: ntot_used
1115 use module_data_mosaic_asecthp, only: &
1117 use module_data_mosaic_boxmod, only: name_rbox, &
1118 kh2so4, khno3, khcl, knh3, kmsa, ko3, &
1119 kso2, kh2o2, khcho, koh, kho2, &
1120 kno3, kno, kno2, khono, kpan, &
1122 karo1, karo2, kalk1, kole1, &
1123 kapi1, kapi2, klim1, klim2, &
1124 kpcg1_b_c, kpcg2_b_c, kpcg3_b_c, kpcg4_b_c, kpcg5_b_c, &
1125 kpcg6_b_c, kpcg7_b_c, kpcg8_b_c, kpcg9_b_c, &
1126 kpcg1_b_o, kpcg2_b_o, kpcg3_b_o, kpcg4_b_o, kpcg5_b_o, &
1127 kpcg6_b_o, kpcg7_b_o, kpcg8_b_o, kpcg9_b_o, &
1128 kpcg1_f_c, kpcg2_f_c, kpcg3_f_c, kpcg4_f_c, kpcg5_f_c, &
1129 kpcg6_f_c, kpcg7_f_c, kpcg8_f_c, kpcg9_f_c, &
1130 kpcg1_f_o, kpcg2_f_o, kpcg3_f_o, kpcg4_f_o, kpcg5_f_o, &
1131 kpcg6_f_o, kpcg7_f_o, kpcg8_f_o, kpcg9_f_o, &
1132 kopcg1_b_c, kopcg2_b_c, kopcg3_b_c, kopcg4_b_c, &
1133 kopcg5_b_c, kopcg6_b_c, kopcg7_b_c, kopcg8_b_c, &
1134 kopcg1_b_o, kopcg2_b_o, kopcg3_b_o, kopcg4_b_o, &
1135 kopcg5_b_o, kopcg6_b_o, kopcg7_b_o, kopcg8_b_o, &
1136 kopcg1_f_c, kopcg2_f_c, kopcg3_f_c, kopcg4_f_c, &
1137 kopcg5_f_c, kopcg6_f_c, kopcg7_f_c, kopcg8_f_c, &
1138 kopcg1_f_o, kopcg2_f_o, kopcg3_f_o, kopcg4_f_o, &
1139 kopcg5_f_o, kopcg6_f_o, kopcg7_f_o, kopcg8_f_o, &
1140 kant1_c, kant2_c, kant3_c, kant4_c, &
1141 kant1_o, kant2_o, kant3_o, kant4_o, &
1142 kbiog1_c, kbiog2_c, kbiog3_c, kbiog4_c, &
1143 kbiog1_o, kbiog2_o, kbiog3_o, kbiog4_o, &
1146 khcooh, kch3o2, kch3oh, kch3ooh
1158 call peg_message( lunout, msg )
1159 msg = 'output from subr mosaic2_set_gas_kptrs_names'
1160 call peg_message( lunout, trim(msg) )
1163 ! set pointer and name for h2so4
1165 if (p_h2so4 .ge. p1st .and. p_h2so4 .le. ntot_used) then
1168 else if (p_sulf .ge. p1st .and. p_sulf .le. ntot_used) then
1171 msg = '*** subr mosaic2_set_gas_kptrs_names - ptr error for h2so4'
1172 call peg_error_fatal( lunerr, msg )
1175 if ((kh2so4 .ge. p1st) .and. (kh2so4 .le. ntot_used)) then
1176 name_rbox(kh2so4 ) = 'h2so4'
1180 ! set pointer and name for other gases
1183 ! for ho / oh, chem_dname_table() and name_rbox() are different
1184 call mosaic2_set_one_gas_kptr_name( "ho", l )
1185 if ((l .ge. p1st) .and. (l .le. ntot_used)) then
1187 name_rbox(koh ) = 'oh'
1190 call mosaic2_set_one_gas_kptr_name( "hno3", khno3 )
1191 call mosaic2_set_one_gas_kptr_name( "nh3", knh3 )
1192 call mosaic2_set_one_gas_kptr_name( "hcl", khcl )
1193 call mosaic2_set_one_gas_kptr_name( "msa", kmsa )
1194 call mosaic2_set_one_gas_kptr_name( "aro1", karo1 )
1195 call mosaic2_set_one_gas_kptr_name( "aro2", karo2 )
1196 call mosaic2_set_one_gas_kptr_name( "alk1", kalk1 )
1197 call mosaic2_set_one_gas_kptr_name( "ole1", kole1 )
1198 call mosaic2_set_one_gas_kptr_name( "api1", kapi1 )
1199 call mosaic2_set_one_gas_kptr_name( "api2", kapi2 )
1200 call mosaic2_set_one_gas_kptr_name( "lim1", klim1 )
1201 call mosaic2_set_one_gas_kptr_name( "lim2", klim2 )
1202 call mosaic2_set_one_gas_kptr_name( "n2o5", kn2o5 )
1203 call mosaic2_set_one_gas_kptr_name( "clno2", kclno2 )
1204 call mosaic2_set_one_gas_kptr_name( "o3", ko3 )
1205 call mosaic2_set_one_gas_kptr_name( "pcg1_b_c", kpcg1_b_c )
1206 call mosaic2_set_one_gas_kptr_name( "pcg2_b_c", kpcg2_b_c )
1207 call mosaic2_set_one_gas_kptr_name( "pcg3_b_c", kpcg3_b_c )
1208 call mosaic2_set_one_gas_kptr_name( "pcg4_b_c", kpcg4_b_c )
1209 call mosaic2_set_one_gas_kptr_name( "pcg5_b_c", kpcg5_b_c )
1210 call mosaic2_set_one_gas_kptr_name( "pcg6_b_c", kpcg6_b_c )
1211 call mosaic2_set_one_gas_kptr_name( "pcg7_b_c", kpcg7_b_c )
1212 call mosaic2_set_one_gas_kptr_name( "pcg8_b_c", kpcg8_b_c )
1213 call mosaic2_set_one_gas_kptr_name( "pcg9_b_c", kpcg9_b_c )
1214 call mosaic2_set_one_gas_kptr_name( "pcg1_b_o", kpcg1_b_o )
1215 call mosaic2_set_one_gas_kptr_name( "pcg2_b_o", kpcg2_b_o )
1216 call mosaic2_set_one_gas_kptr_name( "pcg3_b_o", kpcg3_b_o )
1217 call mosaic2_set_one_gas_kptr_name( "pcg4_b_o", kpcg4_b_o )
1218 call mosaic2_set_one_gas_kptr_name( "pcg5_b_o", kpcg5_b_o )
1219 call mosaic2_set_one_gas_kptr_name( "pcg6_b_o", kpcg6_b_o )
1220 call mosaic2_set_one_gas_kptr_name( "pcg7_b_o", kpcg7_b_o )
1221 call mosaic2_set_one_gas_kptr_name( "pcg8_b_o", kpcg8_b_o )
1222 call mosaic2_set_one_gas_kptr_name( "pcg9_b_o", kpcg9_b_o )
1223 call mosaic2_set_one_gas_kptr_name( "opcg1_b_c", kopcg1_b_c )
1224 call mosaic2_set_one_gas_kptr_name( "opcg2_b_c", kopcg2_b_c )
1225 call mosaic2_set_one_gas_kptr_name( "opcg3_b_c", kopcg3_b_c )
1226 call mosaic2_set_one_gas_kptr_name( "opcg4_b_c", kopcg4_b_c )
1227 call mosaic2_set_one_gas_kptr_name( "opcg5_b_c", kopcg5_b_c )
1228 call mosaic2_set_one_gas_kptr_name( "opcg6_b_c", kopcg6_b_c )
1229 call mosaic2_set_one_gas_kptr_name( "opcg7_b_c", kopcg7_b_c )
1230 call mosaic2_set_one_gas_kptr_name( "opcg8_b_c", kopcg8_b_c )
1231 call mosaic2_set_one_gas_kptr_name( "opcg1_b_o", kopcg1_b_o )
1232 call mosaic2_set_one_gas_kptr_name( "opcg2_b_o", kopcg2_b_o )
1233 call mosaic2_set_one_gas_kptr_name( "opcg3_b_o", kopcg3_b_o )
1234 call mosaic2_set_one_gas_kptr_name( "opcg4_b_o", kopcg4_b_o )
1235 call mosaic2_set_one_gas_kptr_name( "opcg5_b_o", kopcg5_b_o )
1236 call mosaic2_set_one_gas_kptr_name( "opcg6_b_o", kopcg6_b_o )
1237 call mosaic2_set_one_gas_kptr_name( "opcg7_b_o", kopcg7_b_o )
1238 call mosaic2_set_one_gas_kptr_name( "opcg8_b_o", kopcg8_b_o )
1239 call mosaic2_set_one_gas_kptr_name( "pcg1_f_c", kpcg1_f_c )
1240 call mosaic2_set_one_gas_kptr_name( "pcg2_f_c", kpcg2_f_c )
1241 call mosaic2_set_one_gas_kptr_name( "pcg3_f_c", kpcg3_f_c )
1242 call mosaic2_set_one_gas_kptr_name( "pcg4_f_c", kpcg4_f_c )
1243 call mosaic2_set_one_gas_kptr_name( "pcg5_f_c", kpcg5_f_c )
1244 call mosaic2_set_one_gas_kptr_name( "pcg6_f_c", kpcg6_f_c )
1245 call mosaic2_set_one_gas_kptr_name( "pcg7_f_c", kpcg7_f_c )
1246 call mosaic2_set_one_gas_kptr_name( "pcg8_f_c", kpcg8_f_c )
1247 call mosaic2_set_one_gas_kptr_name( "pcg9_f_c", kpcg9_f_c )
1248 call mosaic2_set_one_gas_kptr_name( "pcg1_f_o", kpcg1_f_o )
1249 call mosaic2_set_one_gas_kptr_name( "pcg2_f_o", kpcg2_f_o )
1250 call mosaic2_set_one_gas_kptr_name( "pcg3_f_o", kpcg3_f_o )
1251 call mosaic2_set_one_gas_kptr_name( "pcg4_f_o", kpcg4_f_o )
1252 call mosaic2_set_one_gas_kptr_name( "pcg5_f_o", kpcg5_f_o )
1253 call mosaic2_set_one_gas_kptr_name( "pcg6_f_o", kpcg6_f_o )
1254 call mosaic2_set_one_gas_kptr_name( "pcg7_f_o", kpcg7_f_o )
1255 call mosaic2_set_one_gas_kptr_name( "pcg8_f_o", kpcg8_f_o )
1256 call mosaic2_set_one_gas_kptr_name( "pcg9_f_o", kpcg9_f_o )
1257 call mosaic2_set_one_gas_kptr_name( "opcg1_f_c", kopcg1_f_c )
1258 call mosaic2_set_one_gas_kptr_name( "opcg2_f_c", kopcg2_f_c )
1259 call mosaic2_set_one_gas_kptr_name( "opcg3_f_c", kopcg3_f_c )
1260 call mosaic2_set_one_gas_kptr_name( "opcg4_f_c", kopcg4_f_c )
1261 call mosaic2_set_one_gas_kptr_name( "opcg5_f_c", kopcg5_f_c )
1262 call mosaic2_set_one_gas_kptr_name( "opcg6_f_c", kopcg6_f_c )
1263 call mosaic2_set_one_gas_kptr_name( "opcg7_f_c", kopcg7_f_c )
1264 call mosaic2_set_one_gas_kptr_name( "opcg8_f_c", kopcg8_f_c )
1265 call mosaic2_set_one_gas_kptr_name( "opcg1_f_o", kopcg1_f_o )
1266 call mosaic2_set_one_gas_kptr_name( "opcg2_f_o", kopcg2_f_o )
1267 call mosaic2_set_one_gas_kptr_name( "opcg3_f_o", kopcg3_f_o )
1268 call mosaic2_set_one_gas_kptr_name( "opcg4_f_o", kopcg4_f_o )
1269 call mosaic2_set_one_gas_kptr_name( "opcg5_f_o", kopcg5_f_o )
1270 call mosaic2_set_one_gas_kptr_name( "opcg6_f_o", kopcg6_f_o )
1271 call mosaic2_set_one_gas_kptr_name( "opcg7_f_o", kopcg7_f_o )
1272 call mosaic2_set_one_gas_kptr_name( "opcg8_f_o", kopcg8_f_o )
1273 call mosaic2_set_one_gas_kptr_name( "smpa", ksmpa )
1274 call mosaic2_set_one_gas_kptr_name( "smpbb", ksmpbb )
1275 ! call mosaic2_set_one_gas_kptr_name( "iepox", kiepox )
1276 ! call mosaic2_set_one_gas_kptr_name( "gly", kgly )
1277 call mosaic2_set_one_gas_kptr_name( "ant1_c", kant1_c )
1278 call mosaic2_set_one_gas_kptr_name( "ant2_c", kant2_c )
1279 call mosaic2_set_one_gas_kptr_name( "ant3_c", kant3_c )
1280 call mosaic2_set_one_gas_kptr_name( "ant4_c", kant4_c )
1281 call mosaic2_set_one_gas_kptr_name( "ant1_o", kant1_o )
1282 call mosaic2_set_one_gas_kptr_name( "ant2_o", kant2_o )
1283 call mosaic2_set_one_gas_kptr_name( "ant3_o", kant3_o )
1284 call mosaic2_set_one_gas_kptr_name( "ant4_o", kant4_o )
1285 call mosaic2_set_one_gas_kptr_name( "biog1_c", kbiog1_c )
1286 call mosaic2_set_one_gas_kptr_name( "biog2_c", kbiog2_c )
1287 call mosaic2_set_one_gas_kptr_name( "biog3_c", kbiog3_c )
1288 call mosaic2_set_one_gas_kptr_name( "biog4_c", kbiog4_c )
1289 call mosaic2_set_one_gas_kptr_name( "biog1_o", kbiog1_o )
1290 call mosaic2_set_one_gas_kptr_name( "biog2_o", kbiog2_o )
1291 call mosaic2_set_one_gas_kptr_name( "biog3_o", kbiog3_o )
1292 call mosaic2_set_one_gas_kptr_name( "biog4_o", kbiog4_o )
1293 call mosaic2_set_one_gas_kptr_name( "so2", kso2 )
1294 call mosaic2_set_one_gas_kptr_name( "h2o2", kh2o2 )
1295 call mosaic2_set_one_gas_kptr_name( "hcho", khcho )
1296 call mosaic2_set_one_gas_kptr_name( "hcooh", khcooh )
1297 call mosaic2_set_one_gas_kptr_name( "ho2", kho2 )
1298 call mosaic2_set_one_gas_kptr_name( "no3", kno3 )
1299 call mosaic2_set_one_gas_kptr_name( "no", kno )
1300 call mosaic2_set_one_gas_kptr_name( "no2", kno2 )
1301 call mosaic2_set_one_gas_kptr_name( "hono", khono )
1302 call mosaic2_set_one_gas_kptr_name( "pan", kpan )
1303 call mosaic2_set_one_gas_kptr_name( "ch3o2", kch3o2 )
1304 call mosaic2_set_one_gas_kptr_name( "ch3oh", kch3oh )
1305 call mosaic2_set_one_gas_kptr_name( "ch3ooh", kch3ooh )
1308 end subroutine mosaic2_set_gas_kptrs_names
1311 !-----------------------------------------------------------------------
1312 subroutine mosaic2_set_one_gas_kptr_name( gasname, kptr )
1314 use module_data_mosaic_asecthp, only: lunerr, lunout
1315 use module_data_mosaic_boxmod, only: name_rbox
1316 use module_data_mosaic_main, only: ntot_used
1317 use module_state_description, only: p1st => param_first_scalar
1318 use module_peg_util, only: peg_error_fatal, peg_message
1320 integer, intent(inout) :: kptr
1321 character(len=*), intent(in) :: gasname
1324 character(len=40) :: chemname
1325 character(len=200) :: msg
1328 call mosaic2_find_chemname_in_table( chemname, l )
1330 if (l > ntot_used) then
1331 write(msg,'(2a,2(1x,i5),2x,a)') 'mosaic2_set_one_gas_kptr_name error', &
1332 ' - l, ntot_used, gasname = ', l, ntot_used, trim(gasname)
1333 call peg_error_fatal( lunerr, msg )
1338 name_rbox(l) = gasname
1341 write(msg,'(2i12,2a)') l, kptr, ' = k', trim(chemname)
1342 call peg_message( lunout, trim(msg) )
1345 end subroutine mosaic2_set_one_gas_kptr_name
1348 !-----------------------------------------------------------------------
1349 subroutine set_rbox_gas_ptrs
1351 ! sets the rbox_gas_ptr(igas) values that are used to
1352 ! map gas species between the rbox array and the gas array
1354 use module_state_description, only: p1st => param_first_scalar
1356 use module_data_mosaic_aero, only: &
1357 gas_name, ngas_aerchtot, &
1358 ih2so4_g, ihno3_g, ihcl_g, inh3_g, &
1360 iaro1_g, iaro2_g, ialk1_g, iole1_g, &
1361 iapi1_g, iapi2_g, ilim1_g, ilim2_g, &
1362 in2o5_g, iclno2_g, &
1363 ipcg1_b_c_g, ipcg2_b_c_g, ipcg3_b_c_g, ipcg4_b_c_g, &
1364 ipcg5_b_c_g, ipcg6_b_c_g, ipcg7_b_c_g, ipcg8_b_c_g, &
1366 ipcg1_b_o_g, ipcg2_b_o_g, ipcg3_b_o_g, ipcg4_b_o_g, &
1367 ipcg5_b_o_g, ipcg6_b_o_g, ipcg7_b_o_g, ipcg8_b_o_g, &
1369 iopcg1_b_c_g, iopcg2_b_c_g, iopcg3_b_c_g, iopcg4_b_c_g, &
1370 iopcg5_b_c_g, iopcg6_b_c_g, iopcg7_b_c_g, iopcg8_b_c_g, &
1371 iopcg1_b_o_g, iopcg2_b_o_g, iopcg3_b_o_g, iopcg4_b_o_g, &
1372 iopcg5_b_o_g, iopcg6_b_o_g, iopcg7_b_o_g, iopcg8_b_o_g, &
1373 ipcg1_f_c_g, ipcg2_f_c_g, ipcg3_f_c_g, ipcg4_f_c_g, &
1374 ipcg5_f_c_g, ipcg6_f_c_g, ipcg7_f_c_g, ipcg8_f_c_g, &
1376 ipcg1_f_o_g, ipcg2_f_o_g, ipcg3_f_o_g, ipcg4_f_o_g, &
1377 ipcg5_f_o_g, ipcg6_f_o_g, ipcg7_f_o_g, ipcg8_f_o_g, &
1379 iopcg1_f_c_g, iopcg2_f_c_g, iopcg3_f_c_g, iopcg4_f_c_g, &
1380 iopcg5_f_c_g, iopcg6_f_c_g, iopcg7_f_c_g, iopcg8_f_c_g, &
1381 iopcg1_f_o_g, iopcg2_f_o_g, iopcg3_f_o_g, iopcg4_f_o_g, &
1382 iopcg5_f_o_g, iopcg6_f_o_g, iopcg7_f_o_g, iopcg8_f_o_g, &
1383 iant1_c_g, iant2_c_g, iant3_c_g, iant4_c_g, &
1384 iant1_o_g, iant2_o_g, iant3_o_g, iant4_o_g, &
1385 ibiog1_c_g, ibiog2_c_g, ibiog3_c_g, ibiog4_c_g, &
1386 ibiog1_o_g, ibiog2_o_g, ibiog3_o_g, ibiog4_o_g, &
1388 ! ismpa_g, ismpbb_g, &
1391 use module_data_mosaic_asecthp, only: rbox_gas_ptr
1393 use module_data_mosaic_boxmod, only: &
1395 kh2so4, khno3, khcl, knh3, kmsa, ko3, &
1396 kso2, kh2o2, khcho, koh, kho2, &
1397 kno3, kno, kno2, khono, kpan, &
1399 karo1, karo2, kalk1, kole1, &
1400 kapi1, kapi2, klim1, klim2, &
1401 kpcg1_b_c, kpcg2_b_c, kpcg3_b_c, kpcg4_b_c, kpcg5_b_c, &
1402 kpcg6_b_c, kpcg7_b_c, kpcg8_b_c, kpcg9_b_c, &
1403 kpcg1_b_o, kpcg2_b_o, kpcg3_b_o, kpcg4_b_o, kpcg5_b_o, &
1404 kpcg6_b_o, kpcg7_b_o, kpcg8_b_o, kpcg9_b_o, &
1405 kpcg1_f_c, kpcg2_f_c, kpcg3_f_c, kpcg4_f_c, kpcg5_f_c, &
1406 kpcg6_f_c, kpcg7_f_c, kpcg8_f_c, kpcg9_f_c, &
1407 kpcg1_f_o, kpcg2_f_o, kpcg3_f_o, kpcg4_f_o, kpcg5_f_o, &
1408 kpcg6_f_o, kpcg7_f_o, kpcg8_f_o, kpcg9_f_o, &
1409 kopcg1_b_c, kopcg2_b_c, kopcg3_b_c, kopcg4_b_c, &
1410 kopcg5_b_c, kopcg6_b_c, kopcg7_b_c, kopcg8_b_c, &
1411 kopcg1_b_o, kopcg2_b_o, kopcg3_b_o, kopcg4_b_o, &
1412 kopcg5_b_o, kopcg6_b_o, kopcg7_b_o, kopcg8_b_o, &
1413 kopcg1_f_c, kopcg2_f_c, kopcg3_f_c, kopcg4_f_c, &
1414 kopcg5_f_c, kopcg6_f_c, kopcg7_f_c, kopcg8_f_c, &
1415 kopcg1_f_o, kopcg2_f_o, kopcg3_f_o, kopcg4_f_o, &
1416 kopcg5_f_o, kopcg6_f_o, kopcg7_f_o, kopcg8_f_o, &
1417 kant1_c, kant2_c, kant3_c, kant4_c, &
1418 kant1_o, kant2_o, kant3_o, kant4_o, &
1419 kbiog1_c, kbiog2_c, kbiog3_c, kbiog4_c, &
1420 kbiog1_o, kbiog2_o, kbiog3_o, kbiog4_o, &
1423 khcooh, kch3o2, kch3oh, kch3ooh
1425 use module_data_mosaic_main, only: &
1431 rbox_gas_ptr(1:ngas_aerchtot) = -1
1433 call set_1_rbox_gas_ptr( ih2so4_g, kh2so4 )
1434 call set_1_rbox_gas_ptr( ihno3_g, khno3 )
1435 call set_1_rbox_gas_ptr( ihcl_g, khcl )
1436 call set_1_rbox_gas_ptr( inh3_g, knh3 )
1437 call set_1_rbox_gas_ptr( imsa_g, kmsa )
1438 call set_1_rbox_gas_ptr( iaro1_g, karo1 )
1439 call set_1_rbox_gas_ptr( iaro2_g, karo2 )
1440 call set_1_rbox_gas_ptr( ialk1_g, kalk1 )
1441 call set_1_rbox_gas_ptr( iole1_g, kole1 )
1442 call set_1_rbox_gas_ptr( iapi1_g, kapi1 )
1443 call set_1_rbox_gas_ptr( iapi2_g, kapi2 )
1444 call set_1_rbox_gas_ptr( ilim1_g, klim1 )
1445 call set_1_rbox_gas_ptr( ilim2_g, klim2 )
1446 call set_1_rbox_gas_ptr( in2o5_g, kn2o5 )
1447 call set_1_rbox_gas_ptr( iclno2_g, kclno2 )
1448 call set_1_rbox_gas_ptr( ipcg1_b_c_g, kpcg1_b_c )
1449 call set_1_rbox_gas_ptr( ipcg2_b_c_g, kpcg2_b_c )
1450 call set_1_rbox_gas_ptr( ipcg3_b_c_g, kpcg3_b_c )
1451 call set_1_rbox_gas_ptr( ipcg4_b_c_g, kpcg4_b_c )
1452 call set_1_rbox_gas_ptr( ipcg5_b_c_g, kpcg5_b_c )
1453 call set_1_rbox_gas_ptr( ipcg6_b_c_g, kpcg6_b_c )
1454 call set_1_rbox_gas_ptr( ipcg7_b_c_g, kpcg7_b_c )
1455 call set_1_rbox_gas_ptr( ipcg8_b_c_g, kpcg8_b_c )
1456 call set_1_rbox_gas_ptr( ipcg9_b_c_g, kpcg9_b_c )
1457 call set_1_rbox_gas_ptr( ipcg1_b_o_g, kpcg1_b_o )
1458 call set_1_rbox_gas_ptr( ipcg2_b_o_g, kpcg2_b_o )
1459 call set_1_rbox_gas_ptr( ipcg3_b_o_g, kpcg3_b_o )
1460 call set_1_rbox_gas_ptr( ipcg4_b_o_g, kpcg4_b_o )
1461 call set_1_rbox_gas_ptr( ipcg5_b_o_g, kpcg5_b_o )
1462 call set_1_rbox_gas_ptr( ipcg6_b_o_g, kpcg6_b_o )
1463 call set_1_rbox_gas_ptr( ipcg7_b_o_g, kpcg7_b_o )
1464 call set_1_rbox_gas_ptr( ipcg8_b_o_g, kpcg8_b_o )
1465 call set_1_rbox_gas_ptr( ipcg9_b_o_g, kpcg9_b_o )
1466 call set_1_rbox_gas_ptr( iopcg1_b_c_g, kopcg1_b_c )
1467 call set_1_rbox_gas_ptr( iopcg2_b_c_g, kopcg2_b_c )
1468 call set_1_rbox_gas_ptr( iopcg3_b_c_g, kopcg3_b_c )
1469 call set_1_rbox_gas_ptr( iopcg4_b_c_g, kopcg4_b_c )
1470 call set_1_rbox_gas_ptr( iopcg5_b_c_g, kopcg5_b_c )
1471 call set_1_rbox_gas_ptr( iopcg6_b_c_g, kopcg6_b_c )
1472 call set_1_rbox_gas_ptr( iopcg7_b_c_g, kopcg7_b_c )
1473 call set_1_rbox_gas_ptr( iopcg8_b_c_g, kopcg8_b_c )
1474 call set_1_rbox_gas_ptr( iopcg1_b_o_g, kopcg1_b_o )
1475 call set_1_rbox_gas_ptr( iopcg2_b_o_g, kopcg2_b_o )
1476 call set_1_rbox_gas_ptr( iopcg3_b_o_g, kopcg3_b_o )
1477 call set_1_rbox_gas_ptr( iopcg4_b_o_g, kopcg4_b_o )
1478 call set_1_rbox_gas_ptr( iopcg5_b_o_g, kopcg5_b_o )
1479 call set_1_rbox_gas_ptr( iopcg6_b_o_g, kopcg6_b_o )
1480 call set_1_rbox_gas_ptr( iopcg7_b_o_g, kopcg7_b_o )
1481 call set_1_rbox_gas_ptr( iopcg8_b_o_g, kopcg8_b_o )
1482 call set_1_rbox_gas_ptr( ipcg1_f_c_g, kpcg1_f_c )
1483 call set_1_rbox_gas_ptr( ipcg2_f_c_g, kpcg2_f_c )
1484 call set_1_rbox_gas_ptr( ipcg3_f_c_g, kpcg3_f_c )
1485 call set_1_rbox_gas_ptr( ipcg4_f_c_g, kpcg4_f_c )
1486 call set_1_rbox_gas_ptr( ipcg5_f_c_g, kpcg5_f_c )
1487 call set_1_rbox_gas_ptr( ipcg6_f_c_g, kpcg6_f_c )
1488 call set_1_rbox_gas_ptr( ipcg7_f_c_g, kpcg7_f_c )
1489 call set_1_rbox_gas_ptr( ipcg8_f_c_g, kpcg8_f_c )
1490 call set_1_rbox_gas_ptr( ipcg9_f_c_g, kpcg9_f_c )
1491 call set_1_rbox_gas_ptr( ipcg1_f_o_g, kpcg1_f_o )
1492 call set_1_rbox_gas_ptr( ipcg2_f_o_g, kpcg2_f_o )
1493 call set_1_rbox_gas_ptr( ipcg3_f_o_g, kpcg3_f_o )
1494 call set_1_rbox_gas_ptr( ipcg4_f_o_g, kpcg4_f_o )
1495 call set_1_rbox_gas_ptr( ipcg5_f_o_g, kpcg5_f_o )
1496 call set_1_rbox_gas_ptr( ipcg6_f_o_g, kpcg6_f_o )
1497 call set_1_rbox_gas_ptr( ipcg7_f_o_g, kpcg7_f_o )
1498 call set_1_rbox_gas_ptr( ipcg8_f_o_g, kpcg8_f_o )
1499 call set_1_rbox_gas_ptr( ipcg9_f_o_g, kpcg9_f_o )
1500 call set_1_rbox_gas_ptr( iopcg1_f_c_g, kopcg1_f_c )
1501 call set_1_rbox_gas_ptr( iopcg2_f_c_g, kopcg2_f_c )
1502 call set_1_rbox_gas_ptr( iopcg3_f_c_g, kopcg3_f_c )
1503 call set_1_rbox_gas_ptr( iopcg4_f_c_g, kopcg4_f_c )
1504 call set_1_rbox_gas_ptr( iopcg5_f_c_g, kopcg5_f_c )
1505 call set_1_rbox_gas_ptr( iopcg6_f_c_g, kopcg6_f_c )
1506 call set_1_rbox_gas_ptr( iopcg7_f_c_g, kopcg7_f_c )
1507 call set_1_rbox_gas_ptr( iopcg8_f_c_g, kopcg8_f_c )
1508 call set_1_rbox_gas_ptr( iopcg1_f_o_g, kopcg1_f_o )
1509 call set_1_rbox_gas_ptr( iopcg2_f_o_g, kopcg2_f_o )
1510 call set_1_rbox_gas_ptr( iopcg3_f_o_g, kopcg3_f_o )
1511 call set_1_rbox_gas_ptr( iopcg4_f_o_g, kopcg4_f_o )
1512 call set_1_rbox_gas_ptr( iopcg5_f_o_g, kopcg5_f_o )
1513 call set_1_rbox_gas_ptr( iopcg6_f_o_g, kopcg6_f_o )
1514 call set_1_rbox_gas_ptr( iopcg7_f_o_g, kopcg7_f_o )
1515 call set_1_rbox_gas_ptr( iopcg8_f_o_g, kopcg8_f_o )
1516 call set_1_rbox_gas_ptr( iant1_c_g, kant1_c )
1517 call set_1_rbox_gas_ptr( iant2_c_g, kant2_c )
1518 call set_1_rbox_gas_ptr( iant3_c_g, kant3_c )
1519 call set_1_rbox_gas_ptr( iant4_c_g, kant4_c )
1520 call set_1_rbox_gas_ptr( iant1_o_g, kant1_o )
1521 call set_1_rbox_gas_ptr( iant2_o_g, kant2_o )
1522 call set_1_rbox_gas_ptr( iant3_o_g, kant3_o )
1523 call set_1_rbox_gas_ptr( iant4_o_g, kant4_o )
1524 call set_1_rbox_gas_ptr( ibiog1_c_g, kbiog1_c )
1525 call set_1_rbox_gas_ptr( ibiog2_c_g, kbiog2_c )
1526 call set_1_rbox_gas_ptr( ibiog3_c_g, kbiog3_c )
1527 call set_1_rbox_gas_ptr( ibiog4_c_g, kbiog4_c )
1528 call set_1_rbox_gas_ptr( ibiog1_o_g, kbiog1_o )
1529 call set_1_rbox_gas_ptr( ibiog2_o_g, kbiog2_o )
1530 call set_1_rbox_gas_ptr( ibiog3_o_g, kbiog3_o )
1531 call set_1_rbox_gas_ptr( ibiog4_o_g, kbiog4_o )
1532 call set_1_rbox_gas_ptr( ismpa_g, ksmpa )
1533 call set_1_rbox_gas_ptr( ismpbb_g, ksmpbb )
1534 ! call set_1_rbox_gas_ptr( iiepox_g, kiepox )
1535 ! call set_1_rbox_gas_ptr( igly_g, kgly )
1537 write(*,'(/a)') 'set_rbox_gas_ptrs'
1538 do igas = 1, ngas_aerchtot
1539 l = rbox_gas_ptr(igas)
1540 if ( (l < p1st) .or. (l > ntot_used) ) then
1541 rbox_gas_ptr(igas) = -1
1542 write(*,'(2a,2i7)') 'rbox_gas_ptr ', gas_name(igas), igas, -999
1544 write(*,'(2a,2i7,2x,a7)') 'rbox_gas_ptr ', gas_name(igas), igas, l, name_rbox(l)
1549 end subroutine set_rbox_gas_ptrs
1552 !-----------------------------------------------------------------------
1553 subroutine set_1_rbox_gas_ptr( igas, lgas )
1555 use module_data_mosaic_aero, only: ngas_aerchtot
1557 use module_data_mosaic_asecthp, only: rbox_gas_ptr
1559 use module_data_mosaic_main, only: ntot_used
1561 use module_state_description, only: p1st => param_first_scalar
1564 integer, intent(in) :: igas, lgas
1566 if ( igas < 1 .or. igas > ngas_aerchtot) return
1567 if ( lgas < p1st .or. lgas > ntot_used ) return
1569 rbox_gas_ptr(igas) = lgas
1572 end subroutine set_1_rbox_gas_ptr
1575 !-----------------------------------------------------------------------
1576 subroutine mosaic2_set_otheraa( chem_opt, is_aerosol )
1578 ! set is_aerosol(), name_rbox()
1580 use module_configure
1581 use module_state_description, only: num_chem, p1st => param_first_scalar
1582 use module_scalar_tables, only: chem_dname_table
1584 use module_data_mosaic_asecthp
1585 use module_data_mosaic_main, only: ntot_used
1586 use module_data_mosaic_boxmod, only: name_rbox
1587 use module_peg_util, only: peg_error_fatal, peg_message
1590 integer, intent(in) :: chem_opt
1591 logical, intent(inout) :: is_aerosol(num_chem)
1594 integer i, j, l, ll, n
1595 integer icomp, isize, itype, iphase
1598 character*20 tmpch20
1602 call peg_message( lunout, msg )
1603 msg = 'output from subr mosaic2_set_otheraa'
1604 call peg_message( lunout, trim(msg) )
1606 is_aerosol(1:num_chem) = .false.
1608 do iphase = 1, nphase_aer
1609 do itype = 1, ntype_aer
1610 do isize = 1, nsize_aer(itype)
1612 do icomp = 1, ncomp_aer(itype)
1613 l = massptr_aer(icomp,isize,itype,iphase)
1614 if (l >= p1st .and. l <= num_chem) then
1615 is_aerosol(l) = .true.
1616 name_rbox(l) = chem_dname_table(1,l)
1620 l = numptr_aer(isize,itype,iphase)
1621 if (l >= p1st .and. l <= num_chem) then
1622 is_aerosol(l) = .true.
1623 name_rbox(l) = chem_dname_table(1,l)
1626 if (iphase == ai_phase) then
1627 l = waterptr_aer(isize,itype)
1628 if (l >= p1st .and. l <= num_chem) then
1629 is_aerosol(l) = .true.
1630 name_rbox(l) = chem_dname_table(1,l)
1632 l = hyswptr_aer(isize,itype)
1633 if (l >= p1st .and. l <= num_chem) then
1634 is_aerosol(l) = .true.
1635 name_rbox(l) = chem_dname_table(1,l)
1637 end if ! (iphase == ai_phase) then
1645 tmpch20 = chem_dname_table(1,l)(1:20)
1647 j = ichar(tmpch20(i:i))
1648 if (j < 32 .or. j > 126) tmpch20(i:i) = '?'
1651 if (l > num_chem) then
1652 write(msg,'(a,i5,2(2x,a20))') 'name ', l, name_rbox(l)(1:20)
1653 else if (name_rbox(l) == chem_dname_table(1,l)) then
1654 write(msg,'(a,i5,2(2x,a20))') 'chem_dname', l, tmpch20
1656 write(msg,'(a,i5,2(2x,a20))') 'name_dname', l, name_rbox(l)(1:20), tmpch20
1658 call peg_message( lunout, trim(msg) )
1663 end subroutine mosaic2_set_otheraa
1666 !-----------------------------------------------------------------------
1667 subroutine mosaic2_set_all_lnw_ptr( chem_opt, lmax, lunerr )
1669 use module_data_mosaic_asecthp, only: &
1671 maxd_asize, maxd_atype, maxd_aphase, &
1672 numptr_aer, hyswptr_aer, waterptr_aer, &
1673 lptr_so4_aer, lptr_no3_aer, lptr_cl_aer, lptr_msa_aer, &
1674 lptr_co3_aer, lptr_nh4_aer, lptr_na_aer, lptr_ca_aer, &
1675 lptr_oc_aer, lptr_bc_aer, lptr_oin_aer, &
1676 lptr_aro1_aer, lptr_aro2_aer, lptr_alk1_aer, lptr_ole1_aer, &
1677 lptr_api1_aer, lptr_api2_aer, lptr_lim1_aer, lptr_lim2_aer, &
1679 ! lptr_tr1r1_aer, lptr_tr1r2_aer, lptr_tr1r3_aer, lptr_tr1r4_aer, &
1680 ! lptr_tanv_aer, lptr_sopnv_aer, lptr_ternv_aer, lptr_seqnv_aer, &
1681 ! lptr_sianv_aer, lptr_pcg1_b_c_aer, lptr_pcg2_b_c_aer, lptr_pcg3_b_c_aer, &
1682 lptr_pcg1_b_c_aer, lptr_pcg2_b_c_aer, lptr_pcg3_b_c_aer, &
1683 lptr_pcg4_b_c_aer, lptr_pcg5_b_c_aer, lptr_pcg6_b_c_aer, lptr_pcg7_b_c_aer, &
1684 lptr_pcg8_b_c_aer, lptr_pcg9_b_c_aer, lptr_pcg1_b_o_aer, lptr_pcg2_b_o_aer, &
1685 lptr_pcg3_b_o_aer, lptr_pcg4_b_o_aer, lptr_pcg5_b_o_aer, lptr_pcg6_b_o_aer, &
1686 lptr_pcg7_b_o_aer, lptr_pcg8_b_o_aer, lptr_pcg9_b_o_aer, lptr_opcg1_b_c_aer, &
1687 lptr_opcg2_b_c_aer, lptr_opcg3_b_c_aer, lptr_opcg4_b_c_aer, lptr_opcg5_b_c_aer, &
1688 lptr_opcg6_b_c_aer, lptr_opcg7_b_c_aer, lptr_opcg8_b_c_aer, lptr_opcg1_b_o_aer, &
1689 lptr_opcg2_b_o_aer, lptr_opcg3_b_o_aer, lptr_opcg4_b_o_aer, lptr_opcg5_b_o_aer, &
1690 lptr_opcg6_b_o_aer, lptr_opcg7_b_o_aer, lptr_opcg8_b_o_aer, lptr_pcg1_f_c_aer, &
1691 lptr_pcg2_f_c_aer, lptr_pcg3_f_c_aer, lptr_pcg4_f_c_aer, lptr_pcg5_f_c_aer, &
1692 lptr_pcg6_f_c_aer, lptr_pcg7_f_c_aer, lptr_pcg8_f_c_aer, lptr_pcg9_f_c_aer, &
1693 lptr_pcg1_f_o_aer, lptr_pcg2_f_o_aer, lptr_pcg3_f_o_aer, lptr_pcg4_f_o_aer, &
1694 lptr_pcg5_f_o_aer, lptr_pcg6_f_o_aer, lptr_pcg7_f_o_aer, lptr_pcg8_f_o_aer, &
1695 lptr_pcg9_f_o_aer, lptr_opcg1_f_c_aer, lptr_opcg2_f_c_aer, lptr_opcg3_f_c_aer, &
1696 lptr_opcg4_f_c_aer, lptr_opcg5_f_c_aer, lptr_opcg6_f_c_aer, lptr_opcg7_f_c_aer, &
1697 lptr_opcg8_f_c_aer, lptr_opcg1_f_o_aer, lptr_opcg2_f_o_aer, lptr_opcg3_f_o_aer, &
1698 lptr_opcg4_f_o_aer, lptr_opcg5_f_o_aer, lptr_opcg6_f_o_aer, lptr_opcg7_f_o_aer, &
1699 lptr_opcg8_f_o_aer, lptr_smpa_aer, lptr_smpbb_aer, &
1700 ! lptr_opcg8_f_o_aer, lptr_smpa_aer, lptr_smpbb_aer, lptr_iepox_aer, &
1701 ! lptr_iepoxos_aer, lptr_tetrol_aer, lptr_gly_aer, lptr_ant1_c_aer, &
1703 lptr_ant2_c_aer, lptr_ant3_c_aer, lptr_ant4_c_aer, lptr_ant1_o_aer, &
1704 lptr_ant2_o_aer, lptr_ant3_o_aer, lptr_ant4_o_aer, lptr_biog1_c_aer, &
1705 lptr_biog2_c_aer, lptr_biog3_c_aer, lptr_biog4_c_aer, lptr_biog1_o_aer, &
1706 lptr_biog2_o_aer, lptr_biog3_o_aer, lptr_biog4_o_aer
1708 integer, intent(in) :: chem_opt, lmax, lunerr
1710 integer :: lptr_tmp(maxd_asize,maxd_atype,maxd_aphase)
1714 call mosaic2_set_one_lnw_ptr( numptr_aer, 'num', 1, 0, lmax, lunerr )
1716 ! required and ai_phase only
1717 call mosaic2_set_one_lnw_ptr( lptr_tmp, 'water', 1, 1, lmax, lunerr )
1718 waterptr_aer(1:maxd_asize,1:maxd_atype) = lptr_tmp(1:maxd_asize,1:maxd_atype,ai_phase)
1719 call mosaic2_set_one_lnw_ptr( lptr_tmp, 'hysw', 1, 1, lmax, lunerr )
1720 hyswptr_aer(1:maxd_asize,1:maxd_atype) = lptr_tmp(1:maxd_asize,1:maxd_atype,ai_phase)
1723 call mosaic2_set_one_lnw_ptr( lptr_so4_aer, "so4", 1, 0, lmax, lunerr )
1725 ! not required, although a few of them should be
1726 call mosaic2_set_one_lnw_ptr( lptr_no3_aer, "no3", 0, 0, lmax, lunerr )
1727 call mosaic2_set_one_lnw_ptr( lptr_cl_aer, "cl", 0, 0, lmax, lunerr )
1728 call mosaic2_set_one_lnw_ptr( lptr_msa_aer, "msa", 0, 0, lmax, lunerr )
1729 call mosaic2_set_one_lnw_ptr( lptr_co3_aer, "co3", 0, 0, lmax, lunerr )
1730 call mosaic2_set_one_lnw_ptr( lptr_nh4_aer, "nh4", 0, 0, lmax, lunerr )
1731 call mosaic2_set_one_lnw_ptr( lptr_na_aer, "na", 0, 0, lmax, lunerr )
1732 call mosaic2_set_one_lnw_ptr( lptr_ca_aer, "ca", 0, 0, lmax, lunerr )
1733 call mosaic2_set_one_lnw_ptr( lptr_oc_aer, "oc", 0, 0, lmax, lunerr )
1734 call mosaic2_set_one_lnw_ptr( lptr_bc_aer, "bc", 0, 0, lmax, lunerr )
1735 call mosaic2_set_one_lnw_ptr( lptr_oin_aer, "oin", 0, 0, lmax, lunerr )
1736 call mosaic2_set_one_lnw_ptr( lptr_aro1_aer, "aro1", 0, 0, lmax, lunerr )
1737 call mosaic2_set_one_lnw_ptr( lptr_aro2_aer, "aro2", 0, 0, lmax, lunerr )
1738 call mosaic2_set_one_lnw_ptr( lptr_alk1_aer, "alk1", 0, 0, lmax, lunerr )
1739 call mosaic2_set_one_lnw_ptr( lptr_ole1_aer, "ole1", 0, 0, lmax, lunerr )
1740 call mosaic2_set_one_lnw_ptr( lptr_api1_aer, "api1", 0, 0, lmax, lunerr )
1741 call mosaic2_set_one_lnw_ptr( lptr_api2_aer, "api2", 0, 0, lmax, lunerr )
1742 call mosaic2_set_one_lnw_ptr( lptr_lim1_aer, "lim1", 0, 0, lmax, lunerr )
1743 call mosaic2_set_one_lnw_ptr( lptr_lim2_aer, "lim2", 0, 0, lmax, lunerr )
1744 ! call mosaic2_set_one_lnw_ptr( lptr_dust_aer, "dust", 0, 0, lmax, lunerr )
1745 ! call mosaic2_set_one_lnw_ptr( lptr_tr1r1_aer, "tr1r1", 0, 0, lmax, lunerr )
1746 ! call mosaic2_set_one_lnw_ptr( lptr_tr1r2_aer, "tr1r2", 0, 0, lmax, lunerr )
1747 ! call mosaic2_set_one_lnw_ptr( lptr_tr1r3_aer, "tr1r3", 0, 0, lmax, lunerr )
1748 ! call mosaic2_set_one_lnw_ptr( lptr_tr1r4_aer, "tr1r4", 0, 0, lmax, lunerr )
1749 ! call mosaic2_set_one_lnw_ptr( lptr_tanv_aer, "tanv", 0, 0, lmax, lunerr )
1750 ! call mosaic2_set_one_lnw_ptr( lptr_sopnv_aer, "sopnv", 0, 0, lmax, lunerr )
1751 ! call mosaic2_set_one_lnw_ptr( lptr_ternv_aer, "ternv", 0, 0, lmax, lunerr )
1752 ! call mosaic2_set_one_lnw_ptr( lptr_seqnv_aer, "seqnv", 0, 0, lmax, lunerr )
1753 ! call mosaic2_set_one_lnw_ptr( lptr_sianv_aer, "sianv", 0, 0, lmax, lunerr )
1754 call mosaic2_set_one_lnw_ptr( lptr_pcg1_b_c_aer, "pcg1_b_c", 0, 0, lmax, lunerr )
1755 call mosaic2_set_one_lnw_ptr( lptr_pcg2_b_c_aer, "pcg2_b_c", 0, 0, lmax, lunerr )
1756 call mosaic2_set_one_lnw_ptr( lptr_pcg3_b_c_aer, "pcg3_b_c", 0, 0, lmax, lunerr )
1757 call mosaic2_set_one_lnw_ptr( lptr_pcg4_b_c_aer, "pcg4_b_c", 0, 0, lmax, lunerr )
1758 call mosaic2_set_one_lnw_ptr( lptr_pcg5_b_c_aer, "pcg5_b_c", 0, 0, lmax, lunerr )
1759 call mosaic2_set_one_lnw_ptr( lptr_pcg6_b_c_aer, "pcg6_b_c", 0, 0, lmax, lunerr )
1760 call mosaic2_set_one_lnw_ptr( lptr_pcg7_b_c_aer, "pcg7_b_c", 0, 0, lmax, lunerr )
1761 call mosaic2_set_one_lnw_ptr( lptr_pcg8_b_c_aer, "pcg8_b_c", 0, 0, lmax, lunerr )
1762 call mosaic2_set_one_lnw_ptr( lptr_pcg9_b_c_aer, "pcg9_b_c", 0, 0, lmax, lunerr )
1763 call mosaic2_set_one_lnw_ptr( lptr_pcg1_b_o_aer, "pcg1_b_o", 0, 0, lmax, lunerr )
1764 call mosaic2_set_one_lnw_ptr( lptr_pcg2_b_o_aer, "pcg2_b_o", 0, 0, lmax, lunerr )
1765 call mosaic2_set_one_lnw_ptr( lptr_pcg3_b_o_aer, "pcg3_b_o", 0, 0, lmax, lunerr )
1766 call mosaic2_set_one_lnw_ptr( lptr_pcg4_b_o_aer, "pcg4_b_o", 0, 0, lmax, lunerr )
1767 call mosaic2_set_one_lnw_ptr( lptr_pcg5_b_o_aer, "pcg5_b_o", 0, 0, lmax, lunerr )
1768 call mosaic2_set_one_lnw_ptr( lptr_pcg6_b_o_aer, "pcg6_b_o", 0, 0, lmax, lunerr )
1769 call mosaic2_set_one_lnw_ptr( lptr_pcg7_b_o_aer, "pcg7_b_o", 0, 0, lmax, lunerr )
1770 call mosaic2_set_one_lnw_ptr( lptr_pcg8_b_o_aer, "pcg8_b_o", 0, 0, lmax, lunerr )
1771 call mosaic2_set_one_lnw_ptr( lptr_pcg9_b_o_aer, "pcg9_b_o", 0, 0, lmax, lunerr )
1772 call mosaic2_set_one_lnw_ptr( lptr_opcg1_b_c_aer, "opcg1_b_c", 0, 0, lmax, lunerr )
1773 call mosaic2_set_one_lnw_ptr( lptr_opcg2_b_c_aer, "opcg2_b_c", 0, 0, lmax, lunerr )
1774 call mosaic2_set_one_lnw_ptr( lptr_opcg3_b_c_aer, "opcg3_b_c", 0, 0, lmax, lunerr )
1775 call mosaic2_set_one_lnw_ptr( lptr_opcg4_b_c_aer, "opcg4_b_c", 0, 0, lmax, lunerr )
1776 call mosaic2_set_one_lnw_ptr( lptr_opcg5_b_c_aer, "opcg5_b_c", 0, 0, lmax, lunerr )
1777 call mosaic2_set_one_lnw_ptr( lptr_opcg6_b_c_aer, "opcg6_b_c", 0, 0, lmax, lunerr )
1778 call mosaic2_set_one_lnw_ptr( lptr_opcg7_b_c_aer, "opcg7_b_c", 0, 0, lmax, lunerr )
1779 call mosaic2_set_one_lnw_ptr( lptr_opcg8_b_c_aer, "opcg8_b_c", 0, 0, lmax, lunerr )
1780 call mosaic2_set_one_lnw_ptr( lptr_opcg1_b_o_aer, "opcg1_b_o", 0, 0, lmax, lunerr )
1781 call mosaic2_set_one_lnw_ptr( lptr_opcg2_b_o_aer, "opcg2_b_o", 0, 0, lmax, lunerr )
1782 call mosaic2_set_one_lnw_ptr( lptr_opcg3_b_o_aer, "opcg3_b_o", 0, 0, lmax, lunerr )
1783 call mosaic2_set_one_lnw_ptr( lptr_opcg4_b_o_aer, "opcg4_b_o", 0, 0, lmax, lunerr )
1784 call mosaic2_set_one_lnw_ptr( lptr_opcg5_b_o_aer, "opcg5_b_o", 0, 0, lmax, lunerr )
1785 call mosaic2_set_one_lnw_ptr( lptr_opcg6_b_o_aer, "opcg6_b_o", 0, 0, lmax, lunerr )
1786 call mosaic2_set_one_lnw_ptr( lptr_opcg7_b_o_aer, "opcg7_b_o", 0, 0, lmax, lunerr )
1787 call mosaic2_set_one_lnw_ptr( lptr_opcg8_b_o_aer, "opcg8_b_o", 0, 0, lmax, lunerr )
1788 call mosaic2_set_one_lnw_ptr( lptr_pcg1_f_c_aer, "pcg1_f_c", 0, 0, lmax, lunerr )
1789 call mosaic2_set_one_lnw_ptr( lptr_pcg2_f_c_aer, "pcg2_f_c", 0, 0, lmax, lunerr )
1790 call mosaic2_set_one_lnw_ptr( lptr_pcg3_f_c_aer, "pcg3_f_c", 0, 0, lmax, lunerr )
1791 call mosaic2_set_one_lnw_ptr( lptr_pcg4_f_c_aer, "pcg4_f_c", 0, 0, lmax, lunerr )
1792 call mosaic2_set_one_lnw_ptr( lptr_pcg5_f_c_aer, "pcg5_f_c", 0, 0, lmax, lunerr )
1793 call mosaic2_set_one_lnw_ptr( lptr_pcg6_f_c_aer, "pcg6_f_c", 0, 0, lmax, lunerr )
1794 call mosaic2_set_one_lnw_ptr( lptr_pcg7_f_c_aer, "pcg7_f_c", 0, 0, lmax, lunerr )
1795 call mosaic2_set_one_lnw_ptr( lptr_pcg8_f_c_aer, "pcg8_f_c", 0, 0, lmax, lunerr )
1796 call mosaic2_set_one_lnw_ptr( lptr_pcg9_f_c_aer, "pcg9_f_c", 0, 0, lmax, lunerr )
1797 call mosaic2_set_one_lnw_ptr( lptr_pcg1_f_o_aer, "pcg1_f_o", 0, 0, lmax, lunerr )
1798 call mosaic2_set_one_lnw_ptr( lptr_pcg2_f_o_aer, "pcg2_f_o", 0, 0, lmax, lunerr )
1799 call mosaic2_set_one_lnw_ptr( lptr_pcg3_f_o_aer, "pcg3_f_o", 0, 0, lmax, lunerr )
1800 call mosaic2_set_one_lnw_ptr( lptr_pcg4_f_o_aer, "pcg4_f_o", 0, 0, lmax, lunerr )
1801 call mosaic2_set_one_lnw_ptr( lptr_pcg5_f_o_aer, "pcg5_f_o", 0, 0, lmax, lunerr )
1802 call mosaic2_set_one_lnw_ptr( lptr_pcg6_f_o_aer, "pcg6_f_o", 0, 0, lmax, lunerr )
1803 call mosaic2_set_one_lnw_ptr( lptr_pcg7_f_o_aer, "pcg7_f_o", 0, 0, lmax, lunerr )
1804 call mosaic2_set_one_lnw_ptr( lptr_pcg8_f_o_aer, "pcg8_f_o", 0, 0, lmax, lunerr )
1805 call mosaic2_set_one_lnw_ptr( lptr_pcg9_f_o_aer, "pcg9_f_o", 0, 0, lmax, lunerr )
1806 call mosaic2_set_one_lnw_ptr( lptr_opcg1_f_c_aer, "opcg1_f_c", 0, 0, lmax, lunerr )
1807 call mosaic2_set_one_lnw_ptr( lptr_opcg2_f_c_aer, "opcg2_f_c", 0, 0, lmax, lunerr )
1808 call mosaic2_set_one_lnw_ptr( lptr_opcg3_f_c_aer, "opcg3_f_c", 0, 0, lmax, lunerr )
1809 call mosaic2_set_one_lnw_ptr( lptr_opcg4_f_c_aer, "opcg4_f_c", 0, 0, lmax, lunerr )
1810 call mosaic2_set_one_lnw_ptr( lptr_opcg5_f_c_aer, "opcg5_f_c", 0, 0, lmax, lunerr )
1811 call mosaic2_set_one_lnw_ptr( lptr_opcg6_f_c_aer, "opcg6_f_c", 0, 0, lmax, lunerr )
1812 call mosaic2_set_one_lnw_ptr( lptr_opcg7_f_c_aer, "opcg7_f_c", 0, 0, lmax, lunerr )
1813 call mosaic2_set_one_lnw_ptr( lptr_opcg8_f_c_aer, "opcg8_f_c", 0, 0, lmax, lunerr )
1814 call mosaic2_set_one_lnw_ptr( lptr_opcg1_f_o_aer, "opcg1_f_o", 0, 0, lmax, lunerr )
1815 call mosaic2_set_one_lnw_ptr( lptr_opcg2_f_o_aer, "opcg2_f_o", 0, 0, lmax, lunerr )
1816 call mosaic2_set_one_lnw_ptr( lptr_opcg3_f_o_aer, "opcg3_f_o", 0, 0, lmax, lunerr )
1817 call mosaic2_set_one_lnw_ptr( lptr_opcg4_f_o_aer, "opcg4_f_o", 0, 0, lmax, lunerr )
1818 call mosaic2_set_one_lnw_ptr( lptr_opcg5_f_o_aer, "opcg5_f_o", 0, 0, lmax, lunerr )
1819 call mosaic2_set_one_lnw_ptr( lptr_opcg6_f_o_aer, "opcg6_f_o", 0, 0, lmax, lunerr )
1820 call mosaic2_set_one_lnw_ptr( lptr_opcg7_f_o_aer, "opcg7_f_o", 0, 0, lmax, lunerr )
1821 call mosaic2_set_one_lnw_ptr( lptr_opcg8_f_o_aer, "opcg8_f_o", 0, 0, lmax, lunerr )
1822 call mosaic2_set_one_lnw_ptr( lptr_smpa_aer, "smpa", 0, 0, lmax, lunerr )
1823 call mosaic2_set_one_lnw_ptr( lptr_smpbb_aer, "smpbb", 0, 0, lmax, lunerr )
1824 ! call mosaic2_set_one_lnw_ptr( lptr_iepox_aer, "iepox", 0, 0, lmax, lunerr )
1825 ! call mosaic2_set_one_lnw_ptr( lptr_iepoxos_aer, "iepoxos", 0, 0, lmax, lunerr )
1826 ! call mosaic2_set_one_lnw_ptr( lptr_tetrol_aer, "tetrol", 0, 0, lmax, lunerr )
1827 ! call mosaic2_set_one_lnw_ptr( lptr_gly_aer, "gly", 0, 0, lmax, lunerr )
1828 call mosaic2_set_one_lnw_ptr( lptr_ant1_c_aer, "ant1_c", 0, 0, lmax, lunerr )
1829 call mosaic2_set_one_lnw_ptr( lptr_ant2_c_aer, "ant2_c", 0, 0, lmax, lunerr )
1830 call mosaic2_set_one_lnw_ptr( lptr_ant3_c_aer, "ant3_c", 0, 0, lmax, lunerr )
1831 call mosaic2_set_one_lnw_ptr( lptr_ant4_c_aer, "ant4_c", 0, 0, lmax, lunerr )
1832 call mosaic2_set_one_lnw_ptr( lptr_ant1_o_aer, "ant1_o", 0, 0, lmax, lunerr )
1833 call mosaic2_set_one_lnw_ptr( lptr_ant2_o_aer, "ant2_o", 0, 0, lmax, lunerr )
1834 call mosaic2_set_one_lnw_ptr( lptr_ant3_o_aer, "ant3_o", 0, 0, lmax, lunerr )
1835 call mosaic2_set_one_lnw_ptr( lptr_ant4_o_aer, "ant4_o", 0, 0, lmax, lunerr )
1836 call mosaic2_set_one_lnw_ptr( lptr_biog1_c_aer, "biog1_c", 0, 0, lmax, lunerr )
1837 call mosaic2_set_one_lnw_ptr( lptr_biog2_c_aer, "biog2_c", 0, 0, lmax, lunerr )
1838 call mosaic2_set_one_lnw_ptr( lptr_biog3_c_aer, "biog3_c", 0, 0, lmax, lunerr )
1839 call mosaic2_set_one_lnw_ptr( lptr_biog4_c_aer, "biog4_c", 0, 0, lmax, lunerr )
1840 call mosaic2_set_one_lnw_ptr( lptr_biog1_o_aer, "biog1_o", 0, 0, lmax, lunerr )
1841 call mosaic2_set_one_lnw_ptr( lptr_biog2_o_aer, "biog2_o", 0, 0, lmax, lunerr )
1842 call mosaic2_set_one_lnw_ptr( lptr_biog3_o_aer, "biog3_o", 0, 0, lmax, lunerr )
1843 call mosaic2_set_one_lnw_ptr( lptr_biog4_o_aer, "biog4_o", 0, 0, lmax, lunerr )
1847 end subroutine mosaic2_set_all_lnw_ptr
1850 !-----------------------------------------------------------------------
1851 subroutine mosaic2_set_one_lnw_ptr( lptr_aer, sname, required, ai_phase_only, lmax, lunerr )
1853 use module_data_mosaic_asecthp, only: &
1855 identical_comps_optaa, &
1856 maxd_asize, maxd_atype, maxd_aphase, &
1857 nsize_aer, ntype_aer, nphase_aer
1858 use module_peg_util, only: peg_error_fatal
1860 integer, intent(out) :: lptr_aer(maxd_asize,maxd_atype,maxd_aphase)
1861 integer, intent(in) :: required ! if positive, this variable must be found (otherwise fatal error)
1862 integer, intent(in) :: ai_phase_only ! if positive, only do the ai_phase
1863 integer, intent(in) :: lmax, lunerr
1865 character(len=*), intent(in) :: sname
1867 integer :: ierr, iphase, isize, itype, l, ntot, ntotsv
1868 character(len=40) :: chemname
1869 character(len=200) :: msg
1872 if (ai_phase /= 1) then
1873 write(msg,*) 'mosaic2_set_one_lnw_ptr error 0 - bad ai_phase = ', ai_phase
1874 call peg_error_fatal( lunerr, msg )
1877 ! set lptr_aer values which point to aerosol species locations in the chem array
1878 lptr_aer(1:maxd_asize,1:maxd_atype,1:maxd_aphase) = 1
1880 do itype = 1, ntype_aer
1882 do iphase = 1, nphase_aer
1883 if ((ai_phase_only > 0) .and. (iphase /= 1)) cycle
1887 do isize = 1, nsize_aer(itype)
1888 call mosaic2_form_chemname( sname, isize, itype, iphase, lunerr, chemname )
1889 call mosaic2_find_chemname_in_table( chemname, l )
1894 write(msg,*) 'mosaic2_set_one_lnw_ptr error 1 - chemname, l, lmax = ', &
1896 call peg_error_fatal( lunerr, msg )
1898 lptr_aer(isize,itype,iphase) = l
1902 if (itype == 1 .and. iphase == 1) ntotsv = ntot
1904 ! check that all sizes either have or do not have this species
1906 if (ntotsv == nsize_aer(itype)) ierr = 1
1907 if ( (required <= 0) .and. (ntotsv == 0) ) ierr = 1
1908 if ( ierr <= 0 ) then
1909 write(msg,*) 'mosaic2_set_one_lnw_ptr error 2 - sname, itype, iphase, ntotsv, nsize = ', &
1910 sname, itype, iphase, ntotsv, nsize_aer(itype)
1911 call peg_error_fatal( lunerr, msg )
1914 if (identical_comps_optaa > 0) then
1915 ! check that all types, phases, and sizes have the same ntot
1916 if ( ntotsv /= ntot ) then
1917 write(msg,*) 'mosaic2_set_one_lnw_ptr error 3 - sname, itype, iphase, ntotsv, ntot = ', &
1918 sname, itype, iphase, ntotsv, ntot
1919 call peg_error_fatal( lunerr, msg )
1928 end subroutine mosaic2_set_one_lnw_ptr
1931 !-----------------------------------------------------------------------
1932 subroutine set_rbox_aer_ptrs
1934 ! sets the rbox_aer_ptr(iaer,ibin) values that are used to
1935 ! map gas species between the rbox array and the aer, num_a, and water_a arrays
1937 use module_state_description, only: p1st => param_first_scalar
1939 use module_data_mosaic_aero, only: &
1940 aer_name, naer, nbin_a, nbin_a_max, &
1941 iso4_a, ino3_a, icl_a, inh4_a, ico3_a, &
1942 imsa_a, ina_a, ica_a, ioc_a, ibc_a, &
1943 ioin_a, iaro1_a, iaro2_a, ialk1_a, iole1_a, &
1944 iapi1_a, iapi2_a, ilim1_a, ilim2_a, &
1946 ! itr1r1_a, itr1r2_a, itr1r3_a, itr1r4_a, &
1947 ipcg1_b_c_a, ipcg2_b_c_a, ipcg3_b_c_a, ipcg4_b_c_a, &
1948 ipcg5_b_c_a, ipcg6_b_c_a, ipcg7_b_c_a, ipcg8_b_c_a, &
1950 ipcg1_b_o_a, ipcg2_b_o_a, ipcg3_b_o_a, ipcg4_b_o_a, &
1951 ipcg5_b_o_a, ipcg6_b_o_a, ipcg7_b_o_a, ipcg8_b_o_a, &
1953 iopcg1_b_c_a, iopcg2_b_c_a, iopcg3_b_c_a, iopcg4_b_c_a, &
1954 iopcg5_b_c_a, iopcg6_b_c_a, iopcg7_b_c_a, iopcg8_b_c_a, &
1955 iopcg1_b_o_a, iopcg2_b_o_a, iopcg3_b_o_a, iopcg4_b_o_a, &
1956 iopcg5_b_o_a, iopcg6_b_o_a, iopcg7_b_o_a, iopcg8_b_o_a, &
1957 ipcg1_f_c_a, ipcg2_f_c_a, ipcg3_f_c_a, ipcg4_f_c_a, &
1958 ipcg5_f_c_a, ipcg6_f_c_a, ipcg7_f_c_a, ipcg8_f_c_a, &
1960 ipcg1_f_o_a, ipcg2_f_o_a, ipcg3_f_o_a, ipcg4_f_o_a, &
1961 ipcg5_f_o_a, ipcg6_f_o_a, ipcg7_f_o_a, ipcg8_f_o_a, &
1963 iopcg1_f_c_a, iopcg2_f_c_a, iopcg3_f_c_a, iopcg4_f_c_a, &
1964 iopcg5_f_c_a, iopcg6_f_c_a, iopcg7_f_c_a, iopcg8_f_c_a, &
1965 iopcg1_f_o_a, iopcg2_f_o_a, iopcg3_f_o_a, iopcg4_f_o_a, &
1966 iopcg5_f_o_a, iopcg6_f_o_a, iopcg7_f_o_a, iopcg8_f_o_a, &
1967 iant1_c_a, iant2_c_a, iant3_c_a, iant4_c_a, &
1968 iant1_o_a, iant2_o_a, iant3_o_a, iant4_o_a, &
1969 ibiog1_c_a, ibiog2_c_a, ibiog3_c_a, ibiog4_c_a, &
1970 ibiog1_o_a, ibiog2_o_a, ibiog3_o_a, ibiog4_o_a, &
1972 ! ismpa_a, ismpbb_a, &
1973 ! iiepox_a, igly_a, iiepoxos_a, itetrol_a, &
1974 ! itanv_a, isopnv_a, iternv_a, iseqnv_a, &
1977 use module_data_mosaic_asecthp, only: &
1979 isize_of_ibin, itype_of_ibin, &
1981 numptr_aer, hyswptr_aer, waterptr_aer, &
1982 lptr_so4_aer, lptr_no3_aer, lptr_cl_aer, lptr_msa_aer, &
1983 lptr_co3_aer, lptr_nh4_aer, lptr_na_aer, lptr_ca_aer, &
1984 lptr_oc_aer, lptr_bc_aer, lptr_oin_aer, &
1985 lptr_aro1_aer, lptr_aro2_aer, lptr_alk1_aer, lptr_ole1_aer, &
1986 lptr_api1_aer, lptr_api2_aer, lptr_lim1_aer, lptr_lim2_aer, &
1988 ! lptr_tr1r1_aer, lptr_tr1r2_aer, lptr_tr1r3_aer, lptr_tr1r4_aer, &
1989 ! lptr_tanv_aer, lptr_sopnv_aer, lptr_ternv_aer, lptr_seqnv_aer, &
1990 ! lptr_sianv_aer, lptr_pcg1_b_c_aer, lptr_pcg2_b_c_aer, lptr_pcg3_b_c_aer, &
1991 lptr_pcg1_b_c_aer, lptr_pcg2_b_c_aer, lptr_pcg3_b_c_aer, &
1992 lptr_pcg4_b_c_aer, lptr_pcg5_b_c_aer, lptr_pcg6_b_c_aer, lptr_pcg7_b_c_aer, &
1993 lptr_pcg8_b_c_aer, lptr_pcg9_b_c_aer, lptr_pcg1_b_o_aer, lptr_pcg2_b_o_aer, &
1994 lptr_pcg3_b_o_aer, lptr_pcg4_b_o_aer, lptr_pcg5_b_o_aer, lptr_pcg6_b_o_aer, &
1995 lptr_pcg7_b_o_aer, lptr_pcg8_b_o_aer, lptr_pcg9_b_o_aer, lptr_opcg1_b_c_aer, &
1996 lptr_opcg2_b_c_aer, lptr_opcg3_b_c_aer, lptr_opcg4_b_c_aer, lptr_opcg5_b_c_aer, &
1997 lptr_opcg6_b_c_aer, lptr_opcg7_b_c_aer, lptr_opcg8_b_c_aer, lptr_opcg1_b_o_aer, &
1998 lptr_opcg2_b_o_aer, lptr_opcg3_b_o_aer, lptr_opcg4_b_o_aer, lptr_opcg5_b_o_aer, &
1999 lptr_opcg6_b_o_aer, lptr_opcg7_b_o_aer, lptr_opcg8_b_o_aer, lptr_pcg1_f_c_aer, &
2000 lptr_pcg2_f_c_aer, lptr_pcg3_f_c_aer, lptr_pcg4_f_c_aer, lptr_pcg5_f_c_aer, &
2001 lptr_pcg6_f_c_aer, lptr_pcg7_f_c_aer, lptr_pcg8_f_c_aer, lptr_pcg9_f_c_aer, &
2002 lptr_pcg1_f_o_aer, lptr_pcg2_f_o_aer, lptr_pcg3_f_o_aer, lptr_pcg4_f_o_aer, &
2003 lptr_pcg5_f_o_aer, lptr_pcg6_f_o_aer, lptr_pcg7_f_o_aer, lptr_pcg8_f_o_aer, &
2004 lptr_pcg9_f_o_aer, lptr_opcg1_f_c_aer, lptr_opcg2_f_c_aer, lptr_opcg3_f_c_aer, &
2005 lptr_opcg4_f_c_aer, lptr_opcg5_f_c_aer, lptr_opcg6_f_c_aer, lptr_opcg7_f_c_aer, &
2006 lptr_opcg8_f_c_aer, lptr_opcg1_f_o_aer, lptr_opcg2_f_o_aer, lptr_opcg3_f_o_aer, &
2007 lptr_opcg4_f_o_aer, lptr_opcg5_f_o_aer, lptr_opcg6_f_o_aer, lptr_opcg7_f_o_aer, &
2008 lptr_opcg8_f_o_aer, lptr_smpa_aer, lptr_smpbb_aer, &
2009 ! lptr_opcg8_f_o_aer, lptr_smpa_aer, lptr_smpbb_aer, lptr_iepox_aer, &
2010 ! lptr_iepoxos_aer, lptr_tetrol_aer, lptr_gly_aer, lptr_ant1_c_aer, &
2012 lptr_ant2_c_aer, lptr_ant3_c_aer, lptr_ant4_c_aer, lptr_ant1_o_aer, &
2013 lptr_ant2_o_aer, lptr_ant3_o_aer, lptr_ant4_o_aer, lptr_biog1_c_aer, &
2014 lptr_biog2_c_aer, lptr_biog3_c_aer, lptr_biog4_c_aer, lptr_biog1_o_aer, &
2015 lptr_biog2_o_aer, lptr_biog3_o_aer, lptr_biog4_o_aer
2017 use module_data_mosaic_boxmod, only: name_rbox
2019 use module_data_mosaic_main, only: ntot_used
2022 integer :: iaer, ibin, iph, isz, ity, l
2024 character(len=16) :: tmp_name
2027 rbox_aer_ptr(-3:naer,1:nbin_a_max) = -1
2033 isz = isize_of_ibin(ibin)
2034 ity = itype_of_ibin(ibin)
2036 rbox_aer_ptr( -1, ibin ) = numptr_aer(isz,ity,iph)
2037 rbox_aer_ptr( -2, ibin ) = waterptr_aer(isz,ity)
2038 rbox_aer_ptr( -3, ibin ) = hyswptr_aer(isz,ity)
2040 call set_1_rbox_aer_ptr( ibin, iso4_a, lptr_so4_aer( isz,ity,iph) )
2041 call set_1_rbox_aer_ptr( ibin, ino3_a, lptr_no3_aer( isz,ity,iph) )
2042 call set_1_rbox_aer_ptr( ibin, icl_a, lptr_cl_aer( isz,ity,iph) )
2043 call set_1_rbox_aer_ptr( ibin, inh4_a, lptr_nh4_aer( isz,ity,iph) )
2044 call set_1_rbox_aer_ptr( ibin, ico3_a, lptr_co3_aer( isz,ity,iph) )
2045 call set_1_rbox_aer_ptr( ibin, imsa_a, lptr_msa_aer( isz,ity,iph) )
2046 call set_1_rbox_aer_ptr( ibin, ina_a, lptr_na_aer( isz,ity,iph) )
2047 call set_1_rbox_aer_ptr( ibin, ica_a, lptr_ca_aer( isz,ity,iph) )
2048 call set_1_rbox_aer_ptr( ibin, ioc_a, lptr_oc_aer( isz,ity,iph) )
2049 call set_1_rbox_aer_ptr( ibin, ibc_a, lptr_bc_aer( isz,ity,iph) )
2050 call set_1_rbox_aer_ptr( ibin, ioin_a, lptr_oin_aer( isz,ity,iph) )
2051 call set_1_rbox_aer_ptr( ibin, iaro1_a, lptr_aro1_aer( isz,ity,iph) )
2052 call set_1_rbox_aer_ptr( ibin, iaro2_a, lptr_aro2_aer( isz,ity,iph) )
2053 call set_1_rbox_aer_ptr( ibin, ialk1_a, lptr_alk1_aer( isz,ity,iph) )
2054 call set_1_rbox_aer_ptr( ibin, iole1_a, lptr_ole1_aer( isz,ity,iph) )
2055 call set_1_rbox_aer_ptr( ibin, iapi1_a, lptr_api1_aer( isz,ity,iph) )
2056 call set_1_rbox_aer_ptr( ibin, iapi2_a, lptr_api2_aer( isz,ity,iph) )
2057 call set_1_rbox_aer_ptr( ibin, ilim1_a, lptr_lim1_aer( isz,ity,iph) )
2058 call set_1_rbox_aer_ptr( ibin, ilim2_a, lptr_lim2_aer( isz,ity,iph) )
2059 ! call set_1_rbox_aer_ptr( ibin, idust_a, lptr_dust_aer( isz,ity,iph) )
2060 ! call set_1_rbox_aer_ptr( ibin, itr1r1_a, lptr_tr1r1_aer( isz,ity,iph) )
2061 ! call set_1_rbox_aer_ptr( ibin, itr1r2_a, lptr_tr1r2_aer( isz,ity,iph) )
2062 ! call set_1_rbox_aer_ptr( ibin, itr1r3_a, lptr_tr1r3_aer( isz,ity,iph) )
2063 ! call set_1_rbox_aer_ptr( ibin, itr1r4_a, lptr_tr1r4_aer( isz,ity,iph) )
2064 call set_1_rbox_aer_ptr( ibin, ipcg1_b_c_a, lptr_pcg1_b_c_aer( isz,ity,iph) )
2065 call set_1_rbox_aer_ptr( ibin, ipcg2_b_c_a, lptr_pcg2_b_c_aer( isz,ity,iph) )
2066 call set_1_rbox_aer_ptr( ibin, ipcg3_b_c_a, lptr_pcg3_b_c_aer( isz,ity,iph) )
2067 call set_1_rbox_aer_ptr( ibin, ipcg4_b_c_a, lptr_pcg4_b_c_aer( isz,ity,iph) )
2068 call set_1_rbox_aer_ptr( ibin, ipcg5_b_c_a, lptr_pcg5_b_c_aer( isz,ity,iph) )
2069 call set_1_rbox_aer_ptr( ibin, ipcg6_b_c_a, lptr_pcg6_b_c_aer( isz,ity,iph) )
2070 call set_1_rbox_aer_ptr( ibin, ipcg7_b_c_a, lptr_pcg7_b_c_aer( isz,ity,iph) )
2071 call set_1_rbox_aer_ptr( ibin, ipcg8_b_c_a, lptr_pcg8_b_c_aer( isz,ity,iph) )
2072 call set_1_rbox_aer_ptr( ibin, ipcg9_b_c_a, lptr_pcg9_b_c_aer( isz,ity,iph) )
2073 call set_1_rbox_aer_ptr( ibin, ipcg1_b_o_a, lptr_pcg1_b_o_aer( isz,ity,iph) )
2074 call set_1_rbox_aer_ptr( ibin, ipcg2_b_o_a, lptr_pcg2_b_o_aer( isz,ity,iph) )
2075 call set_1_rbox_aer_ptr( ibin, ipcg3_b_o_a, lptr_pcg3_b_o_aer( isz,ity,iph) )
2076 call set_1_rbox_aer_ptr( ibin, ipcg4_b_o_a, lptr_pcg4_b_o_aer( isz,ity,iph) )
2077 call set_1_rbox_aer_ptr( ibin, ipcg5_b_o_a, lptr_pcg5_b_o_aer( isz,ity,iph) )
2078 call set_1_rbox_aer_ptr( ibin, ipcg6_b_o_a, lptr_pcg6_b_o_aer( isz,ity,iph) )
2079 call set_1_rbox_aer_ptr( ibin, ipcg7_b_o_a, lptr_pcg7_b_o_aer( isz,ity,iph) )
2080 call set_1_rbox_aer_ptr( ibin, ipcg8_b_o_a, lptr_pcg8_b_o_aer( isz,ity,iph) )
2081 call set_1_rbox_aer_ptr( ibin, ipcg9_b_o_a, lptr_pcg9_b_o_aer( isz,ity,iph) )
2082 call set_1_rbox_aer_ptr( ibin, iopcg1_b_c_a, lptr_opcg1_b_c_aer(isz,ity,iph) )
2083 call set_1_rbox_aer_ptr( ibin, iopcg2_b_c_a, lptr_opcg2_b_c_aer(isz,ity,iph) )
2084 call set_1_rbox_aer_ptr( ibin, iopcg3_b_c_a, lptr_opcg3_b_c_aer(isz,ity,iph) )
2085 call set_1_rbox_aer_ptr( ibin, iopcg4_b_c_a, lptr_opcg4_b_c_aer(isz,ity,iph) )
2086 call set_1_rbox_aer_ptr( ibin, iopcg5_b_c_a, lptr_opcg5_b_c_aer(isz,ity,iph) )
2087 call set_1_rbox_aer_ptr( ibin, iopcg6_b_c_a, lptr_opcg6_b_c_aer(isz,ity,iph) )
2088 call set_1_rbox_aer_ptr( ibin, iopcg7_b_c_a, lptr_opcg7_b_c_aer(isz,ity,iph) )
2089 call set_1_rbox_aer_ptr( ibin, iopcg8_b_c_a, lptr_opcg8_b_c_aer(isz,ity,iph) )
2090 call set_1_rbox_aer_ptr( ibin, iopcg1_b_o_a, lptr_opcg1_b_o_aer(isz,ity,iph) )
2091 call set_1_rbox_aer_ptr( ibin, iopcg2_b_o_a, lptr_opcg2_b_o_aer(isz,ity,iph) )
2092 call set_1_rbox_aer_ptr( ibin, iopcg3_b_o_a, lptr_opcg3_b_o_aer(isz,ity,iph) )
2093 call set_1_rbox_aer_ptr( ibin, iopcg4_b_o_a, lptr_opcg4_b_o_aer(isz,ity,iph) )
2094 call set_1_rbox_aer_ptr( ibin, iopcg5_b_o_a, lptr_opcg5_b_o_aer(isz,ity,iph) )
2095 call set_1_rbox_aer_ptr( ibin, iopcg6_b_o_a, lptr_opcg6_b_o_aer(isz,ity,iph) )
2096 call set_1_rbox_aer_ptr( ibin, iopcg7_b_o_a, lptr_opcg7_b_o_aer(isz,ity,iph) )
2097 call set_1_rbox_aer_ptr( ibin, iopcg8_b_o_a, lptr_opcg8_b_o_aer(isz,ity,iph) )
2098 call set_1_rbox_aer_ptr( ibin, ipcg1_f_c_a, lptr_pcg1_f_c_aer( isz,ity,iph) )
2099 call set_1_rbox_aer_ptr( ibin, ipcg2_f_c_a, lptr_pcg2_f_c_aer( isz,ity,iph) )
2100 call set_1_rbox_aer_ptr( ibin, ipcg3_f_c_a, lptr_pcg3_f_c_aer( isz,ity,iph) )
2101 call set_1_rbox_aer_ptr( ibin, ipcg4_f_c_a, lptr_pcg4_f_c_aer( isz,ity,iph) )
2102 call set_1_rbox_aer_ptr( ibin, ipcg5_f_c_a, lptr_pcg5_f_c_aer( isz,ity,iph) )
2103 call set_1_rbox_aer_ptr( ibin, ipcg6_f_c_a, lptr_pcg6_f_c_aer( isz,ity,iph) )
2104 call set_1_rbox_aer_ptr( ibin, ipcg7_f_c_a, lptr_pcg7_f_c_aer( isz,ity,iph) )
2105 call set_1_rbox_aer_ptr( ibin, ipcg8_f_c_a, lptr_pcg8_f_c_aer( isz,ity,iph) )
2106 call set_1_rbox_aer_ptr( ibin, ipcg9_f_c_a, lptr_pcg9_f_c_aer( isz,ity,iph) )
2107 call set_1_rbox_aer_ptr( ibin, ipcg1_f_o_a, lptr_pcg1_f_o_aer( isz,ity,iph) )
2108 call set_1_rbox_aer_ptr( ibin, ipcg2_f_o_a, lptr_pcg2_f_o_aer( isz,ity,iph) )
2109 call set_1_rbox_aer_ptr( ibin, ipcg3_f_o_a, lptr_pcg3_f_o_aer( isz,ity,iph) )
2110 call set_1_rbox_aer_ptr( ibin, ipcg4_f_o_a, lptr_pcg4_f_o_aer( isz,ity,iph) )
2111 call set_1_rbox_aer_ptr( ibin, ipcg5_f_o_a, lptr_pcg5_f_o_aer( isz,ity,iph) )
2112 call set_1_rbox_aer_ptr( ibin, ipcg6_f_o_a, lptr_pcg6_f_o_aer( isz,ity,iph) )
2113 call set_1_rbox_aer_ptr( ibin, ipcg7_f_o_a, lptr_pcg7_f_o_aer( isz,ity,iph) )
2114 call set_1_rbox_aer_ptr( ibin, ipcg8_f_o_a, lptr_pcg8_f_o_aer( isz,ity,iph) )
2115 call set_1_rbox_aer_ptr( ibin, ipcg9_f_o_a, lptr_pcg9_f_o_aer( isz,ity,iph) )
2116 call set_1_rbox_aer_ptr( ibin, iopcg1_f_c_a, lptr_opcg1_f_c_aer(isz,ity,iph) )
2117 call set_1_rbox_aer_ptr( ibin, iopcg2_f_c_a, lptr_opcg2_f_c_aer(isz,ity,iph) )
2118 call set_1_rbox_aer_ptr( ibin, iopcg3_f_c_a, lptr_opcg3_f_c_aer(isz,ity,iph) )
2119 call set_1_rbox_aer_ptr( ibin, iopcg4_f_c_a, lptr_opcg4_f_c_aer(isz,ity,iph) )
2120 call set_1_rbox_aer_ptr( ibin, iopcg5_f_c_a, lptr_opcg5_f_c_aer(isz,ity,iph) )
2121 call set_1_rbox_aer_ptr( ibin, iopcg6_f_c_a, lptr_opcg6_f_c_aer(isz,ity,iph) )
2122 call set_1_rbox_aer_ptr( ibin, iopcg7_f_c_a, lptr_opcg7_f_c_aer(isz,ity,iph) )
2123 call set_1_rbox_aer_ptr( ibin, iopcg8_f_c_a, lptr_opcg8_f_c_aer(isz,ity,iph) )
2124 call set_1_rbox_aer_ptr( ibin, iopcg1_f_o_a, lptr_opcg1_f_o_aer(isz,ity,iph) )
2125 call set_1_rbox_aer_ptr( ibin, iopcg2_f_o_a, lptr_opcg2_f_o_aer(isz,ity,iph) )
2126 call set_1_rbox_aer_ptr( ibin, iopcg3_f_o_a, lptr_opcg3_f_o_aer(isz,ity,iph) )
2127 call set_1_rbox_aer_ptr( ibin, iopcg4_f_o_a, lptr_opcg4_f_o_aer(isz,ity,iph) )
2128 call set_1_rbox_aer_ptr( ibin, iopcg5_f_o_a, lptr_opcg5_f_o_aer(isz,ity,iph) )
2129 call set_1_rbox_aer_ptr( ibin, iopcg6_f_o_a, lptr_opcg6_f_o_aer(isz,ity,iph) )
2130 call set_1_rbox_aer_ptr( ibin, iopcg7_f_o_a, lptr_opcg7_f_o_aer(isz,ity,iph) )
2131 call set_1_rbox_aer_ptr( ibin, iopcg8_f_o_a, lptr_opcg8_f_o_aer(isz,ity,iph) )
2132 call set_1_rbox_aer_ptr( ibin, iant1_c_a, lptr_ant1_c_aer( isz,ity,iph) )
2133 call set_1_rbox_aer_ptr( ibin, iant2_c_a, lptr_ant2_c_aer( isz,ity,iph) )
2134 call set_1_rbox_aer_ptr( ibin, iant3_c_a, lptr_ant3_c_aer( isz,ity,iph) )
2135 call set_1_rbox_aer_ptr( ibin, iant4_c_a, lptr_ant4_c_aer( isz,ity,iph) )
2136 call set_1_rbox_aer_ptr( ibin, iant1_o_a, lptr_ant1_o_aer( isz,ity,iph) )
2137 call set_1_rbox_aer_ptr( ibin, iant2_o_a, lptr_ant2_o_aer( isz,ity,iph) )
2138 call set_1_rbox_aer_ptr( ibin, iant3_o_a, lptr_ant3_o_aer( isz,ity,iph) )
2139 call set_1_rbox_aer_ptr( ibin, iant4_o_a, lptr_ant4_o_aer( isz,ity,iph) )
2140 call set_1_rbox_aer_ptr( ibin, ibiog1_c_a, lptr_biog1_c_aer( isz,ity,iph) )
2141 call set_1_rbox_aer_ptr( ibin, ibiog2_c_a, lptr_biog2_c_aer( isz,ity,iph) )
2142 call set_1_rbox_aer_ptr( ibin, ibiog3_c_a, lptr_biog3_c_aer( isz,ity,iph) )
2143 call set_1_rbox_aer_ptr( ibin, ibiog4_c_a, lptr_biog4_c_aer( isz,ity,iph) )
2144 call set_1_rbox_aer_ptr( ibin, ibiog1_o_a, lptr_biog1_o_aer( isz,ity,iph) )
2145 call set_1_rbox_aer_ptr( ibin, ibiog2_o_a, lptr_biog2_o_aer( isz,ity,iph) )
2146 call set_1_rbox_aer_ptr( ibin, ibiog3_o_a, lptr_biog3_o_aer( isz,ity,iph) )
2147 call set_1_rbox_aer_ptr( ibin, ibiog4_o_a, lptr_biog4_o_aer( isz,ity,iph) )
2148 call set_1_rbox_aer_ptr( ibin, ismpa_a, lptr_smpa_aer( isz,ity,iph) )
2149 call set_1_rbox_aer_ptr( ibin, ismpbb_a, lptr_smpbb_aer( isz,ity,iph) )
2150 ! call set_1_rbox_aer_ptr( ibin, iiepox_a, lptr_iepox_aer( isz,ity,iph) )
2151 ! call set_1_rbox_aer_ptr( ibin, igly_a, lptr_gly_aer( isz,ity,iph) )
2152 ! call set_1_rbox_aer_ptr( ibin, iiepoxos_a, lptr_iepoxos_aer( isz,ity,iph) )
2153 ! call set_1_rbox_aer_ptr( ibin, itetrol_a, lptr_tetrol_aer( isz,ity,iph) )
2154 ! call set_1_rbox_aer_ptr( ibin, itanv_a, lptr_tanv_aer( isz,ity,iph) )
2155 ! call set_1_rbox_aer_ptr( ibin, isopnv_a, lptr_sopnv_aer( isz,ity,iph) )
2156 ! call set_1_rbox_aer_ptr( ibin, iternv_a, lptr_ternv_aer( isz,ity,iph) )
2157 ! call set_1_rbox_aer_ptr( ibin, iseqnv_a, lptr_seqnv_aer( isz,ity,iph) )
2158 ! call set_1_rbox_aer_ptr( ibin, isianv_a, lptr_sianv_aer( isz,ity,iph) )
2162 write(*,'(/a)') 'set_rbox_aer_ptrs'
2166 if (iaer == -3) then
2168 else if (iaer == -2) then
2170 else if (iaer == -1) then
2172 else if (iaer == 0) then
2175 tmp_name = aer_name(iaer)
2177 l = rbox_aer_ptr(iaer,ibin)
2178 if ( (l < p1st) .or. (l > ntot_used) ) then
2179 rbox_aer_ptr(iaer,ibin) = -1
2180 if ( ibin <= 1 ) then
2181 write(*,'(2a,i4,i5,i7,2x,a)') 'rbox_aer_ptr ', tmp_name, ibin, iaer, -999
2183 if ( rbox_aer_ptr(iaer,ibin-1) > 0 ) &
2184 write(*,'(2a,i4,i5,i7,2x,a)') 'rbox_aer_ptr ', tmp_name, ibin, iaer, -999
2187 write(*,'(2a,i4,i5,i7,2x,a)') 'rbox_aer_ptr ', tmp_name, ibin, iaer, l, name_rbox(l)
2193 end subroutine set_rbox_aer_ptrs
2196 !-----------------------------------------------------------------------
2197 subroutine set_1_rbox_aer_ptr( ibin, iaer, laer )
2199 use module_data_mosaic_aero, only: naer, nbin_a_max
2201 use module_data_mosaic_asecthp, only: rbox_aer_ptr
2203 use module_data_mosaic_main, only: ntot_used
2205 use module_state_description, only: p1st => param_first_scalar
2208 integer, intent(in) :: ibin, iaer, laer
2210 if ( ibin < 1 .or. ibin > nbin_a_max) return
2211 if ( iaer < 1 .or. iaer > naer ) return
2212 if ( laer < p1st .or. laer > ntot_used ) return
2214 rbox_aer_ptr(iaer,ibin) = laer
2217 end subroutine set_1_rbox_aer_ptr
2220 !-----------------------------------------------------------------------
2221 subroutine mosaic2_set_massptr( chem_opt, lmax, lunerr )
2224 use module_data_mosaic_asecthp, only: &
2225 identical_comps_optaa, &
2227 maxd_acomp, maxd_asize, maxd_atype, maxd_aphase, &
2228 ncomp_aer, nsize_aer, ntype_aer, nphase_aer, &
2230 use module_peg_util, only: peg_error_fatal
2232 integer, intent(in) :: chem_opt, lmax, lunerr
2234 integer :: icomp, iphase, isize, itype, l, ntot, ntotsvaa, ntotsvbb
2235 character(len=40) :: chemname
2236 character(len=200) :: msg
2239 ! set massptr_aer values which point to aerosol species locations in the chem array
2240 massptr_aer(1:maxd_acomp,1:maxd_asize,1:maxd_atype,1:maxd_aphase) = -999888777
2241 ntotsvaa = -999888777 ; ntotsvbb = -999888777
2243 do itype = 1, ntype_aer
2245 do iphase = 1, nphase_aer
2247 do isize = 1, nsize_aer(itype)
2250 do icomp = 1, ncomp_aer(itype)
2251 call mosaic2_form_chemname( sname_aer(icomp,itype), isize, itype, iphase, lunerr, chemname )
2252 call mosaic2_find_chemname_in_table( chemname, l )
2256 write(msg,*) 'mosaic2_set_massptr error 1 - chemname, l, lmax = ', &
2258 call peg_error_fatal( lunerr, msg )
2261 massptr_aer(icomp,isize,itype,iphase) = l
2264 if ( itype == 1 .and. iphase == 1 .and. isize == 1 ) ntotsvaa = ntot
2265 if ( iphase == 1 .and. isize == 1 ) ntotsvbb = ntot
2267 ! check that all phases and sizes have the same number of species
2268 if (ntotsvbb /= ntot) then
2269 write(msg,*) 'mosaic2_set_massptr error 2 - itype, iphase, isize, ntotsvbb, ntot = ', &
2270 itype, iphase, isize, ntotsvbb, ntot
2271 call peg_error_fatal( lunerr, msg )
2274 if (identical_comps_optaa > 0) then
2275 ! check that all types have the same number of species
2276 if (ntotsvaa /= ntotsvbb) then
2277 write(msg,*) 'mosaic2_set_massptr error 3 - itype, iphase, isize, ntotsvaa, ntotsvbb = ', &
2278 itype, iphase, isize, ntotsvaa, ntotsvbb
2279 call peg_error_fatal( lunerr, msg )
2290 end subroutine mosaic2_set_massptr
2293 !-----------------------------------------------------------------------
2294 subroutine mosaic2_set_ncomp( chem_opt, lunerr )
2296 use module_data_mosaic_asecthp, only: &
2297 dens_aer, dens_mastercomp_aer, &
2298 hygro_aer, hygro_mastercomp_aer, &
2299 identical_comps_optaa, is_tracer_mastercomp_aer, &
2300 mastercompptr_aer, maxd_acomp, maxd_atype, &
2301 mw_aer, mw_mastercomp_aer, &
2302 name_aer, name_mastercomp_aer, &
2303 ncomp_aer, ncomp_plustracer_aer, &
2304 ntot_mastercomp_aer, ntype_aer, &
2305 sname_aer, sname_mastercomp_aer, &
2308 use module_peg_util, only: peg_error_fatal
2310 integer, intent(in) :: chem_opt, lunerr
2312 integer :: icomp, icompmc, ipass, itype, l
2313 character(len=40) :: chemname
2314 character(len=200) :: msg
2318 ! mastercompptr_aer, ncomp_aer, ncomp_plustracerl_aer
2319 ! name_aer, sname_aer, dens_aer, mw_aer, hygro_aer
2321 mastercompptr_aer(1:maxd_acomp,1:maxd_atype) = -999888777
2322 ncomp_aer(1:maxd_atype) = 0
2323 ncomp_plustracer_aer(1:maxd_atype) = 0
2325 name_aer( 1:maxd_acomp,1:maxd_atype) = 'empty'
2326 sname_aer(1:maxd_acomp,1:maxd_atype) = 'empty'
2328 dens_aer( 1:maxd_acomp,1:maxd_atype) = 1.0
2329 mw_aer( 1:maxd_acomp,1:maxd_atype) = 1.0
2330 hygro_aer(1:maxd_acomp,1:maxd_atype) = 1.0
2333 do itype = 1, ntype_aer
2339 do icompmc = 1, ntot_mastercomp_aer
2341 if (ipass == 1) then
2342 if ( is_tracer_mastercomp_aer(icompmc) .eqv. .true. ) cycle
2344 if ( is_tracer_mastercomp_aer(icompmc) .eqv. .false. ) cycle
2347 chemname = trim(sname_mastercomp_aer(icompmc)) // '_a01' // type_chars_aer(itype)
2348 call mosaic2_find_chemname_in_table( chemname, l )
2352 name_aer(icomp,itype) = name_mastercomp_aer(icompmc)
2353 sname_aer(icomp,itype) = sname_mastercomp_aer(icompmc)
2354 dens_aer(icomp,itype) = dens_mastercomp_aer(icompmc)
2355 mw_aer(icomp,itype) = mw_mastercomp_aer(icompmc)
2356 hygro_aer(icomp,itype) = hygro_mastercomp_aer(icompmc)
2360 if (ipass == 1) then
2361 ncomp_aer(itype) = icomp
2363 ncomp_plustracer_aer(itype) = icomp
2370 if (identical_comps_optaa > 0) then
2371 ! check that all types have the same number of species
2372 do itype = 2, ntype_aer
2373 do icomp = 1, max( ncomp_plustracer_aer(1), ncomp_plustracer_aer(itype) )
2374 if (mastercompptr_aer(icomp,1) /= mastercompptr_aer(icomp,itype)) then
2375 write(msg,*) 'mosaic2_set_ncomp error 1 - itype, icomp, mcompptr1, mcompptr2ntot = ', &
2376 itype, icomp, mastercompptr_aer(icomp,1), mastercompptr_aer(icomp,itype)
2377 call peg_error_fatal( lunerr, msg )
2384 end subroutine mosaic2_set_ncomp
2387 !-----------------------------------------------------------------------
2388 subroutine mosaic2_set_bin_sizes( chem_opt, lunerr )
2390 use module_data_mosaic_kind, only: r8
2391 use module_data_mosaic_asecthp, only: &
2392 dcen_sect, dcut_sect, dhi_sect, dlo_sect, &
2393 maxd_asize, maxd_atype, &
2394 nsize_aer, ntype_aer, &
2396 volumcen_sect, volumcut_sect, volumhi_sect, volumlo_sect
2397 use module_data_mosaic_constants, only: pi
2398 use module_peg_util, only: peg_error_fatal
2400 integer, intent(in) :: chem_opt, lunerr
2402 integer :: itype, n, nhi
2405 dlo_sect( 1:maxd_asize,1:maxd_atype) = 0.0
2406 dhi_sect( 1:maxd_asize,1:maxd_atype) = 0.0
2407 dcen_sect(1:maxd_asize,1:maxd_atype) = 0.0
2408 dcut_sect(0:maxd_asize,1:maxd_atype) = 0.0
2409 volumlo_sect( 1:maxd_asize,1:maxd_atype) = 0.0
2410 volumhi_sect( 1:maxd_asize,1:maxd_atype) = 0.0
2411 volumcen_sect(1:maxd_asize,1:maxd_atype) = 0.0
2412 volumcut_sect(0:maxd_asize,1:maxd_atype) = 0.0
2413 sigmag_aer(1:maxd_asize,1:maxd_atype) = 1.0
2415 do itype = 1, ntype_aer
2416 nhi = nsize_aer(itype)
2417 dlo_sect(1,itype) = 3.90625e-6_r8
2418 dhi_sect(nhi,itype) = 10.0e-4_r8
2420 tmpa = log( dhi_sect(nhi,itype)/dlo_sect(1,itype) ) / nhi
2422 dlo_sect(n,itype) = dlo_sect(1,itype) * exp( (n-1)*tmpa )
2423 dhi_sect(n-1,itype) = dlo_sect(n,itype)
2426 dcen_sect(n,itype) = sqrt( dlo_sect(n,itype)*dhi_sect(n,itype) )
2427 volumlo_sect(n,itype) = (pi/6.) * (dlo_sect(n,itype)**3)
2428 volumhi_sect(n,itype) = (pi/6.) * (dhi_sect(n,itype)**3)
2429 volumcen_sect(n,itype) = (pi/6.) * (dcen_sect(n,itype)**3)
2430 sigmag_aer(n,itype) = (dhi_sect(n,itype)/dlo_sect(n,itype))**0.289
2431 dcut_sect(n,itype) = dhi_sect(n,itype)
2432 volumcut_sect(n,itype) = volumhi_sect(n,itype)
2434 dcut_sect(0,itype) = dlo_sect(1,itype)
2435 volumcut_sect(0,itype) = volumlo_sect(1,itype)
2439 end subroutine mosaic2_set_bin_sizes
2442 !-----------------------------------------------------------------------
2443 subroutine mosaic2_set_nsize( chem_opt, lunerr )
2445 use module_data_mosaic_asecthp, only: &
2446 identical_sizes_optaa, &
2447 maxd_asize, nphase_aer, nsize_aer, ntype_aer
2448 use module_peg_util, only: peg_error_fatal
2450 integer, intent(in) :: chem_opt, lunerr
2452 integer :: iphase, isize, itype, l, nsizetmp
2453 character(len=40) :: chemname
2454 character(len=200) :: msg
2457 ! set number of size bins
2458 ! use the sulfate (so4) species for this
2459 do itype = 1, ntype_aer
2461 do iphase = 1, nphase_aer
2464 do isize = 1, maxd_asize+10
2465 call mosaic2_form_chemname( 'so4', isize, itype, iphase, lunerr, chemname )
2466 call mosaic2_find_chemname_in_table( chemname, l )
2468 nsizetmp = nsizetmp + 1
2471 if (iphase == 1) then
2472 nsize_aer(itype) = nsizetmp
2473 else if (nsize_aer(itype) /= nsizetmp) then
2474 write(msg,*) 'mosaic2_set_nsize error 1 - itype, iphase, nsize_aer, nsizetmp =', &
2475 itype, iphase, nsize_aer(itype), nsizetmp
2476 call peg_error_fatal( lunerr, msg )
2481 if ((nsize_aer(itype) < 1) .or. (nsize_aer(itype) > maxd_asize)) then
2482 write(msg,*) 'mosaic2_set_nsize error 2 - itype, nsize_aer, maxd_asize =', itype, nsize_aer(itype), maxd_asize
2483 call peg_error_fatal( lunerr, msg )
2486 if (identical_sizes_optaa > 0) then
2487 if (nsize_aer(itype) /= nsize_aer(1)) then
2488 write(msg,*) 'mosaic2_set_nsize error 3 - itype, nsize, nsize =', itype, nsize_aer(itype), nsize_aer(1)
2489 call peg_error_fatal( lunerr, msg )
2496 end subroutine mosaic2_set_nsize
2499 !-----------------------------------------------------------------------
2500 subroutine mosaic2_set_nphase( chem_opt, lunerr )
2502 use module_data_mosaic_asecthp, only: &
2503 ai_phase, cw_phase, ci_phase, &
2504 identical_phases_optaa, &
2505 maxd_aphase, nphase_aer, ntype_aer, &
2506 phase_chars_aer, type_chars_aer
2507 use module_peg_util, only: peg_error_fatal
2509 integer, intent(in) :: chem_opt, lunerr
2511 integer :: iphase, itype, l, nphasetmp
2512 character(len=40) :: chemname
2513 character(len=200) :: msg
2514 character(len=3) :: phase_chars_tmp
2518 ! nphase_aer = number of phases
2519 ! ai_phase, cw_phase, ...
2523 phase_chars_aer(1:maxd_aphase) = '_empty'
2525 do itype = 1, ntype_aer
2528 do iphase = 1, maxd_aphase
2529 if (iphase == 1) then
2530 phase_chars_tmp = '_a'
2531 else if (iphase == 2) then
2532 phase_chars_tmp = '_cw'
2533 else if (iphase == 3) then
2534 phase_chars_tmp = '_ci'
2538 chemname = 'so4' // trim(phase_chars_tmp) // '01' // type_chars_aer(1)
2539 call mosaic2_find_chemname_in_table( chemname, l )
2542 nphasetmp = nphasetmp + 1
2543 ! the only allowable phase combinations are [ai only], [ai and cw], [ai, cw, and ci]
2544 ! so at this point, nphasetmp and iphase should be
2545 if (nphasetmp /= iphase) then
2546 write(msg,*) 'mosaic2_set_nphase error - nphasetmp, iphase =', nphasetmp, iphase
2547 call peg_error_fatal( lunerr, msg )
2550 if (iphase == 1) then
2551 ai_phase = nphasetmp
2552 else if (iphase == 2) then
2553 cw_phase = nphasetmp
2555 else if (iphase == 3) then
2556 ci_phase = nphasetmp
2560 phase_chars_aer(iphase) = phase_chars_tmp
2563 if (itype == 1) then
2564 nphase_aer = nphasetmp
2565 if ((nphase_aer < 1) .or. (nphase_aer > maxd_aphase)) then
2566 write(msg,*) 'mosaic2_set_nphase error 1 - nphase_aer, maxd_aphase =', nphase_aer, maxd_aphase
2567 call peg_error_fatal( lunerr, msg )
2570 if (identical_phases_optaa > 0) then
2571 if (nphase_aer /= nphasetmp) then
2572 write(msg,*) 'mosaic2_set_nphase error 2 - iphase, nphase_aer, nphasetmp =', iphase, nphase_aer, nphasetmp
2573 call peg_error_fatal( lunerr, msg )
2581 end subroutine mosaic2_set_nphase
2584 !-----------------------------------------------------------------------
2585 subroutine mosaic2_set_ntype( chem_opt, lunerr )
2587 use module_data_mosaic_asecthp, only: maxd_atype, ntype_aer, type_chars_aer
2588 use module_peg_util, only: peg_error_fatal
2590 integer, intent(in) :: chem_opt, lunerr
2593 character(len=40) :: chemname
2594 character(len=200) :: msg
2596 ! set ntype_aer (the number of aerosol types)
2597 ! by checking for existence of species whose names are
2598 ! "so4_a01", "so4_a01_t02", "so4_a01_t03", "so4_a01_t04", ...
2601 if (itype == 1) then
2602 chemname = 'so4_a01'
2604 write( chemname, '(a,i2.2)' ) 'so4_a01_t', itype
2606 call mosaic2_find_chemname_in_table( chemname, l )
2611 if (ntype_aer < 1 .or. ntype_aer > maxd_atype) then
2612 write(msg,*) 'mosaic2_set_ntype error 1 - ' // &
2613 'ntype_aer, maxd_atype =', ntype_aer, maxd_atype
2614 call peg_error_fatal( lunerr, msg )
2617 ! set the type_chars_aer
2618 type_chars_aer(1:maxd_atype) = 'empty'
2619 do itype = 1, maxd_atype
2620 type_chars_aer(itype) = ' '
2621 if (itype == 1) cycle
2622 write(type_chars_aer(itype), '(a,i2.2)' ) '_t', itype
2626 end subroutine mosaic2_set_ntype
2629 !-----------------------------------------------------------------------
2630 subroutine mosaic2_set_3dbin_1dbin_ptrs( chem_opt, aer_extmix_opt, lunerr )
2632 ! set variables involving the bc mass fraction and kappa bins
2634 use module_data_mosaic_kind, only: r8
2635 use module_data_mosaic_asecthp, only: &
2636 ibin_of_isize_itype, isize_of_ibin, itype_of_ibin, &
2637 itype_of_itype_md1md2, itype_md1_of_itype, itype_md2_of_itype, &
2638 maxd_asize, maxd_atype, maxd_atype_md1, maxd_atype_md2, &
2639 nbin_a_max, nsize_aer, ntype_aer, ntype_md1_aer, ntype_md2_aer, &
2640 xcut_atype_md1, xcut_atype_md2
2642 use module_peg_util, only: peg_message, peg_error_fatal
2644 integer, intent(in) :: chem_opt, aer_extmix_opt, lunerr
2646 integer :: iok, isize, itype, it1, it2, n
2647 character(len=230) :: msg
2650 ! check for a valid external-mixing configuration
2652 if (ntype_aer == 1) then
2653 if ( aer_extmix_opt == 0 .or. aer_extmix_opt == 1 ) iok = 1
2654 else if (ntype_aer == 2) then
2655 if ( aer_extmix_opt == 2100 .or. aer_extmix_opt == 2101 .or. &
2656 aer_extmix_opt == 2200 .or. aer_extmix_opt == 2201 ) iok = 1
2657 else if (ntype_aer == 3) then
2658 if ( aer_extmix_opt == 3100 .or. aer_extmix_opt == 3101 .or. &
2659 aer_extmix_opt == 3200 .or. aer_extmix_opt == 3201 ) iok = 1
2660 else if (ntype_aer == 4) then
2661 if ( aer_extmix_opt == 4300 .or. aer_extmix_opt == 4301 ) iok = 1
2664 write(msg,*) 'mosaic2_set_3dbin_1dbin_ptrs error - ' // &
2665 'ntype_aer, aer_extmix_opt =', ntype_aer, aer_extmix_opt
2666 call peg_error_fatal( lunerr, msg )
2669 ! set number of bins and bin boundaries for the
2670 ! bc mass fraction (wbc) and kappa bins
2673 xcut_atype_md1(0:1) = (/ -0.10_r8, 1.10_r8 /)
2674 xcut_atype_md2(0:1) = (/ -0.10_r8, 5.10_r8 /)
2676 if ( ((aer_extmix_opt == 0) .and. (ntype_aer == 1)) .or. &
2677 ((aer_extmix_opt == 1) .and. (ntype_aer == 1)) ) then
2680 else if ( ((aer_extmix_opt == 2100) .and. (ntype_aer == 2)) .or. &
2681 ((aer_extmix_opt == 2101) .and. (ntype_aer == 2)) ) then ! 2 wbc bins
2683 xcut_atype_md1(0:2) = (/ -0.10_r8, 0.26_r8, 1.10_r8 /)
2685 else if ( ((aer_extmix_opt == 2200) .and. (ntype_aer == 2)) .or. &
2686 ((aer_extmix_opt == 2201) .and. (ntype_aer == 2)) ) then ! 2 kappa bins
2688 xcut_atype_md2(0:2) = (/ -0.10_r8, 0.20_r8, 5.10_r8 /)
2690 else if ( ((aer_extmix_opt == 3100) .and. (ntype_aer == 3)) .or. &
2691 ((aer_extmix_opt == 3101) .and. (ntype_aer == 3)) ) then ! 3 wbc bins
2693 xcut_atype_md1(0:3) = (/ -0.10_r8, 0.10_r8, 0.36_r8, 1.10_r8 /)
2695 else if ( ((aer_extmix_opt == 3200) .and. (ntype_aer == 3)) .or. &
2696 ((aer_extmix_opt == 3201) .and. (ntype_aer == 3)) ) then ! 3 kappa bins
2698 xcut_atype_md2(0:3) = (/ -0.10_r8, 0.06_r8, 0.20_r8, 5.10_r8 /)
2700 else if ( ((aer_extmix_opt == 4300) .and. (ntype_aer == 4)) .or. &
2701 ((aer_extmix_opt == 4301) .and. (ntype_aer == 4)) ) then ! 2 wbc and 2 kappa bins
2704 xcut_atype_md1(0:2) = (/ -0.10_r8, 0.30_r8, 1.10_r8 /)
2705 xcut_atype_md2(0:2) = (/ -0.10_r8, 0.10_r8, 5.10_r8 /)
2709 if ( ntype_md1_aer < 1 .or. ntype_md1_aer > maxd_atype_md1 ) then
2710 write(msg,*) 'mosaic2_set_3dbin_1dbin_ptrs error - ' // &
2711 'ntype_md1_aer, maxd_atype_md1 =', &
2712 ntype_md1_aer, maxd_atype_md1
2713 call peg_error_fatal( lunerr, msg )
2715 if ( ntype_md2_aer < 1 .or. ntype_md2_aer > maxd_atype_md2 ) then
2716 write(msg,*) 'mosaic2_set_3dbin_1dbin_ptrs error - ' // &
2717 'ntype_md2_aer, maxd_atype_md2 =', &
2718 ntype_md2_aer, maxd_atype_md2
2719 call peg_error_fatal( lunerr, msg )
2721 if ( ntype_md1_aer*ntype_md2_aer /= ntype_aer ) then
2722 write(msg,*) 'mosaic2_set_3dbin_1dbin_ptrs error - ' // &
2723 'ntype_md1_aer, ntype_md2_aer, ntype_aer =', ntype_md1_aer, ntype_md2_aer, ntype_aer
2724 call peg_error_fatal( lunerr, msg )
2727 ! for aer_extmix_opt = 2100, 2200, 3100, 3200, 4300 set xcut so that everything goes into bin 1
2728 if ((aer_extmix_opt >= 2000) .and. (mod(aer_extmix_opt,100) == 0)) then
2729 xcut_atype_md1(0:4) = (/ -0.10_r8, 1.10_r8, 2.10_r8, 3.10_r8, 4.10_r8 /)
2730 xcut_atype_md2(0:4) = (/ -0.10_r8, 5.10_r8, 6.10_r8, 7.10_r8, 8.10_r8 /)
2733 ! put values in the unused portions of the xcut
2734 do it1 = ntype_md1_aer+1, maxd_atype_md1
2735 xcut_atype_md1(it1) = xcut_atype_md1(it1-1) + 1.0_r8
2737 do it2 = ntype_md2_aer+1, maxd_atype_md2
2738 xcut_atype_md2(it2) = xcut_atype_md2(it2-1) + 1.0_r8
2741 ! set the 3d <--> 1d pointers
2742 ibin_of_isize_itype(1:maxd_asize,1:maxd_atype) = -999888777
2743 isize_of_ibin(1:nbin_a_max) = -999888777
2744 itype_of_ibin(1:nbin_a_max) = -999888777
2747 do itype = 1, ntype_aer
2748 do isize = 1, nsize_aer(itype)
2750 ibin_of_isize_itype(isize,itype) = n
2751 isize_of_ibin(n) = isize
2752 itype_of_ibin(n) = itype
2756 itype_of_itype_md1md2(1:maxd_atype_md1,1:maxd_atype_md2) = -999888777
2757 itype_md1_of_itype(1:maxd_atype) = -999888777
2758 itype_md2_of_itype(1:maxd_atype) = -999888777
2761 do it2 = 1, ntype_md2_aer
2762 do it1 = 1, ntype_md1_aer
2764 itype_of_itype_md1md2(it1,it2) = itype
2765 itype_md1_of_itype(itype) = it1
2766 itype_md2_of_itype(itype) = it2
2770 write(msg,'(a,3i10)') 'ntype_aer, ntype_md1_aer, ntype_md2_aer', &
2771 ntype_aer, ntype_md1_aer, ntype_md2_aer
2772 call peg_message( lunerr, msg )
2773 ! if maxd_atype_md2=20, the "msg" will be 224 characters long
2774 write(msg,'(a,1p,21e10.2)') 'xcut_atype_md1', xcut_atype_md1(0:min(maxd_atype_md1,20))
2775 call peg_message( lunerr, msg )
2776 write(msg,'(a,1p,21e10.2)') 'xcut_atype_md2', xcut_atype_md2(0:min(maxd_atype_md2,20))
2777 call peg_message( lunerr, msg )
2780 end subroutine mosaic2_set_3dbin_1dbin_ptrs
2783 !-----------------------------------------------------------------------
2784 subroutine mosaic2_form_chemname( sname, isize, itype, iphase, lunerr, chemname )
2786 use module_data_mosaic_asecthp, only: phase_chars_aer, type_chars_aer
2787 use module_peg_util, only: peg_error_fatal
2789 integer, intent(in) :: isize, itype, iphase, lunerr
2790 character(len=*), intent(in) :: sname
2791 character(len=*), intent(inout) :: chemname
2794 character(len=3) :: size_chars
2795 character(len=200) :: msg
2800 if ( isize < 1 .or. isize > 999 ) then
2802 else if (isize <= 99) then
2803 write(size_chars(1:2),'(i2.2)') isize
2805 write(size_chars(1:3),'(i3.3)') isize
2809 write(msg,*) 'mosaic2_form_chemname error 1 - sname, isize = ', trim(sname), isize
2810 call peg_error_fatal( lunerr, msg )
2813 chemname = trim(sname) // trim(phase_chars_aer(iphase)) // trim(size_chars) // type_chars_aer(itype)
2816 end subroutine mosaic2_form_chemname
2819 !-----------------------------------------------------------------------
2820 subroutine mosaic2_find_chemname_in_table( chemname, chemindx )
2822 use module_state_description, only: num_chem, param_first_scalar
2823 use module_scalar_tables, only: chem_dname_table
2825 integer, intent(out) :: chemindx
2826 character(len=*), intent(in) :: chemname
2831 do l = param_first_scalar, num_chem
2832 if (chem_dname_table(1,l) == chemname) then
2839 end subroutine mosaic2_find_chemname_in_table
2842 !-----------------------------------------------------------------------
2843 subroutine mosaic2_set_mastercomp
2845 use module_data_mosaic_asecthp
2850 ! set master aerosol chemical types
2852 name_mastercomp_aer( 1:maxd_acomp ) = 'empty'
2853 sname_mastercomp_aer(1:maxd_acomp ) = 'empty'
2854 dens_mastercomp_aer( 1:maxd_acomp ) = 1.0
2855 mw_mastercomp_aer( 1:maxd_acomp ) = 1.0
2856 hygro_mastercomp_aer(1:maxd_acomp ) = 0.0
2858 is_tracer_mastercomp_aer(1:maxd_acomp) = .false.
2861 !ntot_mastercomp_aer = 96 !czhao add dust or tr1r1-4
2862 ntot_mastercomp_aer = 109
2865 ! only need to set sname_mastercomp_aer if it differs from name_mastercomp_aer
2867 mastercompindx_so4_aer = l
2868 name_mastercomp_aer( l ) = 'sulfate'
2869 sname_mastercomp_aer( l ) = 'so4'
2870 dens_mastercomp_aer( l ) = dens_so4_aer
2871 mw_mastercomp_aer( l ) = mw_so4_aer
2872 hygro_mastercomp_aer(l ) = hygro_so4_aer
2875 mastercompindx_no3_aer = l
2876 name_mastercomp_aer( l ) = 'nitrate'
2877 sname_mastercomp_aer( l ) = 'no3'
2878 dens_mastercomp_aer( l ) = dens_no3_aer
2879 mw_mastercomp_aer( l ) = mw_no3_aer
2880 hygro_mastercomp_aer(l ) = hygro_no3_aer
2883 mastercompindx_cl_aer = l
2884 name_mastercomp_aer( l ) = 'chloride'
2885 sname_mastercomp_aer( l ) = 'cl'
2886 dens_mastercomp_aer( l ) = dens_cl_aer
2887 mw_mastercomp_aer( l ) = mw_cl_aer
2888 hygro_mastercomp_aer(l ) = hygro_cl_aer
2891 mastercompindx_msa_aer = l
2892 name_mastercomp_aer( l ) = 'msa'
2893 dens_mastercomp_aer( l ) = dens_msa_aer
2894 mw_mastercomp_aer( l ) = mw_msa_aer
2895 hygro_mastercomp_aer(l ) = hygro_msa_aer
2898 mastercompindx_co3_aer = l
2899 name_mastercomp_aer( l ) = 'carbonate'
2900 sname_mastercomp_aer( l ) = 'co3'
2901 dens_mastercomp_aer( l ) = dens_co3_aer
2902 mw_mastercomp_aer( l ) = mw_co3_aer
2903 hygro_mastercomp_aer(l ) = hygro_co3_aer
2906 mastercompindx_nh4_aer = l
2907 name_mastercomp_aer( l ) = 'ammonium'
2908 sname_mastercomp_aer( l ) = 'nh4'
2909 dens_mastercomp_aer( l ) = dens_nh4_aer
2910 mw_mastercomp_aer( l ) = mw_nh4_aer
2911 hygro_mastercomp_aer(l ) = hygro_nh4_aer
2914 mastercompindx_na_aer = l
2915 name_mastercomp_aer( l ) = 'sodium'
2916 sname_mastercomp_aer( l ) = 'na'
2917 dens_mastercomp_aer( l ) = dens_na_aer
2918 mw_mastercomp_aer( l ) = mw_na_aer
2919 hygro_mastercomp_aer(l ) = hygro_na_aer
2922 mastercompindx_ca_aer = l
2923 name_mastercomp_aer( l ) = 'calcium'
2924 sname_mastercomp_aer( l ) = 'ca'
2925 dens_mastercomp_aer( l ) = dens_ca_aer
2926 mw_mastercomp_aer( l ) = mw_ca_aer
2927 hygro_mastercomp_aer(l ) = hygro_ca_aer
2930 mastercompindx_oin_aer = l
2931 name_mastercomp_aer( l ) = 'otherinorg'
2932 sname_mastercomp_aer( l ) = 'oin'
2933 dens_mastercomp_aer( l ) = dens_oin_aer
2934 mw_mastercomp_aer( l ) = mw_oin_aer
2935 hygro_mastercomp_aer(l ) = hygro_oin_aer
2938 ! mastercompindx_dust_aer = l
2939 ! name_mastercomp_aer( l ) = 'dust'
2940 ! dens_mastercomp_aer( l ) = dens_dust_aer
2941 ! mw_mastercomp_aer( l ) = mw_dust_aer
2942 ! hygro_mastercomp_aer(l ) = hygro_dust_aer
2945 mastercompindx_oc_aer = l
2946 name_mastercomp_aer( l ) = 'organic-c'
2947 sname_mastercomp_aer( l ) = 'oc'
2948 dens_mastercomp_aer( l ) = dens_oc_aer
2949 mw_mastercomp_aer( l ) = mw_oc_aer
2950 hygro_mastercomp_aer(l ) = hygro_oc_aer
2953 mastercompindx_bc_aer = l
2954 name_mastercomp_aer( l ) = 'black-c'
2955 sname_mastercomp_aer( l ) = 'bc'
2956 dens_mastercomp_aer( l ) = dens_bc_aer
2957 mw_mastercomp_aer( l ) = mw_bc_aer
2958 hygro_mastercomp_aer(l ) = hygro_bc_aer
2961 mastercompindx_pcg1_b_c_aer = l
2962 name_mastercomp_aer( l ) = 'pcg1_b_c'
2963 dens_mastercomp_aer( l ) = dens_pcg1_b_c_aer
2964 mw_mastercomp_aer( l ) = mw_pcg1_b_c_aer
2965 hygro_mastercomp_aer(l ) = hygro_pcg1_b_c_aer
2968 mastercompindx_pcg2_b_c_aer = l
2969 name_mastercomp_aer( l ) = 'pcg2_b_c'
2970 dens_mastercomp_aer( l ) = dens_pcg2_b_c_aer
2971 mw_mastercomp_aer( l ) = mw_pcg2_b_c_aer
2972 hygro_mastercomp_aer(l ) = hygro_pcg2_b_c_aer
2975 mastercompindx_pcg3_b_c_aer = l
2976 name_mastercomp_aer( l ) = 'pcg3_b_c'
2977 dens_mastercomp_aer( l ) = dens_pcg3_b_c_aer
2978 mw_mastercomp_aer( l ) = mw_pcg3_b_c_aer
2979 hygro_mastercomp_aer(l ) = hygro_pcg3_b_c_aer
2982 mastercompindx_pcg4_b_c_aer = l
2983 name_mastercomp_aer( l ) = 'pcg4_b_c'
2984 dens_mastercomp_aer( l ) = dens_pcg4_b_c_aer
2985 mw_mastercomp_aer( l ) = mw_pcg4_b_c_aer
2986 hygro_mastercomp_aer(l ) = hygro_pcg4_b_c_aer
2989 mastercompindx_pcg5_b_c_aer = l
2990 name_mastercomp_aer( l ) = 'pcg5_b_c'
2991 dens_mastercomp_aer( l ) = dens_pcg5_b_c_aer
2992 mw_mastercomp_aer( l ) = mw_pcg5_b_c_aer
2993 hygro_mastercomp_aer(l ) = hygro_pcg5_b_c_aer
2996 mastercompindx_pcg6_b_c_aer = l
2997 name_mastercomp_aer( l ) = 'pcg6_b_c'
2998 dens_mastercomp_aer( l ) = dens_pcg6_b_c_aer
2999 mw_mastercomp_aer( l ) = mw_pcg6_b_c_aer
3000 hygro_mastercomp_aer(l ) = hygro_pcg6_b_c_aer
3003 mastercompindx_pcg7_b_c_aer = l
3004 name_mastercomp_aer( l ) = 'pcg7_b_c'
3005 dens_mastercomp_aer( l ) = dens_pcg7_b_c_aer
3006 mw_mastercomp_aer( l ) = mw_pcg7_b_c_aer
3007 hygro_mastercomp_aer(l ) = hygro_pcg7_b_c_aer
3010 mastercompindx_pcg8_b_c_aer = l
3011 name_mastercomp_aer( l ) = 'pcg8_b_c'
3012 dens_mastercomp_aer( l ) = dens_pcg8_b_c_aer
3013 mw_mastercomp_aer( l ) = mw_pcg8_b_c_aer
3014 hygro_mastercomp_aer(l ) = hygro_pcg8_b_c_aer
3017 mastercompindx_pcg9_b_c_aer = l
3018 name_mastercomp_aer( l ) = 'pcg9_b_c'
3019 dens_mastercomp_aer( l ) = dens_pcg9_b_c_aer
3020 mw_mastercomp_aer( l ) = mw_pcg9_b_c_aer
3021 hygro_mastercomp_aer(l ) = hygro_pcg9_b_c_aer
3024 mastercompindx_pcg1_b_o_aer = l
3025 name_mastercomp_aer( l ) = 'pcg1_b_o'
3026 dens_mastercomp_aer( l ) = dens_pcg1_b_o_aer
3027 mw_mastercomp_aer( l ) = mw_pcg1_b_o_aer
3028 hygro_mastercomp_aer(l ) = hygro_pcg1_b_o_aer
3031 mastercompindx_pcg2_b_o_aer = l
3032 name_mastercomp_aer( l ) = 'pcg2_b_o'
3033 dens_mastercomp_aer( l ) = dens_pcg2_b_o_aer
3034 mw_mastercomp_aer( l ) = mw_pcg2_b_o_aer
3035 hygro_mastercomp_aer(l ) = hygro_pcg2_b_o_aer
3038 mastercompindx_pcg3_b_o_aer = l
3039 name_mastercomp_aer( l ) = 'pcg3_b_o'
3040 dens_mastercomp_aer( l ) = dens_pcg3_b_o_aer
3041 mw_mastercomp_aer( l ) = mw_pcg3_b_o_aer
3042 hygro_mastercomp_aer(l ) = hygro_pcg3_b_o_aer
3045 mastercompindx_pcg4_b_o_aer = l
3046 name_mastercomp_aer( l ) = 'pcg4_b_o'
3047 dens_mastercomp_aer( l ) = dens_pcg4_b_o_aer
3048 mw_mastercomp_aer( l ) = mw_pcg4_b_o_aer
3049 hygro_mastercomp_aer(l ) = hygro_pcg4_b_o_aer
3052 mastercompindx_pcg5_b_o_aer = l
3053 name_mastercomp_aer( l ) = 'pcg5_b_o'
3054 dens_mastercomp_aer( l ) = dens_pcg5_b_o_aer
3055 mw_mastercomp_aer( l ) = mw_pcg5_b_o_aer
3056 hygro_mastercomp_aer(l ) = hygro_pcg5_b_o_aer
3059 mastercompindx_pcg6_b_o_aer = l
3060 name_mastercomp_aer( l ) = 'pcg6_b_o'
3061 dens_mastercomp_aer( l ) = dens_pcg6_b_o_aer
3062 mw_mastercomp_aer( l ) = mw_pcg6_b_o_aer
3063 hygro_mastercomp_aer(l ) = hygro_pcg6_b_o_aer
3066 mastercompindx_pcg7_b_o_aer = l
3067 name_mastercomp_aer( l ) = 'pcg7_b_o'
3068 dens_mastercomp_aer( l ) = dens_pcg7_b_o_aer
3069 mw_mastercomp_aer( l ) = mw_pcg7_b_o_aer
3070 hygro_mastercomp_aer(l ) = hygro_pcg7_b_o_aer
3073 mastercompindx_pcg8_b_o_aer = l
3074 name_mastercomp_aer( l ) = 'pcg8_b_o'
3075 dens_mastercomp_aer( l ) = dens_pcg8_b_o_aer
3076 mw_mastercomp_aer( l ) = mw_pcg8_b_o_aer
3077 hygro_mastercomp_aer(l ) = hygro_pcg8_b_o_aer
3080 mastercompindx_pcg9_b_o_aer = l
3081 name_mastercomp_aer( l ) = 'pcg9_b_o'
3082 dens_mastercomp_aer( l ) = dens_pcg9_b_o_aer
3083 mw_mastercomp_aer( l ) = mw_pcg9_b_o_aer
3084 hygro_mastercomp_aer(l ) = hygro_pcg9_b_o_aer
3087 mastercompindx_opcg1_b_c_aer = l
3088 name_mastercomp_aer( l ) = 'opcg1_b_c'
3089 dens_mastercomp_aer( l ) = dens_opcg1_b_c_aer
3090 mw_mastercomp_aer( l ) = mw_opcg1_b_c_aer
3091 hygro_mastercomp_aer(l ) = hygro_opcg1_b_c_aer
3094 mastercompindx_opcg2_b_c_aer = l
3095 name_mastercomp_aer( l ) = 'opcg2_b_c'
3096 dens_mastercomp_aer( l ) = dens_opcg2_b_c_aer
3097 mw_mastercomp_aer( l ) = mw_opcg2_b_c_aer
3098 hygro_mastercomp_aer(l ) = hygro_opcg2_b_c_aer
3101 mastercompindx_opcg3_b_c_aer = l
3102 name_mastercomp_aer( l ) = 'opcg3_b_c'
3103 dens_mastercomp_aer( l ) = dens_opcg3_b_c_aer
3104 mw_mastercomp_aer( l ) = mw_opcg3_b_c_aer
3105 hygro_mastercomp_aer(l ) = hygro_opcg3_b_c_aer
3108 mastercompindx_opcg4_b_c_aer = l
3109 name_mastercomp_aer( l ) = 'opcg4_b_c'
3110 dens_mastercomp_aer( l ) = dens_opcg4_b_c_aer
3111 mw_mastercomp_aer( l ) = mw_opcg4_b_c_aer
3112 hygro_mastercomp_aer(l ) = hygro_opcg4_b_c_aer
3115 mastercompindx_opcg5_b_c_aer = l
3116 name_mastercomp_aer( l ) = 'opcg5_b_c'
3117 dens_mastercomp_aer( l ) = dens_opcg5_b_c_aer
3118 mw_mastercomp_aer( l ) = mw_opcg5_b_c_aer
3119 hygro_mastercomp_aer(l ) = hygro_opcg5_b_c_aer
3122 mastercompindx_opcg6_b_c_aer = l
3123 name_mastercomp_aer( l ) = 'opcg6_b_c'
3124 dens_mastercomp_aer( l ) = dens_opcg6_b_c_aer
3125 mw_mastercomp_aer( l ) = mw_opcg6_b_c_aer
3126 hygro_mastercomp_aer(l ) = hygro_opcg6_b_c_aer
3129 mastercompindx_opcg7_b_c_aer = l
3130 name_mastercomp_aer( l ) = 'opcg7_b_c'
3131 dens_mastercomp_aer( l ) = dens_opcg7_b_c_aer
3132 mw_mastercomp_aer( l ) = mw_opcg7_b_c_aer
3133 hygro_mastercomp_aer(l ) = hygro_opcg7_b_c_aer
3136 mastercompindx_opcg8_b_c_aer = l
3137 name_mastercomp_aer( l ) = 'opcg8_b_c'
3138 dens_mastercomp_aer( l ) = dens_opcg8_b_c_aer
3139 mw_mastercomp_aer( l ) = mw_opcg8_b_c_aer
3140 hygro_mastercomp_aer(l ) = hygro_opcg8_b_c_aer
3143 mastercompindx_opcg1_b_o_aer = l
3144 name_mastercomp_aer( l ) = 'opcg1_b_o'
3145 dens_mastercomp_aer( l ) = dens_opcg1_b_o_aer
3146 mw_mastercomp_aer( l ) = mw_opcg1_b_o_aer
3147 hygro_mastercomp_aer(l ) = hygro_opcg1_b_o_aer
3150 mastercompindx_opcg2_b_o_aer = l
3151 name_mastercomp_aer( l ) = 'opcg2_b_o'
3152 dens_mastercomp_aer( l ) = dens_opcg2_b_o_aer
3153 mw_mastercomp_aer( l ) = mw_opcg2_b_o_aer
3154 hygro_mastercomp_aer(l ) = hygro_opcg2_b_o_aer
3157 mastercompindx_opcg3_b_o_aer = l
3158 name_mastercomp_aer( l ) = 'opcg3_b_o'
3159 dens_mastercomp_aer( l ) = dens_opcg3_b_o_aer
3160 mw_mastercomp_aer( l ) = mw_opcg3_b_o_aer
3161 hygro_mastercomp_aer(l ) = hygro_opcg3_b_o_aer
3164 mastercompindx_opcg4_b_o_aer = l
3165 name_mastercomp_aer( l ) = 'opcg4_b_o'
3166 dens_mastercomp_aer( l ) = dens_opcg4_b_o_aer
3167 mw_mastercomp_aer( l ) = mw_opcg4_b_o_aer
3168 hygro_mastercomp_aer(l ) = hygro_opcg4_b_o_aer
3171 mastercompindx_opcg5_b_o_aer = l
3172 name_mastercomp_aer( l ) = 'opcg5_b_o'
3173 dens_mastercomp_aer( l ) = dens_opcg5_b_o_aer
3174 mw_mastercomp_aer( l ) = mw_opcg5_b_o_aer
3175 hygro_mastercomp_aer(l ) = hygro_opcg5_b_o_aer
3178 mastercompindx_opcg6_b_o_aer = l
3179 name_mastercomp_aer( l ) = 'opcg6_b_o'
3180 dens_mastercomp_aer( l ) = dens_opcg6_b_o_aer
3181 mw_mastercomp_aer( l ) = mw_opcg6_b_o_aer
3182 hygro_mastercomp_aer(l ) = hygro_opcg6_b_o_aer
3185 mastercompindx_opcg7_b_o_aer = l
3186 name_mastercomp_aer( l ) = 'opcg7_b_o'
3187 dens_mastercomp_aer( l ) = dens_opcg7_b_o_aer
3188 mw_mastercomp_aer( l ) = mw_opcg7_b_o_aer
3189 hygro_mastercomp_aer(l ) = hygro_opcg7_b_o_aer
3192 mastercompindx_opcg8_b_o_aer = l
3193 name_mastercomp_aer( l ) = 'opcg8_b_o'
3194 dens_mastercomp_aer( l ) = dens_opcg8_b_o_aer
3195 mw_mastercomp_aer( l ) = mw_opcg8_b_o_aer
3196 hygro_mastercomp_aer(l ) = hygro_opcg8_b_o_aer
3199 mastercompindx_pcg1_f_c_aer = l
3200 name_mastercomp_aer( l ) = 'pcg1_f_c'
3201 dens_mastercomp_aer( l ) = dens_pcg1_f_c_aer
3202 mw_mastercomp_aer( l ) = mw_pcg1_f_c_aer
3203 hygro_mastercomp_aer(l ) = hygro_pcg1_f_c_aer
3206 mastercompindx_pcg2_f_c_aer = l
3207 name_mastercomp_aer( l ) = 'pcg2_f_c'
3208 dens_mastercomp_aer( l ) = dens_pcg2_f_c_aer
3209 mw_mastercomp_aer( l ) = mw_pcg2_f_c_aer
3210 hygro_mastercomp_aer(l ) = hygro_pcg2_f_c_aer
3213 mastercompindx_pcg3_f_c_aer = l
3214 name_mastercomp_aer( l ) = 'pcg3_f_c'
3215 dens_mastercomp_aer( l ) = dens_pcg3_f_c_aer
3216 mw_mastercomp_aer( l ) = mw_pcg3_f_c_aer
3217 hygro_mastercomp_aer(l ) = hygro_pcg3_f_c_aer
3220 mastercompindx_pcg4_f_c_aer = l
3221 name_mastercomp_aer( l ) = 'pcg4_f_c'
3222 dens_mastercomp_aer( l ) = dens_pcg4_f_c_aer
3223 mw_mastercomp_aer( l ) = mw_pcg4_f_c_aer
3224 hygro_mastercomp_aer(l ) = hygro_pcg4_f_c_aer
3227 mastercompindx_pcg5_f_c_aer = l
3228 name_mastercomp_aer( l ) = 'pcg5_f_c'
3229 dens_mastercomp_aer( l ) = dens_pcg5_f_c_aer
3230 mw_mastercomp_aer( l ) = mw_pcg5_f_c_aer
3231 hygro_mastercomp_aer(l ) = hygro_pcg5_f_c_aer
3234 mastercompindx_pcg6_f_c_aer = l
3235 name_mastercomp_aer( l ) = 'pcg6_f_c'
3236 dens_mastercomp_aer( l ) = dens_pcg6_f_c_aer
3237 mw_mastercomp_aer( l ) = mw_pcg6_f_c_aer
3238 hygro_mastercomp_aer(l ) = hygro_pcg6_f_c_aer
3241 mastercompindx_pcg7_f_c_aer = l
3242 name_mastercomp_aer( l ) = 'pcg7_f_c'
3243 dens_mastercomp_aer( l ) = dens_pcg7_f_c_aer
3244 mw_mastercomp_aer( l ) = mw_pcg7_f_c_aer
3245 hygro_mastercomp_aer(l ) = hygro_pcg7_f_c_aer
3248 mastercompindx_pcg8_f_c_aer = l
3249 name_mastercomp_aer( l ) = 'pcg8_f_c'
3250 dens_mastercomp_aer( l ) = dens_pcg8_f_c_aer
3251 mw_mastercomp_aer( l ) = mw_pcg8_f_c_aer
3252 hygro_mastercomp_aer(l ) = hygro_pcg8_f_c_aer
3255 mastercompindx_pcg9_f_c_aer = l
3256 name_mastercomp_aer( l ) = 'pcg9_f_c'
3257 dens_mastercomp_aer( l ) = dens_pcg9_f_c_aer
3258 mw_mastercomp_aer( l ) = mw_pcg9_f_c_aer
3259 hygro_mastercomp_aer(l ) = hygro_pcg9_f_c_aer
3262 mastercompindx_pcg1_f_o_aer = l
3263 name_mastercomp_aer( l ) = 'pcg1_f_o'
3264 dens_mastercomp_aer( l ) = dens_pcg1_f_o_aer
3265 mw_mastercomp_aer( l ) = mw_pcg1_f_o_aer
3266 hygro_mastercomp_aer(l ) = hygro_pcg1_f_o_aer
3269 mastercompindx_pcg2_f_o_aer = l
3270 name_mastercomp_aer( l ) = 'pcg2_f_o'
3271 dens_mastercomp_aer( l ) = dens_pcg2_f_o_aer
3272 mw_mastercomp_aer( l ) = mw_pcg2_f_o_aer
3273 hygro_mastercomp_aer(l ) = hygro_pcg2_f_o_aer
3276 mastercompindx_pcg3_f_o_aer = l
3277 name_mastercomp_aer( l ) = 'pcg3_f_o'
3278 dens_mastercomp_aer( l ) = dens_pcg3_f_o_aer
3279 mw_mastercomp_aer( l ) = mw_pcg3_f_o_aer
3280 hygro_mastercomp_aer(l ) = hygro_pcg3_f_o_aer
3283 mastercompindx_pcg4_f_o_aer = l
3284 name_mastercomp_aer( l ) = 'pcg4_f_o'
3285 dens_mastercomp_aer( l ) = dens_pcg4_f_o_aer
3286 mw_mastercomp_aer( l ) = mw_pcg4_f_o_aer
3287 hygro_mastercomp_aer(l ) = hygro_pcg4_f_o_aer
3290 mastercompindx_pcg5_f_o_aer = l
3291 name_mastercomp_aer( l ) = 'pcg5_f_o'
3292 dens_mastercomp_aer( l ) = dens_pcg5_f_o_aer
3293 mw_mastercomp_aer( l ) = mw_pcg5_f_o_aer
3294 hygro_mastercomp_aer(l ) = hygro_pcg5_f_o_aer
3297 mastercompindx_pcg6_f_o_aer = l
3298 name_mastercomp_aer( l ) = 'pcg6_f_o'
3299 dens_mastercomp_aer( l ) = dens_pcg6_f_o_aer
3300 mw_mastercomp_aer( l ) = mw_pcg6_f_o_aer
3301 hygro_mastercomp_aer(l ) = hygro_pcg6_f_o_aer
3304 mastercompindx_pcg7_f_o_aer = l
3305 name_mastercomp_aer( l ) = 'pcg7_f_o'
3306 dens_mastercomp_aer( l ) = dens_pcg7_f_o_aer
3307 mw_mastercomp_aer( l ) = mw_pcg7_f_o_aer
3308 hygro_mastercomp_aer(l ) = hygro_pcg7_f_o_aer
3311 mastercompindx_pcg8_f_o_aer = l
3312 name_mastercomp_aer( l ) = 'pcg8_f_o'
3313 dens_mastercomp_aer( l ) = dens_pcg8_f_o_aer
3314 mw_mastercomp_aer( l ) = mw_pcg8_f_o_aer
3315 hygro_mastercomp_aer(l ) = hygro_pcg8_f_o_aer
3318 mastercompindx_pcg9_f_o_aer = l
3319 name_mastercomp_aer( l ) = 'pcg9_f_o'
3320 dens_mastercomp_aer( l ) = dens_pcg9_f_o_aer
3321 mw_mastercomp_aer( l ) = mw_pcg9_f_o_aer
3322 hygro_mastercomp_aer(l ) = hygro_pcg9_f_o_aer
3325 mastercompindx_opcg1_f_c_aer = l
3326 name_mastercomp_aer( l ) = 'opcg1_f_c'
3327 dens_mastercomp_aer( l ) = dens_opcg1_f_c_aer
3328 mw_mastercomp_aer( l ) = mw_opcg1_f_c_aer
3329 hygro_mastercomp_aer(l ) = hygro_opcg1_f_c_aer
3332 mastercompindx_opcg2_f_c_aer = l
3333 name_mastercomp_aer( l ) = 'opcg2_f_c'
3334 dens_mastercomp_aer( l ) = dens_opcg2_f_c_aer
3335 mw_mastercomp_aer( l ) = mw_opcg2_f_c_aer
3336 hygro_mastercomp_aer(l ) = hygro_opcg2_f_c_aer
3339 mastercompindx_opcg3_f_c_aer = l
3340 name_mastercomp_aer( l ) = 'opcg3_f_c'
3341 dens_mastercomp_aer( l ) = dens_opcg3_f_c_aer
3342 mw_mastercomp_aer( l ) = mw_opcg3_f_c_aer
3343 hygro_mastercomp_aer(l ) = hygro_opcg3_f_c_aer
3346 mastercompindx_opcg4_f_c_aer = l
3347 name_mastercomp_aer( l ) = 'opcg4_f_c'
3348 dens_mastercomp_aer( l ) = dens_opcg4_f_c_aer
3349 mw_mastercomp_aer( l ) = mw_opcg4_f_c_aer
3350 hygro_mastercomp_aer(l ) = hygro_opcg4_f_c_aer
3353 mastercompindx_opcg5_f_c_aer = l
3354 name_mastercomp_aer( l ) = 'opcg5_f_c'
3355 dens_mastercomp_aer( l ) = dens_opcg5_f_c_aer
3356 mw_mastercomp_aer( l ) = mw_opcg5_f_c_aer
3357 hygro_mastercomp_aer(l ) = hygro_opcg5_f_c_aer
3360 mastercompindx_opcg6_f_c_aer = l
3361 name_mastercomp_aer( l ) = 'opcg6_f_c'
3362 dens_mastercomp_aer( l ) = dens_opcg6_f_c_aer
3363 mw_mastercomp_aer( l ) = mw_opcg6_f_c_aer
3364 hygro_mastercomp_aer(l ) = hygro_opcg6_f_c_aer
3367 mastercompindx_opcg7_f_c_aer = l
3368 name_mastercomp_aer( l ) = 'opcg7_f_c'
3369 dens_mastercomp_aer( l ) = dens_opcg7_f_c_aer
3370 mw_mastercomp_aer( l ) = mw_opcg7_f_c_aer
3371 hygro_mastercomp_aer(l ) = hygro_opcg7_f_c_aer
3374 mastercompindx_opcg8_f_c_aer = l
3375 name_mastercomp_aer( l ) = 'opcg8_f_c'
3376 dens_mastercomp_aer( l ) = dens_opcg8_f_c_aer
3377 mw_mastercomp_aer( l ) = mw_opcg8_f_c_aer
3378 hygro_mastercomp_aer(l ) = hygro_opcg8_f_c_aer
3381 mastercompindx_opcg1_f_o_aer = l
3382 name_mastercomp_aer( l ) = 'opcg1_f_o'
3383 dens_mastercomp_aer( l ) = dens_opcg1_f_o_aer
3384 mw_mastercomp_aer( l ) = mw_opcg1_f_o_aer
3385 hygro_mastercomp_aer(l ) = hygro_opcg1_f_o_aer
3388 mastercompindx_opcg2_f_o_aer = l
3389 name_mastercomp_aer( l ) = 'opcg2_f_o'
3390 dens_mastercomp_aer( l ) = dens_opcg2_f_o_aer
3391 mw_mastercomp_aer( l ) = mw_opcg2_f_o_aer
3392 hygro_mastercomp_aer(l ) = hygro_opcg2_f_o_aer
3395 mastercompindx_opcg3_f_o_aer = l
3396 name_mastercomp_aer( l ) = 'opcg3_f_o'
3397 dens_mastercomp_aer( l ) = dens_opcg3_f_o_aer
3398 mw_mastercomp_aer( l ) = mw_opcg3_f_o_aer
3399 hygro_mastercomp_aer(l ) = hygro_opcg3_f_o_aer
3402 mastercompindx_opcg4_f_o_aer = l
3403 name_mastercomp_aer( l ) = 'opcg4_f_o'
3404 dens_mastercomp_aer( l ) = dens_opcg4_f_o_aer
3405 mw_mastercomp_aer( l ) = mw_opcg4_f_o_aer
3406 hygro_mastercomp_aer(l ) = hygro_opcg4_f_o_aer
3409 mastercompindx_opcg5_f_o_aer = l
3410 name_mastercomp_aer( l ) = 'opcg5_f_o'
3411 dens_mastercomp_aer( l ) = dens_opcg5_f_o_aer
3412 mw_mastercomp_aer( l ) = mw_opcg5_f_o_aer
3413 hygro_mastercomp_aer(l ) = hygro_opcg5_f_o_aer
3416 mastercompindx_opcg6_f_o_aer = l
3417 name_mastercomp_aer( l ) = 'opcg6_f_o'
3418 dens_mastercomp_aer( l ) = dens_opcg6_f_o_aer
3419 mw_mastercomp_aer( l ) = mw_opcg6_f_o_aer
3420 hygro_mastercomp_aer(l ) = hygro_opcg6_f_o_aer
3423 mastercompindx_opcg7_f_o_aer = l
3424 name_mastercomp_aer( l ) = 'opcg7_f_o'
3425 dens_mastercomp_aer( l ) = dens_opcg7_f_o_aer
3426 mw_mastercomp_aer( l ) = mw_opcg7_f_o_aer
3427 hygro_mastercomp_aer(l ) = hygro_opcg7_f_o_aer
3430 mastercompindx_opcg8_f_o_aer = l
3431 name_mastercomp_aer( l ) = 'opcg8_f_o'
3432 dens_mastercomp_aer( l ) = dens_opcg8_f_o_aer
3433 mw_mastercomp_aer( l ) = mw_opcg8_f_o_aer
3434 hygro_mastercomp_aer(l ) = hygro_opcg8_f_o_aer
3437 mastercompindx_ant1_c_aer = l
3438 name_mastercomp_aer( l ) = 'ant1_c'
3439 dens_mastercomp_aer( l ) = dens_ant1_c_aer
3440 mw_mastercomp_aer( l ) = mw_ant1_c_aer
3441 hygro_mastercomp_aer(l ) = hygro_ant1_c_aer
3444 mastercompindx_ant2_c_aer = l
3445 name_mastercomp_aer( l ) = 'ant2_c'
3446 dens_mastercomp_aer( l ) = dens_ant2_c_aer
3447 mw_mastercomp_aer( l ) = mw_ant2_c_aer
3448 hygro_mastercomp_aer(l ) = hygro_ant2_c_aer
3451 mastercompindx_ant3_c_aer = l
3452 name_mastercomp_aer( l ) = 'ant3_c'
3453 dens_mastercomp_aer( l ) = dens_ant3_c_aer
3454 mw_mastercomp_aer( l ) = mw_ant3_c_aer
3455 hygro_mastercomp_aer(l ) = hygro_ant3_c_aer
3458 mastercompindx_ant4_c_aer = l
3459 name_mastercomp_aer( l ) = 'ant4_c'
3460 dens_mastercomp_aer( l ) = dens_ant4_c_aer
3461 mw_mastercomp_aer( l ) = mw_ant4_c_aer
3462 hygro_mastercomp_aer(l ) = hygro_ant4_c_aer
3465 mastercompindx_ant1_o_aer = l
3466 name_mastercomp_aer( l ) = 'ant1_o'
3467 dens_mastercomp_aer( l ) = dens_ant1_o_aer
3468 mw_mastercomp_aer( l ) = mw_ant1_o_aer
3469 hygro_mastercomp_aer(l ) = hygro_ant1_o_aer
3472 mastercompindx_ant2_o_aer = l
3473 name_mastercomp_aer( l ) = 'ant2_o'
3474 dens_mastercomp_aer( l ) = dens_ant2_o_aer
3475 mw_mastercomp_aer( l ) = mw_ant2_o_aer
3476 hygro_mastercomp_aer(l ) = hygro_ant2_o_aer
3479 mastercompindx_ant3_o_aer = l
3480 name_mastercomp_aer( l ) = 'ant3_o'
3481 dens_mastercomp_aer( l ) = dens_ant3_o_aer
3482 mw_mastercomp_aer( l ) = mw_ant3_o_aer
3483 hygro_mastercomp_aer(l ) = hygro_ant3_o_aer
3486 mastercompindx_ant4_o_aer = l
3487 name_mastercomp_aer( l ) = 'ant4_o'
3488 dens_mastercomp_aer( l ) = dens_ant4_o_aer
3489 mw_mastercomp_aer( l ) = mw_ant4_o_aer
3490 hygro_mastercomp_aer(l ) = hygro_ant4_o_aer
3494 mastercompindx_biog1_c_aer = l
3495 name_mastercomp_aer( l ) = 'biog1_c'
3496 dens_mastercomp_aer( l ) = dens_biog1_c_aer
3497 mw_mastercomp_aer( l ) = mw_biog1_c_aer
3498 hygro_mastercomp_aer(l ) = hygro_biog1_c_aer
3501 mastercompindx_biog2_c_aer = l
3502 name_mastercomp_aer( l ) = 'biog2_c'
3503 dens_mastercomp_aer( l ) = dens_biog2_c_aer
3504 mw_mastercomp_aer( l ) = mw_biog2_c_aer
3505 hygro_mastercomp_aer(l ) = hygro_biog2_c_aer
3508 mastercompindx_biog3_c_aer = l
3509 name_mastercomp_aer( l ) = 'biog3_c'
3510 dens_mastercomp_aer( l ) = dens_biog3_c_aer
3511 mw_mastercomp_aer( l ) = mw_biog3_c_aer
3512 hygro_mastercomp_aer(l ) = hygro_biog3_c_aer
3515 mastercompindx_biog4_c_aer = l
3516 name_mastercomp_aer( l ) = 'biog4_c'
3517 dens_mastercomp_aer( l ) = dens_biog4_c_aer
3518 mw_mastercomp_aer( l ) = mw_biog4_c_aer
3519 hygro_mastercomp_aer(l ) = hygro_biog4_c_aer
3522 mastercompindx_biog1_o_aer = l
3523 name_mastercomp_aer( l ) = 'biog1_o'
3524 dens_mastercomp_aer( l ) = dens_biog1_o_aer
3525 mw_mastercomp_aer( l ) = mw_biog1_o_aer
3526 hygro_mastercomp_aer(l ) = hygro_biog1_o_aer
3529 mastercompindx_biog2_o_aer = l
3530 name_mastercomp_aer( l ) = 'biog2_o'
3531 dens_mastercomp_aer( l ) = dens_biog2_o_aer
3532 mw_mastercomp_aer( l ) = mw_biog2_o_aer
3533 hygro_mastercomp_aer(l ) = hygro_biog2_o_aer
3536 mastercompindx_biog3_o_aer = l
3537 name_mastercomp_aer( l ) = 'biog3_o'
3538 dens_mastercomp_aer( l ) = dens_biog3_o_aer
3539 mw_mastercomp_aer( l ) = mw_biog3_o_aer
3540 hygro_mastercomp_aer(l ) = hygro_biog3_o_aer
3543 mastercompindx_biog4_o_aer = l
3544 name_mastercomp_aer( l ) = 'biog4_o'
3545 dens_mastercomp_aer( l ) = dens_biog4_o_aer
3546 mw_mastercomp_aer( l ) = mw_biog4_o_aer
3547 hygro_mastercomp_aer(l ) = hygro_biog4_o_aer
3550 mastercompindx_smpa_aer = l
3551 name_mastercomp_aer( l ) = 'smpa'
3552 dens_mastercomp_aer( l ) = dens_smpa_aer
3553 mw_mastercomp_aer( l ) = mw_smpa_aer
3554 hygro_mastercomp_aer(l ) = hygro_smpa_aer
3557 mastercompindx_smpbb_aer = l
3558 name_mastercomp_aer( l ) = 'smpbb'
3559 dens_mastercomp_aer( l ) = dens_smpbb_aer
3560 mw_mastercomp_aer( l ) = mw_smpbb_aer
3561 hygro_mastercomp_aer(l ) = hygro_smpbb_aer
3564 ! mastercompindx_tr1r1_aer = l
3565 ! name_mastercomp_aer( l ) = 'tr1r1'
3566 ! dens_mastercomp_aer( l ) = dens_tr1r1_aer
3567 ! mw_mastercomp_aer( l ) = mw_tr1r1_aer
3568 ! hygro_mastercomp_aer(l ) = hygro_tr1r1_aer
3571 ! mastercompindx_tr1r2_aer = l
3572 ! name_mastercomp_aer( l ) = 'tr1r2'
3573 ! dens_mastercomp_aer( l ) = dens_tr1r2_aer
3574 ! mw_mastercomp_aer( l ) = mw_tr1r2_aer
3575 ! hygro_mastercomp_aer(l ) = hygro_tr1r2_aer
3578 ! mastercompindx_tr1r3_aer = l
3579 ! name_mastercomp_aer( l ) = 'tr1r3'
3580 ! dens_mastercomp_aer( l ) = dens_tr1r3_aer
3581 ! mw_mastercomp_aer( l ) = mw_tr1r3_aer
3582 ! hygro_mastercomp_aer(l ) = hygro_tr1r3_aer
3585 ! mastercompindx_tr1r4_aer = l
3586 ! name_mastercomp_aer( l ) = 'tr1r4'
3587 ! dens_mastercomp_aer( l ) = dens_tr1r4_aer
3588 ! mw_mastercomp_aer( l ) = mw_tr1r4_aer
3589 ! hygro_mastercomp_aer(l ) = hygro_tr1r4_aer
3592 ! mastercompindx_iepox_aer = l
3593 ! name_mastercomp_aer( l ) = 'iepox'
3594 ! dens_mastercomp_aer( l ) = dens_iepox_aer
3595 ! mw_mastercomp_aer( l ) = mw_iepox_aer
3596 ! hygro_mastercomp_aer(l ) = hygro_iepox_aer
3599 ! mastercompindx_iepoxos_aer = l
3600 ! name_mastercomp_aer( l ) = 'iepoxos'
3601 ! dens_mastercomp_aer( l ) = dens_iepoxos_aer
3602 ! mw_mastercomp_aer( l ) = mw_iepoxos_aer
3603 ! hygro_mastercomp_aer(l ) = hygro_iepoxos_aer
3606 ! mastercompindx_tetrol_aer = l
3607 ! name_mastercomp_aer( l ) = 'tetrol'
3608 ! dens_mastercomp_aer( l ) = dens_tetrol_aer
3609 ! mw_mastercomp_aer( l ) = mw_tetrol_aer
3610 ! hygro_mastercomp_aer(l ) = hygro_tetrol_aer
3613 ! mastercompindx_gly_aer = l
3614 ! name_mastercomp_aer( l ) = 'gly'
3615 ! dens_mastercomp_aer( l ) = dens_gly_aer
3616 ! mw_mastercomp_aer( l ) = mw_gly_aer
3617 ! hygro_mastercomp_aer(l ) = hygro_gly_aer
3620 ! mastercompindx_tanv_aer = l
3621 ! name_mastercomp_aer( l ) = 'tanv'
3622 ! dens_mastercomp_aer( l ) = dens_tanv_aer
3623 ! mw_mastercomp_aer( l ) = mw_tanv_aer
3624 ! hygro_mastercomp_aer(l ) = hygro_tanv_aer
3627 ! mastercompindx_sopnv_aer = l
3628 ! name_mastercomp_aer( l ) = 'sopnv'
3629 ! dens_mastercomp_aer( l ) = dens_sopnv_aer
3630 ! mw_mastercomp_aer( l ) = mw_sopnv_aer
3631 ! hygro_mastercomp_aer(l ) = hygro_sopnv_aer
3634 ! mastercompindx_ternv_aer = l
3635 ! name_mastercomp_aer( l ) = 'ternv'
3636 ! dens_mastercomp_aer( l ) = dens_ternv_aer
3637 ! mw_mastercomp_aer( l ) = mw_ternv_aer
3638 ! hygro_mastercomp_aer(l ) = hygro_ternv_aer
3641 ! mastercompindx_seqnv_aer = l
3642 ! name_mastercomp_aer( l ) = 'seqnv'
3643 ! dens_mastercomp_aer( l ) = dens_seqnv_aer
3644 ! mw_mastercomp_aer( l ) = mw_seqnv_aer
3645 ! hygro_mastercomp_aer(l ) = hygro_seqnv_aer
3648 ! mastercompindx_sianv_aer = l
3649 ! name_mastercomp_aer( l ) = 'sianv'
3650 ! dens_mastercomp_aer( l ) = dens_sianv_aer
3651 ! mw_mastercomp_aer( l ) = mw_sianv_aer
3652 ! hygro_mastercomp_aer(l ) = hygro_sianv_aer
3654 ! for any sname_mastercomp_aer that have not yet be set to something besides
3656 ! set them to name_mastercomp_aer
3657 do l = 1, ntot_mastercomp_aer
3658 if ( sname_mastercomp_aer( l ) == 'empty' ) &
3659 sname_mastercomp_aer( l ) = name_mastercomp_aer( l )
3663 end subroutine mosaic2_set_mastercomp
3667 !-----------------------------------------------------------------------
3668 end module module_mosaic2_driver