1 !************************************************************************
2 ! This computer software was prepared by Battelle Memorial Institute,
3 ! hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 with
4 ! the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE
5 ! CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
6 ! LIABILITY FOR THE USE OF THIS SOFTWARE.
8 ! MOSAIC module: see module_mosaic_driver.F for references and terms of
10 !************************************************************************
11 module module_mosaic_therm
15 use module_data_mosaic_therm
28 ! zz01aerchemistry.f (mosaic.28.0)
29 ! 5/21/2014 raz - updated subr. aerosol_phase_state and function aerosol_water.
30 ! All particles are forced to be metastable (or stable) for RH > 35%
31 ! OC (POA), SOA, OIN, BC are now included in water content calculation using kappa-Kohler theory.
32 ! The kappa values are hardcoded in function aerosol_water.
33 ! 11/13/2008 raz - updated calculation of "epercent" variable
34 ! 6/25/2008 raz - updated nh4no3 and nh4cl condensation algorithm
35 ! 30-apr-07 raz - made about a dozen changes/bug fixes. search for "raz-30apr07" to see the changes
36 ! 05-feb-07 wig - converted to double
37 ! 10-jan-07 raz - contains major revisions and updates. new module ASTEM replaces ASTEEM.
38 ! 04-aug-06 raz - fixed bugs in asteem_flux_mix_case3a and asteem_flux_mix_case3b
39 ! revised treatment of kelvin effect.
40 ! 06-jun-06 rce - changed dens_aer_mac(ica_a) & (ico3_a) from 2.5 to 2.6
41 ! 31-may-06 rce - got latest version from
42 ! nirvana:/home/zaveri/rahul/pegasus/pegasus.3.1.1/src
43 ! in subr map_mosaic_species, turned off mapping
45 ! 18-may-06 raz - major revisions in asteem and minor changes in mesa
46 ! 22-jan-06 raz - revised nh4no3 and nh4cl condensation algorithm
47 ! 07-jan-06 raz - improved asteem algorithm
48 ! 28-apr-05 raz - reversed calls to form_cacl2 and form_nacl
49 ! fixed caco3 error in subr. electrolytes_to_ions
50 ! renamed dens_aer to dens_aer_mac; mw_aer to mw_aer_mac
51 ! 27-apr-05 raz - updated dry_mass calculation approach in mesa_convergence
52 ! 22-apr-05 raz - fixed caso4 mass balance problem and updated algorithm to
53 ! calculate phi_volatile for nh3, hno3, and hcl.
54 ! 20-apr-05 raz - updated asceem
55 ! 19-apr-05 raz - updated the algorithm to constrain the nh4 concentration
56 ! during simultaneous nh3, hno3, and hcl integration such
57 ! that it does not exceed the max possible value for a given bin
58 ! 14-apr-05 raz - fixed asteem_flux_wet_case3 and asteem_flux_dry_case3c
59 ! 11-jan-05 raz - major updates to many subroutines
60 ! 18-nov-04 rce - make sure that acos argument is between +/-1.0
61 ! 28-jan-04 rce - added subr aerchem_boxtest_output;
62 ! eliminated some unnecessary 'include v33com-'
63 ! 01-dec-03 rce - added 'implicit none' to many routines;
64 ! eliminated some unnecessary 'include v33com-'
65 ! 05-oct-03 raz - added hysteresis treatment
66 ! 02-sep-03 raz - implemented asteem
67 ! 10-jul-03 raz - changed ix to ixd in interp. subrs fast*_up and fast*_lo
68 ! 08-jul-03 raz - implemented asteem (adaptive step time-split
69 ! explicit euler method)
70 ! 26-jun-03 raz - updated almost all the subrs. this version contains
71 ! options for rigorous and fast solvers (including lsode solver)
73 ! 07-oct-02 raz - made zx and zm integers in activity coeff subs.
74 ! 16-sep-02 raz - updated many subrs to treat calcium salts
75 ! 19-aug-02 raz - inlcude v33com9a in subr aerosolmtc
76 ! 14-aug-02 rce - '(msectional.eq.0)' changed to '(msectional.le.0)'
77 ! 07-aug-02 rce - this is rahul's latest version from freshair
78 ! after adding 'real mean_molecular_speed' wherever it is used
79 ! 01-apr-02 raz - made final tests and gave the code to jerome
81 ! 04--14-dec-01 rce - several minor changes during initial testing/debug
82 ! in 3d los angeles simulation
83 ! (see earlier versions for details about these changes)
84 !-----------------------------------------------------------------------
85 !23456789012345678901234567890123456789012345678901234567890123456789012
87 !***********************************************************************
90 ! author: rahul a. zaveri
92 !-----------------------------------------------------------------------
93 subroutine aerchemistry( iclm, jclm, kclm_calcbgn, kclm_calcend, &
94 dtchem_sngl, idiagaa,vbs_nbin, &
95 ph_aer1, ph_aer2, ph_aer3, ph_aer4,kms,kme,do_ph )
97 use module_data_mosaic_asect
98 use module_data_mosaic_other
99 use module_mosaic_movesect, only: move_sections
107 integer iclm, jclm, kclm_calcbgn, kclm_calcend, idiagaa,vbs_nbin(1)
110 integer, intent(in) :: do_ph
111 real, optional, intent(out), dimension(kms:kme) :: &
112 ph_aer1, ph_aer2, ph_aer3, ph_aer4 ! pH of the aerosols
114 real(kind=8) :: dtchem
122 ncorecnt_aer = ncorecnt
124 ! special output for solver testing
125 call aerchem_boxtest_output( 1, iclm, jclm, 0, 0, dtchem )
129 kclm_aer_calcbgn = kclm_calcbgn
130 kclm_aer_calcend = kclm_calcend
133 do 200 m = 1, nsubareas
136 do 100 k = kclm_aer_calcbgn, kclm_aer_calcend
138 if (afracsubarea(k,m) .lt. 1.e-4) goto 100
142 call mosaic( k, m, dtchem,vbs_nbin)
144 if (istat_mosaic_fe1 .lt. 0) then
145 nfe1_mosaic_cur = nfe1_mosaic_cur + 1
146 nfe1_mosaic_tot = nfe1_mosaic_tot + 1
147 if (iprint_mosaic_fe1 .gt. 0) then
148 write(6,*) 'mosaic aerchemistry fatal error - i/j/k/m =', &
149 iclm_aer, jclm_aer, kclm_aer, mclm_aer
151 if (iprint_mosaic_fe1 .ge. 10) &
152 call mosaic_aerchem_error_dump( 0, 0, lunerr_aer, &
153 'aerchemistry fatal error' )
158 call specialoutaa( iclm, jclm, k, m, 'befor_movesect' )
159 call move_sections( 1, iclm, jclm, k, m)
160 call specialoutaa( iclm, jclm, k, m, 'after_movesect' )
161 if ( do_ph .eq. 1 ) then
168 100 continue ! k levels
170 200 continue ! subareas
173 ! special output for solver testing
174 call aerchem_boxtest_output( 3, iclm, jclm, 0, 0, dtchem )
177 end subroutine aerchemistry
188 !***********************************************************************
189 ! mosaic (model for simulating aerosol interactions and chemistry)
191 ! author: rahul a. zaveri
193 !-----------------------------------------------------------------------
194 subroutine mosaic(k, m, dtchem,vbs_nbin)
196 use module_data_mosaic_asect
197 use module_data_mosaic_other
204 integer k, m,vbs_nbin(1)
207 real(kind=8) yh2o, dumdum
208 integer iclm_debug, jclm_debug, kclm_debug, ncnt_debug
209 ! data iclm_debug /28/
210 ! data jclm_debug /1/
211 ! data kclm_debug /9/
212 ! data ncnt_debug /6/
213 iclm_debug=-28; jclm_debug=1; kclm_debug=9; ncnt_debug=6
217 if(iclm_aer .eq. iclm_debug .and. &
218 jclm_aer .eq. jclm_debug .and. &
219 kclm_aer .eq. kclm_debug .and. &
220 ncorecnt_aer .eq. ncnt_debug)then
227 call hijack_input(k,m)
231 t_k = rsub(ktemp,k,m) ! update temperature = k
232 p_atm = ptotclm(k) /1.032d6 ! update pressure = atm
233 yh2o = rsub(kh2o,k,m) ! mol(h2o)/mol(air)
234 rh_pc = 100.*relhumclm(k) ! rh (%)
235 ah2o = relhumclm(k) ! fractional rh
238 call load_mosaic_parameters ! sets up indices and other stuff once per simulation
240 call initialize_mosaic_variables
242 call update_thermodynamic_constants(vbs_nbin) ! update t and rh dependent constants
244 call map_mosaic_species(k, m, 0)
247 call overall_massbal_in ! save input mass over all bins
248 iprint_input = myes ! reset to default
251 call mosaic_dynamic_solver( dtchem,vbs_nbin )
252 if (istat_mosaic_fe1 .lt. 0) return
255 call overall_massbal_out(0) ! check mass balance after integration
257 call map_mosaic_species(k, m, 1)
259 ! write(6,*)' done ijk', iclm_aer, jclm_aer, kclm_aer
262 end subroutine mosaic
275 !***********************************************************************
276 ! interface to asceem and asteem dynamic gas-particle exchange solvers
278 ! author: rahul a. zaveri
280 !-----------------------------------------------------------------------
281 subroutine mosaic_dynamic_solver( dtchem,vbs_nbin )
288 integer ibin, iv, k, m,vbs_nbin(1)
289 real(kind=8) xt, dumdum
290 ! real(kind=8) aerosol_water_up ! mosaic func
293 ! if(iclm_aer .eq. 21 .and. &
294 ! jclm_aer .eq. 17 .and. &
295 ! kclm_aer .eq. 3 .and. &
296 ! ncorecnt_aer .eq. 4)then
301 do 500 ibin = 1, nbin_a
303 call check_aerosol_mass(ibin)
304 if(jaerosolstate(ibin) .eq. no_aerosol)goto 500
306 call conform_electrolytes(jtotal,ibin,xt) ! conforms aer(jtotal) to a valid aerosol
308 call check_aerosol_mass(ibin) ! check mass again after conform_electrolytes
309 if(jaerosolstate(ibin) .eq. no_aerosol)goto 500 ! ignore this bin
311 call conform_aerosol_number(ibin) ! adjusts number conc so that it conforms with bin mass and diameter
318 ! call initial_aer_print_box ! box
320 call save_pregrow_props
322 call specialoutaa( iclm_aer, jclm_aer, kclm_aer, 77, &
325 !-------------------------------------
326 ! do dynamic gas-aerosol mass transfer
328 if(mgas_aer_xfer .eq. mon)then
330 call astem(dtchem,vbs_nbin)
334 !-------------------------------------
336 ! grows or shrinks size depending on mass increase or decrease
338 ! do ibin = 1, nbin_a
339 ! if(jaerosolstate(ibin) .ne. no_aerosol)then
340 ! call conform_particle_size(ibin) ! box
346 do 600 ibin = 1, nbin_a
347 if(jaerosolstate(ibin).eq.no_aerosol) goto 600
349 if(jhyst_leg(ibin) .eq. jhyst_lo)then
350 water_a_hyst(ibin) = 0.0
351 elseif(jhyst_leg(ibin) .eq. jhyst_up)then
352 water_a_up(ibin) = aerosol_water_up(ibin) ! at 60% rh
353 water_a_hyst(ibin) = water_a_up(ibin)
356 call calc_dry_n_wet_aerosol_props(ibin) ! compute final mass and density
360 end subroutine mosaic_dynamic_solver
375 subroutine hijack_input(k, m)
377 use module_data_mosaic_asect
378 use module_data_mosaic_other
389 integer ibin, igas, iphase, isize, itype
390 real(kind=8) t_kdum, p_atmdum, rhdum, cairclmdum
391 real(kind=8) gasdum(4), aerdum(14,8)
396 ! read inputs----------------
397 open(92, file = 'box.txt')
399 read(92,*)t_kdum, p_atmdum, rhdum, cairclmdum
401 read(92,*)gasdum(1),gasdum(2),gasdum(3),gasdum(4)
405 read(92,*)aerdum(1,ibin),aerdum(2,ibin),aerdum(3,ibin), &
406 aerdum(4,ibin),aerdum(5,ibin),aerdum(6,ibin), &
407 aerdum(7,ibin),aerdum(8,ibin),aerdum(9,ibin), &
408 aerdum(10,ibin),aerdum(11,ibin),aerdum(12,ibin), &
409 aerdum(13,ibin),aerdum(14,ibin)
413 !----------------------------
417 rsub(ktemp,k,m) = t_kdum ! update temperature = k
418 ptotclm(k) = p_atmdum*1.032d6! update pressure = atm
419 relhumclm(k) = rhdum/100.0 ! fractional rh
420 cairclm(k) = cairclmdum ! mol/cc
424 ! calculate air conc in mol/m^3
425 cair_mol_m3 = cairclm(k)*1.e6 ! cairclm(k) is in mol/cc
426 cair_mol_cc = cairclm(k)
429 ! define conversion factors
430 conv1a = cair_mol_m3*1.e9 ! converts q/mol(air) to nq/m^3 (q = mol or g)
431 conv1b = 1./conv1a ! converts nq/m^3 to q/mol(air)
432 conv2a = cair_mol_m3*18.*1.e-3 ! converts mol(h2o)/mol(air) to kg(h2o)/m^3(air)
433 conv2b = 1./conv2a ! converts kg(h2o)/m^3(air) to mol(h2o)/mol(air)
436 ! read rsub (mol/mol(air))
438 rsub(kh2so4,k,m) = gasdum(1)
439 rsub(khno3,k,m) = gasdum(2)
440 rsub(khcl,k,m) = gasdum(3)
441 rsub(knh3,k,m) = gasdum(4)
444 ! aerosol: rsub [mol/mol (air) or g/mol(air)]
447 do 10 itype = 1, ntype_aer
448 do 10 isize = 1, nsize_aer(itype)
451 rsub(lptr_so4_aer(isize,itype,iphase),k,m) = aerdum(1,ibin)
452 rsub(lptr_no3_aer(isize,itype,iphase),k,m) = aerdum(2,ibin)
453 rsub(lptr_cl_aer(isize,itype,iphase),k,m) = aerdum(3,ibin)
454 rsub(lptr_nh4_aer(isize,itype,iphase),k,m) = aerdum(4,ibin)
455 rsub(lptr_oc_aer(isize,itype,iphase),k,m) = aerdum(5,ibin)
456 rsub(lptr_co3_aer(isize,itype,iphase),k,m) = aerdum(6,ibin)
457 rsub(lptr_msa_aer(isize,itype,iphase),k,m) = aerdum(7,ibin)
458 rsub(lptr_bc_aer(isize,itype,iphase),k,m) = aerdum(8,ibin)
459 rsub(lptr_na_aer(isize,itype,iphase),k,m) = aerdum(9,ibin)
460 rsub(lptr_ca_aer(isize,itype,iphase),k,m) = aerdum(10,ibin)
461 rsub(lptr_oin_aer(isize,itype,iphase),k,m) = aerdum(11,ibin)
463 rsub(hyswptr_aer(isize,itype),k,m) = aerdum(12,ibin) ! kg/m^3(air)
464 rsub(waterptr_aer(isize,itype),k,m) = aerdum(13,ibin) ! kg/m^3(air)
465 rsub(numptr_aer(isize,itype,iphase),k,m) = aerdum(14,ibin) ! num_a is in #/cc
469 end subroutine hijack_input
475 !***********************************************************************
476 ! intializes all the mosaic variables to zero or their default values.
478 ! author: rahul a. zaveri
480 !-----------------------------------------------------------------------
481 subroutine initialize_mosaic_variables
485 integer iaer, ibin, iv, ja, jc, je
497 mass_dry_a(ibin) = 0.0
498 mass_soluble_a(ibin) = 0.0
501 aer(iaer,jtotal,ibin) = 0.0
502 aer(iaer,jsolid,ibin) = 0.0
503 aer(iaer,jliquid,ibin) = 0.0
506 do je = 1, nelectrolyte
507 electrolyte(je,jtotal,ibin) = 0.0
508 electrolyte(je,jsolid,ibin) = 0.0
509 electrolyte(je,jliquid,ibin) = 0.0
510 epercent(je,jtotal,ibin) = 0.0 ! raz update 11/13/2008
511 epercent(je,jsolid,ibin) = 0.0 ! raz update 11/13/2008
512 epercent(je,jliquid,ibin) = 0.0 ! raz update 11/13/2008
513 activity(je,ibin) = 0.0
517 gam_ratio(ibin) = 0.0
520 flux_s(iv,ibin) = 0.0
521 flux_l(iv,ibin) = 0.0
523 ! fraceq(iv,ibin) =0.0
524 phi_volatile_s(iv,ibin) = 0.0
525 phi_volatile_l(iv,ibin) = 0.0
526 df_gas_s(iv,ibin) = 0.0
527 df_gas_l(iv,ibin) = 0.0
528 volatile_s(iv,ibin) = 0.0
532 jaerosolstate(ibin) = -1 ! initialize to default value
547 end subroutine initialize_mosaic_variables
554 !***********************************************************************
555 ! maps rsub(k,l,m) to and from mosaic arrays: gas and aer
557 ! author: rahul a. zaveri
559 !-------------------------------------------------------------------------
560 subroutine map_mosaic_species(k, m, imap)
562 use module_data_mosaic_asect
563 use module_data_mosaic_other
564 use module_state_description, only: param_first_scalar
576 integer ibin, iphase, isize, itsi, itype, l, p1st
579 ! if a species index is less than this value, then the species is not defined
580 p1st = param_first_scalar
583 ! calculate air conc in mol/m^3
584 cair_mol_m3 = cairclm(k)*1.e6 ! cairclm(k) is in mol/cc
585 cair_mol_cc = cairclm(k)
588 ! define conversion factors
589 conv1a = cair_mol_m3*1.d9 ! converts q/mol(air) to nq/m^3 (q = mol or g)
590 conv1b = 1.d0/conv1a ! converts nq/m^3 to q/mol(air)
591 conv2a = cair_mol_m3*18.*1.d-3 ! converts mol(h2o)/mol(air) to kg(h2o)/m^3(air)
592 conv2b = 1.d0/conv2a ! converts kg(h2o)/m^3(air) to mol(h2o)/mol(air)
596 ! conv1 = 1.d15/avogad ! converts (molec/cc) to (nmol/m^3)
597 ! conv2 = 1.d0/conv1 ! converts (nmol/m^3) to (molec/cc)
598 ! kaerstart = ngas_max
601 if(imap.eq.0)then ! map rsub (mol/mol(air)) into aer (nmol/m^3)
603 if (kh2so4 .ge. p1st) then
604 gas(ih2so4_g) = rsub(kh2so4,k,m)*conv1a ! nmol/m^3
608 if (khno3 .ge. p1st) then
609 gas(ihno3_g) = rsub(khno3,k,m)*conv1a
613 if (khcl .ge. p1st) then
614 gas(ihcl_g) = rsub(khcl,k,m)*conv1a
618 if (knh3 .ge. p1st) then
619 gas(inh3_g) = rsub(knh3,k,m)*conv1a
623 if (kn2o5 .ge. p1st) then
624 gas(in2o5_g) = rsub(kn2o5,k,m)*conv1a
628 if (kclno2 .ge. p1st) then
629 gas(iclno2_g) = rsub(kclno2,k,m)*conv1a
634 ! soa gas-phase species -- currently deactivated
635 if (kpcg1_b_c .ge. p1st) then
636 gas(ipcg1_b_c_g) = rsub(kpcg1_b_c,k,m)*conv1a
638 gas(ipcg1_b_c_g) = 0.0
640 if (kpcg2_b_c .ge. p1st) then
641 gas(ipcg2_b_c_g) = rsub(kpcg2_b_c,k,m)*conv1a
643 gas(ipcg2_b_c_g) = 0.0
645 if (kpcg3_b_c .ge. p1st) then
646 gas(ipcg3_b_c_g) = rsub(kpcg3_b_c,k,m)*conv1a
648 gas(ipcg3_b_c_g) = 0.0
650 if (kpcg4_b_c .ge. p1st) then
651 gas(ipcg4_b_c_g) = rsub(kpcg4_b_c,k,m)*conv1a
653 gas(ipcg4_b_c_g) = 0.0
655 if (kpcg5_b_c .ge. p1st) then
656 gas(ipcg5_b_c_g) = rsub(kpcg5_b_c,k,m)*conv1a
658 gas(ipcg5_b_c_g) = 0.0
660 if (kpcg6_b_c .ge. p1st) then
661 gas(ipcg6_b_c_g) = rsub(kpcg6_b_c,k,m)*conv1a
663 gas(ipcg6_b_c_g) = 0.0
665 if (kpcg7_b_c .ge. p1st) then
666 gas(ipcg7_b_c_g) = rsub(kpcg7_b_c,k,m)*conv1a
668 gas(ipcg7_b_c_g) = 0.0
670 if (kpcg8_b_c .ge. p1st) then
671 gas(ipcg8_b_c_g) = rsub(kpcg8_b_c,k,m)*conv1a
673 gas(ipcg8_b_c_g) = 0.0
675 if (kpcg9_b_c .ge. p1st) then
676 gas(ipcg9_b_c_g) = rsub(kpcg9_b_c,k,m)*conv1a
678 gas(ipcg9_b_c_g) = 0.0
680 if (kpcg1_b_o .ge. p1st) then
681 gas(ipcg1_b_o_g) = rsub(kpcg1_b_o,k,m)*conv1a
683 gas(ipcg1_b_o_g) = 0.0
685 if (kpcg2_b_o .ge. p1st) then
686 gas(ipcg2_b_o_g) = rsub(kpcg2_b_o,k,m)*conv1a
688 gas(ipcg2_b_o_g) = 0.0
690 if (kpcg3_b_o .ge. p1st) then
691 gas(ipcg3_b_o_g) = rsub(kpcg3_b_o,k,m)*conv1a
693 gas(ipcg3_b_o_g) = 0.0
695 if (kpcg4_b_o .ge. p1st) then
696 gas(ipcg4_b_o_g) = rsub(kpcg4_b_o,k,m)*conv1a
698 gas(ipcg4_b_o_g) = 0.0
700 if (kpcg5_b_o .ge. p1st) then
701 gas(ipcg5_b_o_g) = rsub(kpcg5_b_o,k,m)*conv1a
703 gas(ipcg5_b_o_g) = 0.0
705 if (kpcg6_b_o .ge. p1st) then
706 gas(ipcg6_b_o_g) = rsub(kpcg6_b_o,k,m)*conv1a
708 gas(ipcg6_b_o_g) = 0.0
710 if (kpcg7_b_o .ge. p1st) then
711 gas(ipcg7_b_o_g) = rsub(kpcg7_b_o,k,m)*conv1a
713 gas(ipcg7_b_o_g) = 0.0
715 if (kpcg8_b_o .ge. p1st) then
716 gas(ipcg8_b_o_g) = rsub(kpcg8_b_o,k,m)*conv1a
718 gas(ipcg8_b_o_g) = 0.0
720 if (kpcg9_b_o .ge. p1st) then
721 gas(ipcg9_b_o_g) = rsub(kpcg9_b_o,k,m)*conv1a
723 gas(ipcg9_b_o_g) = 0.0
725 if (kopcg1_b_c .ge. p1st) then
726 gas(iopcg1_b_c_g) = rsub(kopcg1_b_c,k,m)*conv1a
728 gas(iopcg1_b_c_g) = 0.0
730 if (kopcg2_b_c .ge. p1st) then
731 gas(iopcg2_b_c_g) = rsub(kopcg2_b_c,k,m)*conv1a
733 gas(iopcg2_b_c_g) = 0.0
735 if (kopcg3_b_c .ge. p1st) then
736 gas(iopcg3_b_c_g) = rsub(kopcg3_b_c,k,m)*conv1a
738 gas(iopcg3_b_c_g) = 0.0
740 if (kopcg4_b_c .ge. p1st) then
741 gas(iopcg4_b_c_g) = rsub(kopcg4_b_c,k,m)*conv1a
743 gas(iopcg4_b_c_g) = 0.0
745 if (kopcg5_b_c .ge. p1st) then
746 gas(iopcg5_b_c_g) = rsub(kopcg5_b_c,k,m)*conv1a
748 gas(iopcg5_b_c_g) = 0.0
750 if (kopcg6_b_c .ge. p1st) then
751 gas(iopcg6_b_c_g) = rsub(kopcg6_b_c,k,m)*conv1a
753 gas(iopcg6_b_c_g) = 0.0
755 if (kopcg7_b_c .ge. p1st) then
756 gas(iopcg7_b_c_g) = rsub(kopcg7_b_c,k,m)*conv1a
758 gas(iopcg7_b_c_g) = 0.0
760 if (kopcg8_b_c .ge. p1st) then
761 gas(iopcg8_b_c_g) = rsub(kopcg8_b_c,k,m)*conv1a
763 gas(iopcg8_b_c_g) = 0.0
765 if (kopcg1_b_o .ge. p1st) then
766 gas(iopcg1_b_o_g) = rsub(kopcg1_b_o,k,m)*conv1a
768 gas(iopcg1_b_o_g) = 0.0
770 if (kopcg2_b_o .ge. p1st) then
771 gas(iopcg2_b_o_g) = rsub(kopcg2_b_o,k,m)*conv1a
773 gas(iopcg2_b_o_g) = 0.0
775 if (kopcg3_b_o .ge. p1st) then
776 gas(iopcg3_b_o_g) = rsub(kopcg3_b_o,k,m)*conv1a
778 gas(iopcg3_b_o_g) = 0.0
780 if (kopcg4_b_o .ge. p1st) then
781 gas(iopcg4_b_o_g) = rsub(kopcg4_b_o,k,m)*conv1a
783 gas(iopcg4_b_o_g) = 0.0
785 if (kopcg5_b_o .ge. p1st) then
786 gas(iopcg5_b_o_g) = rsub(kopcg5_b_o,k,m)*conv1a
788 gas(iopcg5_b_o_g) = 0.0
790 if (kopcg6_b_o .ge. p1st) then
791 gas(iopcg6_b_o_g) = rsub(kopcg6_b_o,k,m)*conv1a
793 gas(iopcg6_b_o_g) = 0.0
795 if (kopcg7_b_o .ge. p1st) then
796 gas(iopcg7_b_o_g) = rsub(kopcg7_b_o,k,m)*conv1a
798 gas(iopcg7_b_o_g) = 0.0
800 if (kopcg8_b_o .ge. p1st) then
801 gas(iopcg8_b_o_g) = rsub(kopcg8_b_o,k,m)*conv1a
803 gas(iopcg8_b_o_g) = 0.0
805 if (kpcg1_f_c .ge. p1st) then
806 gas(ipcg1_f_c_g) = rsub(kpcg1_f_c,k,m)*conv1a
808 gas(ipcg1_f_c_g) = 0.0
810 if (kpcg2_f_c .ge. p1st) then
811 gas(ipcg2_f_c_g) = rsub(kpcg2_f_c,k,m)*conv1a
813 gas(ipcg2_f_c_g) = 0.0
815 if (kpcg3_f_c .ge. p1st) then
816 gas(ipcg3_f_c_g) = rsub(kpcg3_f_c,k,m)*conv1a
818 gas(ipcg3_f_c_g) = 0.0
820 if (kpcg4_f_c .ge. p1st) then
821 gas(ipcg4_f_c_g) = rsub(kpcg4_f_c,k,m)*conv1a
823 gas(ipcg4_f_c_g) = 0.0
825 if (kpcg5_f_c .ge. p1st) then
826 gas(ipcg5_f_c_g) = rsub(kpcg5_f_c,k,m)*conv1a
828 gas(ipcg5_f_c_g) = 0.0
830 if (kpcg6_f_c .ge. p1st) then
831 gas(ipcg6_f_c_g) = rsub(kpcg6_f_c,k,m)*conv1a
833 gas(ipcg6_f_c_g) = 0.0
835 if (kpcg7_f_c .ge. p1st) then
836 gas(ipcg7_f_c_g) = rsub(kpcg7_f_c,k,m)*conv1a
838 gas(ipcg7_f_c_g) = 0.0
840 if (kpcg8_f_c .ge. p1st) then
841 gas(ipcg8_f_c_g) = rsub(kpcg8_f_c,k,m)*conv1a
843 gas(ipcg8_f_c_g) = 0.0
845 if (kpcg9_f_c .ge. p1st) then
846 gas(ipcg9_f_c_g) = rsub(kpcg9_f_c,k,m)*conv1a
848 gas(ipcg9_f_c_g) = 0.0
850 if (kpcg1_f_o .ge. p1st) then
851 gas(ipcg1_f_o_g) = rsub(kpcg1_f_o,k,m)*conv1a
853 gas(ipcg1_f_o_g) = 0.0
855 if (kpcg2_f_o .ge. p1st) then
856 gas(ipcg2_f_o_g) = rsub(kpcg2_f_o,k,m)*conv1a
858 gas(ipcg2_f_o_g) = 0.0
860 if (kpcg3_f_o .ge. p1st) then
861 gas(ipcg3_f_o_g) = rsub(kpcg3_f_o,k,m)*conv1a
863 gas(ipcg3_f_o_g) = 0.0
865 if (kpcg4_f_o .ge. p1st) then
866 gas(ipcg4_f_o_g) = rsub(kpcg4_f_o,k,m)*conv1a
868 gas(ipcg4_f_o_g) = 0.0
870 if (kpcg5_f_o .ge. p1st) then
871 gas(ipcg5_f_o_g) = rsub(kpcg5_f_o,k,m)*conv1a
873 gas(ipcg5_f_o_g) = 0.0
875 if (kpcg6_f_o .ge. p1st) then
876 gas(ipcg6_f_o_g) = rsub(kpcg6_f_o,k,m)*conv1a
878 gas(ipcg6_f_o_g) = 0.0
880 if (kpcg7_f_o .ge. p1st) then
881 gas(ipcg7_f_o_g) = rsub(kpcg7_f_o,k,m)*conv1a
883 gas(ipcg7_f_o_g) = 0.0
885 if (kpcg8_f_o .ge. p1st) then
886 gas(ipcg8_f_o_g) = rsub(kpcg8_f_o,k,m)*conv1a
888 gas(ipcg8_f_o_g) = 0.0
890 if (kpcg9_f_o .ge. p1st) then
891 gas(ipcg9_f_o_g) = rsub(kpcg9_f_o,k,m)*conv1a
893 gas(ipcg9_f_o_g) = 0.0
895 if (kopcg1_f_c .ge. p1st) then
896 gas(iopcg1_f_c_g) = rsub(kopcg1_f_c,k,m)*conv1a
898 gas(iopcg1_f_c_g) = 0.0
900 if (kopcg2_f_c .ge. p1st) then
901 gas(iopcg2_f_c_g) = rsub(kopcg2_f_c,k,m)*conv1a
903 gas(iopcg2_f_c_g) = 0.0
905 if (kopcg3_f_c .ge. p1st) then
906 gas(iopcg3_f_c_g) = rsub(kopcg3_f_c,k,m)*conv1a
908 gas(iopcg3_f_c_g) = 0.0
910 if (kopcg4_f_c .ge. p1st) then
911 gas(iopcg4_f_c_g) = rsub(kopcg4_f_c,k,m)*conv1a
913 gas(iopcg4_f_c_g) = 0.0
915 if (kopcg5_f_c .ge. p1st) then
916 gas(iopcg5_f_c_g) = rsub(kopcg5_f_c,k,m)*conv1a
918 gas(iopcg5_f_c_g) = 0.0
920 if (kopcg6_f_c .ge. p1st) then
921 gas(iopcg6_f_c_g) = rsub(kopcg6_f_c,k,m)*conv1a
923 gas(iopcg6_f_c_g) = 0.0
925 if (kopcg7_f_c .ge. p1st) then
926 gas(iopcg7_f_c_g) = rsub(kopcg7_f_c,k,m)*conv1a
928 gas(iopcg7_f_c_g) = 0.0
930 if (kopcg8_f_c .ge. p1st) then
931 gas(iopcg8_f_c_g) = rsub(kopcg8_f_c,k,m)*conv1a
933 gas(iopcg8_f_c_g) = 0.0
935 if (kopcg1_f_o .ge. p1st) then
936 gas(iopcg1_f_o_g) = rsub(kopcg1_f_o,k,m)*conv1a
938 gas(iopcg1_f_o_g) = 0.0
940 if (kopcg2_f_o .ge. p1st) then
941 gas(iopcg2_f_o_g) = rsub(kopcg2_f_o,k,m)*conv1a
943 gas(iopcg2_f_o_g) = 0.0
945 if (kopcg3_f_o .ge. p1st) then
946 gas(iopcg3_f_o_g) = rsub(kopcg3_f_o,k,m)*conv1a
948 gas(iopcg3_f_o_g) = 0.0
950 if (kopcg4_f_o .ge. p1st) then
951 gas(iopcg4_f_o_g) = rsub(kopcg4_f_o,k,m)*conv1a
953 gas(iopcg4_f_o_g) = 0.0
955 if (kopcg5_f_o .ge. p1st) then
956 gas(iopcg5_f_o_g) = rsub(kopcg5_f_o,k,m)*conv1a
958 gas(iopcg5_f_o_g) = 0.0
960 if (kopcg6_f_o .ge. p1st) then
961 gas(iopcg6_f_o_g) = rsub(kopcg6_f_o,k,m)*conv1a
963 gas(iopcg6_f_o_g) = 0.0
965 if (kopcg7_f_o .ge. p1st) then
966 gas(iopcg7_f_o_g) = rsub(kopcg7_f_o,k,m)*conv1a
968 gas(iopcg7_f_o_g) = 0.0
970 if (kopcg8_f_o .ge. p1st) then
971 gas(iopcg8_f_o_g) = rsub(kopcg8_f_o,k,m)*conv1a
973 gas(iopcg8_f_o_g) = 0.0
976 if (ksmpa .ge. p1st) then
977 gas(ismpa_g) = rsub(ksmpa,k,m)*conv1a
981 if (ksmpbb .ge. p1st) then
982 gas(ismpbb_g) = rsub(ksmpbb,k,m)*conv1a
986 if (kgly .ge. p1st) then
987 gas(igly) = rsub(kgly,k,m)*conv1a
991 if (koh .ge. p1st) then
992 gas(iho) = rsub(koh,k,m)*conv1a
998 if (kant1_c .ge. p1st) then
999 gas(iant1_c_g) = rsub(kant1_c,k,m)*conv1a
1001 gas(iant1_c_g) = 0.0
1003 if (kant2_c .ge. p1st) then
1004 gas(iant2_c_g) = rsub(kant2_c,k,m)*conv1a
1006 gas(iant2_c_g) = 0.0
1008 if (kant3_c .ge. p1st) then
1009 gas(iant3_c_g) = rsub(kant3_c,k,m)*conv1a
1011 gas(iant3_c_g) = 0.0
1013 if (kant4_c .ge. p1st) then
1014 gas(iant4_c_g) = rsub(kant4_c,k,m)*conv1a
1016 gas(iant4_c_g) = 0.0
1019 if (kant1_o .ge. p1st) then
1020 gas(iant1_o_g) = rsub(kant1_o,k,m)*conv1a
1022 gas(iant1_o_g) = 0.0
1024 if (kant2_o .ge. p1st) then
1025 gas(iant2_o_g) = rsub(kant2_o,k,m)*conv1a
1027 gas(iant2_o_g) = 0.0
1029 if (kant3_o .ge. p1st) then
1030 gas(iant3_o_g) = rsub(kant3_o,k,m)*conv1a
1032 gas(iant3_o_g) = 0.0
1034 if (kant4_o .ge. p1st) then
1035 gas(iant4_o_g) = rsub(kant4_o,k,m)*conv1a
1037 gas(iant4_o_g) = 0.0
1040 if (kbiog1_c .ge. p1st) then
1041 gas(ibiog1_c_g) = rsub(kbiog1_c,k,m)*conv1a
1043 gas(ibiog1_c_g) = 0.0
1045 if (kbiog2_c .ge. p1st) then
1046 gas(ibiog2_c_g) = rsub(kbiog2_c,k,m)*conv1a
1048 gas(ibiog2_c_g) = 0.0
1050 if (kbiog3_c .ge. p1st) then
1051 gas(ibiog3_c_g) = rsub(kbiog3_c,k,m)*conv1a
1053 gas(ibiog3_c_g) = 0.0
1055 if (kbiog4_c .ge. p1st) then
1056 gas(ibiog4_c_g) = rsub(kbiog4_c,k,m)*conv1a
1058 gas(ibiog4_c_g) = 0.0
1061 if (kbiog1_o .ge. p1st) then
1062 gas(ibiog1_o_g) = rsub(kbiog1_o,k,m)*conv1a
1064 gas(ibiog1_o_g) = 0.0
1066 if (kbiog2_o .ge. p1st) then
1067 gas(ibiog2_o_g) = rsub(kbiog2_o,k,m)*conv1a
1069 gas(ibiog2_o_g) = 0.0
1071 if (kbiog3_o .ge. p1st) then
1072 gas(ibiog3_o_g) = rsub(kbiog3_o,k,m)*conv1a
1074 gas(ibiog3_o_g) = 0.0
1076 if (kbiog4_o .ge. p1st) then
1077 gas(ibiog4_o_g) = rsub(kbiog4_o,k,m)*conv1a
1079 gas(ibiog4_o_g) = 0.0
1082 if (kasoaX .ge. p1st) then
1083 gas(iasoaX_g) = rsub(kasoaX,k,m)*conv1a
1088 if (kasoa1 .ge. p1st) then
1089 gas(iasoa1_g) = rsub(kasoa1,k,m)*conv1a
1094 if (kasoa2 .ge. p1st) then
1095 gas(iasoa2_g) = rsub(kasoa2,k,m)*conv1a
1100 if (kasoa3 .ge. p1st) then
1101 gas(iasoa3_g) = rsub(kasoa3,k,m)*conv1a
1106 if (kasoa4 .ge. p1st) then
1107 gas(iasoa4_g) = rsub(kasoa4,k,m)*conv1a
1112 if (kbsoaX .ge. p1st) then
1113 gas(ibsoaX_g) = rsub(kbsoaX,k,m)*conv1a
1118 if (kbsoa1 .ge. p1st) then
1119 gas(ibsoa1_g) = rsub(kbsoa1,k,m)*conv1a
1124 if (kbsoa2 .ge. p1st) then
1125 gas(ibsoa2_g) = rsub(kbsoa2,k,m)*conv1a
1130 if (kbsoa3 .ge. p1st) then
1131 gas(ibsoa3_g) = rsub(kbsoa3,k,m)*conv1a
1136 if (kbsoa4 .ge. p1st) then
1137 gas(ibsoa4_g) = rsub(kbsoa4,k,m)*conv1a
1149 do 10 itype = 1, ntype_aer
1150 do 10 isize = 1, nsize_aer(itype)
1153 ! aer array units are nmol/(m^3 air)
1155 ! rce 18-nov-2004 - always map so4 and number,
1156 ! but only map other species when (lptr_xxx .ge. p1st)
1157 ! rce 11-may-2006 - so4 mapping now optional
1158 l = lptr_so4_aer(isize,itype,iphase)
1159 if (l .ge. p1st) then
1160 aer(iso4_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1162 aer(iso4_a,jtotal,ibin)=0.0
1165 l = lptr_no3_aer(isize,itype,iphase)
1166 if (l .ge. p1st) then
1167 aer(ino3_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1169 aer(ino3_a,jtotal,ibin)=0.0
1172 l = lptr_cl_aer(isize,itype,iphase)
1173 if (l .ge. p1st) then
1174 aer(icl_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1176 aer(icl_a,jtotal,ibin)=0.0
1179 l = lptr_nh4_aer(isize,itype,iphase)
1180 if (l .ge. p1st) then
1181 aer(inh4_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1183 aer(inh4_a,jtotal,ibin)=0.0
1186 l = lptr_oc_aer(isize,itype,iphase)
1187 if (l .ge. p1st) then
1188 aer(ioc_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1190 aer(ioc_a,jtotal,ibin)=0.0
1193 l = lptr_bc_aer(isize,itype,iphase)
1194 if (l .ge. p1st) then
1195 aer(ibc_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1197 aer(ibc_a,jtotal,ibin)=0.0
1200 l = lptr_na_aer(isize,itype,iphase)
1201 if (l .ge. p1st) then
1202 aer(ina_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1204 aer(ina_a,jtotal,ibin)=0.0
1207 l = lptr_oin_aer(isize,itype,iphase)
1208 if (l .ge. p1st) then
1209 aer(ioin_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1211 aer(ioin_a,jtotal,ibin)=0.0
1214 l = lptr_msa_aer(isize,itype,iphase)
1215 if (l .ge. p1st) then
1216 aer(imsa_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1218 aer(imsa_a,jtotal,ibin)=0.0
1221 l = lptr_co3_aer(isize,itype,iphase)
1222 if (l .ge. p1st) then
1223 aer(ico3_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1225 aer(ico3_a,jtotal,ibin)=0.0
1228 l = lptr_ca_aer(isize,itype,iphase)
1229 if (l .ge. p1st) then
1230 aer(ica_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1232 aer(ica_a,jtotal,ibin)=0.0
1235 ! soa aerosol-phase species -- currently deactivated
1237 l = lptr_pcg1_b_c_aer(isize,itype,iphase)
1238 if (l .ge. p1st) then
1239 aer(ipcg1_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1241 aer(ipcg1_b_c_a,jtotal,ibin)=0.0
1243 l = lptr_pcg2_b_c_aer(isize,itype,iphase)
1244 if (l .ge. p1st) then
1245 aer(ipcg2_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1247 aer(ipcg2_b_c_a,jtotal,ibin)=0.0
1249 l = lptr_pcg3_b_c_aer(isize,itype,iphase)
1250 if (l .ge. p1st) then
1251 aer(ipcg3_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1253 aer(ipcg3_b_c_a,jtotal,ibin)=0.0
1255 l = lptr_pcg4_b_c_aer(isize,itype,iphase)
1256 if (l .ge. p1st) then
1257 aer(ipcg4_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1259 aer(ipcg4_b_c_a,jtotal,ibin)=0.0
1261 l = lptr_pcg5_b_c_aer(isize,itype,iphase)
1262 if (l .ge. p1st) then
1263 aer(ipcg5_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1265 aer(ipcg5_b_c_a,jtotal,ibin)=0.0
1267 l = lptr_pcg6_b_c_aer(isize,itype,iphase)
1268 if (l .ge. p1st) then
1269 aer(ipcg6_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1271 aer(ipcg6_b_c_a,jtotal,ibin)=0.0
1273 l = lptr_pcg7_b_c_aer(isize,itype,iphase)
1274 if (l .ge. p1st) then
1275 aer(ipcg7_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1277 aer(ipcg7_b_c_a,jtotal,ibin)=0.0
1279 l = lptr_pcg8_b_c_aer(isize,itype,iphase)
1280 if (l .ge. p1st) then
1281 aer(ipcg8_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1283 aer(ipcg8_b_c_a,jtotal,ibin)=0.0
1285 l = lptr_pcg9_b_c_aer(isize,itype,iphase)
1286 if (l .ge. p1st) then
1287 aer(ipcg9_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1289 aer(ipcg9_b_c_a,jtotal,ibin)=0.0
1291 l = lptr_pcg1_b_o_aer(isize,itype,iphase)
1292 if (l .ge. p1st) then
1293 aer(ipcg1_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1295 aer(ipcg1_b_o_a,jtotal,ibin)=0.0
1297 l = lptr_pcg2_b_o_aer(isize,itype,iphase)
1298 if (l .ge. p1st) then
1299 aer(ipcg2_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1301 aer(ipcg2_b_o_a,jtotal,ibin)=0.0
1303 l = lptr_pcg3_b_o_aer(isize,itype,iphase)
1304 if (l .ge. p1st) then
1305 aer(ipcg3_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1307 aer(ipcg3_b_o_a,jtotal,ibin)=0.0
1309 l = lptr_pcg4_b_o_aer(isize,itype,iphase)
1310 if (l .ge. p1st) then
1311 aer(ipcg4_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1313 aer(ipcg4_b_o_a,jtotal,ibin)=0.0
1315 l = lptr_pcg5_b_o_aer(isize,itype,iphase)
1316 if (l .ge. p1st) then
1317 aer(ipcg5_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1319 aer(ipcg5_b_o_a,jtotal,ibin)=0.0
1321 l = lptr_pcg6_b_o_aer(isize,itype,iphase)
1322 if (l .ge. p1st) then
1323 aer(ipcg6_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1325 aer(ipcg6_b_o_a,jtotal,ibin)=0.0
1327 l = lptr_pcg7_b_o_aer(isize,itype,iphase)
1328 if (l .ge. p1st) then
1329 aer(ipcg7_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1331 aer(ipcg7_b_o_a,jtotal,ibin)=0.0
1333 l = lptr_pcg8_b_o_aer(isize,itype,iphase)
1334 if (l .ge. p1st) then
1335 aer(ipcg8_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1337 aer(ipcg8_b_o_a,jtotal,ibin)=0.0
1339 l = lptr_pcg9_b_o_aer(isize,itype,iphase)
1340 if (l .ge. p1st) then
1341 aer(ipcg9_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1343 aer(ipcg9_b_o_a,jtotal,ibin)=0.0
1345 l = lptr_opcg1_b_c_aer(isize,itype,iphase)
1346 if (l .ge. p1st) then
1347 aer(iopcg1_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1349 aer(iopcg1_b_c_a,jtotal,ibin)=0.0
1351 l = lptr_opcg2_b_c_aer(isize,itype,iphase)
1352 if (l .ge. p1st) then
1353 aer(iopcg2_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1355 aer(iopcg2_b_c_a,jtotal,ibin)=0.0
1357 l = lptr_opcg3_b_c_aer(isize,itype,iphase)
1358 if (l .ge. p1st) then
1359 aer(iopcg3_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1361 aer(iopcg3_b_c_a,jtotal,ibin)=0.0
1363 l = lptr_opcg4_b_c_aer(isize,itype,iphase)
1364 if (l .ge. p1st) then
1365 aer(iopcg4_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1367 aer(iopcg4_b_c_a,jtotal,ibin)=0.0
1369 l = lptr_opcg5_b_c_aer(isize,itype,iphase)
1370 if (l .ge. p1st) then
1371 aer(iopcg5_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1373 aer(iopcg5_b_c_a,jtotal,ibin)=0.0
1375 l = lptr_opcg6_b_c_aer(isize,itype,iphase)
1376 if (l .ge. p1st) then
1377 aer(iopcg6_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1379 aer(iopcg6_b_c_a,jtotal,ibin)=0.0
1381 l = lptr_opcg7_b_c_aer(isize,itype,iphase)
1382 if (l .ge. p1st) then
1383 aer(iopcg7_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1385 aer(iopcg7_b_c_a,jtotal,ibin)=0.0
1387 l = lptr_opcg8_b_c_aer(isize,itype,iphase)
1388 if (l .ge. p1st) then
1389 aer(iopcg8_b_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1391 aer(iopcg8_b_c_a,jtotal,ibin)=0.0
1393 l = lptr_opcg1_b_o_aer(isize,itype,iphase)
1394 if (l .ge. p1st) then
1395 aer(iopcg1_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1397 aer(iopcg1_b_o_a,jtotal,ibin)=0.0
1399 l = lptr_opcg2_b_o_aer(isize,itype,iphase)
1400 if (l .ge. p1st) then
1401 aer(iopcg2_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1403 aer(iopcg2_b_o_a,jtotal,ibin)=0.0
1405 l = lptr_opcg3_b_o_aer(isize,itype,iphase)
1406 if (l .ge. p1st) then
1407 aer(iopcg3_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1409 aer(iopcg3_b_o_a,jtotal,ibin)=0.0
1411 l = lptr_opcg4_b_o_aer(isize,itype,iphase)
1412 if (l .ge. p1st) then
1413 aer(iopcg4_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1415 aer(iopcg4_b_o_a,jtotal,ibin)=0.0
1417 l = lptr_opcg5_b_o_aer(isize,itype,iphase)
1418 if (l .ge. p1st) then
1419 aer(iopcg5_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1421 aer(iopcg5_b_o_a,jtotal,ibin)=0.0
1423 l = lptr_opcg6_b_o_aer(isize,itype,iphase)
1424 if (l .ge. p1st) then
1425 aer(iopcg6_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1427 aer(iopcg6_b_o_a,jtotal,ibin)=0.0
1429 l = lptr_opcg7_b_o_aer(isize,itype,iphase)
1430 if (l .ge. p1st) then
1431 aer(iopcg7_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1433 aer(iopcg7_b_o_a,jtotal,ibin)=0.0
1435 l = lptr_opcg8_b_o_aer(isize,itype,iphase)
1436 if (l .ge. p1st) then
1437 aer(iopcg8_b_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1439 aer(iopcg8_b_o_a,jtotal,ibin)=0.0
1441 l = lptr_pcg1_f_c_aer(isize,itype,iphase)
1442 if (l .ge. p1st) then
1443 aer(ipcg1_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1445 aer(ipcg1_f_c_a,jtotal,ibin)=0.0
1447 l = lptr_pcg2_f_c_aer(isize,itype,iphase)
1448 if (l .ge. p1st) then
1449 aer(ipcg2_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1451 aer(ipcg2_f_c_a,jtotal,ibin)=0.0
1453 l = lptr_pcg3_f_c_aer(isize,itype,iphase)
1454 if (l .ge. p1st) then
1455 aer(ipcg3_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1457 aer(ipcg3_f_c_a,jtotal,ibin)=0.0
1459 l = lptr_pcg4_f_c_aer(isize,itype,iphase)
1460 if (l .ge. p1st) then
1461 aer(ipcg4_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1463 aer(ipcg4_f_c_a,jtotal,ibin)=0.0
1465 l = lptr_pcg5_f_c_aer(isize,itype,iphase)
1466 if (l .ge. p1st) then
1467 aer(ipcg5_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1469 aer(ipcg5_f_c_a,jtotal,ibin)=0.0
1471 l = lptr_pcg6_f_c_aer(isize,itype,iphase)
1472 if (l .ge. p1st) then
1473 aer(ipcg6_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1475 aer(ipcg6_f_c_a,jtotal,ibin)=0.0
1477 l = lptr_pcg7_f_c_aer(isize,itype,iphase)
1478 if (l .ge. p1st) then
1479 aer(ipcg7_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1481 aer(ipcg7_f_c_a,jtotal,ibin)=0.0
1483 l = lptr_pcg8_f_c_aer(isize,itype,iphase)
1484 if (l .ge. p1st) then
1485 aer(ipcg8_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1487 aer(ipcg8_f_c_a,jtotal,ibin)=0.0
1489 l = lptr_pcg9_f_c_aer(isize,itype,iphase)
1490 if (l .ge. p1st) then
1491 aer(ipcg9_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1493 aer(ipcg9_f_c_a,jtotal,ibin)=0.0
1495 l = lptr_pcg1_f_o_aer(isize,itype,iphase)
1496 if (l .ge. p1st) then
1497 aer(ipcg1_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1499 aer(ipcg1_f_o_a,jtotal,ibin)=0.0
1501 l = lptr_pcg2_f_o_aer(isize,itype,iphase)
1502 if (l .ge. p1st) then
1503 aer(ipcg2_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1505 aer(ipcg2_f_o_a,jtotal,ibin)=0.0
1507 l = lptr_pcg3_f_o_aer(isize,itype,iphase)
1508 if (l .ge. p1st) then
1509 aer(ipcg3_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1511 aer(ipcg3_f_o_a,jtotal,ibin)=0.0
1513 l = lptr_pcg4_f_o_aer(isize,itype,iphase)
1514 if (l .ge. p1st) then
1515 aer(ipcg4_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1517 aer(ipcg4_f_o_a,jtotal,ibin)=0.0
1519 l = lptr_pcg5_f_o_aer(isize,itype,iphase)
1520 if (l .ge. p1st) then
1521 aer(ipcg5_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1523 aer(ipcg5_f_o_a,jtotal,ibin)=0.0
1525 l = lptr_pcg6_f_o_aer(isize,itype,iphase)
1526 if (l .ge. p1st) then
1527 aer(ipcg6_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1529 aer(ipcg6_f_o_a,jtotal,ibin)=0.0
1531 l = lptr_pcg7_f_o_aer(isize,itype,iphase)
1532 if (l .ge. p1st) then
1533 aer(ipcg7_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1535 aer(ipcg7_f_o_a,jtotal,ibin)=0.0
1537 l = lptr_pcg8_f_o_aer(isize,itype,iphase)
1538 if (l .ge. p1st) then
1539 aer(ipcg8_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1541 aer(ipcg8_f_o_a,jtotal,ibin)=0.0
1543 l = lptr_pcg9_f_o_aer(isize,itype,iphase)
1544 if (l .ge. p1st) then
1545 aer(ipcg9_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1547 aer(ipcg9_f_o_a,jtotal,ibin)=0.0
1549 l = lptr_opcg1_f_c_aer(isize,itype,iphase)
1550 if (l .ge. p1st) then
1551 aer(iopcg1_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1553 aer(iopcg1_f_c_a,jtotal,ibin)=0.0
1555 l = lptr_opcg2_f_c_aer(isize,itype,iphase)
1556 if (l .ge. p1st) then
1557 aer(iopcg2_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1559 aer(iopcg2_f_c_a,jtotal,ibin)=0.0
1561 l = lptr_opcg3_f_c_aer(isize,itype,iphase)
1562 if (l .ge. p1st) then
1563 aer(iopcg3_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1565 aer(iopcg3_f_c_a,jtotal,ibin)=0.0
1567 l = lptr_opcg4_f_c_aer(isize,itype,iphase)
1568 if (l .ge. p1st) then
1569 aer(iopcg4_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1571 aer(iopcg4_f_c_a,jtotal,ibin)=0.0
1573 l = lptr_opcg5_f_c_aer(isize,itype,iphase)
1574 if (l .ge. p1st) then
1575 aer(iopcg5_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1577 aer(iopcg5_f_c_a,jtotal,ibin)=0.0
1579 l = lptr_opcg6_f_c_aer(isize,itype,iphase)
1580 if (l .ge. p1st) then
1581 aer(iopcg6_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1583 aer(iopcg6_f_c_a,jtotal,ibin)=0.0
1585 l = lptr_opcg7_f_c_aer(isize,itype,iphase)
1586 if (l .ge. p1st) then
1587 aer(iopcg7_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1589 aer(iopcg7_f_c_a,jtotal,ibin)=0.0
1591 l = lptr_opcg8_f_c_aer(isize,itype,iphase)
1592 if (l .ge. p1st) then
1593 aer(iopcg8_f_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1595 aer(iopcg8_f_c_a,jtotal,ibin)=0.0
1597 l = lptr_opcg1_f_o_aer(isize,itype,iphase)
1598 if (l .ge. p1st) then
1599 aer(iopcg1_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1601 aer(iopcg1_f_o_a,jtotal,ibin)=0.0
1603 l = lptr_opcg2_f_o_aer(isize,itype,iphase)
1604 if (l .ge. p1st) then
1605 aer(iopcg2_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1607 aer(iopcg2_f_o_a,jtotal,ibin)=0.0
1609 l = lptr_opcg3_f_o_aer(isize,itype,iphase)
1610 if (l .ge. p1st) then
1611 aer(iopcg3_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1613 aer(iopcg3_f_o_a,jtotal,ibin)=0.0
1615 l = lptr_opcg4_f_o_aer(isize,itype,iphase)
1616 if (l .ge. p1st) then
1617 aer(iopcg4_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1619 aer(iopcg4_f_o_a,jtotal,ibin)=0.0
1621 l = lptr_opcg5_f_o_aer(isize,itype,iphase)
1622 if (l .ge. p1st) then
1623 aer(iopcg5_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1625 aer(iopcg5_f_o_a,jtotal,ibin)=0.0
1627 l = lptr_opcg6_f_o_aer(isize,itype,iphase)
1628 if (l .ge. p1st) then
1629 aer(iopcg6_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1631 aer(iopcg6_f_o_a,jtotal,ibin)=0.0
1633 l = lptr_opcg7_f_o_aer(isize,itype,iphase)
1634 if (l .ge. p1st) then
1635 aer(iopcg7_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1637 aer(iopcg7_f_o_a,jtotal,ibin)=0.0
1639 l = lptr_opcg8_f_o_aer(isize,itype,iphase)
1640 if (l .ge. p1st) then
1641 aer(iopcg8_f_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1643 aer(iopcg8_f_o_a,jtotal,ibin)=0.0
1646 l = lptr_smpa_aer(isize,itype,iphase)
1647 if (l .ge. p1st) then
1648 aer(ismpa_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1650 aer(ismpa_a,jtotal,ibin)=0.0
1652 l = lptr_smpbb_aer(isize,itype,iphase)
1653 if (l .ge. p1st) then
1654 aer(ismpbb_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1656 aer(ismpbb_a,jtotal,ibin)=0.0
1659 l = lptr_glysoa_r1_aer(isize,itype,iphase)
1660 if (l .ge. p1st) then
1661 aer(iglysoa_r1_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1663 aer(iglysoa_r1_a,jtotal,ibin)=0.0
1666 l = lptr_glysoa_r2_aer(isize,itype,iphase)
1667 if (l .ge. p1st) then
1668 aer(iglysoa_r2_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1670 aer(iglysoa_r2_a,jtotal,ibin)=0.0
1673 l = lptr_glysoa_sfc_aer(isize,itype,iphase)
1674 if (l .ge. p1st) then
1675 aer(iglysoa_sfc_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1677 aer(iglysoa_sfc_a,jtotal,ibin)=0.0
1680 l = lptr_glysoa_nh4_aer(isize,itype,iphase)
1681 if (l .ge. p1st) then
1682 aer(iglysoa_nh4_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1684 aer(iglysoa_nh4_a,jtotal,ibin)=0.0
1687 l = lptr_glysoa_oh_aer(isize,itype,iphase)
1688 if (l .ge. p1st) then
1689 aer(iglysoa_oh_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1691 aer(iglysoa_oh_a,jtotal,ibin)=0.0
1694 l = lptr_ant1_c_aer(isize,itype,iphase)
1695 if (l .ge. p1st) then
1696 aer(iant1_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1698 aer(iant1_c_a,jtotal,ibin)=0.0
1701 l = lptr_ant2_c_aer(isize,itype,iphase)
1702 if (l .ge. p1st) then
1703 aer(iant2_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1705 aer(iant2_c_a,jtotal,ibin)=0.0
1708 l = lptr_ant3_c_aer(isize,itype,iphase)
1709 if (l .ge. p1st) then
1710 aer(iant3_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1712 aer(iant3_c_a,jtotal,ibin)=0.0
1715 l = lptr_ant4_c_aer(isize,itype,iphase)
1716 if (l .ge. p1st) then
1717 aer(iant4_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1719 aer(iant4_c_a,jtotal,ibin)=0.0
1722 l = lptr_ant1_o_aer(isize,itype,iphase)
1723 if (l .ge. p1st) then
1724 aer(iant1_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1726 aer(iant1_o_a,jtotal,ibin)=0.0
1729 l = lptr_ant2_o_aer(isize,itype,iphase)
1730 if (l .ge. p1st) then
1731 aer(iant2_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1733 aer(iant2_o_a,jtotal,ibin)=0.0
1736 l = lptr_ant3_o_aer(isize,itype,iphase)
1737 if (l .ge. p1st) then
1738 aer(iant3_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1740 aer(iant3_o_a,jtotal,ibin)=0.0
1743 l = lptr_ant4_o_aer(isize,itype,iphase)
1744 if (l .ge. p1st) then
1745 aer(iant4_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1747 aer(iant4_o_a,jtotal,ibin)=0.0
1750 l = lptr_biog1_c_aer(isize,itype,iphase)
1751 if (l .ge. p1st) then
1752 aer(ibiog1_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1754 aer(ibiog1_c_a,jtotal,ibin)=0.0
1757 l = lptr_biog2_c_aer(isize,itype,iphase)
1758 if (l .ge. p1st) then
1759 aer(ibiog2_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1761 aer(ibiog2_c_a,jtotal,ibin)=0.0
1764 l = lptr_biog3_c_aer(isize,itype,iphase)
1765 if (l .ge. p1st) then
1766 aer(ibiog3_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1768 aer(ibiog3_c_a,jtotal,ibin)=0.0
1771 l = lptr_biog4_c_aer(isize,itype,iphase)
1772 if (l .ge. p1st) then
1773 aer(ibiog4_c_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1775 aer(ibiog4_c_a,jtotal,ibin)=0.0
1778 l = lptr_biog1_o_aer(isize,itype,iphase)
1779 if (l .ge. p1st) then
1780 aer(ibiog1_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1782 aer(ibiog1_o_a,jtotal,ibin)=0.0
1785 l = lptr_biog2_o_aer(isize,itype,iphase)
1786 if (l .ge. p1st) then
1787 aer(ibiog2_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1789 aer(ibiog2_o_a,jtotal,ibin)=0.0
1792 l = lptr_biog3_o_aer(isize,itype,iphase)
1793 if (l .ge. p1st) then
1794 aer(ibiog3_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1796 aer(ibiog3_o_a,jtotal,ibin)=0.0
1799 l = lptr_biog4_o_aer(isize,itype,iphase)
1800 if (l .ge. p1st) then
1801 aer(ibiog4_o_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1803 aer(ibiog4_o_a,jtotal,ibin)=0.0
1806 l = lptr_asoaX_aer(isize,itype,iphase)
1807 if (l .ge. p1st) then
1808 aer(iasoaX_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1810 aer(iasoaX_a,jtotal,ibin)=0.0
1813 l = lptr_asoa1_aer(isize,itype,iphase)
1814 if (l .ge. p1st) then
1815 aer(iasoa1_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1817 aer(iasoa1_a,jtotal,ibin)=0.0
1820 l = lptr_asoa2_aer(isize,itype,iphase)
1821 if (l .ge. p1st) then
1822 aer(iasoa2_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1824 aer(iasoa2_a,jtotal,ibin)=0.0
1827 l = lptr_asoa3_aer(isize,itype,iphase)
1828 if (l .ge. p1st) then
1829 aer(iasoa3_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1831 aer(iasoa3_a,jtotal,ibin)=0.0
1834 l = lptr_asoa4_aer(isize,itype,iphase)
1835 if (l .ge. p1st) then
1836 aer(iasoa4_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1838 aer(iasoa4_a,jtotal,ibin)=0.0
1841 l = lptr_bsoaX_aer(isize,itype,iphase)
1842 if (l .ge. p1st) then
1843 aer(ibsoaX_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1845 aer(ibsoaX_a,jtotal,ibin)=0.0
1848 l = lptr_bsoa1_aer(isize,itype,iphase)
1849 if (l .ge. p1st) then
1850 aer(ibsoa1_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1852 aer(ibsoa1_a,jtotal,ibin)=0.0
1855 l = lptr_bsoa2_aer(isize,itype,iphase)
1856 if (l .ge. p1st) then
1857 aer(ibsoa2_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1859 aer(ibsoa2_a,jtotal,ibin)=0.0
1862 l = lptr_bsoa3_aer(isize,itype,iphase)
1863 if (l .ge. p1st) then
1864 aer(ibsoa3_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1866 aer(ibsoa3_a,jtotal,ibin)=0.0
1869 l = lptr_bsoa4_aer(isize,itype,iphase)
1870 if (l .ge. p1st) then
1871 aer(ibsoa4_a,jtotal,ibin)=rsub(l,k,m)*conv1a
1873 aer(ibsoa4_a,jtotal,ibin)=0.0
1876 ! water_a and water_a_hyst units are kg/(m^3 air)
1877 l = hyswptr_aer(isize,itype)
1878 if (l .ge. p1st) then
1879 water_a_hyst(ibin)=rsub(l,k,m)*conv2a
1881 water_a_hyst(ibin)=0.0
1884 ! water_a units are kg/(m^3 air)
1885 l = waterptr_aer(isize,itype)
1886 if (l .ge. p1st) then
1887 water_a(ibin)=rsub(l,k,m)*conv2a
1892 ! num_a units are #/(cm^3 air)
1893 l = numptr_aer(isize,itype,iphase)
1894 num_a(ibin) = rsub(l,k,m)*cair_mol_cc
1896 ! other bin parameters (fixed for now)
1897 sigmag_a(ibin) = 1.02
1904 !---------------------------------------------------------------------
1907 else ! map aer & gas (nmol/m^3) back into rsub (mol/mol(air))
1912 if (kh2so4 .ge. p1st) &
1913 rsub(kh2so4,k,m) = gas(ih2so4_g)*conv1b
1914 if (khno3 .ge. p1st) &
1915 rsub(khno3,k,m) = gas(ihno3_g)*conv1b
1916 if (khcl .ge. p1st) &
1917 rsub(khcl,k,m) = gas(ihcl_g)*conv1b
1918 if (knh3 .ge. p1st) &
1919 rsub(knh3,k,m) = gas(inh3_g)*conv1b
1920 if (kn2o5 .ge. p1st) &
1921 rsub(kn2o5,k,m) = gas(in2o5_g)*conv1b
1922 if (kclno2 .ge. p1st) &
1923 rsub(kclno2,k,m) = gas(iclno2_g)*conv1b
1925 ! soa gas-phase species -- currently deactivated
1926 if (kpcg1_b_c .ge. p1st) &
1927 rsub(kpcg1_b_c,k,m) = gas(ipcg1_b_c_g)*conv1b
1928 if (kpcg2_b_c .ge. p1st) &
1929 rsub(kpcg2_b_c,k,m) = gas(ipcg2_b_c_g)*conv1b
1930 if (kpcg3_b_c .ge. p1st) &
1931 rsub(kpcg3_b_c,k,m) = gas(ipcg3_b_c_g)*conv1b
1932 if (kpcg4_b_c .ge. p1st) &
1933 rsub(kpcg4_b_c,k,m) = gas(ipcg4_b_c_g)*conv1b
1934 if (kpcg5_b_c .ge. p1st) &
1935 rsub(kpcg5_b_c,k,m) = gas(ipcg5_b_c_g)*conv1b
1936 if (kpcg6_b_c .ge. p1st) &
1937 rsub(kpcg6_b_c,k,m) = gas(ipcg6_b_c_g)*conv1b
1938 if (kpcg7_b_c .ge. p1st) &
1939 rsub(kpcg7_b_c,k,m) = gas(ipcg7_b_c_g)*conv1b
1940 if (kpcg8_b_c .ge. p1st) &
1941 rsub(kpcg8_b_c,k,m) = gas(ipcg8_b_c_g)*conv1b
1942 if (kpcg9_b_c .ge. p1st) &
1943 rsub(kpcg9_b_c,k,m) = gas(ipcg9_b_c_g)*conv1b
1944 if (kpcg1_b_o .ge. p1st) &
1945 rsub(kpcg1_b_o,k,m) = gas(ipcg1_b_o_g)*conv1b
1946 if (kpcg2_b_o .ge. p1st) &
1947 rsub(kpcg2_b_o,k,m) = gas(ipcg2_b_o_g)*conv1b
1948 if (kpcg3_b_o .ge. p1st) &
1949 rsub(kpcg3_b_o,k,m) = gas(ipcg3_b_o_g)*conv1b
1950 if (kpcg4_b_o .ge. p1st) &
1951 rsub(kpcg4_b_o,k,m) = gas(ipcg4_b_o_g)*conv1b
1952 if (kpcg5_b_o .ge. p1st) &
1953 rsub(kpcg5_b_o,k,m) = gas(ipcg5_b_o_g)*conv1b
1954 if (kpcg6_b_o .ge. p1st) &
1955 rsub(kpcg6_b_o,k,m) = gas(ipcg6_b_o_g)*conv1b
1956 if (kpcg7_b_o .ge. p1st) &
1957 rsub(kpcg7_b_o,k,m) = gas(ipcg7_b_o_g)*conv1b
1958 if (kpcg8_b_o .ge. p1st) &
1959 rsub(kpcg8_b_o,k,m) = gas(ipcg8_b_o_g)*conv1b
1960 if (kpcg9_b_o .ge. p1st) &
1961 rsub(kpcg9_b_o,k,m) = gas(ipcg9_b_o_g)*conv1b
1962 if (kopcg1_b_c .ge. p1st) &
1963 rsub(kopcg1_b_c,k,m) = gas(iopcg1_b_c_g)*conv1b
1964 if (kopcg2_b_c .ge. p1st) &
1965 rsub(kopcg2_b_c,k,m) = gas(iopcg2_b_c_g)*conv1b
1966 if (kopcg3_b_c .ge. p1st) &
1967 rsub(kopcg3_b_c,k,m) = gas(iopcg3_b_c_g)*conv1b
1968 if (kopcg4_b_c .ge. p1st) &
1969 rsub(kopcg4_b_c,k,m) = gas(iopcg4_b_c_g)*conv1b
1970 if (kopcg5_b_c .ge. p1st) &
1971 rsub(kopcg5_b_c,k,m) = gas(iopcg5_b_c_g)*conv1b
1972 if (kopcg6_b_c .ge. p1st) &
1973 rsub(kopcg6_b_c,k,m) = gas(iopcg6_b_c_g)*conv1b
1974 if (kopcg7_b_c .ge. p1st) &
1975 rsub(kopcg7_b_c,k,m) = gas(iopcg7_b_c_g)*conv1b
1976 if (kopcg8_b_c .ge. p1st) &
1977 rsub(kopcg8_b_c,k,m) = gas(iopcg8_b_c_g)*conv1b
1978 if (kopcg1_b_o .ge. p1st) &
1979 rsub(kopcg1_b_o,k,m) = gas(iopcg1_b_o_g)*conv1b
1980 if (kopcg2_b_o .ge. p1st) &
1981 rsub(kopcg2_b_o,k,m) = gas(iopcg2_b_o_g)*conv1b
1982 if (kopcg3_b_o .ge. p1st) &
1983 rsub(kopcg3_b_o,k,m) = gas(iopcg3_b_o_g)*conv1b
1984 if (kopcg4_b_o .ge. p1st) &
1985 rsub(kopcg4_b_o,k,m) = gas(iopcg4_b_o_g)*conv1b
1986 if (kopcg5_b_o .ge. p1st) &
1987 rsub(kopcg5_b_o,k,m) = gas(iopcg5_b_o_g)*conv1b
1988 if (kopcg6_b_o .ge. p1st) &
1989 rsub(kopcg6_b_o,k,m) = gas(iopcg6_b_o_g)*conv1b
1990 if (kopcg7_b_o .ge. p1st) &
1991 rsub(kopcg7_b_o,k,m) = gas(iopcg7_b_o_g)*conv1b
1992 if (kopcg8_b_o .ge. p1st) &
1993 rsub(kopcg8_b_o,k,m) = gas(iopcg8_b_o_g)*conv1b
1994 if (kpcg1_f_c .ge. p1st) &
1995 rsub(kpcg1_f_c,k,m) = gas(ipcg1_f_c_g)*conv1b
1996 if (kpcg2_f_c .ge. p1st) &
1997 rsub(kpcg2_f_c,k,m) = gas(ipcg2_f_c_g)*conv1b
1998 if (kpcg3_f_c .ge. p1st) &
1999 rsub(kpcg3_f_c,k,m) = gas(ipcg3_f_c_g)*conv1b
2000 if (kpcg4_f_c .ge. p1st) &
2001 rsub(kpcg4_f_c,k,m) = gas(ipcg4_f_c_g)*conv1b
2002 if (kpcg5_f_c .ge. p1st) &
2003 rsub(kpcg5_f_c,k,m) = gas(ipcg5_f_c_g)*conv1b
2004 if (kpcg6_f_c .ge. p1st) &
2005 rsub(kpcg6_f_c,k,m) = gas(ipcg6_f_c_g)*conv1b
2006 if (kpcg7_f_c .ge. p1st) &
2007 rsub(kpcg7_f_c,k,m) = gas(ipcg7_f_c_g)*conv1b
2008 if (kpcg8_f_c .ge. p1st) &
2009 rsub(kpcg8_f_c,k,m) = gas(ipcg8_f_c_g)*conv1b
2010 if (kpcg9_f_c .ge. p1st) &
2011 rsub(kpcg9_f_c,k,m) = gas(ipcg9_f_c_g)*conv1b
2012 if (kpcg1_f_o .ge. p1st) &
2013 rsub(kpcg1_f_o,k,m) = gas(ipcg1_f_o_g)*conv1b
2014 if (kpcg2_f_o .ge. p1st) &
2015 rsub(kpcg2_f_o,k,m) = gas(ipcg2_f_o_g)*conv1b
2016 if (kpcg3_f_o .ge. p1st) &
2017 rsub(kpcg3_f_o,k,m) = gas(ipcg3_f_o_g)*conv1b
2018 if (kpcg4_f_o .ge. p1st) &
2019 rsub(kpcg4_f_o,k,m) = gas(ipcg4_f_o_g)*conv1b
2020 if (kpcg5_f_o .ge. p1st) &
2021 rsub(kpcg5_f_o,k,m) = gas(ipcg5_f_o_g)*conv1b
2022 if (kpcg6_f_o .ge. p1st) &
2023 rsub(kpcg6_f_o,k,m) = gas(ipcg6_f_o_g)*conv1b
2024 if (kpcg7_f_o .ge. p1st) &
2025 rsub(kpcg7_f_o,k,m) = gas(ipcg7_f_o_g)*conv1b
2026 if (kpcg8_f_o .ge. p1st) &
2027 rsub(kpcg8_f_o,k,m) = gas(ipcg8_f_o_g)*conv1b
2028 if (kpcg9_f_o .ge. p1st) &
2029 rsub(kpcg9_f_o,k,m) = gas(ipcg9_f_o_g)*conv1b
2030 if (kopcg1_f_c .ge. p1st) &
2031 rsub(kopcg1_f_c,k,m) = gas(iopcg1_f_c_g)*conv1b
2032 if (kopcg2_f_c .ge. p1st) &
2033 rsub(kopcg2_f_c,k,m) = gas(iopcg2_f_c_g)*conv1b
2034 if (kopcg3_f_c .ge. p1st) &
2035 rsub(kopcg3_f_c,k,m) = gas(iopcg3_f_c_g)*conv1b
2036 if (kopcg4_f_c .ge. p1st) &
2037 rsub(kopcg4_f_c,k,m) = gas(iopcg4_f_c_g)*conv1b
2038 if (kopcg5_f_c .ge. p1st) &
2039 rsub(kopcg5_f_c,k,m) = gas(iopcg5_f_c_g)*conv1b
2040 if (kopcg6_f_c .ge. p1st) &
2041 rsub(kopcg6_f_c,k,m) = gas(iopcg6_f_c_g)*conv1b
2042 if (kopcg7_f_c .ge. p1st) &
2043 rsub(kopcg7_f_c,k,m) = gas(iopcg7_f_c_g)*conv1b
2044 if (kopcg8_f_c .ge. p1st) &
2045 rsub(kopcg8_f_c,k,m) = gas(iopcg8_f_c_g)*conv1b
2046 if (kopcg1_f_o .ge. p1st) &
2047 rsub(kopcg1_f_o,k,m) = gas(iopcg1_f_o_g)*conv1b
2048 if (kopcg2_f_o .ge. p1st) &
2049 rsub(kopcg2_f_o,k,m) = gas(iopcg2_f_o_g)*conv1b
2050 if (kopcg3_f_o .ge. p1st) &
2051 rsub(kopcg3_f_o,k,m) = gas(iopcg3_f_o_g)*conv1b
2052 if (kopcg4_f_o .ge. p1st) &
2053 rsub(kopcg4_f_o,k,m) = gas(iopcg4_f_o_g)*conv1b
2054 if (kopcg5_f_o .ge. p1st) &
2055 rsub(kopcg5_f_o,k,m) = gas(iopcg5_f_o_g)*conv1b
2056 if (kopcg6_f_o .ge. p1st) &
2057 rsub(kopcg6_f_o,k,m) = gas(iopcg6_f_o_g)*conv1b
2058 if (kopcg7_f_o .ge. p1st) &
2059 rsub(kopcg7_f_o,k,m) = gas(iopcg7_f_o_g)*conv1b
2060 if (kopcg8_f_o .ge. p1st) &
2061 rsub(kopcg8_f_o,k,m) = gas(iopcg8_f_o_g)*conv1b
2062 if (ksmpa .ge. p1st) &
2063 rsub(ksmpa,k,m) = gas(ismpa_g)*conv1b
2064 if (kgly .ge. p1st) &
2065 rsub(kgly,k,m) = gas(igly)*conv1b
2066 ! CK 20120913 OH is only used as scaling quantity, not returned to gas array
2067 !! if (koh .ge. p1st) &
2068 !! rsub(koh,k,m) = gas(iho)*conv1b
2069 if (ksmpbb .ge. p1st) &
2070 rsub(ksmpbb,k,m) = gas(ismpbb_g)*conv1b
2071 if (kant1_c .ge. p1st) &
2072 rsub(kant1_c,k,m) = gas(iant1_c_g)*conv1b
2073 if (kant2_c .ge. p1st) &
2074 rsub(kant2_c,k,m) = gas(iant2_c_g)*conv1b
2075 if (kant3_c .ge. p1st) &
2076 rsub(kant3_c,k,m) = gas(iant3_c_g)*conv1b
2077 if (kant4_c .ge. p1st) &
2078 rsub(kant4_c,k,m) = gas(iant4_c_g)*conv1b
2079 if (kant1_o .ge. p1st) &
2080 rsub(kant1_o,k,m) = gas(iant1_o_g)*conv1b
2081 if (kant2_o .ge. p1st) &
2082 rsub(kant2_o,k,m) = gas(iant2_o_g)*conv1b
2083 if (kant3_o .ge. p1st) &
2084 rsub(kant3_o,k,m) = gas(iant3_o_g)*conv1b
2085 if (kant4_o .ge. p1st) &
2086 rsub(kant4_o,k,m) = gas(iant4_o_g)*conv1b
2087 if (kbiog1_c .ge. p1st) &
2088 rsub(kbiog1_c,k,m) = gas(ibiog1_c_g)*conv1b
2089 if (kbiog2_c .ge. p1st) &
2090 rsub(kbiog2_c,k,m) = gas(ibiog2_c_g)*conv1b
2091 if (kbiog3_c .ge. p1st) &
2092 rsub(kbiog3_c,k,m) = gas(ibiog3_c_g)*conv1b
2093 if (kbiog4_c .ge. p1st) &
2094 rsub(kbiog4_c,k,m) = gas(ibiog4_c_g)*conv1b
2095 if (kbiog1_o .ge. p1st) &
2096 rsub(kbiog1_o,k,m) = gas(ibiog1_o_g)*conv1b
2097 if (kbiog2_o .ge. p1st) &
2098 rsub(kbiog2_o,k,m) = gas(ibiog2_o_g)*conv1b
2099 if (kbiog3_o .ge. p1st) &
2100 rsub(kbiog3_o,k,m) = gas(ibiog3_o_g)*conv1b
2101 if (kbiog4_o .ge. p1st) &
2102 rsub(kbiog4_o,k,m) = gas(ibiog4_o_g)*conv1b
2103 if (kasoaX .ge. p1st) &
2104 rsub(kasoaX,k,m) = gas(iasoaX_g)*conv1b
2105 if (kasoa1 .ge. p1st) &
2106 rsub(kasoa1,k,m) = gas(iasoa1_g)*conv1b
2107 if (kasoa2 .ge. p1st) &
2108 rsub(kasoa2,k,m) = gas(iasoa2_g)*conv1b
2109 if (kasoa3 .ge. p1st) &
2110 rsub(kasoa3,k,m) = gas(iasoa3_g)*conv1b
2111 if (kasoa4 .ge. p1st) &
2112 rsub(kasoa4,k,m) = gas(iasoa4_g)*conv1b
2113 if (kbsoaX .ge. p1st) &
2114 rsub(kbsoaX,k,m) = gas(ibsoaX_g)*conv1b
2115 if (kbsoa1 .ge. p1st) &
2116 rsub(kbsoa1,k,m) = gas(ibsoa1_g)*conv1b
2117 if (kbsoa2 .ge. p1st) &
2118 rsub(kbsoa2,k,m) = gas(ibsoa2_g)*conv1b
2119 if (kbsoa3 .ge. p1st) &
2120 rsub(kbsoa3,k,m) = gas(ibsoa3_g)*conv1b
2121 if (kbsoa4 .ge. p1st) &
2122 rsub(kbsoa4,k,m) = gas(ibsoa4_g)*conv1b
2127 do 20 itype = 1, ntype_aer
2128 do 20 isize = 1, nsize_aer(itype)
2132 ! rce 18-nov-2004 - always map so4 and number,
2133 ! but only map other species when (lptr_xxx .ge. p1st)
2134 l = lptr_so4_aer(isize,itype,iphase)
2135 rsub(l,k,m) = aer(iso4_a,jtotal,ibin)*conv1b
2137 l = lptr_no3_aer(isize,itype,iphase)
2138 if (l .ge. p1st) rsub(l,k,m) = aer(ino3_a,jtotal,ibin)*conv1b
2140 l = lptr_cl_aer(isize,itype,iphase)
2141 if (l .ge. p1st) rsub(l,k,m) = aer(icl_a,jtotal,ibin)*conv1b
2143 l = lptr_nh4_aer(isize,itype,iphase)
2144 if (l .ge. p1st) rsub(l,k,m) = aer(inh4_a,jtotal,ibin)*conv1b
2146 l = lptr_oc_aer(isize,itype,iphase)
2147 if (l .ge. p1st) rsub(l,k,m) = aer(ioc_a,jtotal,ibin)*conv1b
2149 l = lptr_bc_aer(isize,itype,iphase)
2150 if (l .ge. p1st) rsub(l,k,m) = aer(ibc_a,jtotal,ibin)*conv1b
2152 l = lptr_na_aer(isize,itype,iphase)
2153 if (l .ge. p1st) rsub(l,k,m) = aer(ina_a,jtotal,ibin)*conv1b
2155 l = lptr_oin_aer(isize,itype,iphase)
2156 if (l .ge. p1st) rsub(l,k,m) = aer(ioin_a,jtotal,ibin)*conv1b
2158 l = lptr_msa_aer(isize,itype,iphase)
2159 if (l .ge. p1st) rsub(l,k,m) = aer(imsa_a,jtotal,ibin)*conv1b
2161 l = lptr_co3_aer(isize,itype,iphase)
2162 if (l .ge. p1st) rsub(l,k,m) = aer(ico3_a,jtotal,ibin)*conv1b
2164 l = lptr_ca_aer(isize,itype,iphase)
2165 if (l .ge. p1st) rsub(l,k,m) = aer(ica_a,jtotal,ibin)*conv1b
2167 ! soa aerosol-phase species -- currently deactivated
2169 l = lptr_pcg1_b_c_aer(isize,itype,iphase)
2170 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg1_b_c_a,jtotal,ibin)*conv1b
2171 l = lptr_pcg2_b_c_aer(isize,itype,iphase)
2172 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg2_b_c_a,jtotal,ibin)*conv1b
2173 l = lptr_pcg3_b_c_aer(isize,itype,iphase)
2174 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg3_b_c_a,jtotal,ibin)*conv1b
2175 l = lptr_pcg4_b_c_aer(isize,itype,iphase)
2176 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg4_b_c_a,jtotal,ibin)*conv1b
2177 l = lptr_pcg5_b_c_aer(isize,itype,iphase)
2178 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg5_b_c_a,jtotal,ibin)*conv1b
2179 l = lptr_pcg6_b_c_aer(isize,itype,iphase)
2180 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg6_b_c_a,jtotal,ibin)*conv1b
2181 l = lptr_pcg7_b_c_aer(isize,itype,iphase)
2182 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg7_b_c_a,jtotal,ibin)*conv1b
2183 l = lptr_pcg8_b_c_aer(isize,itype,iphase)
2184 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg8_b_c_a,jtotal,ibin)*conv1b
2185 l = lptr_pcg9_b_c_aer(isize,itype,iphase)
2186 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg9_b_c_a,jtotal,ibin)*conv1b
2187 l = lptr_pcg1_b_o_aer(isize,itype,iphase)
2188 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg1_b_o_a,jtotal,ibin)*conv1b
2189 l = lptr_pcg2_b_o_aer(isize,itype,iphase)
2190 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg2_b_o_a,jtotal,ibin)*conv1b
2191 l = lptr_pcg3_b_o_aer(isize,itype,iphase)
2192 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg3_b_o_a,jtotal,ibin)*conv1b
2193 l = lptr_pcg4_b_o_aer(isize,itype,iphase)
2194 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg4_b_o_a,jtotal,ibin)*conv1b
2195 l = lptr_pcg5_b_o_aer(isize,itype,iphase)
2196 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg5_b_o_a,jtotal,ibin)*conv1b
2197 l = lptr_pcg6_b_o_aer(isize,itype,iphase)
2198 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg6_b_o_a,jtotal,ibin)*conv1b
2199 l = lptr_pcg7_b_o_aer(isize,itype,iphase)
2200 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg7_b_o_a,jtotal,ibin)*conv1b
2201 l = lptr_pcg8_b_o_aer(isize,itype,iphase)
2202 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg8_b_o_a,jtotal,ibin)*conv1b
2203 l = lptr_pcg9_b_o_aer(isize,itype,iphase)
2204 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg9_b_o_a,jtotal,ibin)*conv1b
2205 l = lptr_opcg1_b_c_aer(isize,itype,iphase)
2206 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg1_b_c_a,jtotal,ibin)*conv1b
2207 l = lptr_opcg2_b_c_aer(isize,itype,iphase)
2208 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg2_b_c_a,jtotal,ibin)*conv1b
2209 l = lptr_opcg3_b_c_aer(isize,itype,iphase)
2210 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg3_b_c_a,jtotal,ibin)*conv1b
2211 l = lptr_opcg4_b_c_aer(isize,itype,iphase)
2212 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg4_b_c_a,jtotal,ibin)*conv1b
2213 l = lptr_opcg5_b_c_aer(isize,itype,iphase)
2214 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg5_b_c_a,jtotal,ibin)*conv1b
2215 l = lptr_opcg6_b_c_aer(isize,itype,iphase)
2216 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg6_b_c_a,jtotal,ibin)*conv1b
2217 l = lptr_opcg7_b_c_aer(isize,itype,iphase)
2218 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg7_b_c_a,jtotal,ibin)*conv1b
2219 l = lptr_opcg8_b_c_aer(isize,itype,iphase)
2220 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg8_b_c_a,jtotal,ibin)*conv1b
2221 l = lptr_opcg1_b_o_aer(isize,itype,iphase)
2222 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg1_b_o_a,jtotal,ibin)*conv1b
2223 l = lptr_opcg2_b_o_aer(isize,itype,iphase)
2224 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg2_b_o_a,jtotal,ibin)*conv1b
2225 l = lptr_opcg3_b_o_aer(isize,itype,iphase)
2226 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg3_b_o_a,jtotal,ibin)*conv1b
2227 l = lptr_opcg4_b_o_aer(isize,itype,iphase)
2228 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg4_b_o_a,jtotal,ibin)*conv1b
2229 l = lptr_opcg5_b_o_aer(isize,itype,iphase)
2230 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg5_b_o_a,jtotal,ibin)*conv1b
2231 l = lptr_opcg6_b_o_aer(isize,itype,iphase)
2232 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg6_b_o_a,jtotal,ibin)*conv1b
2233 l = lptr_opcg7_b_o_aer(isize,itype,iphase)
2234 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg7_b_o_a,jtotal,ibin)*conv1b
2235 l = lptr_opcg8_b_o_aer(isize,itype,iphase)
2236 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg8_b_o_a,jtotal,ibin)*conv1b
2237 l = lptr_pcg1_f_c_aer(isize,itype,iphase)
2238 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg1_f_c_a,jtotal,ibin)*conv1b
2239 l = lptr_pcg2_f_c_aer(isize,itype,iphase)
2240 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg2_f_c_a,jtotal,ibin)*conv1b
2241 l = lptr_pcg3_f_c_aer(isize,itype,iphase)
2242 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg3_f_c_a,jtotal,ibin)*conv1b
2243 l = lptr_pcg4_f_c_aer(isize,itype,iphase)
2244 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg4_f_c_a,jtotal,ibin)*conv1b
2245 l = lptr_pcg5_f_c_aer(isize,itype,iphase)
2246 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg5_f_c_a,jtotal,ibin)*conv1b
2247 l = lptr_pcg6_f_c_aer(isize,itype,iphase)
2248 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg6_f_c_a,jtotal,ibin)*conv1b
2249 l = lptr_pcg7_f_c_aer(isize,itype,iphase)
2250 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg7_f_c_a,jtotal,ibin)*conv1b
2251 l = lptr_pcg8_f_c_aer(isize,itype,iphase)
2252 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg8_f_c_a,jtotal,ibin)*conv1b
2253 l = lptr_pcg9_f_c_aer(isize,itype,iphase)
2254 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg9_f_c_a,jtotal,ibin)*conv1b
2255 l = lptr_pcg1_f_o_aer(isize,itype,iphase)
2256 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg1_f_o_a,jtotal,ibin)*conv1b
2257 l = lptr_pcg2_f_o_aer(isize,itype,iphase)
2258 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg2_f_o_a,jtotal,ibin)*conv1b
2259 l = lptr_pcg3_f_o_aer(isize,itype,iphase)
2260 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg3_f_o_a,jtotal,ibin)*conv1b
2261 l = lptr_pcg4_f_o_aer(isize,itype,iphase)
2262 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg4_f_o_a,jtotal,ibin)*conv1b
2263 l = lptr_pcg5_f_o_aer(isize,itype,iphase)
2264 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg5_f_o_a,jtotal,ibin)*conv1b
2265 l = lptr_pcg6_f_o_aer(isize,itype,iphase)
2266 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg6_f_o_a,jtotal,ibin)*conv1b
2267 l = lptr_pcg7_f_o_aer(isize,itype,iphase)
2268 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg7_f_o_a,jtotal,ibin)*conv1b
2269 l = lptr_pcg8_f_o_aer(isize,itype,iphase)
2270 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg8_f_o_a,jtotal,ibin)*conv1b
2271 l = lptr_pcg9_f_o_aer(isize,itype,iphase)
2272 if (l .ge. p1st) rsub(l,k,m) = aer(ipcg9_f_o_a,jtotal,ibin)*conv1b
2273 l = lptr_opcg1_f_c_aer(isize,itype,iphase)
2274 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg1_f_c_a,jtotal,ibin)*conv1b
2275 l = lptr_opcg2_f_c_aer(isize,itype,iphase)
2276 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg2_f_c_a,jtotal,ibin)*conv1b
2277 l = lptr_opcg3_f_c_aer(isize,itype,iphase)
2278 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg3_f_c_a,jtotal,ibin)*conv1b
2279 l = lptr_opcg4_f_c_aer(isize,itype,iphase)
2280 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg4_f_c_a,jtotal,ibin)*conv1b
2281 l = lptr_opcg5_f_c_aer(isize,itype,iphase)
2282 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg5_f_c_a,jtotal,ibin)*conv1b
2283 l = lptr_opcg6_f_c_aer(isize,itype,iphase)
2284 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg6_f_c_a,jtotal,ibin)*conv1b
2285 l = lptr_opcg7_f_c_aer(isize,itype,iphase)
2286 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg7_f_c_a,jtotal,ibin)*conv1b
2287 l = lptr_opcg8_f_c_aer(isize,itype,iphase)
2288 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg8_f_c_a,jtotal,ibin)*conv1b
2289 l = lptr_opcg1_f_o_aer(isize,itype,iphase)
2290 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg1_f_o_a,jtotal,ibin)*conv1b
2291 l = lptr_opcg2_f_o_aer(isize,itype,iphase)
2292 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg2_f_o_a,jtotal,ibin)*conv1b
2293 l = lptr_opcg3_f_o_aer(isize,itype,iphase)
2294 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg3_f_o_a,jtotal,ibin)*conv1b
2295 l = lptr_opcg4_f_o_aer(isize,itype,iphase)
2296 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg4_f_o_a,jtotal,ibin)*conv1b
2297 l = lptr_opcg5_f_o_aer(isize,itype,iphase)
2298 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg5_f_o_a,jtotal,ibin)*conv1b
2299 l = lptr_opcg6_f_o_aer(isize,itype,iphase)
2300 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg6_f_o_a,jtotal,ibin)*conv1b
2301 l = lptr_opcg7_f_o_aer(isize,itype,iphase)
2302 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg7_f_o_a,jtotal,ibin)*conv1b
2303 l = lptr_opcg8_f_o_aer(isize,itype,iphase)
2304 if (l .ge. p1st) rsub(l,k,m) = aer(iopcg8_f_o_a,jtotal,ibin)*conv1b
2306 l = lptr_smpa_aer(isize,itype,iphase)
2307 if (l .ge. p1st) rsub(l,k,m) = aer(ismpa_a,jtotal,ibin)*conv1b
2308 l = lptr_smpbb_aer(isize,itype,iphase)
2309 if (l .ge. p1st) rsub(l,k,m) = aer(ismpbb_a,jtotal,ibin)*conv1b
2310 l = lptr_glysoa_r1_aer(isize,itype,iphase)
2311 if (l .ge. p1st) rsub(l,k,m) = aer(iglysoa_r1_a,jtotal,ibin)*conv1b
2312 l = lptr_glysoa_r2_aer(isize,itype,iphase)
2313 if (l .ge. p1st) rsub(l,k,m) = aer(iglysoa_r2_a,jtotal,ibin)*conv1b
2314 l = lptr_glysoa_sfc_aer(isize,itype,iphase)
2315 if (l .ge. p1st) rsub(l,k,m) = aer(iglysoa_sfc_a,jtotal,ibin)*conv1b
2316 l = lptr_glysoa_nh4_aer(isize,itype,iphase)
2317 if (l .ge. p1st) rsub(l,k,m) = aer(iglysoa_nh4_a,jtotal,ibin)*conv1b
2318 l = lptr_glysoa_oh_aer(isize,itype,iphase)
2319 if (l .ge. p1st) rsub(l,k,m) = aer(iglysoa_oh_a,jtotal,ibin)*conv1b
2321 l = lptr_ant1_c_aer(isize,itype,iphase)
2322 if (l .ge. p1st) rsub(l,k,m) = aer(iant1_c_a,jtotal,ibin)*conv1b
2323 l = lptr_ant2_c_aer(isize,itype,iphase)
2324 if (l .ge. p1st) rsub(l,k,m) = aer(iant2_c_a,jtotal,ibin)*conv1b
2325 l = lptr_ant3_c_aer(isize,itype,iphase)
2326 if (l .ge. p1st) rsub(l,k,m) = aer(iant3_c_a,jtotal,ibin)*conv1b
2327 l = lptr_ant4_c_aer(isize,itype,iphase)
2328 if (l .ge. p1st) rsub(l,k,m) = aer(iant4_c_a,jtotal,ibin)*conv1b
2329 l = lptr_ant1_o_aer(isize,itype,iphase)
2330 if (l .ge. p1st) rsub(l,k,m) = aer(iant1_o_a,jtotal,ibin)*conv1b
2331 l = lptr_ant2_o_aer(isize,itype,iphase)
2332 if (l .ge. p1st) rsub(l,k,m) = aer(iant2_o_a,jtotal,ibin)*conv1b
2333 l = lptr_ant3_o_aer(isize,itype,iphase)
2334 if (l .ge. p1st) rsub(l,k,m) = aer(iant3_o_a,jtotal,ibin)*conv1b
2335 l = lptr_ant4_o_aer(isize,itype,iphase)
2336 if (l .ge. p1st) rsub(l,k,m) = aer(iant4_o_a,jtotal,ibin)*conv1b
2337 l = lptr_biog1_c_aer(isize,itype,iphase)
2338 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog1_c_a,jtotal,ibin)*conv1b
2339 l = lptr_biog2_c_aer(isize,itype,iphase)
2340 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog2_c_a,jtotal,ibin)*conv1b
2341 l = lptr_biog3_c_aer(isize,itype,iphase)
2342 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog3_c_a,jtotal,ibin)*conv1b
2343 l = lptr_biog4_c_aer(isize,itype,iphase)
2344 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog4_c_a,jtotal,ibin)*conv1b
2345 l = lptr_biog1_o_aer(isize,itype,iphase)
2346 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog1_o_a,jtotal,ibin)*conv1b
2347 l = lptr_biog2_o_aer(isize,itype,iphase)
2348 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog2_o_a,jtotal,ibin)*conv1b
2349 l = lptr_biog3_o_aer(isize,itype,iphase)
2350 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog3_o_a,jtotal,ibin)*conv1b
2351 l = lptr_biog4_o_aer(isize,itype,iphase)
2352 if (l .ge. p1st) rsub(l,k,m) = aer(ibiog4_o_a,jtotal,ibin)*conv1b
2354 l = lptr_asoaX_aer(isize,itype,iphase)
2355 if (l .ge. p1st) rsub(l,k,m) = aer(iasoaX_a,jtotal,ibin)*conv1b
2356 l = lptr_asoa1_aer(isize,itype,iphase)
2357 if (l .ge. p1st) rsub(l,k,m) = aer(iasoa1_a,jtotal,ibin)*conv1b
2358 l = lptr_asoa2_aer(isize,itype,iphase)
2359 if (l .ge. p1st) rsub(l,k,m) = aer(iasoa2_a,jtotal,ibin)*conv1b
2360 l = lptr_asoa3_aer(isize,itype,iphase)
2361 if (l .ge. p1st) rsub(l,k,m) = aer(iasoa3_a,jtotal,ibin)*conv1b
2362 l = lptr_asoa4_aer(isize,itype,iphase)
2363 if (l .ge. p1st) rsub(l,k,m) = aer(iasoa4_a,jtotal,ibin)*conv1b
2364 l = lptr_bsoaX_aer(isize,itype,iphase)
2365 if (l .ge. p1st) rsub(l,k,m) = aer(ibsoaX_a,jtotal,ibin)*conv1b
2366 l = lptr_bsoa1_aer(isize,itype,iphase)
2367 if (l .ge. p1st) rsub(l,k,m) = aer(ibsoa1_a,jtotal,ibin)*conv1b
2368 l = lptr_bsoa2_aer(isize,itype,iphase)
2369 if (l .ge. p1st) rsub(l,k,m) = aer(ibsoa2_a,jtotal,ibin)*conv1b
2370 l = lptr_bsoa3_aer(isize,itype,iphase)
2371 if (l .ge. p1st) rsub(l,k,m) = aer(ibsoa3_a,jtotal,ibin)*conv1b
2372 l = lptr_bsoa4_aer(isize,itype,iphase)
2373 if (l .ge. p1st) rsub(l,k,m) = aer(ibsoa4_a,jtotal,ibin)*conv1b
2378 l = hyswptr_aer(isize,itype)
2379 if (l .ge. p1st) rsub(l,k,m) = water_a_hyst(ibin)*conv2b
2381 l = waterptr_aer(isize,itype)
2382 if (l .ge. p1st) rsub(l,k,m) = water_a(ibin)*conv2b
2384 l = numptr_aer(isize,itype,iphase)
2385 if (l .ge. p1st) rsub(l,k,m) = num_a(ibin)/cair_mol_cc
2388 drymass_aftgrow(isize,itype) = mass_dry_a(ibin)/cair_mol_cc ! g/mol-air
2389 if(jaerosolstate(ibin) .eq. no_aerosol) then
2390 drydens_aftgrow(isize,itype) = -1.
2392 drydens_aftgrow(isize,itype) = dens_dry_a(ibin) ! g/cc
2400 end subroutine map_mosaic_species
2406 subroutine isize_itype_from_ibin( ibin, isize, itype )
2408 ! inside of mosaic, the '2d' (isize,itype) indexing is replaced
2409 ! by '1d' (ibin) indexing
2410 ! this routine gives (isize,itype) corresponding to (ibin)
2412 use module_data_mosaic_asect
2413 use module_data_mosaic_other, only: lunerr
2417 integer ibin, isize, itype
2419 integer jdum_bin, jdum_size, jdum_type
2426 do jdum_type = 1, ntype_aer
2427 do jdum_size = 1, nsize_aer(jdum_type)
2428 jdum_bin = jdum_bin + 1
2429 if (ibin .eq. jdum_bin) then
2436 if (isize .le. 0) then
2437 write(msg,'(a,1x,i5)') &
2438 '*** subr isize_itype_from_ibin - bad ibin =', ibin
2439 call peg_error_fatal( lunerr, msg )
2443 end subroutine isize_itype_from_ibin
2448 subroutine overall_massbal_in
2450 use module_data_mosaic_asect
2451 use module_data_mosaic_other
2454 ! include 'mosaic.h'
2457 tot_so4_in = gas(ih2so4_g)
2458 tot_no3_in = gas(ihno3_g)
2459 tot_cl_in = gas(ihcl_g)
2460 tot_nh4_in = gas(inh3_g)
2466 tot_so4_in = tot_so4_in + aer(iso4_a,jtotal,ibin)
2467 tot_no3_in = tot_no3_in + aer(ino3_a,jtotal,ibin)
2468 tot_cl_in = tot_cl_in + aer(icl_a, jtotal,ibin)
2469 tot_nh4_in = tot_nh4_in + aer(inh4_a,jtotal,ibin)
2470 tot_na_in = tot_na_in + aer(ina_a,jtotal,ibin)
2471 tot_ca_in = tot_ca_in + aer(ica_a,jtotal,ibin)
2475 total_species(inh3_g) = tot_nh4_in
2476 total_species(ihno3_g)= tot_no3_in
2477 total_species(ihcl_g) = tot_cl_in
2481 end subroutine overall_massbal_in
2485 subroutine overall_massbal_out(mbin)
2489 ! include 'v33com9a'
2490 ! include 'v33com9b'
2491 ! include 'mosaic.h'
2500 tot_so4_out = gas(ih2so4_g)
2501 tot_no3_out = gas(ihno3_g)
2502 tot_cl_out = gas(ihcl_g)
2503 tot_nh4_out = gas(inh3_g)
2508 tot_so4_out = tot_so4_out + aer(iso4_a,jtotal,ibin)
2509 tot_no3_out = tot_no3_out + aer(ino3_a,jtotal,ibin)
2510 tot_cl_out = tot_cl_out + aer(icl_a,jtotal,ibin)
2511 tot_nh4_out = tot_nh4_out + aer(inh4_a,jtotal,ibin)
2512 tot_na_out = tot_na_out + aer(ina_a,jtotal,ibin)
2513 tot_ca_out = tot_ca_out + aer(ica_a,jtotal,ibin)
2516 diff_so4 = tot_so4_out - tot_so4_in
2517 diff_no3 = tot_no3_out - tot_no3_in
2518 diff_cl = tot_cl_out - tot_cl_in
2519 diff_nh4 = tot_nh4_out - tot_nh4_in
2520 diff_na = tot_na_out - tot_na_in
2521 diff_ca = tot_ca_out - tot_ca_in
2525 if(tot_so4_in .gt. 1.e-25 .or. tot_so4_out .gt. 1.e-25)then
2526 reldiff_so4 = diff_so4/max(tot_so4_in, tot_so4_out)
2530 if(tot_no3_in .gt. 1.e-25 .or. tot_no3_out .gt. 1.e-25)then
2531 reldiff_no3 = diff_no3/max(tot_no3_in, tot_no3_out)
2535 if(tot_cl_in .gt. 1.e-25 .or. tot_cl_out .gt. 1.e-25)then
2536 reldiff_cl = diff_cl/max(tot_cl_in, tot_cl_out)
2540 if(tot_nh4_in .gt. 1.e-25 .or. tot_nh4_out .gt. 1.e-25)then
2541 reldiff_nh4 = diff_nh4/max(tot_nh4_in, tot_nh4_out)
2545 if(tot_na_in .gt. 1.e-25 .or. tot_na_out .gt. 1.e-25)then
2546 reldiff_na = diff_na/max(tot_na_in, tot_na_out)
2550 if(tot_ca_in .gt. 1.e-25 .or. tot_ca_out .gt. 1.e-25)then
2551 reldiff_ca = diff_ca/max(tot_ca_in, tot_ca_out)
2556 if( abs(reldiff_so4) .gt. 1.e-4 .or. &
2557 abs(reldiff_no3) .gt. 1.e-4 .or. &
2558 abs(reldiff_cl) .gt. 1.e-4 .or. &
2559 abs(reldiff_nh4) .gt. 1.e-4 .or. &
2560 abs(reldiff_na) .gt. 1.e-4 .or. &
2561 abs(reldiff_ca) .gt. 1.e-4)then
2564 if (iprint_mosaic_diag1 .gt. 0) then
2565 if (iprint_input .eq. myes) then
2566 write(6,*)'*** mbin = ', mbin, ' isteps = ', isteps_ASTEM
2567 write(6,*)'reldiff_so4 = ', reldiff_so4
2568 write(6,*)'reldiff_no3 = ', reldiff_no3
2569 write(6,*)'reldiff_cl = ', reldiff_cl
2570 write(6,*)'reldiff_nh4 = ', reldiff_nh4
2571 write(6,*)'reldiff_na = ', reldiff_na
2572 write(6,*)'reldiff_ca = ', reldiff_ca
2582 end subroutine overall_massbal_out
2590 subroutine print_input
2592 use module_data_mosaic_asect
2593 use module_data_mosaic_other
2598 ! include 'v33com9a'
2599 ! include 'v33com9b'
2600 ! include 'mosaic.h'
2604 integer ibin, iphase, isize, itype
2605 integer ipasstmp, luntmp
2608 ! check for print_input allowed and not already done
2609 if (iprint_mosaic_input_ok .le. 0) return
2610 if (iprint_input .ne. myes) return
2617 tot_so4_out = gas(ih2so4_g)
2618 tot_no3_out = gas(ihno3_g)
2619 tot_cl_out = gas(ihcl_g)
2620 tot_nh4_out = gas(inh3_g)
2625 tot_so4_out = tot_so4_out + aer(iso4_a,jtotal,ibin)
2626 tot_no3_out = tot_no3_out + aer(ino3_a,jtotal,ibin)
2627 tot_cl_out = tot_cl_out + aer(icl_a,jtotal,ibin)
2628 tot_nh4_out = tot_nh4_out + aer(inh4_a,jtotal,ibin)
2629 tot_na_out = tot_na_out + aer(ina_a,jtotal,ibin)
2630 tot_ca_out = tot_ca_out + aer(ica_a,jtotal,ibin)
2633 diff_so4 = tot_so4_out - tot_so4_in
2634 diff_no3 = tot_no3_out - tot_no3_in
2635 diff_cl = tot_cl_out - tot_cl_in
2636 diff_nh4 = tot_nh4_out - tot_nh4_in
2637 diff_na = tot_na_out - tot_na_in
2638 diff_ca = tot_ca_out - tot_ca_in
2642 if(tot_so4_in .gt. 1.e-25 .or. tot_so4_out .gt. 1.e-25)then
2643 reldiff_so4 = diff_so4/max(tot_so4_in, tot_so4_out)
2647 if(tot_no3_in .gt. 1.e-25 .or. tot_no3_out .gt. 1.e-25)then
2648 reldiff_no3 = diff_no3/max(tot_no3_in, tot_no3_out)
2652 if(tot_cl_in .gt. 1.e-25 .or. tot_cl_out .gt. 1.e-25)then
2653 reldiff_cl = diff_cl/max(tot_cl_in, tot_cl_out)
2657 if(tot_nh4_in .gt. 1.e-25 .or. tot_nh4_out .gt. 1.e-25)then
2658 reldiff_nh4 = diff_nh4/max(tot_nh4_in, tot_nh4_out)
2662 if(tot_na_in .gt. 1.e-25 .or. tot_na_out .gt. 1.e-25)then
2663 reldiff_na = diff_na/max(tot_na_in, tot_na_out)
2667 if(tot_ca_in .gt. 1.e-25 .or. tot_ca_out .gt. 1.e-25)then
2668 reldiff_ca = diff_ca/max(tot_ca_in, tot_ca_out)
2672 do 2900 ipasstmp = 1, 2
2674 if (ipasstmp .eq. 1) then
2675 luntmp = 6 ! write to standard output
2677 luntmp = 67 ! write to fort.67
2678 ! goto 2900 ! skip this
2681 ! write to monitor screen
2682 write(luntmp,*)'+++++++++++++++++++++++++++++++++++++++++'
2683 write(luntmp,*)'i j k n = ', iclm_aer, jclm_aer, kclm_aer, &
2685 write(luntmp,*)'relative so4 mass bal = ', reldiff_so4
2686 write(luntmp,*)'relative no3 mass bal = ', reldiff_no3
2687 write(luntmp,*)'relative cl mass bal = ', reldiff_cl
2688 write(luntmp,*)'relative nh4 mass bal = ', reldiff_nh4
2689 write(luntmp,*)'relative na mass bal = ', reldiff_na
2690 write(luntmp,*)'relative ca mass bal = ', reldiff_ca
2691 write(luntmp,*)'inputs:'
2692 write(luntmp,*)'t (k), p (atm), rh (%), cair (mol/cc) = '
2693 write(luntmp,44) t_k, p_atm, rh_pc, cairclm(k)
2694 write(luntmp,*)'gas h2so4, hno3, hcl, nh3 (mol/mol)'
2695 write(luntmp,44)rsub(kh2so4,k,m), rsub(khno3,k,m), &
2696 rsub(khcl,k,m), rsub(knh3,k,m)
2701 do itype = 1, ntype_aer
2702 do isize = 1, nsize_aer(itype)
2705 write(luntmp,44) rsub(lptr_so4_aer(ibin,itype,iphase),k,m), &
2706 rsub(lptr_no3_aer(ibin,itype,iphase),k,m), &
2707 rsub(lptr_cl_aer(ibin,itype,iphase),k,m), &
2708 rsub(lptr_nh4_aer(ibin,itype,iphase),k,m), &
2709 rsub(lptr_oc_aer(ibin,itype,iphase),k,m), & ! ng/m^3(air)
2710 rsub(lptr_co3_aer(ibin,itype,iphase),k,m), &
2711 rsub(lptr_msa_aer(ibin,itype,iphase),k,m), &
2712 rsub(lptr_bc_aer(ibin,itype,iphase),k,m), & ! ng/m^3(air)
2713 rsub(lptr_na_aer(ibin,itype,iphase),k,m), &
2714 rsub(lptr_ca_aer(ibin,itype,iphase),k,m), &
2715 rsub(lptr_oin_aer(ibin,itype,iphase),k,m), &
2716 rsub(hyswptr_aer(ibin,itype),k,m), &
2717 rsub(waterptr_aer(ibin,itype),k,m), &
2718 rsub(numptr_aer(ibin,itype,iphase),k,m)
2722 write(luntmp,*)'+++++++++++++++++++++++++++++++++++++++++'
2732 end subroutine print_input
2751 !***********************************************************************
2752 ! checks if aerosol mass is too low to be of any significance
2753 ! and determine jaerosolstate
2755 ! author: rahul a. zaveri
2757 !-----------------------------------------------------------------------
2758 subroutine check_aerosol_mass(ibin)
2760 ! include 'mosaic.h'
2765 real(kind=8) drymass, aer_H
2767 mass_dry_a(ibin) = 0.0
2769 aer_H = (2.*aer(iso4_a,jtotal,ibin) + &
2770 aer(ino3_a,jtotal,ibin) + &
2771 aer(icl_a,jtotal,ibin) + &
2772 aer(imsa_a,jtotal,ibin) + &
2773 2.*aer(ico3_a,jtotal,ibin))- &
2774 (2.*aer(ica_a,jtotal,ibin) + &
2775 aer(ina_a,jtotal,ibin) + &
2776 aer(inh4_a,jtotal,ibin))
2780 mass_dry_a(ibin) = mass_dry_a(ibin) + &
2781 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer) ! ng/m^3(air)
2783 mass_dry_a(ibin) = mass_dry_a(ibin) + aer_H
2785 drymass = mass_dry_a(ibin) ! ng/m^3(air)
2786 mass_dry_a(ibin) = mass_dry_a(ibin)*1.e-15 ! g/cc(air)
2788 if(drymass .lt. mass_cutoff)then ! bin mass is too small
2789 jaerosolstate(ibin) = no_aerosol
2791 if(drymass .eq. 0.)num_a(ibin) = 0.0
2795 end subroutine check_aerosol_mass
2807 !***********************************************************************
2808 ! checks and conforms number according to the mass and bin size range
2810 ! author: rahul a. zaveri
2812 !-----------------------------------------------------------------------
2813 subroutine conform_aerosol_number(ibin)
2815 use module_data_mosaic_asect
2820 ! include 'v33com9a'
2821 ! include 'mosaic.h'
2825 integer je, l, iaer, isize, itype
2826 real(kind=8) num_at_dlo, num_at_dhi, numold
2829 vol_dry_a(ibin) = 0.0 ! initialize to 0.0
2831 if(jaerosolstate(ibin) .eq. no_aerosol) return
2833 aer_H = (2.*aer(iso4_a,jtotal,ibin) + &
2834 aer(ino3_a,jtotal,ibin) + &
2835 aer(icl_a,jtotal,ibin) + &
2836 aer(imsa_a,jtotal,ibin) + &
2837 2.*aer(ico3_a,jtotal,ibin))- &
2838 (2.*aer(ica_a,jtotal,ibin) + &
2839 aer(ina_a,jtotal,ibin) + &
2840 aer(inh4_a,jtotal,ibin))
2843 vol_dry_a(ibin) = vol_dry_a(ibin) + &
2844 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer)/dens_aer_mac(iaer) ! ng/m^3(air)
2846 vol_dry_a(ibin) = vol_dry_a(ibin) + aer_H
2848 vol_dry_a(ibin) = vol_dry_a(ibin)*1.e-15 ! cc(aer)/cc(air)
2851 call isize_itype_from_ibin( ibin, isize, itype )
2852 num_at_dlo = vol_dry_a(ibin)/volumlo_sect(isize,itype)
2853 num_at_dhi = vol_dry_a(ibin)/volumhi_sect(isize,itype)
2855 numold = num_a(ibin)
2856 num_a(ibin) = min(num_a(ibin), num_at_dlo) ! #/cc(air)
2857 num_a(ibin) = max(num_a(ibin), num_at_dhi) ! #/cc(air)
2859 ! if (numold .ne. num_a(ibin)) then
2860 ! write(*,*) 'conform number - i, vol, mass, numold/new', ibin,
2861 ! & vol_dry_a(ibin), mass_dry_temp, numold, num_a(ibin)
2862 ! write(*,*) 'conform i,j,k', iclm_aer, jclm_aer, kclm_aer
2863 ! if (nsubareas .gt. 0) then
2864 ! write(*,'(a,1pe14.4)') (name(l), rsub(l,kclm_aer,1), l=1,ltot2)
2866 ! write(*,'(a,1pe14.4)') (name(l), rclm(kclm_aer,l), l=1,ltot2)
2872 end subroutine conform_aerosol_number
2878 !***********************************************************************
2879 ! determines phase state of an aerosol bin. includes kelvin effect.
2881 ! author: rahul a. zaveri
2883 !-----------------------------------------------------------------------
2884 subroutine aerosol_phase_state(ibin)
2886 ! include 'mosaic.h'
2890 integer js, je, iaer, iv, iter_kelvin
2891 real(kind=8) ah2o_a_new, rel_err
2892 ! real(kind=8) aerosol_water_up, bin_molality ! mosaic func
2893 real(kind=8) kelvin_toler, term
2900 do iv = 1, ngas_volatile+ngas_het
2904 if(rh_pc .le. 99)then
2905 kelvin_toler = 1.e-2
2907 kelvin_toler = 1.e-6
2910 ! calculate dry mass and dry volume of a bin
2911 mass_dry_a(ibin) = 0.0 ! initialize to 0.0
2912 vol_dry_a(ibin) = 0.0 ! initialize to 0.0
2914 aer_H = (2.*aer(iso4_a,jtotal,ibin) + &
2915 aer(ino3_a,jtotal,ibin) + &
2916 aer(icl_a,jtotal,ibin) + &
2917 aer(imsa_a,jtotal,ibin) + &
2918 2.*aer(ico3_a,jtotal,ibin))- &
2919 (2.*aer(ica_a,jtotal,ibin) + &
2920 aer(ina_a,jtotal,ibin) + &
2921 aer(inh4_a,jtotal,ibin))
2924 mass_dry_a(ibin) = mass_dry_a(ibin) + &
2925 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer) ! ng/m^3(air)
2926 vol_dry_a(ibin) = vol_dry_a(ibin) + &
2927 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer)/dens_aer_mac(iaer) ! ncc/m^3(air)
2929 mass_dry_a(ibin) = mass_dry_a(ibin) + aer_H
2930 vol_dry_a(ibin) = vol_dry_a(ibin) + aer_H
2932 mass_dry_a(ibin) = mass_dry_a(ibin)*1.e-15 ! g/cc(air)
2933 vol_dry_a(ibin) = vol_dry_a(ibin)*1.e-15 ! cc(aer)/cc(air) or m^3/m^3(air)
2935 ! wet mass and wet volume
2936 mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
2937 vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air) or m^3/m^3(air)
2940 water_a_up(ibin) = aerosol_water_up(ibin) ! for hysteresis curve determination
2944 10 iter_kelvin = iter_kelvin + 1
2945 do je = 1, nelectrolyte
2946 molality0(je) = bin_molality(je,ibin) ! compute ah2o dependent binary molalities
2950 if(jaerosolstate(ibin) .eq. all_solid)then
2953 if (istat_mosaic_fe1 .lt. 0) return
2955 ! new wet mass and wet volume
2956 mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
2957 vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air) or m^3/m^3(air)
2959 call calculate_kelvin(ibin)
2961 ah2o_a_new = rh_pc*0.01/kelvin(ibin)
2963 rel_err = abs( (ah2o_a_new - ah2o_a(ibin))/ah2o_a(ibin))
2965 if(rel_err .gt. kelvin_toler .and. iter_kelvin.le.10)then
2966 ah2o_a(ibin) = ah2o_a_new
2970 if(jaerosolstate(ibin) .eq. all_liquid)jhyst_leg(ibin) = jhyst_up
2972 ! now compute kelvin effect terms for condensing species (nh3, hno3, and hcl)
2973 do iv = 1, ngas_volatile+ngas_het
2974 term = 4.*sigma_soln(ibin)*partial_molar_vol(iv)/ &
2975 (8.3144e7*T_K*DpmV(ibin))
2976 kel(iv,ibin) = 1. + term*(1. + 0.5*term*(1. + term/3.))
2981 end subroutine aerosol_phase_state
2988 !***********************************************************************
2989 ! computes kelvin effect term (kelvin => 1.0)
2991 ! author: rahul a. zaveri
2993 !-----------------------------------------------------------------------
2994 subroutine calculate_kelvin(ibin)
2996 ! include 'mosaic.h'
3004 volume_a(ibin) = vol_wet_a(ibin) ! [cc/cc(air)]
3005 dpmv(ibin)=(6.*volume_a(ibin)/(num_a(ibin)*3.1415926))**(1./3.) ! [cm]
3006 sigma_soln(ibin) = sigma_water + 49.0*(1. - ah2o_a(ibin)) ! [dyn/cm]
3007 term = 72.*sigma_soln(ibin)/(8.3144e7*t_k*dpmv(ibin)) ! [-]
3008 ! kelvin(ibin) = exp(term)
3009 kelvin(ibin) = 1. + term*(1. + 0.5*term*(1. + term/3.))
3013 end subroutine calculate_kelvin
3029 !***********************************************************************
3030 ! mesa: multicomponent equilibrium solver for aerosols.
3031 ! computes equilibrum solid and liquid phases by integrating
3032 ! pseudo-transient dissolution and precipitation reactions
3034 ! author: rahul a. zaveri
3036 ! update: 21 may 2014 - revised code to force metastable or stable state (upper curve) for RH > 35%
3038 !-----------------------------------------------------------------------
3039 subroutine mesa(ibin) ! touch
3041 ! include 'mosaic.h'
3046 integer idissolved, j_index, jdum, js, je ! raz update 11/13/2008
3047 real(kind=8) crh, solids, sum_soluble, sum_insoluble, xt
3048 ! real(kind=8) aerosol_water ! mosaic func
3049 ! real(kind=8) drh_mutual ! mosaic func
3050 real(kind=8) h_ion, sum_dum ! raz update 11/13/2008
3053 ! calculate percent composition ! raz update 11/13/2008
3055 do je = 1, nelectrolyte
3056 sum_dum = sum_dum + electrolyte(je,jtotal,ibin)
3059 if(sum_dum .eq. 0.)sum_dum = 1.0
3061 do je = 1, nelectrolyte
3062 epercent(je,jtotal,ibin) = 100.*electrolyte(je,jtotal,ibin)/sum_dum
3066 call calculate_xt(ibin,jtotal,xt)
3068 crh = 0.35 ! raz-30apr07
3070 ! step 1: check if ah2o is below crh (crystallization or efflorescence point)
3071 if( (ah2o_a(ibin) .lt. crh) .and. &
3072 (xt.gt.1.0 .or. xt.lt.0.) .and. &
3073 (epercent(jcano3,jtotal,ibin) .le. ptol_mol_astem) .and. &
3074 (epercent(jcacl2,jtotal,ibin) .le. ptol_mol_astem) )then ! raz-30apr07
3075 jaerosolstate(ibin) = all_solid
3076 jphase(ibin) = jsolid
3077 jhyst_leg(ibin) = jhyst_lo
3078 call adjust_solid_aerosol(ibin)
3083 ! step 2: check for supersaturation/metastable state
3084 ! jdum = 1 ! 1 = forced metastable. 0 = maybe stable ! RAZ 5/21/2014
3085 ! if(water_a_hyst(ibin) .gt. 0.5*water_a_up(ibin) .or. jdum .eq. 1)then
3087 ! 2017.12.03 water hysteresis changes
3088 if (mhyst_method .eq. mhyst_uporlo_waterhyst) then
3090 if (water_a_hyst(ibin) .gt. 0.5*water_a_up(ibin)) jdum = 1
3091 else if (mhyst_method .eq. mhyst_force_up) then
3093 else ! if (mhyst_method .eq. mhyst_force_lo) then
3097 if (jdum .eq. 1) then
3099 call do_full_deliquescence(ibin)
3102 ! do js = 1, nsoluble
3103 ! sum_soluble = sum_soluble + electrolyte(js,jtotal,ibin)
3106 ! solids = electrolyte(jcaso4,jtotal,ibin) + &
3107 ! electrolyte(jcaco3,jtotal,ibin) + &
3108 ! aer(ioin_a ,jtotal,ibin)
3111 ! if(sum_soluble .lt. 1.e-15 .and. solids .gt. 0.0)then
3113 ! jaerosolstate(ibin) = all_solid ! no soluble material present
3114 ! jphase(ibin) = jsolid
3115 ! call adjust_solid_aerosol(ibin)
3117 ! new wet mass and wet volume
3118 ! mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
3119 ! vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air) or m^3/m^3(air)
3120 ! growth_factor(ibin) = mass_wet_a(ibin)/mass_dry_a(ibin) ! mass growth factor
3124 ! elseif(sum_soluble .gt. 0.0 .and. solids .eq. 0.0)then
3126 jaerosolstate(ibin) = all_liquid
3127 jhyst_leg(ibin) = jhyst_up
3128 jphase(ibin) = jliquid
3129 water_a(ibin) = aerosol_water(jtotal,ibin)
3131 if(water_a(ibin) .lt. 0.0)then ! one last attempt to catch bad input
3132 jaerosolstate(ibin) = all_solid ! no soluble material present
3133 jphase(ibin) = jsolid
3134 jhyst_leg(ibin) = jhyst_lo
3135 call adjust_solid_aerosol(ibin)
3137 call adjust_liquid_aerosol(ibin)
3138 call compute_activities(ibin)
3141 ! new wet mass and wet volume
3142 mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
3143 vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air) or m^3/m^3(air)
3144 growth_factor(ibin) = mass_wet_a(ibin)/mass_dry_a(ibin) ! mass growth factor
3155 ! step 3: diagnose mdrh
3156 if(xt .lt. 1. .and. xt .gt. 0. )goto 10 ! excess sulfate domain - no mdrh exists
3160 jsalt_present(js) = 0 ! default value - salt absent
3162 if(epercent(js,jtotal,ibin) .gt. ptol_mol_astem)then
3163 jsalt_present(js) = 1 ! salt present
3164 jdum = jdum + jsalt_index(js)
3169 jaerosolstate(ibin) = all_solid ! no significant soluble material present
3170 jphase(ibin) = jsolid
3171 call adjust_solid_aerosol(ibin)
3175 if(xt .ge. 2.0 .or. xt .lt. 0.0)then
3176 j_index = jsulf_poor(jdum)
3178 j_index = jsulf_rich(jdum)
3181 mdrh(ibin) = mdrh_t(j_index)
3183 if(ah2o_a(ibin)*100. .lt. mdrh(ibin)) then
3184 jaerosolstate(ibin) = all_solid
3185 jphase(ibin) = jsolid
3186 jhyst_leg(ibin) = jhyst_lo
3187 call adjust_solid_aerosol(ibin)
3192 ! step 4: none of the above means it must be sub-saturated or mixed-phase
3193 10 call do_full_deliquescence(ibin)
3194 call mesa_ptc(ibin) ! determines jaerosolstate(ibin)
3195 if (istat_mosaic_fe1 .lt. 0) return
3209 !***********************************************************************
3210 ! this subroutine completely deliquesces an aerosol and partitions
3211 ! all the soluble electrolytes into the liquid phase and insoluble
3212 ! ones into the solid phase. it also calculates the corresponding
3213 ! aer(js,jliquid,ibin) and aer(js,jsolid,ibin) generic species
3216 ! author: rahul a. zaveri
3218 !-----------------------------------------------------------------------
3219 subroutine do_full_deliquescence(ibin) ! touch
3221 ! include 'mosaic.h'
3230 ! partition all electrolytes into liquid phase
3231 do js = 1, nelectrolyte
3232 electrolyte(js,jsolid,ibin) = 0.0
3233 electrolyte(js,jliquid,ibin) = electrolyte(js,jtotal,ibin)
3236 ! except these electrolytes, which always remain in the solid phase
3237 electrolyte(jcaco3,jsolid,ibin) = electrolyte(jcaco3,jtotal,ibin)
3238 electrolyte(jcaso4,jsolid,ibin) = electrolyte(jcaso4,jtotal,ibin)
3239 electrolyte(jcaco3,jliquid,ibin)= 0.0
3240 electrolyte(jcaso4,jliquid,ibin)= 0.0
3243 ! partition all the generic aer species into solid and liquid phases
3245 aer(iso4_a,jsolid,ibin) = electrolyte(jcaso4,jsolid,ibin)
3246 aer(ino3_a,jsolid,ibin) = 0.0
3247 aer(icl_a, jsolid,ibin) = 0.0
3248 aer(inh4_a,jsolid,ibin) = 0.0
3249 aer(ioc_a, jsolid,ibin) = aer(ioc_a,jtotal,ibin)
3250 aer(imsa_a,jsolid,ibin) = 0.0
3251 aer(ico3_a,jsolid,ibin) = aer(ico3_a,jtotal,ibin)
3252 aer(ina_a, jsolid,ibin) = 0.0
3253 aer(ica_a, jsolid,ibin) = electrolyte(jcaco3,jsolid,ibin) + &
3254 electrolyte(jcaso4,jsolid,ibin)
3255 aer(ibc_a, jsolid,ibin) = aer(ibc_a,jtotal,ibin)
3256 aer(ioin_a,jsolid,ibin) = aer(ioin_a,jtotal,ibin)
3257 aer(ipcg1_b_c_a,jsolid,ibin)= aer(ipcg1_b_c_a,jtotal,ibin)
3258 aer(ipcg2_b_c_a,jsolid,ibin)= aer(ipcg2_b_c_a,jtotal,ibin)
3259 aer(ipcg3_b_c_a,jsolid,ibin)= aer(ipcg3_b_c_a,jtotal,ibin)
3260 aer(ipcg4_b_c_a,jsolid,ibin)= aer(ipcg4_b_c_a,jtotal,ibin)
3261 aer(ipcg5_b_c_a,jsolid,ibin)= aer(ipcg5_b_c_a,jtotal,ibin)
3262 aer(ipcg6_b_c_a,jsolid,ibin)= aer(ipcg6_b_c_a,jtotal,ibin)
3263 aer(ipcg7_b_c_a,jsolid,ibin)= aer(ipcg7_b_c_a,jtotal,ibin)
3264 aer(ipcg8_b_c_a,jsolid,ibin)= aer(ipcg8_b_c_a,jtotal,ibin)
3265 aer(ipcg9_b_c_a,jsolid,ibin)= aer(ipcg9_b_c_a,jtotal,ibin)
3266 aer(ipcg1_b_o_a,jsolid,ibin)= aer(ipcg1_b_o_a,jtotal,ibin)
3267 aer(ipcg2_b_o_a,jsolid,ibin)= aer(ipcg2_b_o_a,jtotal,ibin)
3268 aer(ipcg3_b_o_a,jsolid,ibin)= aer(ipcg3_b_o_a,jtotal,ibin)
3269 aer(ipcg4_b_o_a,jsolid,ibin)= aer(ipcg4_b_o_a,jtotal,ibin)
3270 aer(ipcg5_b_o_a,jsolid,ibin)= aer(ipcg5_b_o_a,jtotal,ibin)
3271 aer(ipcg6_b_o_a,jsolid,ibin)= aer(ipcg6_b_o_a,jtotal,ibin)
3272 aer(ipcg7_b_o_a,jsolid,ibin)= aer(ipcg7_b_o_a,jtotal,ibin)
3273 aer(ipcg8_b_o_a,jsolid,ibin)= aer(ipcg8_b_o_a,jtotal,ibin)
3274 aer(ipcg9_b_o_a,jsolid,ibin)= aer(ipcg9_b_o_a,jtotal,ibin)
3275 aer(iopcg1_b_c_a,jsolid,ibin)= aer(iopcg1_b_c_a,jtotal,ibin)
3276 aer(iopcg2_b_c_a,jsolid,ibin)= aer(iopcg2_b_c_a,jtotal,ibin)
3277 aer(iopcg3_b_c_a,jsolid,ibin)= aer(iopcg3_b_c_a,jtotal,ibin)
3278 aer(iopcg4_b_c_a,jsolid,ibin)= aer(iopcg4_b_c_a,jtotal,ibin)
3279 aer(iopcg5_b_c_a,jsolid,ibin)= aer(iopcg5_b_c_a,jtotal,ibin)
3280 aer(iopcg6_b_c_a,jsolid,ibin)= aer(iopcg6_b_c_a,jtotal,ibin)
3281 aer(iopcg7_b_c_a,jsolid,ibin)= aer(iopcg7_b_c_a,jtotal,ibin)
3282 aer(iopcg8_b_c_a,jsolid,ibin)= aer(iopcg8_b_c_a,jtotal,ibin)
3283 aer(iopcg1_b_o_a,jsolid,ibin)= aer(iopcg1_b_o_a,jtotal,ibin)
3284 aer(iopcg2_b_o_a,jsolid,ibin)= aer(iopcg2_b_o_a,jtotal,ibin)
3285 aer(iopcg3_b_o_a,jsolid,ibin)= aer(iopcg3_b_o_a,jtotal,ibin)
3286 aer(iopcg4_b_o_a,jsolid,ibin)= aer(iopcg4_b_o_a,jtotal,ibin)
3287 aer(iopcg5_b_o_a,jsolid,ibin)= aer(iopcg5_b_o_a,jtotal,ibin)
3288 aer(iopcg6_b_o_a,jsolid,ibin)= aer(iopcg6_b_o_a,jtotal,ibin)
3289 aer(iopcg7_b_o_a,jsolid,ibin)= aer(iopcg7_b_o_a,jtotal,ibin)
3290 aer(iopcg8_b_o_a,jsolid,ibin)= aer(iopcg8_b_o_a,jtotal,ibin)
3291 aer(ipcg1_f_c_a,jsolid,ibin)= aer(ipcg1_f_c_a,jtotal,ibin)
3292 aer(ipcg2_f_c_a,jsolid,ibin)= aer(ipcg2_f_c_a,jtotal,ibin)
3293 aer(ipcg3_f_c_a,jsolid,ibin)= aer(ipcg3_f_c_a,jtotal,ibin)
3294 aer(ipcg4_f_c_a,jsolid,ibin)= aer(ipcg4_f_c_a,jtotal,ibin)
3295 aer(ipcg5_f_c_a,jsolid,ibin)= aer(ipcg5_f_c_a,jtotal,ibin)
3296 aer(ipcg6_f_c_a,jsolid,ibin)= aer(ipcg6_f_c_a,jtotal,ibin)
3297 aer(ipcg7_f_c_a,jsolid,ibin)= aer(ipcg7_f_c_a,jtotal,ibin)
3298 aer(ipcg8_f_c_a,jsolid,ibin)= aer(ipcg8_f_c_a,jtotal,ibin)
3299 aer(ipcg9_f_c_a,jsolid,ibin)= aer(ipcg9_f_c_a,jtotal,ibin)
3300 aer(ipcg1_f_o_a,jsolid,ibin)= aer(ipcg1_f_o_a,jtotal,ibin)
3301 aer(ipcg2_f_o_a,jsolid,ibin)= aer(ipcg2_f_o_a,jtotal,ibin)
3302 aer(ipcg3_f_o_a,jsolid,ibin)= aer(ipcg3_f_o_a,jtotal,ibin)
3303 aer(ipcg4_f_o_a,jsolid,ibin)= aer(ipcg4_f_o_a,jtotal,ibin)
3304 aer(ipcg5_f_o_a,jsolid,ibin)= aer(ipcg5_f_o_a,jtotal,ibin)
3305 aer(ipcg6_f_o_a,jsolid,ibin)= aer(ipcg6_f_o_a,jtotal,ibin)
3306 aer(ipcg7_f_o_a,jsolid,ibin)= aer(ipcg7_f_o_a,jtotal,ibin)
3307 aer(ipcg8_f_o_a,jsolid,ibin)= aer(ipcg8_f_o_a,jtotal,ibin)
3308 aer(ipcg9_f_o_a,jsolid,ibin)= aer(ipcg9_f_o_a,jtotal,ibin)
3309 aer(iopcg1_f_c_a,jsolid,ibin)= aer(iopcg1_f_c_a,jtotal,ibin)
3310 aer(iopcg2_f_c_a,jsolid,ibin)= aer(iopcg2_f_c_a,jtotal,ibin)
3311 aer(iopcg3_f_c_a,jsolid,ibin)= aer(iopcg3_f_c_a,jtotal,ibin)
3312 aer(iopcg4_f_c_a,jsolid,ibin)= aer(iopcg4_f_c_a,jtotal,ibin)
3313 aer(iopcg5_f_c_a,jsolid,ibin)= aer(iopcg5_f_c_a,jtotal,ibin)
3314 aer(iopcg6_f_c_a,jsolid,ibin)= aer(iopcg6_f_c_a,jtotal,ibin)
3315 aer(iopcg7_f_c_a,jsolid,ibin)= aer(iopcg7_f_c_a,jtotal,ibin)
3316 aer(iopcg8_f_c_a,jsolid,ibin)= aer(iopcg8_f_c_a,jtotal,ibin)
3317 aer(iopcg1_f_o_a,jsolid,ibin)= aer(iopcg1_f_o_a,jtotal,ibin)
3318 aer(iopcg2_f_o_a,jsolid,ibin)= aer(iopcg2_f_o_a,jtotal,ibin)
3319 aer(iopcg3_f_o_a,jsolid,ibin)= aer(iopcg3_f_o_a,jtotal,ibin)
3320 aer(iopcg4_f_o_a,jsolid,ibin)= aer(iopcg4_f_o_a,jtotal,ibin)
3321 aer(iopcg5_f_o_a,jsolid,ibin)= aer(iopcg5_f_o_a,jtotal,ibin)
3322 aer(iopcg6_f_o_a,jsolid,ibin)= aer(iopcg6_f_o_a,jtotal,ibin)
3323 aer(iopcg7_f_o_a,jsolid,ibin)= aer(iopcg7_f_o_a,jtotal,ibin)
3324 aer(iopcg8_f_o_a,jsolid,ibin)= aer(iopcg8_f_o_a,jtotal,ibin)
3325 aer(ismpa_a,jsolid,ibin)= aer(ismpa_a,jtotal,ibin)
3326 aer(ismpbb_a,jsolid,ibin)= aer(ismpbb_a,jtotal,ibin)
3327 aer(iglysoa_r1_a,jsolid,ibin)= aer(iglysoa_r1_a,jtotal,ibin)
3328 aer(iglysoa_r2_a,jsolid,ibin)= aer(iglysoa_r2_a,jtotal,ibin)
3329 aer(iglysoa_sfc_a,jsolid,ibin)= aer(iglysoa_sfc_a,jtotal,ibin)
3330 aer(iglysoa_nh4_a,jsolid,ibin)= aer(iglysoa_nh4_a,jtotal,ibin)
3331 aer(iglysoa_oh_a,jsolid,ibin)= aer(iglysoa_oh_a,jtotal,ibin)
3332 aer(iant1_c_a,jsolid,ibin)= aer(iant1_c_a,jtotal,ibin)
3333 aer(iant2_c_a,jsolid,ibin)= aer(iant2_c_a,jtotal,ibin)
3334 aer(iant3_c_a,jsolid,ibin)= aer(iant3_c_a,jtotal,ibin)
3335 aer(iant4_c_a,jsolid,ibin)= aer(iant4_c_a,jtotal,ibin)
3336 aer(iant1_o_a,jsolid,ibin)= aer(iant1_o_a,jtotal,ibin)
3337 aer(iant2_o_a,jsolid,ibin)= aer(iant2_o_a,jtotal,ibin)
3338 aer(iant3_o_a,jsolid,ibin)= aer(iant3_o_a,jtotal,ibin)
3339 aer(iant4_o_a,jsolid,ibin)= aer(iant4_o_a,jtotal,ibin)
3340 aer(ibiog1_c_a,jsolid,ibin)= aer(ibiog1_c_a,jtotal,ibin)
3341 aer(ibiog2_c_a,jsolid,ibin)= aer(ibiog2_c_a,jtotal,ibin)
3342 aer(ibiog3_c_a,jsolid,ibin)= aer(ibiog3_c_a,jtotal,ibin)
3343 aer(ibiog4_c_a,jsolid,ibin)= aer(ibiog4_c_a,jtotal,ibin)
3344 aer(ibiog1_o_a,jsolid,ibin)= aer(ibiog1_o_a,jtotal,ibin)
3345 aer(ibiog2_o_a,jsolid,ibin)= aer(ibiog2_o_a,jtotal,ibin)
3346 aer(ibiog3_o_a,jsolid,ibin)= aer(ibiog3_o_a,jtotal,ibin)
3347 aer(ibiog4_o_a,jsolid,ibin)= aer(ibiog4_o_a,jtotal,ibin)
3348 aer(iasoaX_a,jsolid,ibin)= aer(iasoaX_a,jtotal,ibin)
3349 aer(iasoa1_a,jsolid,ibin)= aer(iasoa1_a,jtotal,ibin)
3350 aer(iasoa2_a,jsolid,ibin)= aer(iasoa2_a,jtotal,ibin)
3351 aer(iasoa3_a,jsolid,ibin)= aer(iasoa3_a,jtotal,ibin)
3352 aer(iasoa4_a,jsolid,ibin)= aer(iasoa4_a,jtotal,ibin)
3353 aer(ibsoaX_a,jsolid,ibin)= aer(ibsoaX_a,jtotal,ibin)
3354 aer(ibsoa1_a,jsolid,ibin)= aer(ibsoa1_a,jtotal,ibin)
3355 aer(ibsoa2_a,jsolid,ibin)= aer(ibsoa2_a,jtotal,ibin)
3356 aer(ibsoa3_a,jsolid,ibin)= aer(ibsoa3_a,jtotal,ibin)
3357 aer(ibsoa4_a,jsolid,ibin)= aer(ibsoa4_a,jtotal,ibin)
3360 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jtotal,ibin) - &
3361 electrolyte(jcaso4,jsolid,ibin)
3362 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jtotal,ibin)
3363 aer(icl_a, jliquid,ibin) = aer(icl_a,jtotal,ibin)
3364 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jtotal,ibin)
3365 aer(ioc_a, jliquid,ibin) = 0.0
3366 aer(imsa_a,jliquid,ibin) = aer(imsa_a,jtotal,ibin)
3367 aer(ico3_a,jliquid,ibin) = 0.0
3368 aer(ina_a, jliquid,ibin) = aer(ina_a,jtotal,ibin)
3369 aer(ica_a, jliquid,ibin) = electrolyte(jcano3,jtotal,ibin) + &
3370 electrolyte(jcacl2,jtotal,ibin)
3371 aer(ibc_a, jliquid,ibin) = 0.0
3372 aer(ioin_a,jliquid,ibin) = 0.0
3373 aer(ipcg1_b_c_a,jliquid,ibin)= 0.0
3374 aer(ipcg2_b_c_a,jliquid,ibin)= 0.0
3375 aer(ipcg3_b_c_a,jliquid,ibin)= 0.0
3376 aer(ipcg4_b_c_a,jliquid,ibin)= 0.0
3377 aer(ipcg5_b_c_a,jliquid,ibin)= 0.0
3378 aer(ipcg6_b_c_a,jliquid,ibin)= 0.0
3379 aer(ipcg7_b_c_a,jliquid,ibin)= 0.0
3380 aer(ipcg8_b_c_a,jliquid,ibin)= 0.0
3381 aer(ipcg9_b_c_a,jliquid,ibin)= 0.0
3382 aer(ipcg1_b_o_a,jliquid,ibin)= 0.0
3383 aer(ipcg2_b_o_a,jliquid,ibin)= 0.0
3384 aer(ipcg3_b_o_a,jliquid,ibin)= 0.0
3385 aer(ipcg4_b_o_a,jliquid,ibin)= 0.0
3386 aer(ipcg5_b_o_a,jliquid,ibin)= 0.0
3387 aer(ipcg6_b_o_a,jliquid,ibin)= 0.0
3388 aer(ipcg7_b_o_a,jliquid,ibin)= 0.0
3389 aer(ipcg8_b_o_a,jliquid,ibin)= 0.0
3390 aer(ipcg9_b_o_a,jliquid,ibin)= 0.0
3391 aer(iopcg1_b_c_a,jliquid,ibin)= 0.0
3392 aer(iopcg2_b_c_a,jliquid,ibin)= 0.0
3393 aer(iopcg3_b_c_a,jliquid,ibin)= 0.0
3394 aer(iopcg4_b_c_a,jliquid,ibin)= 0.0
3395 aer(iopcg5_b_c_a,jliquid,ibin)= 0.0
3396 aer(iopcg6_b_c_a,jliquid,ibin)= 0.0
3397 aer(iopcg7_b_c_a,jliquid,ibin)= 0.0
3398 aer(iopcg8_b_c_a,jliquid,ibin)= 0.0
3399 aer(iopcg1_b_o_a,jliquid,ibin)= 0.0
3400 aer(iopcg2_b_o_a,jliquid,ibin)= 0.0
3401 aer(iopcg3_b_o_a,jliquid,ibin)= 0.0
3402 aer(iopcg4_b_o_a,jliquid,ibin)= 0.0
3403 aer(iopcg5_b_o_a,jliquid,ibin)= 0.0
3404 aer(iopcg6_b_o_a,jliquid,ibin)= 0.0
3405 aer(iopcg7_b_o_a,jliquid,ibin)= 0.0
3406 aer(iopcg8_b_o_a,jliquid,ibin)= 0.0
3407 aer(ipcg1_f_c_a,jliquid,ibin)= 0.0
3408 aer(ipcg2_f_c_a,jliquid,ibin)= 0.0
3409 aer(ipcg3_f_c_a,jliquid,ibin)= 0.0
3410 aer(ipcg4_f_c_a,jliquid,ibin)= 0.0
3411 aer(ipcg5_f_c_a,jliquid,ibin)= 0.0
3412 aer(ipcg6_f_c_a,jliquid,ibin)= 0.0
3413 aer(ipcg7_f_c_a,jliquid,ibin)= 0.0
3414 aer(ipcg8_f_c_a,jliquid,ibin)= 0.0
3415 aer(ipcg9_f_c_a,jliquid,ibin)= 0.0
3416 aer(ipcg1_f_o_a,jliquid,ibin)= 0.0
3417 aer(ipcg2_f_o_a,jliquid,ibin)= 0.0
3418 aer(ipcg3_f_o_a,jliquid,ibin)= 0.0
3419 aer(ipcg4_f_o_a,jliquid,ibin)= 0.0
3420 aer(ipcg5_f_o_a,jliquid,ibin)= 0.0
3421 aer(ipcg6_f_o_a,jliquid,ibin)= 0.0
3422 aer(ipcg7_f_o_a,jliquid,ibin)= 0.0
3423 aer(ipcg8_f_o_a,jliquid,ibin)= 0.0
3424 aer(ipcg9_f_o_a,jliquid,ibin)= 0.0
3425 aer(iopcg1_f_c_a,jliquid,ibin)= 0.0
3426 aer(iopcg2_f_c_a,jliquid,ibin)= 0.0
3427 aer(iopcg3_f_c_a,jliquid,ibin)= 0.0
3428 aer(iopcg4_f_c_a,jliquid,ibin)= 0.0
3429 aer(iopcg5_f_c_a,jliquid,ibin)= 0.0
3430 aer(iopcg6_f_c_a,jliquid,ibin)= 0.0
3431 aer(iopcg7_f_c_a,jliquid,ibin)= 0.0
3432 aer(iopcg8_f_c_a,jliquid,ibin)= 0.0
3433 aer(iopcg1_f_o_a,jliquid,ibin)= 0.0
3434 aer(iopcg2_f_o_a,jliquid,ibin)= 0.0
3435 aer(iopcg3_f_o_a,jliquid,ibin)= 0.0
3436 aer(iopcg4_f_o_a,jliquid,ibin)= 0.0
3437 aer(iopcg5_f_o_a,jliquid,ibin)= 0.0
3438 aer(iopcg6_f_o_a,jliquid,ibin)= 0.0
3439 aer(iopcg7_f_o_a,jliquid,ibin)= 0.0
3440 aer(iopcg8_f_o_a,jliquid,ibin)= 0.0
3441 aer(ismpa_a,jliquid,ibin)= 0.0
3442 aer(ismpbb_a,jliquid,ibin)= 0.0
3443 aer(iglysoa_r1_a,jliquid,ibin)= 0.0
3444 aer(iglysoa_r2_a,jliquid,ibin)= 0.0
3445 aer(iglysoa_sfc_a,jliquid,ibin)= 0.0
3446 aer(iglysoa_nh4_a,jliquid,ibin)= 0.0
3447 aer(iglysoa_oh_a,jliquid,ibin)= 0.0
3448 aer(iant1_c_a,jliquid,ibin)= 0.0
3449 aer(iant2_c_a,jliquid,ibin)= 0.0
3450 aer(iant3_c_a,jliquid,ibin)= 0.0
3451 aer(iant4_c_a,jliquid,ibin)= 0.0
3452 aer(iant1_o_a,jliquid,ibin)= 0.0
3453 aer(iant2_o_a,jliquid,ibin)= 0.0
3454 aer(iant3_o_a,jliquid,ibin)= 0.0
3455 aer(iant4_o_a,jliquid,ibin)= 0.0
3456 aer(ibiog1_c_a,jliquid,ibin)= 0.0
3457 aer(ibiog2_c_a,jliquid,ibin)= 0.0
3458 aer(ibiog3_c_a,jliquid,ibin)= 0.0
3459 aer(ibiog4_c_a,jliquid,ibin)= 0.0
3460 aer(ibiog1_o_a,jliquid,ibin)= 0.0
3461 aer(ibiog2_o_a,jliquid,ibin)= 0.0
3462 aer(ibiog3_o_a,jliquid,ibin)= 0.0
3463 aer(ibiog4_o_a,jliquid,ibin)= 0.0
3464 aer(iasoaX_a,jliquid,ibin)= 0.0
3465 aer(iasoa1_a,jliquid,ibin)= 0.0
3466 aer(iasoa2_a,jliquid,ibin)= 0.0
3467 aer(iasoa3_a,jliquid,ibin)= 0.0
3468 aer(iasoa4_a,jliquid,ibin)= 0.0
3469 aer(ibsoaX_a,jliquid,ibin)= 0.0
3470 aer(ibsoa1_a,jliquid,ibin)= 0.0
3471 aer(ibsoa2_a,jliquid,ibin)= 0.0
3472 aer(ibsoa3_a,jliquid,ibin)= 0.0
3473 aer(ibsoa4_a,jliquid,ibin)= 0.0
3480 end subroutine do_full_deliquescence
3503 !***********************************************************************
3504 ! mesa: multicomponent equilibrium solver for aerosol-phase
3505 ! computes equilibrum solid and liquid phases by integrating
3506 ! pseudo-transient dissolution and precipitation reactions
3508 ! author: rahul a. zaveri
3510 ! reference: zaveri r.a., r.c. easter, and l.k. peters, jgr, 2005b
3511 !-----------------------------------------------------------------------
3512 subroutine mesa_ptc(ibin) ! touch
3514 ! include 'mosaic.h'
3518 integer iaer, iconverge, iconverge_flux, iconverge_mass, &
3519 idissolved, itdum, js, je, jp ! raz update 11/13/2008
3520 real(kind=8) tau_p(nsalt), tau_d(nsalt)
3521 real(kind=8) hsalt_min
3522 real(kind=8) phi_prod, alpha_fac, sum_dum ! raz update 11/13/2008
3525 ! real(kind=8) aerosol_water
3530 itdum = 0 ! initialize time
3543 ! calculate percent composition ! raz update 11/13/2008
3545 do je = 1, nelectrolyte
3546 sum_dum = sum_dum + electrolyte(je,jtotal,ibin)
3549 if(sum_dum .eq. 0.)sum_dum = 1.0
3551 do je = 1, nelectrolyte
3552 epercent(je,jtotal,ibin) = 100.*electrolyte(je,jtotal,ibin)/sum_dum
3558 jsalt_present(js) = 0 ! default value - salt absent
3559 if(epercent(js,jtotal,ibin) .gt. 1.0)then
3560 jsalt_present(js) = 1 ! salt present
3565 mass_dry_a(ibin) = 0.0
3567 aer_H = (2.*aer(iso4_a,jtotal,ibin) + &
3568 aer(ino3_a,jtotal,ibin) + &
3569 aer(icl_a,jtotal,ibin) + &
3570 aer(imsa_a,jtotal,ibin) + &
3571 2.*aer(ico3_a,jtotal,ibin))- &
3572 (2.*aer(ica_a,jtotal,ibin) + &
3573 aer(ina_a,jtotal,ibin) + &
3574 aer(inh4_a,jtotal,ibin))
3575 aer_H = max(aer_H, 0.0d0) ! raz update 11/13/2008
3578 mass_dry_a(ibin) = mass_dry_a(ibin) + &
3579 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer) ! [ng/m^3(air)]
3580 vol_dry_a(ibin) = vol_dry_a(ibin) + &
3581 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer)/dens_aer_mac(iaer) ! ncc/m^3(air)
3583 mass_dry_a(ibin) = mass_dry_a(ibin) + aer_H
3584 vol_dry_a(ibin) = vol_dry_a(ibin) + aer_H
3586 mass_dry_a(ibin) = mass_dry_a(ibin)*1.e-15 ! [g/cc(air)]
3587 vol_dry_a(ibin) = vol_dry_a(ibin)*1.e-15 ! [cc(aer)/cc(air)]
3589 mass_dry_salt(ibin) = 0.0 ! soluble salts only
3591 mass_dry_salt(ibin) = mass_dry_salt(ibin) + &
3592 electrolyte(je,jtotal,ibin)*mw_electrolyte(je)*1.e-15 ! g/cc(air)
3595 nmesa_call = nmesa_call + 1
3597 !----begin pseudo time continuation loop-------------------------------
3599 do 500 itdum = 1, nmax_mesa
3602 ! compute new salt fluxes
3603 call mesa_flux_salt(ibin)
3604 if (istat_mosaic_fe1 .lt. 0) return
3608 call mesa_convergence_criterion(ibin, &
3613 if(iconverge_mass .eq. myes)then
3614 iter_mesa(ibin) = iter_mesa(ibin) + itdum
3615 niter_mesa = niter_mesa + itdum
3616 niter_mesa_max = max(niter_mesa_max, itdum)
3617 jaerosolstate(ibin) = all_solid
3618 call adjust_solid_aerosol(ibin)
3619 jhyst_leg(ibin) = jhyst_lo
3620 growth_factor(ibin) = 1.0
3622 elseif(iconverge_flux .eq. myes)then
3623 iter_mesa(ibin) = iter_mesa(ibin)+ itdum
3624 niter_mesa = niter_mesa + itdum
3625 niter_mesa_max = max(niter_mesa_max, itdum)
3626 mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
3627 vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air) or m^3/m^3(air)
3628 growth_factor(ibin) = mass_wet_a(ibin)/mass_dry_a(ibin) ! mass growth factor
3630 if(idissolved .eq. myes)then
3631 jaerosolstate(ibin) = all_liquid
3632 ! jhyst_leg(ibin) = jhyst_up ! do this later (to avoid tripping kelvin iterations)
3634 jaerosolstate(ibin) = mixed
3635 jhyst_leg(ibin) = jhyst_lo
3638 ! calculate epercent(jsolid) composition in mixed-phase aerosol
3641 do je = 1, nelectrolyte
3642 electrolyte(je,jp,ibin) = max(0.D0,electrolyte(je,jp,ibin)) ! remove -ve
3643 sum_dum = sum_dum + electrolyte(je,jp,ibin)
3645 electrolyte_sum(jp,ibin) = sum_dum
3646 if(sum_dum .eq. 0.)sum_dum = 1.0
3647 do je = 1, nelectrolyte
3648 epercent(je,jp,ibin) = 100.*electrolyte(je,jp,ibin)/sum_dum
3655 ! calculate hsalt(js) ! time step
3659 phi_prod = phi_salt(js) * phi_salt_old(js)
3661 if(itdum .gt. 1 .and. phi_prod .gt. 0.0)then
3662 phi_bar(js) = (abs(phi_salt(js))-abs(phi_salt_old(js)))/ &
3665 phi_bar(js) = 0.0 ! oscillating, or phi_salt and/or phi_salt_old may be zero
3668 if(phi_bar(js) .lt. 0.0)then ! good. phi getting lower. maybe able to take bigger alphas
3669 phi_bar(js) = max(phi_bar(js), -10.0D0)
3670 alpha_fac = 3.0*exp(phi_bar(js))
3671 alpha_salt(js) = min(alpha_fac*abs(phi_salt(js)), 0.9D0)
3672 elseif(phi_bar(js) .gt. 0.0)then ! bad - phi is getting bigger. so be conservative with alpha
3673 alpha_salt(js) = min(abs(phi_salt(js)), 0.5D0)
3674 else ! very bad - phi is oscillating. be very conservative
3675 alpha_salt(js) = min(abs(phi_salt(js))/3.0, 0.5D0)
3678 ! alpha_salt(js) = max(alpha_salt(js), 0.01D0)
3680 phi_salt_old(js) = phi_salt(js) ! update old array
3683 if(flux_sl(js) .gt. 0.)then
3685 tau_p(js) = eleliquid(js)/flux_sl(js) ! precipitation time scale
3686 if(tau_p(js) .eq. 0.0)then
3691 hsalt(js) = alpha_salt(js)*tau_p(js)
3694 elseif(flux_sl(js) .lt. 0.)then
3696 tau_p(js) = -eleliquid(js)/flux_sl(js) ! precipitation time scale
3697 tau_d(js) = -electrolyte(js,jsolid,ibin)/flux_sl(js) ! dissolution time scale
3698 if(tau_p(js) .eq. 0.0)then
3699 hsalt(js) = alpha_salt(js)*tau_d(js)
3701 hsalt(js) = alpha_salt(js)*min(tau_p(js),tau_d(js))
3710 hsalt_min = min(hsalt(js), hsalt_min)
3714 !---------------------------------
3716 ! integrate electrolyte(solid)
3718 electrolyte(js,jsolid,ibin) = &
3719 electrolyte(js,jsolid,ibin) + &
3720 hsalt(js) * flux_sl(js)
3724 ! compute aer(solid) from electrolyte(solid)
3725 call electrolytes_to_ions(jsolid,ibin)
3728 ! compute new electrolyte(liquid) from mass balance
3730 aer(iaer,jliquid,ibin) = aer(iaer,jtotal,ibin) - &
3731 aer(iaer,jsolid,ibin)
3734 !---------------------------------
3738 500 continue ! end time continuation loop
3739 !--------------------------------------------------------------------
3740 nmesa_fail = nmesa_fail + 1
3741 iter_mesa(ibin) = iter_mesa(ibin) + itdum
3742 niter_mesa = niter_mesa + itdum
3743 jaerosolstate(ibin) = mixed
3744 jhyst_leg(ibin) = jhyst_lo
3745 mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
3746 vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air) or m^3/m^3(air)
3747 growth_factor(ibin) = mass_wet_a(ibin)/mass_dry_a(ibin) ! mass growth factor
3750 end subroutine mesa_ptc
3761 !***********************************************************************
3762 ! part of mesa: calculates solid-liquid fluxes of soluble salts
3764 ! author: rahul a. zaveri
3766 !-----------------------------------------------------------------------
3767 subroutine mesa_flux_salt(ibin) ! touch
3769 ! include 'mosaic.h'
3773 integer js, je ! raz update 11/13/2008
3774 real(kind=8) xt, calcium, sum_salt, sum_dum ! raz update 11/13/2008
3777 ! compute activities and water content
3778 call ions_to_electrolytes(jliquid,ibin,xt)
3779 if (istat_mosaic_fe1 .lt. 0) return
3780 call compute_activities(ibin)
3781 activity(jna3hso4,ibin) = 0.0
3783 if(water_a(ibin) .le. 0.0)then
3791 call mesa_estimate_eleliquid(ibin,xt)
3793 calcium = aer(ica_a,jliquid,ibin)
3797 ! calculate percent composition ! raz update 11/13/2008
3799 do je = 1, nelectrolyte
3800 sum_dum = sum_dum + electrolyte(je,jliquid,ibin)
3803 if(sum_dum .eq. 0.)sum_dum = 1.0
3805 do je = 1, nelectrolyte
3806 epercent(je,jliquid,ibin) = 100.*electrolyte(je,jliquid,ibin)/sum_dum
3811 ! calculate % electrolyte composition in the solid and liquid phases
3814 sum_salt = sum_salt + electrolyte(js,jsolid,ibin)
3816 electrolyte_sum(jsolid,ibin) = sum_salt
3817 if(sum_salt .eq. 0.0)sum_salt = 1.0
3819 frac_salt_solid(js) = electrolyte(js,jsolid,ibin)/sum_salt
3820 frac_salt_liq(js) = epercent(js,jliquid,ibin)/100.
3825 ! compute salt fluxes
3826 do js = 1, nsalt ! soluble solid salts
3828 ! compute new saturation ratio
3829 sat_ratio(js) = activity(js,ibin)/keq_sl(js)
3830 ! compute relative driving force
3831 phi_salt(js) = (sat_ratio(js) - 1.0)/max(sat_ratio(js),1.0D0)
3833 ! check if too little solid-phase salt is trying to dissolve
3834 if(sat_ratio(js) .lt. 1.00 .and. &
3835 frac_salt_solid(js) .lt. 0.01 .and. &
3836 frac_salt_solid(js) .gt. 0.0)then
3837 call mesa_dissolve_small_salt(ibin,js)
3838 call mesa_estimate_eleliquid(ibin,xt)
3839 sat_ratio(js) = activity(js,ibin)/keq_sl(js)
3843 flux_sl(js) = sat_ratio(js) - 1.0
3845 ! apply heaviside function
3846 if( (sat_ratio(js) .lt. 1.0 .and. &
3847 electrolyte(js,jsolid,ibin) .eq. 0.0) .or. &
3848 (calcium .gt. 0.0 .and. frac_salt_liq(js).lt.0.01).or. &
3849 (calcium .gt. 0.0 .and. jsalt_present(js).eq.0) )then
3857 ! force cacl2 and cano3 fluxes to zero
3858 sat_ratio(jcano3) = 1.0
3859 phi_salt(jcano3) = 0.0
3860 flux_sl(jcano3) = 0.0
3862 sat_ratio(jcacl2) = 1.0
3863 phi_salt(jcacl2) = 0.0
3864 flux_sl(jcacl2) = 0.0
3868 end subroutine mesa_flux_salt
3881 !***********************************************************************
3882 ! part of mesa: calculates liquid electrolytes from ions
3885 ! - this subroutine is to be used for liquid-phase or total-phase only
3886 ! - this sub transfers caso4 and caco3 from liquid to solid phase
3888 ! author: rahul a. zaveri
3890 !-----------------------------------------------------------------------
3891 subroutine mesa_estimate_eleliquid(ibin,xt) ! touch
3893 ! include 'mosaic.h'
3898 integer iaer, je, jc, ja, icase
3899 real(kind=8) store(naer), sum_dum, sum_naza, sum_nczc, sum_na_nh4, &
3900 f_nh4, f_na, xh, xb, xl, xs, xt_d, xna_d, xnh4_d, &
3902 real(kind=8) nc(ncation), na(nanion)
3903 real(kind=8) dum_ca, dum_no3, dum_cl, cano3, cacl2
3907 ! remove negative concentrations, if any
3909 aer(iaer,jliquid,ibin) = max(0.0D0, aer(iaer,jliquid,ibin))
3913 ! calculate sulfate ratio
3914 call calculate_xt(ibin,jliquid,xt)
3916 if(xt .ge. 2.0 .or. xt.lt.0.)then
3917 icase = 1 ! near neutral (acidity is caused by hcl and/or hno3)
3919 icase = 2 ! acidic (acidity is caused by excess so4)
3923 ! initialize to zero
3924 do je = 1, nelectrolyte
3928 !---------------------------------------------------------
3929 ! initialize moles of ions depending on the sulfate domain
3933 if(icase.eq.1)then ! xt >= 2 : sulfate poor domain
3935 dum_ca = aer(ica_a,jp,ibin)
3936 dum_no3 = aer(ino3_a,jp,ibin)
3937 dum_cl = aer(icl_a,jp,ibin)
3939 cano3 = min(dum_ca, 0.5*dum_no3)
3940 dum_ca = max(0.D0, dum_ca - cano3)
3941 dum_no3 = max(0.D0, dum_no3 - 2.*cano3)
3943 cacl2 = min(dum_ca, 0.5*dum_cl)
3944 dum_ca = max(0.D0, dum_ca - cacl2)
3945 dum_cl = max(0.D0, dum_cl - 2.*cacl2)
3948 na(ja_so4) = aer(iso4_a,jp,ibin)
3949 na(ja_no3) = aer(ino3_a,jp,ibin)
3950 na(ja_cl) = aer(icl_a, jp,ibin)
3951 na(ja_msa) = aer(imsa_a,jp,ibin)
3953 nc(jc_ca) = aer(ica_a, jp,ibin)
3954 nc(jc_na) = aer(ina_a, jp,ibin)
3955 nc(jc_nh4) = aer(inh4_a,jp,ibin)
3958 ( 2.d0*na(ja_so4)+na(ja_no3)+na(ja_cl)+na(ja_msa) ) - &
3959 ( nc(jc_h)+2.d0*nc(jc_ca) +nc(jc_nh4)+nc(jc_na) )
3961 if(cat_net .lt. 0.0)then
3965 else ! cat_net must be 0.0 or positive
3972 ! now compute equivalent fractions
3975 sum_naza = sum_naza + na(ja)*za(ja)
3980 sum_nczc = sum_nczc + nc(jc)*zc(jc)
3983 if(sum_naza .eq. 0. .or. sum_nczc .eq. 0.)then
3984 if (iprint_mosaic_diag1 .gt. 0) then
3985 write(6,*)'subroutine mesa_estimate_eleliquid'
3986 write(6,*)'ionic concentrations are zero'
3987 write(6,*)'sum_naza = ', sum_naza
3988 write(6,*)'sum_nczc = ', sum_nczc
3994 xeq_a(ja) = na(ja)*za(ja)/sum_naza
3998 xeq_c(jc) = nc(jc)*zc(jc)/sum_nczc
4001 na_ma(ja_so4) = na(ja_so4) *mw_a(ja_so4)
4002 na_ma(ja_no3) = na(ja_no3) *mw_a(ja_no3)
4003 na_ma(ja_cl) = na(ja_cl) *mw_a(ja_cl)
4004 na_ma(ja_hso4)= na(ja_hso4)*mw_a(ja_hso4)
4005 na_Ma(ja_msa) = na(ja_msa) *MW_a(ja_msa)
4007 nc_mc(jc_ca) = nc(jc_ca) *mw_c(jc_ca)
4008 nc_mc(jc_na) = nc(jc_na) *mw_c(jc_na)
4009 nc_mc(jc_nh4) = nc(jc_nh4)*mw_c(jc_nh4)
4010 nc_mc(jc_h) = nc(jc_h) *mw_c(jc_h)
4013 ! now compute electrolyte moles
4014 eleliquid(jna2so4) = (xeq_c(jc_na) *na_ma(ja_so4) + &
4015 xeq_a(ja_so4)*nc_mc(jc_na))/ &
4016 mw_electrolyte(jna2so4)
4018 eleliquid(jnahso4) = (xeq_c(jc_na) *na_ma(ja_hso4) + &
4019 xeq_a(ja_hso4)*nc_mc(jc_na))/ &
4020 mw_electrolyte(jnahso4)
4022 eleliquid(jnamsa) = (xeq_c(jc_na) *na_ma(ja_msa) + &
4023 xeq_a(ja_msa)*nc_mc(jc_na))/ &
4024 mw_electrolyte(jnamsa)
4026 eleliquid(jnano3) = (xeq_c(jc_na) *na_ma(ja_no3) + &
4027 xeq_a(ja_no3)*nc_mc(jc_na))/ &
4028 mw_electrolyte(jnano3)
4030 eleliquid(jnacl) = (xeq_c(jc_na) *na_ma(ja_cl) + &
4031 xeq_a(ja_cl) *nc_mc(jc_na))/ &
4032 mw_electrolyte(jnacl)
4034 eleliquid(jnh4so4) = (xeq_c(jc_nh4)*na_ma(ja_so4) + &
4035 xeq_a(ja_so4)*nc_mc(jc_nh4))/ &
4036 mw_electrolyte(jnh4so4)
4038 eleliquid(jnh4hso4)= (xeq_c(jc_nh4)*na_ma(ja_hso4) + &
4039 xeq_a(ja_hso4)*nc_mc(jc_nh4))/ &
4040 mw_electrolyte(jnh4hso4)
4042 eleliquid(jnh4msa) = (xeq_c(jc_nh4) *na_ma(ja_msa) + &
4043 xeq_a(ja_msa)*nc_mc(jc_nh4))/ &
4044 mw_electrolyte(jnh4msa)
4046 eleliquid(jnh4no3) = (xeq_c(jc_nh4)*na_ma(ja_no3) + &
4047 xeq_a(ja_no3)*nc_mc(jc_nh4))/ &
4048 mw_electrolyte(jnh4no3)
4050 eleliquid(jnh4cl) = (xeq_c(jc_nh4)*na_ma(ja_cl) + &
4051 xeq_a(ja_cl) *nc_mc(jc_nh4))/ &
4052 mw_electrolyte(jnh4cl)
4054 eleliquid(jcano3) = (xeq_c(jc_ca) *na_ma(ja_no3) + &
4055 xeq_a(ja_no3)*nc_mc(jc_ca))/ &
4056 mw_electrolyte(jcano3)
4058 eleliquid(jcamsa2) = (xeq_c(jc_ca) *na_ma(ja_msa) + &
4059 xeq_a(ja_msa)*nc_mc(jc_ca))/ &
4060 mw_electrolyte(jcamsa2)
4062 eleliquid(jcacl2) = (xeq_c(jc_ca) *na_ma(ja_cl) + &
4063 xeq_a(ja_cl) *nc_mc(jc_ca))/ &
4064 mw_electrolyte(jcacl2)
4066 eleliquid(jh2so4) = (xeq_c(jc_h) *na_ma(ja_hso4) + &
4067 xeq_a(ja_hso4)*nc_mc(jc_h))/ &
4068 mw_electrolyte(jh2so4)
4070 eleliquid(jhno3) = (xeq_c(jc_h) *na_ma(ja_no3) + &
4071 xeq_a(ja_no3)*nc_mc(jc_h))/ &
4072 mw_electrolyte(jhno3)
4074 eleliquid(jhcl) = (xeq_c(jc_h) *na_ma(ja_cl) + &
4075 xeq_a(ja_cl)*nc_mc(jc_h))/ &
4076 mw_electrolyte(jhcl)
4078 eleliquid(jmsa) = (xeq_c(jc_h) *na_ma(ja_msa) + &
4079 xeq_a(ja_msa)*nc_mc(jc_h))/ &
4080 mw_electrolyte(jmsa)
4082 !--------------------------------------------------------------------
4084 elseif(icase.eq.2)then ! xt < 2 : sulfate rich domain
4088 store(iso4_a) = aer(iso4_a,jp,ibin)
4089 store(imsa_a) = aer(imsa_a,jp,ibin)
4090 store(inh4_a) = aer(inh4_a,jp,ibin)
4091 store(ina_a) = aer(ina_a, jp,ibin)
4092 store(ica_a) = aer(ica_a, jp,ibin)
4094 call form_camsa2(store,jp,ibin)
4096 sum_na_nh4 = store(ina_a) + store(inh4_a)
4097 if(sum_na_nh4 .gt. 0.0)then
4098 f_nh4 = store(inh4_a)/sum_na_nh4
4099 f_na = store(ina_a)/sum_na_nh4
4105 ! first form msa electrolytes
4106 if(sum_na_nh4 .gt. store(imsa_a))then
4107 eleliquid(jnh4msa) = f_nh4*store(imsa_a)
4108 eleliquid(jnamsa) = f_na *store(imsa_a)
4109 store(inh4_a)= store(inh4_a)-eleliquid(jnh4msa) ! remaining nh4
4110 store(ina_a) = store(ina_a) -eleliquid(jnamsa) ! remaining na
4112 eleliquid(jnh4msa) = store(inh4_a)
4113 eleliquid(jnamsa) = store(ina_a)
4114 eleliquid(jmsa) = store(imsa_a) - sum_na_nh4
4115 store(inh4_a)= 0.0 ! remaining nh4
4116 store(ina_a) = 0.0 ! remaining na
4119 if(store(iso4_a).eq.0.0)goto 10
4122 xna_d = 1. + 0.5*aer(ina_a,jp,ibin)/aer(iso4_a,jp,ibin)
4123 xdum = aer(iso4_a,jp,ibin) - aer(inh4_a,jp,ibin)
4125 dum = 2.d0*aer(iso4_a,jp,ibin) - aer(ina_a,jp,ibin)
4126 if(aer(inh4_a,jp,ibin) .gt. 0.0 .and. dum .gt. 0.0)then
4127 xnh4_d = 2.*aer(inh4_a,jp,ibin)/ &
4128 (2.*aer(iso4_a,jp,ibin) - aer(ina_a,jp,ibin))
4134 if(aer(inh4_a,jp,ibin) .gt. 0.0)then
4137 if(xt_d .ge. xna_d)then
4138 eleliquid(jna2so4) = 0.5*aer(ina_a,jp,ibin)
4140 if(xnh4_d .ge. 5./3.)then
4141 eleliquid(jnh4so4) = 1.5*aer(ina_a,jp,ibin) &
4142 - 3.*xdum - aer(inh4_a,jp,ibin)
4143 eleliquid(jlvcite) = 2.*xdum + aer(inh4_a,jp,ibin) &
4144 - aer(ina_a,jp,ibin)
4145 elseif(xnh4_d .ge. 1.5)then
4146 eleliquid(jnh4so4) = aer(inh4_a,jp,ibin)/5.
4147 eleliquid(jlvcite) = aer(inh4_a,jp,ibin)/5.
4148 elseif(xnh4_d .ge. 1.0)then
4149 eleliquid(jnh4so4) = aer(inh4_a,jp,ibin)/6.
4150 eleliquid(jlvcite) = aer(inh4_a,jp,ibin)/6.
4151 eleliquid(jnh4hso4)= aer(inh4_a,jp,ibin)/6.
4154 elseif(xt_d .gt. 1.0)then
4155 eleliquid(jnh4so4) = aer(inh4_a,jp,ibin)/6.
4156 eleliquid(jlvcite) = aer(inh4_a,jp,ibin)/6.
4157 eleliquid(jnh4hso4) = aer(inh4_a,jp,ibin)/6.
4158 eleliquid(jna2so4) = aer(ina_a,jp,ibin)/3.
4159 eleliquid(jnahso4) = aer(ina_a,jp,ibin)/3.
4160 elseif(xt_d .le. 1.0)then
4161 eleliquid(jna2so4) = aer(ina_a,jp,ibin)/4.
4162 eleliquid(jnahso4) = aer(ina_a,jp,ibin)/2.
4163 eleliquid(jlvcite) = aer(inh4_a,jp,ibin)/6.
4164 eleliquid(jnh4hso4) = aer(inh4_a,jp,ibin)/2.
4169 if(xt_d .gt. 1.0)then
4170 eleliquid(jna2so4) = aer(ina_a,jp,ibin) - aer(iso4_a,jp,ibin)
4171 eleliquid(jnahso4) = 2.*aer(iso4_a,jp,ibin) - &
4174 eleliquid(jna2so4) = aer(ina_a,jp,ibin)/4.
4175 eleliquid(jnahso4) = aer(ina_a,jp,ibin)/2.
4184 !---------------------------------------------------------
4187 end subroutine mesa_estimate_eleliquid
4198 !***********************************************************************
4199 ! part of mesa: completely dissolves small amounts of soluble salts
4201 ! author: rahul a. zaveri
4203 !-----------------------------------------------------------------------
4204 subroutine mesa_dissolve_small_salt(ibin,js)
4206 ! include 'mosaic.h'
4208 integer ibin, js, jp
4213 if(js .eq. jnh4so4)then
4214 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + &
4215 2.*electrolyte(js,jsolid,ibin)
4216 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jliquid,ibin) + &
4217 electrolyte(js,jsolid,ibin)
4219 electrolyte(js,jsolid,ibin) = 0.0
4221 aer(inh4_a,jp,ibin) = electrolyte(jnh4no3,jp,ibin) + &
4222 electrolyte(jnh4cl,jp,ibin) + &
4223 2.*electrolyte(jnh4so4,jp,ibin) + &
4224 3.*electrolyte(jlvcite,jp,ibin) + &
4225 electrolyte(jnh4hso4,jp,ibin)+ &
4226 electrolyte(jnh4msa,jp,ibin)
4228 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4229 electrolyte(jna2so4,jp,ibin) + &
4230 2.*electrolyte(jna3hso4,jp,ibin)+ &
4231 electrolyte(jnahso4,jp,ibin) + &
4232 electrolyte(jnh4so4,jp,ibin) + &
4233 2.*electrolyte(jlvcite,jp,ibin) + &
4234 electrolyte(jnh4hso4,jp,ibin)+ &
4235 electrolyte(jh2so4,jp,ibin)
4240 if(js .eq. jlvcite)then
4241 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + &
4242 3.*electrolyte(js,jsolid,ibin)
4243 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jliquid,ibin) + &
4244 2.*electrolyte(js,jsolid,ibin)
4246 electrolyte(js,jsolid,ibin) = 0.0
4248 aer(inh4_a,jp,ibin) = electrolyte(jnh4no3,jp,ibin) + &
4249 electrolyte(jnh4cl,jp,ibin) + &
4250 2.*electrolyte(jnh4so4,jp,ibin) + &
4251 3.*electrolyte(jlvcite,jp,ibin) + &
4252 electrolyte(jnh4hso4,jp,ibin)+ &
4253 electrolyte(jnh4msa,jp,ibin)
4255 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4256 electrolyte(jna2so4,jp,ibin) + &
4257 2.*electrolyte(jna3hso4,jp,ibin)+ &
4258 electrolyte(jnahso4,jp,ibin) + &
4259 electrolyte(jnh4so4,jp,ibin) + &
4260 2.*electrolyte(jlvcite,jp,ibin) + &
4261 electrolyte(jnh4hso4,jp,ibin)+ &
4262 electrolyte(jh2so4,jp,ibin)
4267 if(js .eq. jnh4hso4)then
4268 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + &
4269 electrolyte(js,jsolid,ibin)
4270 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jliquid,ibin) + &
4271 electrolyte(js,jsolid,ibin)
4273 electrolyte(js,jsolid,ibin) = 0.0
4275 aer(inh4_a,jp,ibin) = electrolyte(jnh4no3,jp,ibin) + &
4276 electrolyte(jnh4cl,jp,ibin) + &
4277 2.*electrolyte(jnh4so4,jp,ibin) + &
4278 3.*electrolyte(jlvcite,jp,ibin) + &
4279 electrolyte(jnh4hso4,jp,ibin)+ &
4280 electrolyte(jnh4msa,jp,ibin)
4282 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4283 electrolyte(jna2so4,jp,ibin) + &
4284 2.*electrolyte(jna3hso4,jp,ibin)+ &
4285 electrolyte(jnahso4,jp,ibin) + &
4286 electrolyte(jnh4so4,jp,ibin) + &
4287 2.*electrolyte(jlvcite,jp,ibin) + &
4288 electrolyte(jnh4hso4,jp,ibin)+ &
4289 electrolyte(jh2so4,jp,ibin)
4294 if(js .eq. jna2so4)then
4295 aer(ina_a,jliquid,ibin) = aer(ina_a,jliquid,ibin) + &
4296 2.*electrolyte(js,jsolid,ibin)
4297 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jliquid,ibin) + &
4298 electrolyte(js,jsolid,ibin)
4300 electrolyte(js,jsolid,ibin) = 0.0
4302 aer(ina_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4303 electrolyte(jnacl,jp,ibin) + &
4304 2.*electrolyte(jna2so4,jp,ibin) + &
4305 3.*electrolyte(jna3hso4,jp,ibin)+ &
4306 electrolyte(jnahso4,jp,ibin) + &
4307 electrolyte(jnamsa,jp,ibin)
4309 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4310 electrolyte(jna2so4,jp,ibin) + &
4311 2.*electrolyte(jna3hso4,jp,ibin)+ &
4312 electrolyte(jnahso4,jp,ibin) + &
4313 electrolyte(jnh4so4,jp,ibin) + &
4314 2.*electrolyte(jlvcite,jp,ibin) + &
4315 electrolyte(jnh4hso4,jp,ibin)+ &
4316 electrolyte(jh2so4,jp,ibin)
4321 if(js .eq. jna3hso4)then
4322 aer(ina_a,jliquid,ibin) = aer(ina_a,jliquid,ibin) + &
4323 3.*electrolyte(js,jsolid,ibin)
4324 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jliquid,ibin) + &
4325 2.*electrolyte(js,jsolid,ibin)
4327 electrolyte(js,jsolid,ibin) = 0.0
4329 aer(ina_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4330 electrolyte(jnacl,jp,ibin) + &
4331 2.*electrolyte(jna2so4,jp,ibin) + &
4332 3.*electrolyte(jna3hso4,jp,ibin)+ &
4333 electrolyte(jnahso4,jp,ibin) + &
4334 electrolyte(jnamsa,jp,ibin)
4336 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4337 electrolyte(jna2so4,jp,ibin) + &
4338 2.*electrolyte(jna3hso4,jp,ibin)+ &
4339 electrolyte(jnahso4,jp,ibin) + &
4340 electrolyte(jnh4so4,jp,ibin) + &
4341 2.*electrolyte(jlvcite,jp,ibin) + &
4342 electrolyte(jnh4hso4,jp,ibin)+ &
4343 electrolyte(jh2so4,jp,ibin)
4348 if(js .eq. jnahso4)then
4349 aer(ina_a,jliquid,ibin) = aer(ina_a,jliquid,ibin) + &
4350 electrolyte(js,jsolid,ibin)
4351 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jliquid,ibin) + &
4352 electrolyte(js,jsolid,ibin)
4354 electrolyte(js,jsolid,ibin) = 0.0
4356 aer(ina_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4357 electrolyte(jnacl,jp,ibin) + &
4358 2.*electrolyte(jna2so4,jp,ibin) + &
4359 3.*electrolyte(jna3hso4,jp,ibin)+ &
4360 electrolyte(jnahso4,jp,ibin) + &
4361 electrolyte(jnamsa,jp,ibin)
4363 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4364 electrolyte(jna2so4,jp,ibin) + &
4365 2.*electrolyte(jna3hso4,jp,ibin)+ &
4366 electrolyte(jnahso4,jp,ibin) + &
4367 electrolyte(jnh4so4,jp,ibin) + &
4368 2.*electrolyte(jlvcite,jp,ibin) + &
4369 electrolyte(jnh4hso4,jp,ibin)+ &
4370 electrolyte(jh2so4,jp,ibin)
4375 if(js .eq. jnh4no3)then
4376 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + &
4377 electrolyte(js,jsolid,ibin)
4378 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) + &
4379 electrolyte(js,jsolid,ibin)
4381 electrolyte(js,jsolid,ibin) = 0.0
4383 aer(inh4_a,jp,ibin) = electrolyte(jnh4no3,jp,ibin) + &
4384 electrolyte(jnh4cl,jp,ibin) + &
4385 2.*electrolyte(jnh4so4,jp,ibin) + &
4386 3.*electrolyte(jlvcite,jp,ibin) + &
4387 electrolyte(jnh4hso4,jp,ibin)+ &
4388 electrolyte(jnh4msa,jp,ibin)
4390 aer(ino3_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4391 2.*electrolyte(jcano3,jp,ibin) + &
4392 electrolyte(jnh4no3,jp,ibin) + &
4393 electrolyte(jhno3,jp,ibin)
4398 if(js .eq. jnh4cl)then
4399 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + &
4400 electrolyte(js,jsolid,ibin)
4401 aer(icl_a,jliquid,ibin) = aer(icl_a,jliquid,ibin) + &
4402 electrolyte(js,jsolid,ibin)
4404 electrolyte(js,jsolid,ibin) = 0.0
4406 aer(inh4_a,jp,ibin) = electrolyte(jnh4no3,jp,ibin) + &
4407 electrolyte(jnh4cl,jp,ibin) + &
4408 2.*electrolyte(jnh4so4,jp,ibin) + &
4409 3.*electrolyte(jlvcite,jp,ibin) + &
4410 electrolyte(jnh4hso4,jp,ibin)+ &
4411 electrolyte(jnh4msa,jp,ibin)
4413 aer(icl_a,jp,ibin) = electrolyte(jnacl,jp,ibin) + &
4414 2.*electrolyte(jcacl2,jp,ibin) + &
4415 electrolyte(jnh4cl,jp,ibin) + &
4416 electrolyte(jhcl,jp,ibin)
4421 if(js .eq. jnano3)then
4422 aer(ina_a,jliquid,ibin) = aer(ina_a,jliquid,ibin) + &
4423 electrolyte(js,jsolid,ibin)
4424 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) + &
4425 electrolyte(js,jsolid,ibin)
4427 electrolyte(js,jsolid,ibin) = 0.0
4429 aer(ina_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4430 electrolyte(jnacl,jp,ibin) + &
4431 2.*electrolyte(jna2so4,jp,ibin) + &
4432 3.*electrolyte(jna3hso4,jp,ibin)+ &
4433 electrolyte(jnahso4,jp,ibin) + &
4434 electrolyte(jnamsa,jp,ibin)
4436 aer(ino3_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4437 2.*electrolyte(jcano3,jp,ibin) + &
4438 electrolyte(jnh4no3,jp,ibin) + &
4439 electrolyte(jhno3,jp,ibin)
4444 if(js .eq. jnacl)then
4445 aer(ina_a,jliquid,ibin) = aer(ina_a,jliquid,ibin) + &
4446 electrolyte(js,jsolid,ibin)
4447 aer(icl_a,jliquid,ibin) = aer(icl_a,jliquid,ibin) + &
4448 electrolyte(js,jsolid,ibin)
4450 electrolyte(js,jsolid,ibin) = 0.0
4452 aer(ina_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4453 electrolyte(jnacl,jp,ibin) + &
4454 2.*electrolyte(jna2so4,jp,ibin) + &
4455 3.*electrolyte(jna3hso4,jp,ibin)+ &
4456 electrolyte(jnahso4,jp,ibin) + &
4457 electrolyte(jnamsa,jp,ibin)
4459 aer(icl_a,jp,ibin) = electrolyte(jnacl,jp,ibin) + &
4460 2.*electrolyte(jcacl2,jp,ibin) + &
4461 electrolyte(jnh4cl,jp,ibin) + &
4462 electrolyte(jhcl,jp,ibin)
4467 if(js .eq. jcano3)then
4468 aer(ica_a,jliquid,ibin) = aer(ica_a,jliquid,ibin) + &
4469 electrolyte(js,jsolid,ibin)
4470 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) + &
4471 2.*electrolyte(js,jsolid,ibin)
4473 electrolyte(js,jsolid,ibin) = 0.0
4475 aer(ica_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4476 electrolyte(jcano3,jp,ibin) + &
4477 electrolyte(jcacl2,jp,ibin) + &
4478 electrolyte(jcaco3,jp,ibin) + &
4479 electrolyte(jcamsa2,jp,ibin)
4481 aer(ino3_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
4482 2.*electrolyte(jcano3,jp,ibin) + &
4483 electrolyte(jnh4no3,jp,ibin) + &
4484 electrolyte(jhno3,jp,ibin)
4489 if(js .eq. jcacl2)then
4490 aer(ica_a,jliquid,ibin) = aer(ica_a,jliquid,ibin) + &
4491 electrolyte(js,jsolid,ibin)
4492 aer(icl_a,jliquid,ibin) = aer(icl_a,jliquid,ibin) + &
4493 2.*electrolyte(js,jsolid,ibin)
4495 electrolyte(js,jsolid,ibin) = 0.0
4497 aer(ica_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
4498 electrolyte(jcano3,jp,ibin) + &
4499 electrolyte(jcacl2,jp,ibin) + &
4500 electrolyte(jcaco3,jp,ibin) + &
4501 electrolyte(jcamsa2,jp,ibin)
4503 aer(icl_a,jp,ibin) = electrolyte(jnacl,jp,ibin) + &
4504 2.*electrolyte(jcacl2,jp,ibin) + &
4505 electrolyte(jnh4cl,jp,ibin) + &
4506 electrolyte(jhcl,jp,ibin)
4513 end subroutine mesa_dissolve_small_salt
4520 !***********************************************************************
4521 ! part of mesa: checks mesa convergence
4523 ! author: rahul a. zaveri
4525 ! Oct 2009: William.Gustafson@pnl.gov - zero salt bug fixed
4526 !-----------------------------------------------------------------------
4527 subroutine mesa_convergence_criterion(ibin, & ! touch
4532 ! include 'mosaic.h'
4534 integer ibin, iconverge_mass, iconverge_flux, idissolved
4536 integer je, js, iaer
4537 real(kind=8) mass_solid, mass_solid_salt, frac_solid, xt, h_ion, &
4538 crustal_solids, sumflux
4541 idissolved = mno ! default = not completely dissolved
4543 ! check mass convergence
4544 iconverge_mass = mno ! default value = no convergence
4546 ! call electrolytes_to_ions(jsolid,ibin)
4549 ! mass_solid = mass_solid + &
4550 ! aer(iaer,jsolid,ibin)*mw_aer_mac(iaer)*1.e-15 ! g/cc(air)
4553 mass_solid_salt = 0.0
4555 mass_solid_salt = mass_solid_salt + &
4556 electrolyte(je,jsolid,ibin)*mw_electrolyte(je)*1.e-15 ! g/cc(air)
4561 ! frac_solid = mass_solid/mass_dry_a(ibin)
4563 !!$ frac_solid = mass_solid_salt/mass_dry_salt(ibin)
4565 !!$ if(frac_solid .ge. 0.98)then
4566 !!$ iconverge_mass = myes
4569 !beg: Modified above logic to handle zero salts, wig 28-Oct-2009
4570 ! If mass of salts is zero, then this will force jaerosolstate to solid
4572 if( mass_dry_salt(ibin) < 1e-30 ) then
4573 iconverge_mass = myes
4576 frac_solid = mass_solid_salt/mass_dry_salt(ibin)
4577 if(frac_solid .ge. 0.98)then
4578 iconverge_mass = myes
4584 ! check relative driving force convergence
4585 iconverge_flux = myes
4587 if(abs(phi_salt(js)).gt. rtol_mesa)then
4588 iconverge_flux = mno
4595 ! check if all the fluxes are zero
4599 sumflux = sumflux + abs(flux_sl(js))
4602 ! 2017.12.03 implement xhyst_up_crustal_thresh
4603 ! crustal_solids = electrolyte(jcaco3,jsolid,ibin) + &
4604 ! electrolyte(jcaso4,jsolid,ibin) + &
4605 ! aer(ioin_a,jsolid,ibin)
4606 crustal_solids = electrolyte(jcaco3,jsolid,ibin)*mw_electrolyte(jcaco3) + &
4607 electrolyte(jcaso4,jsolid,ibin)*mw_electrolyte(jcaso4) + &
4608 aer(ioin_a,jsolid,ibin)*mw_aer_mac(ioin_a)
4610 ! if(sumflux .eq. 0.0 .and. crustal_solids .eq. 0.0)then
4611 if ( sumflux .eq. 0.0 .and. &
4612 crustal_solids .le. xhyst_up_crustal_thresh*(mass_dry_a(ibin)*1.0e15) ) then
4613 ! crustal_solids is ng/m^3, mass_dry_a is g/cm^3
4620 end subroutine mesa_convergence_criterion
4629 !***********************************************************************
4630 ! called when aerosol bin is completely solid.
4632 ! author: rahul a. zaveri
4634 !-----------------------------------------------------------------------
4635 subroutine adjust_solid_aerosol(ibin)
4637 ! include 'mosaic.h'
4644 jphase(ibin) = jsolid
4645 jhyst_leg(ibin) = jhyst_lo ! lower curve
4648 ! transfer aer(jtotal) to aer(jsolid)
4650 aer(iaer, jsolid, ibin) = aer(iaer,jtotal,ibin)
4651 aer(iaer, jliquid,ibin) = 0.0
4654 ! transfer electrolyte(jtotal) to electrolyte(jsolid)
4655 do je = 1, nelectrolyte
4656 electrolyte(je,jliquid,ibin) = 0.0
4657 epercent(je,jliquid,ibin) = 0.0
4658 electrolyte(je,jsolid,ibin) = electrolyte(je,jtotal,ibin)
4659 epercent(je,jsolid,ibin) = epercent(je,jtotal,ibin)
4662 ! update aer(jtotal) that may have been affected above
4663 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin)
4664 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid,ibin)
4665 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid,ibin)
4667 ! update electrolyte(jtotal)
4668 do je = 1, nelectrolyte
4669 electrolyte(je,jtotal,ibin) = electrolyte(je,jsolid,ibin)
4670 epercent(je,jtotal,ibin) = epercent(je,jsolid,ibin)
4674 end subroutine adjust_solid_aerosol
4684 !***********************************************************************
4685 ! called when aerosol bin is completely liquid.
4687 ! author: rahul a. zaveri
4689 !-----------------------------------------------------------------------
4690 subroutine adjust_liquid_aerosol(ibin)
4692 ! include 'mosaic.h'
4701 jphase(ibin) = jliquid
4702 jhyst_leg(ibin) = jhyst_up ! upper curve
4704 ! partition all electrolytes into liquid phase
4705 do je = 1, nelectrolyte
4706 electrolyte(je,jsolid,ibin) = 0.0
4707 epercent(je,jsolid,ibin) = 0.0
4708 electrolyte(je,jliquid,ibin) = electrolyte(je,jtotal,ibin)
4709 epercent(je,jliquid,ibin) = epercent(je,jtotal,ibin)
4711 ! except these electrolytes, which always remain in the solid phase
4712 electrolyte(jcaco3,jsolid,ibin) = electrolyte(jcaco3,jtotal,ibin)
4713 electrolyte(jcaso4,jsolid,ibin) = electrolyte(jcaso4,jtotal,ibin)
4714 epercent(jcaco3,jsolid,ibin) = epercent(jcaco3,jtotal,ibin)
4715 epercent(jcaso4,jsolid,ibin) = epercent(jcaso4,jtotal,ibin)
4716 electrolyte(jcaco3,jliquid,ibin)= 0.0
4717 electrolyte(jcaso4,jliquid,ibin)= 0.0
4718 epercent(jcaco3,jliquid,ibin) = 0.0
4719 epercent(jcaso4,jliquid,ibin) = 0.0
4722 ! partition all the aer species into
4724 aer(iso4_a,jsolid,ibin) = electrolyte(jcaso4,jsolid,ibin)
4725 aer(ino3_a,jsolid,ibin) = 0.0
4726 aer(icl_a,jsolid,ibin) = 0.0
4727 aer(inh4_a,jsolid,ibin) = 0.0
4728 aer(ioc_a,jsolid,ibin) = aer(ioc_a,jtotal,ibin)
4729 aer(imsa_a,jsolid,ibin) = 0.0
4730 aer(ico3_a,jsolid,ibin) = aer(ico3_a,jtotal,ibin)
4731 aer(ina_a,jsolid,ibin) = 0.0
4732 aer(ica_a,jsolid,ibin) = electrolyte(jcaco3,jsolid,ibin) + &
4733 electrolyte(jcaso4,jsolid,ibin)
4734 aer(ibc_a,jsolid,ibin) = aer(ibc_a,jtotal,ibin)
4735 aer(ioin_a,jsolid,ibin) = aer(ioin_a,jtotal,ibin)
4736 aer(ipcg1_b_c_a,jsolid,ibin)= aer(ipcg1_b_c_a,jtotal,ibin)
4737 aer(ipcg2_b_c_a,jsolid,ibin)= aer(ipcg2_b_c_a,jtotal,ibin)
4738 aer(ipcg3_b_c_a,jsolid,ibin)= aer(ipcg3_b_c_a,jtotal,ibin)
4739 aer(ipcg4_b_c_a,jsolid,ibin)= aer(ipcg4_b_c_a,jtotal,ibin)
4740 aer(ipcg5_b_c_a,jsolid,ibin)= aer(ipcg5_b_c_a,jtotal,ibin)
4741 aer(ipcg6_b_c_a,jsolid,ibin)= aer(ipcg6_b_c_a,jtotal,ibin)
4742 aer(ipcg7_b_c_a,jsolid,ibin)= aer(ipcg7_b_c_a,jtotal,ibin)
4743 aer(ipcg8_b_c_a,jsolid,ibin)= aer(ipcg8_b_c_a,jtotal,ibin)
4744 aer(ipcg9_b_c_a,jsolid,ibin)= aer(ipcg9_b_c_a,jtotal,ibin)
4745 aer(ipcg1_b_o_a,jsolid,ibin)= aer(ipcg1_b_o_a,jtotal,ibin)
4746 aer(ipcg2_b_o_a,jsolid,ibin)= aer(ipcg2_b_o_a,jtotal,ibin)
4747 aer(ipcg3_b_o_a,jsolid,ibin)= aer(ipcg3_b_o_a,jtotal,ibin)
4748 aer(ipcg4_b_o_a,jsolid,ibin)= aer(ipcg4_b_o_a,jtotal,ibin)
4749 aer(ipcg5_b_o_a,jsolid,ibin)= aer(ipcg5_b_o_a,jtotal,ibin)
4750 aer(ipcg6_b_o_a,jsolid,ibin)= aer(ipcg6_b_o_a,jtotal,ibin)
4751 aer(ipcg7_b_o_a,jsolid,ibin)= aer(ipcg7_b_o_a,jtotal,ibin)
4752 aer(ipcg8_b_o_a,jsolid,ibin)= aer(ipcg8_b_o_a,jtotal,ibin)
4753 aer(ipcg9_b_o_a,jsolid,ibin)= aer(ipcg9_b_o_a,jtotal,ibin)
4754 aer(iopcg1_b_c_a,jsolid,ibin)= aer(iopcg1_b_c_a,jtotal,ibin)
4755 aer(iopcg2_b_c_a,jsolid,ibin)= aer(iopcg2_b_c_a,jtotal,ibin)
4756 aer(iopcg3_b_c_a,jsolid,ibin)= aer(iopcg3_b_c_a,jtotal,ibin)
4757 aer(iopcg4_b_c_a,jsolid,ibin)= aer(iopcg4_b_c_a,jtotal,ibin)
4758 aer(iopcg5_b_c_a,jsolid,ibin)= aer(iopcg5_b_c_a,jtotal,ibin)
4759 aer(iopcg6_b_c_a,jsolid,ibin)= aer(iopcg6_b_c_a,jtotal,ibin)
4760 aer(iopcg7_b_c_a,jsolid,ibin)= aer(iopcg7_b_c_a,jtotal,ibin)
4761 aer(iopcg8_b_c_a,jsolid,ibin)= aer(iopcg8_b_c_a,jtotal,ibin)
4762 aer(iopcg1_b_o_a,jsolid,ibin)= aer(iopcg1_b_o_a,jtotal,ibin)
4763 aer(iopcg2_b_o_a,jsolid,ibin)= aer(iopcg2_b_o_a,jtotal,ibin)
4764 aer(iopcg3_b_o_a,jsolid,ibin)= aer(iopcg3_b_o_a,jtotal,ibin)
4765 aer(iopcg4_b_o_a,jsolid,ibin)= aer(iopcg4_b_o_a,jtotal,ibin)
4766 aer(iopcg5_b_o_a,jsolid,ibin)= aer(iopcg5_b_o_a,jtotal,ibin)
4767 aer(iopcg6_b_o_a,jsolid,ibin)= aer(iopcg6_b_o_a,jtotal,ibin)
4768 aer(iopcg7_b_o_a,jsolid,ibin)= aer(iopcg7_b_o_a,jtotal,ibin)
4769 aer(iopcg8_b_o_a,jsolid,ibin)= aer(iopcg8_b_o_a,jtotal,ibin)
4770 aer(ipcg1_f_c_a,jsolid,ibin)= aer(ipcg1_f_c_a,jtotal,ibin)
4771 aer(ipcg2_f_c_a,jsolid,ibin)= aer(ipcg2_f_c_a,jtotal,ibin)
4772 aer(ipcg3_f_c_a,jsolid,ibin)= aer(ipcg3_f_c_a,jtotal,ibin)
4773 aer(ipcg4_f_c_a,jsolid,ibin)= aer(ipcg4_f_c_a,jtotal,ibin)
4774 aer(ipcg5_f_c_a,jsolid,ibin)= aer(ipcg5_f_c_a,jtotal,ibin)
4775 aer(ipcg6_f_c_a,jsolid,ibin)= aer(ipcg6_f_c_a,jtotal,ibin)
4776 aer(ipcg7_f_c_a,jsolid,ibin)= aer(ipcg7_f_c_a,jtotal,ibin)
4777 aer(ipcg8_f_c_a,jsolid,ibin)= aer(ipcg8_f_c_a,jtotal,ibin)
4778 aer(ipcg9_f_c_a,jsolid,ibin)= aer(ipcg9_f_c_a,jtotal,ibin)
4779 aer(ipcg1_f_o_a,jsolid,ibin)= aer(ipcg1_f_o_a,jtotal,ibin)
4780 aer(ipcg2_f_o_a,jsolid,ibin)= aer(ipcg2_f_o_a,jtotal,ibin)
4781 aer(ipcg3_f_o_a,jsolid,ibin)= aer(ipcg3_f_o_a,jtotal,ibin)
4782 aer(ipcg4_f_o_a,jsolid,ibin)= aer(ipcg4_f_o_a,jtotal,ibin)
4783 aer(ipcg5_f_o_a,jsolid,ibin)= aer(ipcg5_f_o_a,jtotal,ibin)
4784 aer(ipcg6_f_o_a,jsolid,ibin)= aer(ipcg6_f_o_a,jtotal,ibin)
4785 aer(ipcg7_f_o_a,jsolid,ibin)= aer(ipcg7_f_o_a,jtotal,ibin)
4786 aer(ipcg8_f_o_a,jsolid,ibin)= aer(ipcg8_f_o_a,jtotal,ibin)
4787 aer(ipcg9_f_o_a,jsolid,ibin)= aer(ipcg9_f_o_a,jtotal,ibin)
4788 aer(iopcg1_f_c_a,jsolid,ibin)= aer(iopcg1_f_c_a,jtotal,ibin)
4789 aer(iopcg2_f_c_a,jsolid,ibin)= aer(iopcg2_f_c_a,jtotal,ibin)
4790 aer(iopcg3_f_c_a,jsolid,ibin)= aer(iopcg3_f_c_a,jtotal,ibin)
4791 aer(iopcg4_f_c_a,jsolid,ibin)= aer(iopcg4_f_c_a,jtotal,ibin)
4792 aer(iopcg5_f_c_a,jsolid,ibin)= aer(iopcg5_f_c_a,jtotal,ibin)
4793 aer(iopcg6_f_c_a,jsolid,ibin)= aer(iopcg6_f_c_a,jtotal,ibin)
4794 aer(iopcg7_f_c_a,jsolid,ibin)= aer(iopcg7_f_c_a,jtotal,ibin)
4795 aer(iopcg8_f_c_a,jsolid,ibin)= aer(iopcg8_f_c_a,jtotal,ibin)
4796 aer(iopcg1_f_o_a,jsolid,ibin)= aer(iopcg1_f_o_a,jtotal,ibin)
4797 aer(iopcg2_f_o_a,jsolid,ibin)= aer(iopcg2_f_o_a,jtotal,ibin)
4798 aer(iopcg3_f_o_a,jsolid,ibin)= aer(iopcg3_f_o_a,jtotal,ibin)
4799 aer(iopcg4_f_o_a,jsolid,ibin)= aer(iopcg4_f_o_a,jtotal,ibin)
4800 aer(iopcg5_f_o_a,jsolid,ibin)= aer(iopcg5_f_o_a,jtotal,ibin)
4801 aer(iopcg6_f_o_a,jsolid,ibin)= aer(iopcg6_f_o_a,jtotal,ibin)
4802 aer(iopcg7_f_o_a,jsolid,ibin)= aer(iopcg7_f_o_a,jtotal,ibin)
4803 aer(iopcg8_f_o_a,jsolid,ibin)= aer(iopcg8_f_o_a,jtotal,ibin)
4804 aer(ismpa_a,jsolid,ibin)= aer(ismpa_a,jtotal,ibin)
4805 aer(ismpbb_a,jsolid,ibin)= aer(ismpbb_a,jtotal,ibin)
4806 aer(iglysoa_r1_a,jsolid,ibin)= aer(iglysoa_r1_a,jtotal,ibin)
4807 aer(iglysoa_r2_a,jsolid,ibin)= aer(iglysoa_r2_a,jtotal,ibin)
4808 aer(iglysoa_sfc_a,jsolid,ibin)= aer(iglysoa_sfc_a,jtotal,ibin)
4809 aer(iglysoa_nh4_a,jsolid,ibin)= aer(iglysoa_nh4_a,jtotal,ibin)
4810 aer(iglysoa_oh_a,jsolid,ibin)= aer(iglysoa_oh_a,jtotal,ibin)
4811 aer(iant1_c_a,jsolid,ibin)= aer(iant1_c_a,jtotal,ibin)
4812 aer(iant2_c_a,jsolid,ibin)= aer(iant2_c_a,jtotal,ibin)
4813 aer(iant3_c_a,jsolid,ibin)= aer(iant3_c_a,jtotal,ibin)
4814 aer(iant4_c_a,jsolid,ibin)= aer(iant4_c_a,jtotal,ibin)
4815 aer(iant1_o_a,jsolid,ibin)= aer(iant1_o_a,jtotal,ibin)
4816 aer(iant2_o_a,jsolid,ibin)= aer(iant2_o_a,jtotal,ibin)
4817 aer(iant3_o_a,jsolid,ibin)= aer(iant3_o_a,jtotal,ibin)
4818 aer(iant4_o_a,jsolid,ibin)= aer(iant4_o_a,jtotal,ibin)
4819 aer(ibiog1_c_a,jsolid,ibin)= aer(ibiog1_c_a,jtotal,ibin)
4820 aer(ibiog2_c_a,jsolid,ibin)= aer(ibiog2_c_a,jtotal,ibin)
4821 aer(ibiog3_c_a,jsolid,ibin)= aer(ibiog3_c_a,jtotal,ibin)
4822 aer(ibiog4_c_a,jsolid,ibin)= aer(ibiog4_c_a,jtotal,ibin)
4823 aer(ibiog1_o_a,jsolid,ibin)= aer(ibiog1_o_a,jtotal,ibin)
4824 aer(ibiog2_o_a,jsolid,ibin)= aer(ibiog2_o_a,jtotal,ibin)
4825 aer(ibiog3_o_a,jsolid,ibin)= aer(ibiog3_o_a,jtotal,ibin)
4826 aer(ibiog4_o_a,jsolid,ibin)= aer(ibiog4_o_a,jtotal,ibin)
4827 aer(iasoaX_a,jsolid,ibin)= aer(iasoaX_a,jtotal,ibin)
4828 aer(iasoa1_a,jsolid,ibin)= aer(iasoa1_a,jtotal,ibin)
4829 aer(iasoa2_a,jsolid,ibin)= aer(iasoa2_a,jtotal,ibin)
4830 aer(iasoa3_a,jsolid,ibin)= aer(iasoa3_a,jtotal,ibin)
4831 aer(iasoa4_a,jsolid,ibin)= aer(iasoa4_a,jtotal,ibin)
4832 aer(ibsoaX_a,jsolid,ibin)= aer(ibsoaX_a,jtotal,ibin)
4833 aer(ibsoa1_a,jsolid,ibin)= aer(ibsoa1_a,jtotal,ibin)
4834 aer(ibsoa2_a,jsolid,ibin)= aer(ibsoa2_a,jtotal,ibin)
4835 aer(ibsoa3_a,jsolid,ibin)= aer(ibsoa3_a,jtotal,ibin)
4836 aer(ibsoa4_a,jsolid,ibin)= aer(ibsoa4_a,jtotal,ibin)
4842 aer(iso4_a,jliquid,ibin) = aer(iso4_a,jtotal,ibin) - &
4843 aer(iso4_a,jsolid,ibin)
4844 aer(iso4_a,jliquid,ibin) = max(0.D0, aer(iso4_a,jliquid,ibin))
4845 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jtotal,ibin)
4846 aer(icl_a,jliquid,ibin) = aer(icl_a,jtotal,ibin)
4847 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jtotal,ibin)
4848 aer(ioc_a,jliquid,ibin) = 0.0
4849 aer(imsa_a,jliquid,ibin) = aer(imsa_a,jtotal,ibin)
4850 aer(ico3_a,jliquid,ibin) = 0.0
4851 aer(ina_a,jliquid,ibin) = aer(ina_a,jtotal,ibin)
4852 aer(ica_a,jliquid,ibin) = aer(ica_a,jtotal,ibin) - &
4853 aer(ica_a,jsolid,ibin)
4854 aer(ica_a,jliquid,ibin) = max(0.D0, aer(ica_a,jliquid,ibin))
4855 aer(ibc_a,jliquid,ibin) = 0.0
4856 aer(ioin_a,jliquid,ibin) = 0.0
4857 aer(ipcg1_b_c_a,jliquid,ibin)= 0.0
4858 aer(ipcg2_b_c_a,jliquid,ibin)= 0.0
4859 aer(ipcg3_b_c_a,jliquid,ibin)= 0.0
4860 aer(ipcg4_b_c_a,jliquid,ibin)= 0.0
4861 aer(ipcg5_b_c_a,jliquid,ibin)= 0.0
4862 aer(ipcg6_b_c_a,jliquid,ibin)= 0.0
4863 aer(ipcg7_b_c_a,jliquid,ibin)= 0.0
4864 aer(ipcg8_b_c_a,jliquid,ibin)= 0.0
4865 aer(ipcg9_b_c_a,jliquid,ibin)= 0.0
4866 aer(ipcg1_b_o_a,jliquid,ibin)= 0.0
4867 aer(ipcg2_b_o_a,jliquid,ibin)= 0.0
4868 aer(ipcg3_b_o_a,jliquid,ibin)= 0.0
4869 aer(ipcg4_b_o_a,jliquid,ibin)= 0.0
4870 aer(ipcg5_b_o_a,jliquid,ibin)= 0.0
4871 aer(ipcg6_b_o_a,jliquid,ibin)= 0.0
4872 aer(ipcg7_b_o_a,jliquid,ibin)= 0.0
4873 aer(ipcg8_b_o_a,jliquid,ibin)= 0.0
4874 aer(ipcg9_b_o_a,jliquid,ibin)= 0.0
4875 aer(iopcg1_b_c_a,jliquid,ibin)= 0.0
4876 aer(iopcg2_b_c_a,jliquid,ibin)= 0.0
4877 aer(iopcg3_b_c_a,jliquid,ibin)= 0.0
4878 aer(iopcg4_b_c_a,jliquid,ibin)= 0.0
4879 aer(iopcg5_b_c_a,jliquid,ibin)= 0.0
4880 aer(iopcg6_b_c_a,jliquid,ibin)= 0.0
4881 aer(iopcg7_b_c_a,jliquid,ibin)= 0.0
4882 aer(iopcg8_b_c_a,jliquid,ibin)= 0.0
4883 aer(iopcg1_b_o_a,jliquid,ibin)= 0.0
4884 aer(iopcg2_b_o_a,jliquid,ibin)= 0.0
4885 aer(iopcg3_b_o_a,jliquid,ibin)= 0.0
4886 aer(iopcg4_b_o_a,jliquid,ibin)= 0.0
4887 aer(iopcg5_b_o_a,jliquid,ibin)= 0.0
4888 aer(iopcg6_b_o_a,jliquid,ibin)= 0.0
4889 aer(iopcg7_b_o_a,jliquid,ibin)= 0.0
4890 aer(iopcg8_b_o_a,jliquid,ibin)= 0.0
4891 aer(ipcg1_f_c_a,jliquid,ibin)= 0.0
4892 aer(ipcg2_f_c_a,jliquid,ibin)= 0.0
4893 aer(ipcg3_f_c_a,jliquid,ibin)= 0.0
4894 aer(ipcg4_f_c_a,jliquid,ibin)= 0.0
4895 aer(ipcg5_f_c_a,jliquid,ibin)= 0.0
4896 aer(ipcg6_f_c_a,jliquid,ibin)= 0.0
4897 aer(ipcg7_f_c_a,jliquid,ibin)= 0.0
4898 aer(ipcg8_f_c_a,jliquid,ibin)= 0.0
4899 aer(ipcg9_f_c_a,jliquid,ibin)= 0.0
4900 aer(ipcg1_f_o_a,jliquid,ibin)= 0.0
4901 aer(ipcg2_f_o_a,jliquid,ibin)= 0.0
4902 aer(ipcg3_f_o_a,jliquid,ibin)= 0.0
4903 aer(ipcg4_f_o_a,jliquid,ibin)= 0.0
4904 aer(ipcg5_f_o_a,jliquid,ibin)= 0.0
4905 aer(ipcg6_f_o_a,jliquid,ibin)= 0.0
4906 aer(ipcg7_f_o_a,jliquid,ibin)= 0.0
4907 aer(ipcg8_f_o_a,jliquid,ibin)= 0.0
4908 aer(ipcg9_f_o_a,jliquid,ibin)= 0.0
4909 aer(iopcg1_f_c_a,jliquid,ibin)= 0.0
4910 aer(iopcg2_f_c_a,jliquid,ibin)= 0.0
4911 aer(iopcg3_f_c_a,jliquid,ibin)= 0.0
4912 aer(iopcg4_f_c_a,jliquid,ibin)= 0.0
4913 aer(iopcg5_f_c_a,jliquid,ibin)= 0.0
4914 aer(iopcg6_f_c_a,jliquid,ibin)= 0.0
4915 aer(iopcg7_f_c_a,jliquid,ibin)= 0.0
4916 aer(iopcg8_f_c_a,jliquid,ibin)= 0.0
4917 aer(iopcg1_f_o_a,jliquid,ibin)= 0.0
4918 aer(iopcg2_f_o_a,jliquid,ibin)= 0.0
4919 aer(iopcg3_f_o_a,jliquid,ibin)= 0.0
4920 aer(iopcg4_f_o_a,jliquid,ibin)= 0.0
4921 aer(iopcg5_f_o_a,jliquid,ibin)= 0.0
4922 aer(iopcg6_f_o_a,jliquid,ibin)= 0.0
4923 aer(iopcg7_f_o_a,jliquid,ibin)= 0.0
4924 aer(iopcg8_f_o_a,jliquid,ibin)= 0.0
4925 aer(ismpa_a,jliquid,ibin)= 0.0
4926 aer(ismpbb_a,jliquid,ibin)= 0.0
4927 aer(iglysoa_r1_a,jliquid,ibin)= 0.0
4928 aer(iglysoa_r2_a,jliquid,ibin)= 0.0
4929 aer(iglysoa_sfc_a,jliquid,ibin)= 0.0
4930 aer(iglysoa_nh4_a,jliquid,ibin)= 0.0
4931 aer(iglysoa_oh_a,jliquid,ibin)= 0.0
4932 aer(iant1_c_a,jliquid,ibin)= 0.0
4933 aer(iant2_c_a,jliquid,ibin)= 0.0
4934 aer(iant3_c_a,jliquid,ibin)= 0.0
4935 aer(iant4_c_a,jliquid,ibin)= 0.0
4936 aer(iant1_o_a,jliquid,ibin)= 0.0
4937 aer(iant2_o_a,jliquid,ibin)= 0.0
4938 aer(iant3_o_a,jliquid,ibin)= 0.0
4939 aer(iant4_o_a,jliquid,ibin)= 0.0
4940 aer(ibiog1_c_a,jliquid,ibin)= 0.0
4941 aer(ibiog2_c_a,jliquid,ibin)= 0.0
4942 aer(ibiog3_c_a,jliquid,ibin)= 0.0
4943 aer(ibiog4_c_a,jliquid,ibin)= 0.0
4944 aer(ibiog1_o_a,jliquid,ibin)= 0.0
4945 aer(ibiog2_o_a,jliquid,ibin)= 0.0
4946 aer(ibiog3_o_a,jliquid,ibin)= 0.0
4947 aer(ibiog4_o_a,jliquid,ibin)= 0.0
4948 aer(iasoaX_a,jliquid,ibin)= 0.0
4949 aer(iasoa1_a,jliquid,ibin)= 0.0
4950 aer(iasoa2_a,jliquid,ibin)= 0.0
4951 aer(iasoa3_a,jliquid,ibin)= 0.0
4952 aer(iasoa4_a,jliquid,ibin)= 0.0
4953 aer(ibsoaX_a,jliquid,ibin)= 0.0
4954 aer(ibsoa1_a,jliquid,ibin)= 0.0
4955 aer(ibsoa2_a,jliquid,ibin)= 0.0
4956 aer(ibsoa3_a,jliquid,ibin)= 0.0
4957 aer(ibsoa4_a,jliquid,ibin)= 0.0
4964 end subroutine adjust_liquid_aerosol
4972 ! end of mesa package
4973 !=======================================================================
4982 !***********************************************************************
4983 ! ASTEM: Adaptive Step Time-Split Euler Method
4985 ! author: Rahul A. Zaveri
4987 !-----------------------------------------------------------------------
4988 subroutine ASTEM(dtchem,vbs_nbin)
4990 USE module_mosaic_gly, only : glysoa_complex, glysoa_simple
4993 ! include 'chemistry.com'
4994 ! include 'mosaic.h'
5001 integer start_svoc, Nsoa
5004 ! data first/.true./
5006 integer, save :: iclm_debug, jclm_debug, kclm_debug, ncnt_debug
5007 data iclm_debug /25/
5014 if(iclm_aer .eq. iclm_debug .and. &
5015 jclm_aer .eq. jclm_debug .and. &
5016 kclm_aer .eq. kclm_debug .and. &
5017 ncorecnt_aer .eq. ncnt_debug)then
5023 ! update ASTEM call counter
5024 nASTEM_call = nASTEM_call + 1
5026 ! reset input print flag
5032 ! compute aerosol phase state before starting integration
5034 if(jaerosolstate(ibin) .ne. no_aerosol)then
5035 call aerosol_phase_state(ibin)
5036 if (istat_mosaic_fe1 .lt. 0) return
5037 call calc_dry_n_wet_aerosol_props(ibin)
5039 ! endif ! added by Manish Shrivastav 12/7/09
5045 ! call print_aer(0) ! BOX
5049 ! compute new gas-aerosol mass transfer coefficients
5050 call aerosolmtc(vbs_nbin)
5051 if (istat_mosaic_fe1 .lt. 0) return
5053 ! condense h2so4, msa, and nh3 only
5054 call ASTEM_non_volatiles(dtchem) ! analytical solution
5055 if (istat_mosaic_fe1 .lt. 0) return
5057 ! DL - 20/11/2012 - recalculate the mass balance to take account of
5058 ! NO3- and Cl- changes from N2O5 het reactions
5059 call overall_massbal_in ! save input mass over all bins
5062 ! condense inorganic semi-volatile gases hno3, hcl, nh3, and co2
5063 call ASTEM_semi_volatiles(dtchem) ! semi-implicit + explicit euler
5064 if (istat_mosaic_fe1 .lt. 0) return
5066 if (glysoa_param == glysoa_param_simple) call glysoa_simple(dtchem)
5067 if (glysoa_param == glysoa_param_complex) call glysoa_complex(dtchem)
5069 ! condense secondary organic gases (8 sorgam species)
5070 if (istat_mosaic_fe1 .lt. 0) return
5074 ! simple version, Hodzic and Jimenez, GMD, 2011
5075 if (vbs_nbin(1).eq.0) then
5076 start_svoc = ismpa_g
5077 ! 4-bin version, Knote et al., ACPD, 2014
5078 else if (vbs_nbin(1).eq.4) then
5079 start_svoc = iasoaX_g
5082 start_svoc = ipcg1_b_c_g
5083 ! Nsoa = ngas_volatile-start_svoc
5085 Nsoa = ngas_ioa + ngas_soa - start_svoc + 1
5087 call equilibrium(start_svoc,Nsoa)
5089 !!BSINGH (PNNL)- Following 3 lines are commented due to array out of bound error in equilibrium_smp
5090 ! !if (vbs_nbin.eq.0) then
5091 ! !call equilibrium_smp
5097 ! template for error status checking
5098 ! if (iprint_mosaic_fe1 .gt. 0) then
5099 ! write(6,*)'error in computing dtmax for soa'
5100 ! write(6,*)'mosaic fatal error in astem_soa_dtmax'
5103 ! istat_mosaic_fe1 = -1800
5108 end subroutine astem
5118 subroutine print_mosaic_stats( iflag1 )
5120 ! include 'mosaic.h'
5125 real(kind=8) p_mesa_fails, p_astem_fails, dumcnt
5128 if (iflag1 .le. 0) goto 2000
5130 ! print mesa and astem statistics
5132 dumcnt = float(max(nmesa_call,1))
5133 p_mesa_fails = 100.*float(nmesa_fail)/dumcnt
5134 niter_mesa_avg = float(niter_mesa)/dumcnt
5136 dumcnt = float(max(nastem_call,1))
5137 p_astem_fails = 100.*float(nastem_fail)/dumcnt
5138 nsteps_astem_avg = float(nsteps_astem)/dumcnt
5141 if (iprint_mosaic_perform_stats .gt. 0) then
5142 write(6,*)'------------------------------------------------'
5143 write(6,*)' astem performance statistics'
5144 write(6,*)'number of astem calls=', nastem_call
5145 write(6,*)'percent astem fails =', nastem_fail
5146 write(6,*)'avg steps per dtchem =', nsteps_astem_avg
5147 write(6,*)'max steps per dtchem =', nsteps_astem_max
5149 write(6,*)' mesa performance statistics'
5150 write(6,*)'number of mesa calls =', nmesa_call
5151 write(6,*)'total mesa fails =', nmesa_fail
5152 write(6,*)'percent mesa fails =', p_mesa_fails
5153 write(6,*)'avg iterations/call =', niter_mesa_avg
5154 write(6,*)'max iterations/call =', niter_mesa_max
5158 if (iprint_mosaic_fe1 .gt. 0) then
5159 if ((nfe1_mosaic_cur .gt. 0) .or. &
5160 (iprint_mosaic_fe1 .ge. 100)) then
5161 write(6,*)'-----------------------------------------'
5162 write(6,*)'mosaic failure count (current step) =', &
5164 write(6,*)'mosaic failure count (all step tot) =', &
5170 if (nfe1_mosaic_tot .gt. 9999) then
5171 write(6,'(a)') "MOSAIC FAILURE COUNT > 9999 -- SOMETHING IS SERIOUSLY WRONG !!!"
5172 call peg_error_fatal( lunerr_aer, &
5173 "---> MOSAIC FAILURE COUNT > 9999 -- SOMETHING IS SERIOUSLY WRONG !!!" )
5190 nsteps_astem_max = 0.0
5194 end subroutine print_mosaic_stats
5200 ! Calculates the equilibrium gas-particle partitioning for SOA species
5201 subroutine equilibrium(start_ind,N)
5202 ! subroutine equilibrium
5203 ! This routine was implemented by Manish Shrivastava on 12/24/2009 to do gas-particle partitioning of SOA assuming thermodynamic equilibrium.
5204 ! Modified by Alma Hodzic 12/2012 to implement the partitioning for mozart-mosaic species (based on the initial code implemented by Manish Shrivastava and originated from CAMx)
5205 ! This would give MOSAIC cpabilities of running both dynamic and equilibrium gas-particle partitioning
5206 ! Calls the subroutine soap. Subroutine soap calls subroutine spfcn
5207 ! use module_data_mosaic_main
5208 ! use module_data_mosaic_aero
5211 real(kind=8), parameter :: tinys=1.0d-15
5212 integer, intent(in) :: start_ind, N
5213 ! integer, parameter :: N=ngas_soa !Total number of soa species
5214 integer, parameter :: itermax=2000
5215 integer idxfresh(N),idxaged(N) !counter for fresh and aged soa species
5216 real(kind=8) :: dq,frqfresh(nbin_a),frqaged(nbin_a)
5217 real(kind=8) :: frqtotfresh,frqtotaged,frt
5218 real(kind=8) :: xsumfresh(nbin_a),xsumaged(nbin_a)
5219 real(kind=8) :: mnkfresh,mxkfresh,mnkaged,mxkaged
5221 ! integer :: flagsoap(N) ! flagsoap determines if the species 'i' is fresh (flagsoap(i)=2) or aged(flagsoap(i)=1
5222 real(kind=8) :: Csatfresh(N), Ctotfresh(N)
5223 real(kind=8) :: Cgasfresh(N),Caerfresh(N) ! Csat: Saturation conc., Ctot: Total organic mass
5224 ! in gas+aerosol phase, Cgas:gas phase, Caer: Particle
5225 real(kind=8) :: Csataged(N), Ctotaged(N)
5226 real(kind=8) :: Cgasaged(N),Caeraged(N)
5227 integer nsolfresh,nsolaged,ntrack,icontfresh,icontaged ! counters corresponding to fresh and aged species for mapping
5228 real(kind=8) :: cpxfresh,cpxaged !Moles of pre-existing fresh and aged particle phase organic mass
5229 integer ibin,iter ! Bin nos.
5232 real(kind=8) :: dum, sum_dum, sum_soa, small_oc
5234 ! real, parameter :: tolmin = 1.E-12^M
5235 ! real, parameter :: conmin = 1.E-20^M
5236 ! real totOA,minitw !total OA in particle phase^M
5237 real(kind=8) :: cpx !pre-existing OA umol/m3^M
5238 real(kind=8) :: Ctot(N),Caer(N),Cgas(N),Csat(N)
5239 real(kind=8) :: Paer(ngas_volatile)
5245 cpxfresh=0.0 ! Assume no pres-existing OA forms a solution
5251 ! Paer holds the organic aerosol values in each volatility bin (sum of all size bins)
5252 do iv=1,ngas_volatile
5255 ! Initialize flagsoap
5271 ! Calculate Ctot and Paer
5272 ! do iv = ipcg1_b_c_g, ngas_volatile
5273 ! do iv = start_ind, ngas_ioa + ngas_soa
5274 do iv = start_ind, (start_ind + N - 1)
5275 total_species(iv) = gas(iv)
5277 total_species(iv) = total_species(iv) + aer(iv,jtotal,ibin)
5278 Paer(iv)=Paer(iv)+aer(iv,jtotal,ibin)
5281 ! Calculate pre-existing moles of OA (cpx) as sum of all size bins
5283 cpxaged= cpxaged+aer(ioc_a,jp,ibin)
5286 ! Maps arrays starting from start_ind or ipcg1_b_c_g on to corresponding arrays starting from 1 for just soa species
5288 Ctot(i)=total_species(start_ind+i-1)
5289 Caer(i)=Paer(start_ind+i-1)
5290 Csat(i)=sat_soa(start_ind+i-1)
5291 Cgas(i)=gas(start_ind+i-1)
5294 ! Initialize mapping array indices
5299 ! Seperate the fresh and aged species and treat them as 2 different solutions. Note this approach differes from PMCAMx
5300 ! In PMCAMx if flagsoap(i) was set to zero those species were not considered solution forming.
5303 flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5308 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5311 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5314 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5317 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5320 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5323 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5326 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5329 ! flagsoap(i)=1 ! Biomass burning(carbon and oxygen species) +traditional soa species
5332 ! flagsoap(i)=1 !Oxidized fossil oxygen
5336 if (flagsoap(i).eq.2) then ! fresh primary species forming 1 solution
5337 icontfresh=icontfresh+1 ! count the number of fresh species
5338 idxfresh(icontfresh) = i !Map the species
5339 Csatfresh(icontfresh)=Csat(i)
5340 Ctotfresh(icontfresh)=Ctot(i)
5341 Caerfresh(icontfresh)=Caer(i)
5342 Cgasfresh(icontfresh)=Cgas(i)
5343 nsolfresh=nsolfresh+1
5344 elseif (flagsoap(i).eq.1) then ! Aged SOA species forming another solution
5345 icontaged=icontaged+1
5346 idxaged(icontaged) = i
5347 Csataged(icontaged)=Csat(i)
5348 Ctotaged(icontaged)=Ctot(i)
5349 Caeraged(icontaged)=Caer(i)
5350 Cgasaged(icontaged)=Cgas(i)
5355 ! Caluclate the initial equilibrium partitioning by the bisection method (CMU PMCAMx approach)
5356 ! If all fresh abd aged species form a solution
5357 ! call soap(ngas_soa,Ctot,Csat,Caer,Cgas,cpx)
5359 ! if fresh and aged species form seperate solutions
5360 if (nsolfresh.gt.0) call soap(nsolfresh,Ctotfresh, &
5361 Csatfresh,Caerfresh,Cgasfresh,cpxfresh)
5362 if (nsolaged.gt.0) call soap(nsolaged,Ctotaged, &
5363 Csataged,Caeraged,Cgasaged,cpxaged)
5365 ! Map the fresh and aged species back into original arrays
5366 ! Now assign the equilibrium gas-particle partitioning arrays
5368 do i=1,N ! Map the fresh and aged species back into array from 1 to N after calculating equilibrium
5369 if (idxfresh(i).gt.0) then
5370 Caer(idxfresh(i))= Caerfresh(i)
5371 Cgas(idxfresh(i))= Cgasfresh(i)
5372 Ctot(idxfresh(i))= Ctotfresh(i)
5375 if (idxaged(i).gt.0) then
5376 Caer(idxaged(i))= Caeraged(i)
5377 Cgas(idxaged(i))= Cgasaged(i)
5378 Ctot(idxaged(i))= Ctotaged(i)
5382 ! Check for total number of species
5383 if (ntrack.ne.N) then
5384 call wrf_error_fatal('Error in mapping fresh and primary species arrays')
5386 ! From here on distribute the organic aerosol in size bins following Koo et al. 2003 " Integrated approaches to modeling
5387 ! the organic and inorganic atmospheric aerosol components"
5388 ! The original code from PMCAMx was modified to include 2 solutions for fresh and primary species
5389 ! by Manish Shrivastava on 01/11/2010
5390 ! Calculate total organic aerosol OA(in nmoles/m3) in each bin for either of fresh and aged aerosols
5395 xsumaged(ibin)= xsumaged(ibin)+aer(ioc_a,jp,ibin)!Caluclate pre-existing primary in each bin for aged aerosol
5396 ! do iv = start_ind, ngas_ioa + ngas_soa
5397 do iv = start_ind, (start_ind + N - 1)
5398 if (flagsoap(iv-start_ind+1).eq.2) then
5399 xsumfresh(ibin)= xsumfresh(ibin)+aer(iv,jtotal,ibin)
5400 elseif (flagsoap(iv-start_ind+1).eq.1) then
5401 xsumaged(ibin)= xsumaged(ibin)+aer(iv,jtotal,ibin)
5402 elseif (flagsoap(iv-start_ind+1).eq.0) then
5403 print *, 'Error in mapping flagsoap to start_ind'
5406 ! do iv = ipcg1_b_c_g, ngas_volatile
5407 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5408 ! xsumfresh(ibin)= xsumfresh(ibin)+aer(iv,jtotal,ibin)
5409 ! elseif (flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5410 ! xsumaged(ibin)= xsumaged(ibin)+aer(iv,jtotal,ibin)
5411 ! elseif (flagsoap(iv-ipcg1_b_c_g+1).eq.0) then
5412 ! print *, 'Error in mapping flagsoap to ipcg1_b_c_g'
5416 ! Give a small non-zero value to xsum if it is zero in the section
5417 if (xsumfresh(ibin).eq.0.0) xsumfresh(ibin)=tinys
5418 if (xsumaged(ibin).eq.0.0) xsumaged(ibin)=tinys
5422 ! Calculate dq as (gas concentration) G(t)-G(t+h):
5423 ! Caluclate driving force at previous time step (Cgas,i-XiCsati) for both fresh and aged solutions
5424 ! do iv = start_ind, ngas_ioa + ngas_soa
5425 do iv = start_ind, (start_ind + N - 1)
5426 if (Ctot(iv-start_ind+1).lt.1d-10) goto 120 ! If a given species concentration is too low skip
5427 dq=gas(iv)-Cgas(iv-start_ind+1) !Since both fresh and aged species have been remapped to an array going from 1 to N
5428 ! do iv = ipcg1_b_c_g, ngas_volatile
5429 ! if (Ctot(iv-ipcg1_b_c_g+1).lt.1d-10) goto 120 ! If a given species concentration is too low skip
5430 ! dq=gas(iv)-Cgas(iv-ipcg1_b_c_g+1) !Since both fresh and aged species have been remapped to an array going from 1 to N
5438 ! fraceq(iv,ibin) is calculated as the rate of mass transfer
5439 ! The weighting fractions frqfresh(ibin) amd frqaged(ibin) are caluclated assuming mole fractions from previous time step
5440 ! This assumtion could be relaxed by iterativetely solving this equation
5441 if (flagsoap(iv-start_ind+1).eq.2) then
5442 frqfresh(ibin)= kg(iv,ibin)*(gas(iv) & ! replaced fraceq(iv,ibin) by kg(iv,ibin) on 01/19/10
5443 -(aer(iv,jtotal,ibin))/xsumfresh(ibin) &
5444 *Csat(iv-start_ind+1))
5447 if (flagsoap(iv-start_ind+1).eq.1) then
5448 frqaged(ibin)= kg(iv,ibin)*(gas(iv) & ! replaced fraceq(iv,ibin) by kg(iv,ibin) on 01/19/10
5449 -(aer(iv,jtotal,ibin))/xsumaged(ibin) &
5450 *Csat(iv-start_ind+1))
5453 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5454 ! frqfresh(ibin)= kg(iv,ibin)*(gas(iv) & ! replaced fraceq(iv,ibin) by kg(iv,ibin) on 01/19/10
5455 ! -(aer(iv,jtotal,ibin))/xsumfresh(ibin) &
5456 ! *Csat(iv-ipcg1_b_c_g+1))
5459 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5460 ! frqaged(ibin)= kg(iv,ibin)*(gas(iv) & ! replaced fraceq(iv,ibin) by kg(iv,ibin) on 01/19/10
5461 ! -(aer(iv,jtotal,ibin))/xsumaged(ibin) &
5462 ! *Csat(iv-ipcg1_b_c_g+1))
5464 mnkfresh=min(mnkfresh,frqfresh(ibin))
5465 mnkaged=min(mnkaged,frqaged(ibin))
5467 mxkfresh=max(mxkfresh,frqfresh(ibin))
5468 mxkaged=max(mxkaged,frqaged(ibin))
5470 ! Repeat code from this point on for aged aerosol species
5471 if (flagsoap(iv-start_ind+1).eq.2) then
5472 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5473 ! Condensation is favored in the next time step in this bin
5474 if(dq.gt.0.and.mnkfresh.lt.0.and.mxkfresh.gt.0) then
5476 frqfresh(ibin)=max(frqfresh(ibin)-mnkfresh,0.0d0)
5478 ! evaporation is favored in the next time step in this bin
5479 elseif(dq.lt.0.and.mxkfresh.gt.0.and.mnkfresh.lt.0) then
5481 frqfresh(ibin)=min(frqfresh(ibin)-mxkfresh,0.0d0)
5485 frqtotfresh=frqtotfresh+frqfresh(ibin)
5487 ! Re-normalize frqfresh(ibin)
5488 ! Additional code to check for frqtotfresh and frqtotaged
5489 ! Added by Manish Shrivastava on 02/19/2010
5492 frqfresh(ibin)=frqfresh(ibin)/frqtotfresh
5495 elseif(flagsoap(iv-start_ind+1).eq.1) then
5496 ! elseif(flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5497 if(dq.gt.0.and.mnkaged.lt.0.and.mxkaged.gt.0) then
5499 frqaged(ibin)=max(frqaged(ibin)-mnkaged,0.0d0)
5501 elseif(dq.lt.0.and.mxkaged.gt.0.and.mnkaged.lt.0) then
5503 frqaged(ibin)=min(frqaged(ibin)-mxkaged,0.0d0)
5508 frqtotaged=frqtotaged+frqaged(ibin)
5512 frqaged(ibin)=frqaged(ibin)/frqtotaged
5515 endif ! for flagsoap
5516 ! Condense all condensing species
5517 if(dq.gt.0.0d0) then
5519 ! Map the species back into the original MOSAIC arrays
5521 if (flagsoap(iv-start_ind+1).eq.2) then
5522 aer(iv,jtotal,ibin)= aer(iv,jtotal,ibin)+dq*frqfresh(ibin)
5524 if (flagsoap(iv-start_ind+1).eq.1) then
5525 aer(iv,jtotal,ibin)= aer(iv,jtotal,ibin)+dq*frqaged(ibin)
5528 ! Set the gas phase species to equilibrium value
5529 gas(iv)=Cgas(iv-start_ind+1)
5532 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5533 ! aer(iv,jtotal,ibin)= aer(iv,jtotal,ibin)+dq*frqfresh(ibin)
5535 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5536 ! aer(iv,jtotal,ibin)= aer(iv,jtotal,ibin)+dq*frqaged(ibin)
5539 !! Set the gas phase species to equilibrium value
5540 ! gas(iv)=Cgas(iv-ipcg1_b_c_g+1)
5542 ! Evaporate all evaporating species
5543 elseif(dq.lt.0.0d0) then
5547 if (flagsoap(iv-start_ind+1).eq.2) then
5548 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5549 ! Cannot evaporate more than whats in the bin ie ratio (aer(iv,jtotal,ibin)/dq*frqfresh(ibin)) should be less than equal to 1
5550 if(frqfresh(ibin).gt.0.0d0) &
5551 frt=MAX(MIN(aer(iv,jtotal,ibin)/abs(-dq*frqfresh(ibin)),frt),0.0d0)
5552 ! elseif(flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5553 elseif(flagsoap(iv-start_ind+1).eq.1) then
5554 if(frqaged(ibin).gt.0.0d0) &
5555 frt=MAX(MIN(aer(iv,jtotal,ibin)/abs(-dq*frqaged(ibin)),frt),0.0d0)
5556 endif ! for flagsoap
5565 if (flagsoap(iv-start_ind+1).eq.2) then
5566 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5567 aer(iv,jtotal,ibin)= &
5568 ! Since dq is negative this is evaporating aerosols
5569 MAX(aer(iv,jtotal,ibin)+frt*dq*frqfresh(ibin),0.0d0)
5570 if(aer(iv,jtotal,ibin).lt.tinys) frqfresh(ibin)=0.0d0
5571 frqtotfresh=frqtotfresh+frqfresh(ibin)
5572 ! elseif (flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5573 elseif (flagsoap(iv-start_ind+1).eq.1) then
5574 aer(iv,jtotal,ibin)= &
5575 MAX(aer(iv,jtotal,ibin)+frt*dq*frqaged(ibin),0.0d0)
5576 if(aer(iv,jtotal,ibin).lt.tinys) frqaged(ibin)=0.0d0
5577 frqtotaged=frqtotaged+frqaged(ibin)
5578 endif ! for flagsoap
5581 ! Check if we should evaporate more
5583 ! if (flagsoap(iv-ipcg1_b_c_g+1).eq.2) then
5584 if (flagsoap(iv-start_ind+1).eq.2) then
5585 if(dq.lt.-1.d-8) then ! check if d-8 is better
5586 if(frqtotfresh.gt.tinys) then ! we have sections which are not empty
5587 if(iter.le.itermax) then ! check infinite loop
5590 frqfresh(ibin) = frqfresh(ibin) / frqtotfresh
5594 endif ! frqtotfresh.gt.tinys
5595 endif ! dq.lt.-1.d-7
5596 ! elseif (flagsoap(iv-ipcg1_b_c_g+1).eq.1) then
5597 elseif (flagsoap(iv-start_ind+1).eq.1) then
5598 if(dq.lt.-1.d-8) then
5599 if(frqtotaged.gt.tinys) then ! we have sections which are not empty
5600 if(iter.le.itermax) then ! check infinite loop
5603 frqaged(ibin) = frqaged(ibin) / frqtotaged
5610 ! we need to evaporate more to achieve equilibrium
5611 ! but we completely evaporated the species in all sections
5612 ! or exceeded itermax
5613 endif ! for flagsoap
5615 ! now set the gas species concentration conservatively
5616 ! gas(iv)=Ctot(iv-ipcg1_b_c_g+1)
5617 gas(iv)=Ctot(iv-start_ind+1)
5619 gas(iv)=gas(iv)-aer(iv,jtotal,ibin)
5624 enddo ! for iv=start_ind
5626 end subroutine equilibrium
5629 !---------------------------------
5630 ! Calculates the equilibrium gas-particle partitioning for SOA species when MOZART_MOSAIC_4BIN_KPP is used
5631 ! This routine was modified by Alma Hodzic based on the initial code implemented by Manish Shrivastava and originated from CAMx
5633 !++ alma - removed the subroutine equilibrium_smp
5634 ! subroutine equilibrium_smp
5636 ! end subroutine equilibrium_smp
5639 ! This subroutine spfcn calculates the objective function fval to solve gas-particle partitioning of SOA
5640 ! Subroutine spfcn is called from within the subroutine soap
5641 subroutine spfcn(N,Ctot,Csat,Ca,cpx,tom,fval)
5642 ! use module_data_mosaic_main
5643 ! use module_data_mosaic_aero
5645 real(kind=8):: Ctot(N),Csat(N),Ca(N),tom,fval,cpx
5650 Ca(i)=Ctot(i)*tom/(tom+Csat(i)/1)! Replace the divisor 1 by Molecular Weights if the units for Csat(i) are ug/m3 or ng/m3
5651 fval=fval+Ca(i)/1 ! The divisor is set to 1 as the species are in nmol/m3
5656 end subroutine spfcn
5659 subroutine soap(N,Ctot,Csat,Ca,Cgas,cpx)
5660 ! SOAP calculates the gas-partitioning of SOA. Adapted from PMCAMx and uses the bisection approach.
5661 ! SOAP calls subroutine spfcn which calculates the objective function for solving gas-particle partitioning
5662 ! use module_data_mosaic_main
5663 ! use module_data_mosaic_aero
5665 real(kind=8), parameter :: xtol = 5.0e-5
5666 real(kind=8):: Ctot(N),Csat(N),cpx,Ca(N),Cgas(N)
5667 real(kind=8):: xend,dx,xmid,fend,fmid,sun
5672 if (Csat(i).gt.0) then
5673 sun=sun+Ctot(i)/Csat(i) !If a species does not exist its Csat is zero
5677 if(cpx.lt.1e-9.and.sun.le.1.0) then !if ctots for all species are less than corr. csats and cpre is negligible
5687 xend=xend+Ctot(i)/1 ! Replace the divisor 1 by molecular weight if the units of Ctot(i) are in ng/m3 or ug/m3
5689 xend=xend+cpx ! total number of moles
5690 if (xend.gt.1e-10) then
5691 call spfcn(N,Ctot,Csat,Ca,cpx,xend,fend) ! Calculates the objective function
5693 ! write (2,*) "Total no of moles less than 1e-10 bypassing soap"
5696 if(abs(fend).le.xtol*xend) goto 99 ! Check for tolerance
5697 if (fend.gt.0.0) then ! The objective function is supposed to be less than equal to zero
5698 write (2,*) "Error in SOAP"
5704 xmid=xend-dx ! Find the midpoint following the bisection approach
5705 call spfcn (N,Ctot,Csat,Ca,cpx,xmid,fmid) ! Re-calculate the objective function
5706 if(abs(fmid).le.xtol*xmid.or.dx.le.xtol*xmid) goto 100 ! converged
5707 if (fmid.lt.0.0) xend=xmid
5709 50 call wrf_message("Error in SOAP")
5710 call wrf_error_fatal("Error: max number of iterations reached")
5716 Ca(i)=min(Ctot(i), Ca(i))
5717 Cgas(i)=Ctot(i)-Ca(i)
5729 !***********************************************************************
5730 ! part of ASTEM: integrates semi-volatile inorganic gases
5732 ! author: Rahul A. Zaveri
5734 !-----------------------------------------------------------------------
5735 subroutine ASTEM_semi_volatiles(dtchem)
5737 ! include 'chemistry.com'
5738 ! include 'mosaic.h'
5742 integer ibin, iv, jp
5743 real(kind=8) dtmax, t_new, t_old, t_out, xt
5744 real(kind=8) sum1, sum2, sum3, sum4, sum4a, sum4b, h_flux_s
5751 ! reset ASTEM time steps and MESA iterations counters to zero
5757 !--------------------------------
5758 ! overall integration loop begins over dtchem seconds
5760 10 isteps_ASTEM = isteps_ASTEM + 1
5762 ! compute new fluxes
5765 ieqblm_ASTEM = mYES ! reset to default
5767 do 501 ibin = 1, nbin_a
5769 idry_case3a(ibin) = mNO ! reset to default
5770 ! default fluxes and other stuff
5773 df_gas_s(iv,ibin) = 0.0
5774 df_gas_l(iv,ibin) = 0.0
5775 flux_s(iv,ibin) = 0.0
5776 flux_l(iv,ibin) = 0.0
5778 volatile_s(iv,ibin) = 0.0
5779 phi_volatile_s(iv,ibin) = 0.0
5780 phi_volatile_l(iv,ibin) = 0.0
5781 integrate(iv,jsolid,ibin) = mNO ! reset to default
5782 integrate(iv,jliquid,ibin) = mNO ! reset to default
5786 if(jaerosolstate(ibin) .eq. all_solid)then
5787 jphase(ibin) = jsolid
5788 call ASTEM_flux_dry(ibin)
5789 elseif(jaerosolstate(ibin) .eq. all_liquid)then
5790 jphase(ibin) = jliquid
5791 call ASTEM_flux_wet(ibin)
5792 elseif(jaerosolstate(ibin) .eq. mixed)then
5794 if( electrolyte(jnh4no3,jsolid,ibin).gt. 0.0 .or. &
5795 electrolyte(jnh4cl, jsolid,ibin).gt. 0.0 )then
5796 call ASTEM_flux_mix(ibin) ! jphase(ibin) will be determined in this subr.
5798 jphase(ibin) = jliquid
5799 call ASTEM_flux_wet(ibin)
5806 if(ieqblm_ASTEM .eq. mYES)goto 30 ! all bins have reached eqblm, so quit.
5808 !-------------------------
5811 ! calculate maximum possible internal time-step
5812 11 call ASTEM_calculate_dtmax(dtchem, dtmax)
5813 t_new = t_old + dtmax ! update time
5814 if(t_new .gt. t_out)then ! check if the new time step is too large
5815 dtmax = t_out - t_old
5820 !------------------------------------------
5821 ! do internal time-step (dtmax) integration
5832 do 21 ibin = 1, nbin_a
5833 if(jaerosolstate(ibin) .eq. no_aerosol)goto 21
5836 sum1 = sum1 + aer(iv,jp,ibin)/ &
5837 (1. + dtmax*kg(iv,ibin)*Heff(iv,ibin)*integrate(iv,jp,ibin))
5839 sum2 = sum2 + kg(iv,ibin)*integrate(iv,jp,ibin)/ &
5840 (1. + dtmax*kg(iv,ibin)*Heff(iv,ibin)*integrate(iv,jp,ibin))
5843 sum3 = sum3 + aer(iv,jp,ibin)
5845 if(flux_s(iv,ibin) .gt. 0.)then
5846 h_flux_s = dtmax*flux_s(iv,ibin)
5847 sum4a = sum4a + h_flux_s
5848 aer(iv,jp,ibin) = aer(iv,jp,ibin) + h_flux_s
5849 elseif(flux_s(iv,ibin) .lt. 0.)then
5850 h_flux_s = min(h_s_i_m(iv,ibin),dtmax)*flux_s(iv,ibin)
5851 sum4b = sum4b + h_flux_s
5852 aer(iv,jp,ibin) = aer(iv,jp,ibin) + h_flux_s
5853 aer(iv,jp,ibin) = max(aer(iv,jp,ibin), 0.0D0)
5858 sum4 = sum4a + sum4b
5861 ! first update gas concentration
5862 gas(iv) = (total_species(iv) - (sum1 + sum3 + sum4) )/ &
5864 gas(iv) = max(gas(iv), 0.0D0)
5866 ! if(gas(iv) .lt. 0.)write(6,*) gas(iv)
5868 ! now update aer concentration in the liquid phase
5869 do 22 ibin = 1, nbin_a
5871 if(integrate(iv,jliquid,ibin) .eq. mYES)then
5872 aer(iv,jliquid,ibin) = &
5873 (aer(iv,jliquid,ibin) + dtmax*kg(iv,ibin)*gas(iv))/ &
5874 (1. + dtmax*kg(iv,ibin)*Heff(iv,ibin))
5882 !------------------------------------------
5883 ! sub-step integration done
5886 !------------------------------------------
5887 ! now update aer(jtotal) and update internal phase equilibrium
5888 ! also do integration of species by mass balance if necessary
5890 do 40 ibin = 1, nbin_a
5891 if(jaerosolstate(ibin) .eq. no_aerosol)goto 40
5893 if(jphase(ibin) .eq. jsolid)then
5894 call form_electrolytes(jsolid,ibin,XT) ! degas excess nh3 (if present)
5895 elseif(jphase(ibin) .eq. jliquid)then
5896 call form_electrolytes(jliquid,ibin,XT) ! degas excess nh3 (if present)
5897 elseif(jphase(ibin) .eq. jtotal)then
5898 call form_electrolytes(jsolid,ibin,XT) ! degas excess nh3 (if present)
5899 call form_electrolytes(jliquid,ibin,XT) ! degas excess nh3 (if present)
5902 !========================
5905 aer(iv,jtotal,ibin)=aer(iv,jsolid,ibin)+aer(iv,jliquid,ibin)
5907 !========================
5910 call form_electrolytes(jtotal,ibin,XT) ! for MDRH diagnosis
5914 ! update internal phase equilibrium
5915 if(jhyst_leg(ibin) .eq. jhyst_lo)then
5916 call ASTEM_update_phase_eqblm(ibin)
5918 call do_full_deliquescence(ibin) ! simply do liquid <-- total
5923 !------------------------------------------
5929 if(isteps_astem .ge. nmax_astem)then
5930 nastem_fail = nastem_fail + 1
5931 write(6,*)'ASTEM internal steps exceeded', nmax_astem
5932 if(iprint_input .eq. mYES)then
5933 write(67,*)'ASTEM internal steps exceeded', nmax_astem
5938 elseif(t_new .lt. t_out)then
5943 ! check if end of dtchem reached
5944 if(t_new .lt. 0.9999*t_out) goto 10
5946 30 nsteps_astem = nsteps_astem + isteps_astem ! cumulative steps
5947 nsteps_astem_max = max(nsteps_astem_max, isteps_astem) ! max steps in a dtchem time-step
5949 !================================================
5950 ! end of overall integration loop over dtchem seconds
5954 ! call subs to calculate fluxes over mixed-phase particles to update H+ ions,
5955 ! which were wiped off during update_phase_eqblm
5956 ! do ibin = 1, nbin_a
5958 ! if(jaerosolstate(ibin) .eq. mixed)then
5959 ! if( electrolyte(jnh4no3,jsolid,ibin).gt. 0.0 .or. &
5960 ! electrolyte(jnh4cl, jsolid,ibin).gt. 0.0 )then
5961 ! call ASTEM_flux_mix(ibin) ! jphase(ibin) will be determined in this subr.
5963 ! jphase(ibin) = jliquid
5964 ! call ASTEM_flux_wet(ibin)
5973 end subroutine ASTEM_semi_volatiles
5986 !***********************************************************************
5987 ! part of ASTEM: computes max time step for gas-aerosol integration
5989 ! author: Rahul A. Zaveri
5991 !-----------------------------------------------------------------------
5992 subroutine ASTEM_calculate_dtmax(dtchem, dtmax)
5993 use module_data_mosaic_other, only: lunerr
5995 ! include 'mosaic.h'
5997 real(kind=8) dtchem, dtmax
6000 real(kind=8) alpha, h_gas, h_sub_max, &
6001 h_gas_i(ngas_ioa), h_gas_l, h_gas_s, &
6002 sum_kg_phi, sumflux_s
6005 h_sub_max = 100.0 ! sec raz update 4/30/2007
6011 ! calculate h_gas_i and h_gas_l
6015 do 5 iv = 2, ngas_ioa
6019 if(flux_s(iv,ibin) .gt. 0.0)then
6020 sumflux_s = sumflux_s + flux_s(iv,ibin)
6024 if(sumflux_s .gt. 0.0)then
6025 h_gas_i(iv) = 0.1*gas(iv)/sumflux_s ! raz-30apr07
6026 h_gas_s = min(h_gas_s, h_gas_i(iv))
6033 ! calculate h_gas_s and h_gas_l
6037 do 6 iv = 2, ngas_ioa
6041 if(integrate(iv,jliquid,ibin) .eq. mYES)then
6042 sum_kg_phi = sum_kg_phi + &
6043 abs(phi_volatile_l(iv,ibin))*kg(iv,ibin)
6047 if(sum_kg_phi .gt. 0.0)then
6048 h_gas_i(iv) = alpha_astem/sum_kg_phi
6049 h_gas_l = min(h_gas_l, h_gas_i(iv))
6054 h_gas = min(h_gas_s, h_gas_l)
6055 h_gas = min(h_gas, h_sub_max)
6060 ! aerosol-side: solid-phase
6062 ! first load volatile_solid array
6065 volatile_s(ino3_a,ibin) = electrolyte(jnh4no3,jsolid,ibin)
6066 volatile_s(inh4_a,ibin) = electrolyte(jnh4cl,jsolid,ibin) + &
6067 electrolyte(jnh4no3,jsolid,ibin)
6069 if(idry_case3a(ibin) .eq. mYES)then
6070 volatile_s(icl_a,ibin) = aer(icl_a,jsolid,ibin)
6072 volatile_s(icl_a,ibin) = electrolyte(jnh4cl,jsolid,ibin)
6078 ! next calculate weighted avg_df_gas_s
6086 if(flux_s(iv,ibin) .lt. 0.)then ! aer -> gas
6087 sum_bin_s(iv) = sum_bin_s(iv) + 1.0
6088 sum_vdf_s(iv) = sum_vdf_s(iv) + &
6089 volatile_s(iv,ibin)*df_gas_s(iv,ibin)
6090 sum_vol_s(iv) = sum_vol_s(iv) + volatile_s(iv,ibin)
6094 if(sum_vol_s(iv) .gt. 0.0)then
6095 avg_df_gas_s(iv) = sum_vdf_s(iv)/sum_vol_s(iv)
6097 avg_df_gas_s(iv) = 1.0 ! never used, but set to 1.0 just to be safe
6106 do 20 ibin = 1, nbin_a
6108 if(jaerosolstate(ibin) .eq. no_aerosol) goto 20
6110 do 10 iv = 2, ngas_ioa
6112 if(flux_s(iv,ibin) .lt. 0.)then ! aer -> gas
6114 alpha = abs(avg_df_gas_s(iv))/ &
6115 (volatile_s(iv,ibin)*sum_bin_s(iv))
6116 alpha = min(alpha, 1.0D0)
6118 if(idry_case3a(ibin) .eq. mYES)alpha = 1.0D0
6120 h_s_i_m(iv,ibin) = &
6121 -alpha*volatile_s(iv,ibin)/flux_s(iv,ibin)
6131 dtmax = min(dtchem, h_gas)
6134 if(dtmax .eq. 0.0)then
6135 write(6,*)' dtmax = ', dtmax
6136 write(67,*)' dtmax = ', dtmax
6139 call peg_error_fatal( lunerr, " " )
6143 end subroutine astem_calculate_dtmax
6159 !***********************************************************************
6160 ! part of ASTEM: updates solid-liquid partitioning after each gas-aerosol
6161 ! mass transfer step
6163 ! author: Rahul A. Zaveri
6165 !-----------------------------------------------------------------------
6166 subroutine ASTEM_update_phase_eqblm(ibin) ! TOUCH
6168 ! include 'mosaic.h'
6172 integer jdum, js, j_index, je ! raz update 11/13/2008
6173 real(kind=8) XT, sum_dum ! raz update 11/13/2008
6177 ! calculate percent composition ! raz update 11/13/2008
6179 do je = 1, nelectrolyte
6180 sum_dum = sum_dum + electrolyte(je,jtotal,ibin)
6183 if(sum_dum .eq. 0.)sum_dum = 1.0
6185 do je = 1, nelectrolyte
6186 epercent(je,jtotal,ibin) = 100.*electrolyte(je,jtotal,ibin)/sum_dum
6190 ! calculate overall sulfate ratio
6191 call calculate_XT(ibin,jtotal,XT) ! calc updated XT
6194 if(XT .lt. 1. .and. XT .gt. 0. )goto 10 ! excess sulfate domain - no MDRH exists
6198 jsalt_present(js) = 0 ! default value - salt absent
6200 if(epercent(js,jtotal,ibin) .gt. ptol_mol_astem)then
6201 jsalt_present(js) = 1 ! salt present
6202 jdum = jdum + jsalt_index(js)
6207 jaerosolstate(ibin) = all_solid ! no significant soluble material present
6208 jphase(ibin) = jsolid
6209 call adjust_solid_aerosol(ibin)
6213 if(XT .ge. 2.0 .or. XT .lt. 0.0)then
6214 j_index = jsulf_poor(jdum)
6216 j_index = jsulf_rich(jdum)
6219 MDRH(ibin) = MDRH_T(j_index)
6221 if(aH2O*100. .lt. MDRH(ibin)) then
6222 jaerosolstate(ibin) = all_solid
6223 jphase(ibin) = jsolid
6224 call adjust_solid_aerosol(ibin)
6229 ! none of the above means it must be sub-saturated or mixed-phase
6230 10 if(jphase(ibin) .eq. jsolid)then
6231 call do_full_deliquescence(ibin)
6240 end subroutine ASTEM_update_phase_eqblm
6253 !==================================================================
6257 !***********************************************************************
6258 ! part of ASTEM: computes fluxes over wet aerosols
6260 ! author: Rahul A. Zaveri
6262 !-----------------------------------------------------------------------
6263 subroutine ASTEM_flux_wet(ibin)
6264 use module_data_mosaic_other, only: lunerr
6266 ! include 'mosaic.h'
6270 integer iv, iadjust, iadjust_intermed
6271 real(kind=8) xt, g_nh3_hno3, g_nh3_hcl, a_nh4_no3, a_nh4_cl
6275 call ions_to_electrolytes(jliquid,ibin,XT) ! for water content calculation
6276 call compute_activities(ibin)
6278 if(water_a(ibin) .eq. 0.0)then
6279 write(6,*)'Water is zero in liquid phase'
6280 call peg_error_fatal( lunerr, "Stopping in ASTEM_flux_wet" )
6283 !-------------------------------------------------------------------
6284 ! CASE 1: caco3 > 0 absorb acids (and indirectly degas co2)
6286 if(electrolyte(jcaco3,jsolid,ibin) .gt. 0.0)then
6287 call ASTEM_flux_wet_case1(ibin)
6291 !-------------------------------------------------------------------
6292 ! CASE 2: Sulfate-Rich Domain
6294 if(XT.lt.1.9999 .and. XT.ge.0.)then
6295 call ASTEM_flux_wet_case2(ibin)
6299 !-------------------------------------------------------------------
6301 if( (gas(inh3_g)+aer(inh4_a,jliquid,ibin)) .lt. 1.e-25)goto 10 ! no ammonia in the system
6303 !-------------------------------------------------------------------
6304 ! CASE 3: nh4no3 and/or nh4cl maybe active
6305 ! do some small adjustments (if needed) before deciding case 3
6307 iadjust = mNO ! default
6308 iadjust_intermed = mNO ! default
6311 g_nh3_hno3 = gas(inh3_g)*gas(ihno3_g)
6312 a_nh4_no3 = aer(inh4_a,jliquid,ibin)*aer(ino3_a,jliquid,ibin)
6314 if(g_nh3_hno3 .gt. 0. .and. a_nh4_no3 .eq. 0.)then
6315 call absorb_tiny_nh4no3(ibin)
6317 iadjust_intermed = mYES
6320 if(iadjust_intermed .eq. mYES)then
6321 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
6322 iadjust_intermed = mNO ! reset
6326 g_nh3_hcl = gas(inh3_g)*gas(ihcl_g)
6327 a_nh4_cl = aer(inh4_a,jliquid,ibin)*aer(icl_a,jliquid,ibin)
6329 if(g_nh3_hcl .gt. 0. .and. a_nh4_cl .eq. 0.)then
6330 call absorb_tiny_nh4cl(ibin)
6332 iadjust_intermed = mYES
6335 if(iadjust_intermed .eq. mYES)then
6336 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
6339 if(iadjust .eq. mYES)then
6340 call compute_activities(ibin) ! update after adjustments
6344 ! all adjustments done...
6347 kelvin_nh4no3 = kel(inh3_g,ibin)*kel(ihno3_g,ibin)
6348 Keq_nh4no3 = kelvin_nh4no3*activity(jnh4no3,ibin)*Kp_nh4no3 ! = [NH3]s * [HNO3]s
6350 kelvin_nh4cl = kel(inh3_g,ibin)*kel(ihcl_g,ibin)
6351 Keq_nh4cl = kelvin_nh4cl*activity(jnh4cl,ibin)*Kp_nh4cl ! = [NH3]s * [HCl]s
6353 call ASTEM_flux_wet_case3(ibin)
6358 !-------------------------------------------------------------------
6359 ! CASE 4: ammonia = 0. hno3 and hcl exchange may happen here
6360 ! do small adjustments (if needed) before deciding case 4
6362 10 iadjust = mNO ! default
6363 iadjust_intermed = mNO ! default
6366 if(gas(ihno3_g).gt.0. .and. aer(ino3_a,jliquid,ibin).eq.0. .and. &
6367 aer(icl_a,jliquid,ibin) .gt. 0.0)then
6368 call absorb_tiny_hno3(ibin) ! and degas tiny hcl
6370 iadjust_intermed = mYES
6373 if(iadjust_intermed .eq. mYES)then
6374 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
6375 iadjust_intermed = mNO ! reset
6379 if(gas(ihcl_g).gt.0. .and. aer(icl_a,jliquid,ibin).eq.0. .and. &
6380 aer(ino3_a,jliquid,ibin) .gt. 0.0)then
6381 call absorb_tiny_hcl(ibin) ! and degas tiny hno3
6383 iadjust_intermed = mYES
6386 if(iadjust_intermed .eq. mYES)then
6387 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
6390 if(iadjust .eq. mYES)then
6391 call compute_activities(ibin) ! update after adjustments
6394 ! all adjustments done...
6396 call ASTEM_flux_wet_case4(ibin)
6400 end subroutine ASTEM_flux_wet
6413 !***********************************************************************
6414 ! part of ASTEM: subroutines for flux_wet cases
6416 ! author: Rahul A. Zaveri
6418 !-----------------------------------------------------------------------
6420 ! CASE 1: CaCO3 > 0 absorb all acids (and indirectly degas co2)
6422 subroutine ASTEM_flux_wet_case1(ibin)
6424 ! include 'mosaic.h'
6430 mc(jc_h,ibin) = sqrt(Keq_ll(3))
6433 if(gas(ihno3_g) .gt. 1.e-5)then
6434 sfc_a(ihno3_g) = 0.0
6435 df_gas_s(ihno3_g,ibin) = gas(ihno3_g)
6436 phi_volatile_s(ihno3_g,ibin) = 1.0
6437 flux_s(ihno3_g,ibin) = kg(ihno3_g,ibin)*df_gas_s(ihno3_g,ibin)
6438 integrate(ihno3_g,jsolid,ibin) = mYES
6439 jphase(ibin) = jsolid
6443 if(gas(ihcl_g) .gt. 1.e-5)then
6445 df_gas_s(ihcl_g,ibin) = gas(ihcl_g)
6446 phi_volatile_s(ihcl_g,ibin) = 1.0
6447 flux_s(ihcl_g,ibin) = kg(ihcl_g,ibin)*df_gas_s(ihcl_g,ibin)
6448 integrate(ihcl_g,jsolid,ibin) = mYES
6449 jphase(ibin) = jsolid
6454 end subroutine ASTEM_flux_wet_case1
6458 !--------------------------------------------------------------------
6459 ! CASE 2: Sulfate-Rich Domain
6461 subroutine ASTEM_flux_wet_case2(ibin)
6463 ! include 'mosaic.h'
6467 real(kind=8) dum_hno3, dum_hcl, dum_nh3
6470 sfc_a(inh3_g) = kel(inh3_g,ibin)* &
6471 gam_ratio(ibin)*mc(jc_nh4,ibin)*Keq_ll(3)/ &
6472 (mc(jc_h,ibin)*Keq_ll(2)*Keq_gl(2))
6474 sfc_a(ihno3_g) = kel(ihno3_g,ibin)* &
6475 mc(jc_h,ibin)*ma(ja_no3,ibin)*gam(jhno3,ibin)**2/ &
6478 sfc_a(ihcl_g) = kel(ihcl_g,ibin)* &
6479 mc(jc_h,ibin)*ma(ja_cl,ibin)*gam(jhcl,ibin)**2/ &
6482 dum_hno3 = max(sfc_a(ihno3_g), gas(ihno3_g))
6483 dum_hcl = max(sfc_a(ihcl_g), gas(ihcl_g))
6484 dum_nh3 = max(sfc_a(inh3_g), gas(inh3_g))
6487 ! compute relative driving forces
6488 if(dum_hno3 .gt. 0.0)then
6489 df_gas_l(ihno3_g,ibin) = gas(ihno3_g) - sfc_a(ihno3_g)
6490 phi_volatile_l(ihno3_g,ibin)= df_gas_l(ihno3_g,ibin)/dum_hno3
6492 phi_volatile_l(ihno3_g,ibin)= 0.0
6495 if(dum_hcl .gt. 0.0)then
6496 df_gas_l(ihcl_g,ibin) = gas(ihcl_g) - sfc_a(ihcl_g)
6497 phi_volatile_l(ihcl_g,ibin) = df_gas_l(ihcl_g,ibin)/dum_hcl
6499 phi_volatile_l(ihcl_g,ibin) = 0.0
6502 if(dum_nh3 .gt. 0.0)then
6503 df_gas_l(inh3_g,ibin) = gas(inh3_g) - sfc_a(inh3_g)
6504 phi_volatile_l(inh3_g,ibin) = df_gas_l(inh3_g,ibin)/dum_nh3
6506 phi_volatile_l(inh3_g,ibin) = 0.0
6510 if(phi_volatile_l(ihno3_g,ibin) .le. rtol_eqb_astem .and. &
6511 phi_volatile_l(ihcl_g,ibin) .le. rtol_eqb_astem .and. &
6512 phi_volatile_l(inh3_g,ibin) .le. rtol_eqb_astem)then
6520 if(dum_hno3 .gt. 0.0)then
6521 Heff(ihno3_g,ibin)= &
6522 kel(ihno3_g,ibin)*gam(jhno3,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6523 (water_a(ibin)*Keq_gl(3))
6524 integrate(ihno3_g,jliquid,ibin)= mYES
6528 if(dum_hcl .gt. 0.0)then
6529 Heff(ihcl_g,ibin)= &
6530 kel(ihcl_g,ibin)*gam(jhcl,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6531 (water_a(ibin)*Keq_gl(4))
6532 integrate(ihcl_g,jliquid,ibin) = mYES
6536 if(dum_nh3 .gt. 0.0)then
6537 Heff(inh3_g,ibin) = &
6538 kel(inh3_g,ibin)*gam_ratio(ibin)*1.e-9*Keq_ll(3)/ &
6539 (water_a(ibin)*mc(jc_h,ibin)*Keq_ll(2)*Keq_gl(2))
6540 integrate(inh3_g,jliquid,ibin) = mYES
6546 end subroutine ASTEM_flux_wet_case2
6555 !---------------------------------------------------------------------
6556 ! CASE 3: nh4no3 and/or nh4cl may be active
6558 subroutine ASTEM_flux_wet_case3(ibin)
6560 ! include 'mosaic.h'
6564 real(kind=8) a, b, c, dum_hno3, dum_hcl, dum_nh3
6566 ! real(kind=8) quadratic
6569 b = - kg(inh3_g,ibin)*gas(inh3_g) &
6570 + kg(ihno3_g,ibin)*gas(ihno3_g) &
6571 + kg(ihcl_g,ibin)*gas(ihcl_g)
6572 c = -(kg(ihno3_g,ibin)*Keq_nh4no3 + kg(ihcl_g,ibin)*Keq_nh4cl)
6574 sfc_a(inh3_g) = quadratic(a,b,c)
6575 sfc_a(ihno3_g) = Keq_nh4no3/max(sfc_a(inh3_g),1.D-20)
6576 sfc_a(ihcl_g) = Keq_nh4cl/max(sfc_a(inh3_g),1.D-20)
6580 if(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
6581 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
6582 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
6583 elseif(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
6584 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
6585 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
6587 call equilibrate_acids(ibin) ! hno3 and/or hcl may be > 0 in the gas phase
6588 mc(jc_h,ibin) = max(mc(jc_h,ibin), sqrt(Keq_ll(3)))
6590 sfc_a(inh3_g) = kel(inh3_g,ibin)* &
6591 gam_ratio(ibin)*mc(jc_nh4,ibin)*Keq_ll(3)/ &
6592 (mc(jc_h,ibin)*Keq_ll(2)*Keq_gl(2))
6594 sfc_a(ihno3_g) = kel(ihno3_g,ibin)* &
6595 mc(jc_h,ibin)*ma(ja_no3,ibin)*gam(jhno3,ibin)**2/ &
6597 sfc_a(ihcl_g) = kel(ihcl_g,ibin)* &
6598 mc(jc_h,ibin)*ma(ja_cl,ibin)*gam(jhcl,ibin)**2/ &
6604 dum_hno3 = max(sfc_a(ihno3_g), gas(ihno3_g))
6605 dum_hcl = max(sfc_a(ihcl_g), gas(ihcl_g))
6606 dum_nh3 = max(sfc_a(inh3_g), gas(inh3_g))
6608 ! compute relative driving forces
6609 if(dum_hno3 .gt. 0.0)then
6610 df_gas_l(ihno3_g,ibin) = gas(ihno3_g) - sfc_a(ihno3_g)
6611 phi_volatile_l(ihno3_g,ibin)= df_gas_l(ihno3_g,ibin)/dum_hno3
6613 phi_volatile_l(ihno3_g,ibin)= 0.0
6616 if(dum_hcl .gt. 0.0)then
6617 df_gas_l(ihcl_g,ibin) = gas(ihcl_g) - sfc_a(ihcl_g)
6618 phi_volatile_l(ihcl_g,ibin) = df_gas_l(ihcl_g,ibin)/dum_hcl
6620 phi_volatile_l(ihcl_g,ibin) = 0.0
6623 if(dum_nh3 .gt. 0.0)then
6624 df_gas_l(inh3_g,ibin) = gas(inh3_g) - sfc_a(inh3_g)
6625 phi_volatile_l(inh3_g,ibin) = df_gas_l(inh3_g,ibin)/dum_nh3
6627 phi_volatile_l(inh3_g,ibin) = 0.0
6632 if(phi_volatile_l(ihno3_g,ibin) .le. rtol_eqb_astem .and. &
6633 phi_volatile_l(ihcl_g,ibin) .le. rtol_eqb_astem .and. &
6634 phi_volatile_l(inh3_g,ibin) .le. rtol_eqb_astem)then
6642 if(dum_hno3 .gt. 0.0)then
6643 Heff(ihno3_g,ibin)= &
6644 kel(ihno3_g,ibin)*gam(jhno3,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6645 (water_a(ibin)*Keq_gl(3))
6646 integrate(ihno3_g,jliquid,ibin)= mYES
6650 if(dum_hcl .gt. 0.0)then
6651 Heff(ihcl_g,ibin)= &
6652 kel(ihcl_g,ibin)*gam(jhcl,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6653 (water_a(ibin)*Keq_gl(4))
6654 integrate(ihcl_g,jliquid,ibin) = mYES
6658 if(dum_nh3 .gt. 0.0)then
6659 Heff(inh3_g,ibin) = &
6660 kel(inh3_g,ibin)*gam_ratio(ibin)*1.e-9*Keq_ll(3)/ &
6661 (water_a(ibin)*mc(jc_h,ibin)*Keq_ll(2)*Keq_gl(2))
6662 integrate(inh3_g,jliquid,ibin) = mYES
6669 end subroutine ASTEM_flux_wet_case3
6679 !--------------------------------------------------------------------
6680 ! CASE 3a: only NH4NO3 (aq) active
6682 subroutine ASTEM_flux_wet_case3a(ibin) ! NH4NO3 (aq)
6684 ! include 'mosaic.h'
6688 real(kind=8) a, b, c, dum_hno3, dum_nh3
6690 ! real(kind=8) quadratic
6694 b = - kg(inh3_g,ibin)*gas(inh3_g) &
6695 + kg(ihno3_g,ibin)*gas(ihno3_g)
6696 c = -(kg(ihno3_g,ibin)*Keq_nh4no3)
6698 sfc_a(inh3_g) = quadratic(a,b,c)
6699 sfc_a(ihno3_g) = Keq_nh4no3/sfc_a(inh3_g)
6703 if(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
6704 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
6705 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
6707 mc(jc_h,ibin) = sqrt(Keq_ll(3))
6712 dum_hno3 = max(sfc_a(ihno3_g), gas(ihno3_g))
6713 dum_nh3 = max(sfc_a(inh3_g), gas(inh3_g))
6715 ! compute relative driving forces
6716 if(dum_hno3 .gt. 0.0)then
6717 df_gas_l(ihno3_g,ibin) = gas(ihno3_g) - sfc_a(ihno3_g)
6718 phi_volatile_l(ihno3_g,ibin)= df_gas_l(ihno3_g,ibin)/dum_hno3
6720 phi_volatile_l(ihno3_g,ibin)= 0.0
6723 if(dum_nh3 .gt. 0.0)then
6724 df_gas_l(inh3_g,ibin) = gas(inh3_g) - sfc_a(inh3_g)
6725 phi_volatile_l(inh3_g,ibin) = df_gas_l(inh3_g,ibin)/dum_nh3
6727 phi_volatile_l(inh3_g,ibin) = 0.0
6731 if(phi_volatile_l(ihno3_g,ibin) .le. rtol_eqb_astem .and. &
6732 phi_volatile_l(inh3_g,ibin) .le. rtol_eqb_astem)then
6740 Heff(ihno3_g,ibin)= &
6741 kel(ihno3_g,ibin)*gam(jhno3,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6742 (water_a(ibin)*Keq_gl(3))
6743 integrate(ihno3_g,jliquid,ibin)= mYES
6746 Heff(inh3_g,ibin) = &
6747 kel(inh3_g,ibin)*gam_ratio(ibin)*1.e-9*Keq_ll(3)/ &
6748 (water_a(ibin)*mc(jc_h,ibin)*Keq_ll(2)*Keq_gl(2))
6749 integrate(inh3_g,jliquid,ibin) = mYES
6756 end subroutine ASTEM_flux_wet_case3a
6766 !--------------------------------------------------------------------
6767 ! CASE 3b: only NH4Cl (aq) active
6769 subroutine ASTEM_flux_wet_case3b(ibin) ! NH4Cl (aq)
6771 ! include 'mosaic.h'
6775 real(kind=8) a, b, c, dum_hcl, dum_nh3
6777 ! real(kind=8) quadratic
6781 b = - kg(inh3_g,ibin)*gas(inh3_g) &
6782 + kg(ihcl_g,ibin)*gas(ihcl_g)
6783 c = -(kg(ihcl_g,ibin)*Keq_nh4cl)
6785 sfc_a(inh3_g) = quadratic(a,b,c)
6786 sfc_a(ihcl_g) = Keq_nh4cl /sfc_a(inh3_g)
6790 if(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
6791 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
6792 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
6794 mc(jc_h,ibin) = sqrt(Keq_ll(3))
6799 dum_hcl = max(sfc_a(ihcl_g), gas(ihcl_g))
6800 dum_nh3 = max(sfc_a(inh3_g), gas(inh3_g))
6803 ! compute relative driving forces
6804 if(dum_hcl .gt. 0.0)then
6805 df_gas_l(ihcl_g,ibin) = gas(ihcl_g) - sfc_a(ihcl_g)
6806 phi_volatile_l(ihcl_g,ibin) = df_gas_l(ihcl_g,ibin)/dum_hcl
6808 phi_volatile_l(ihcl_g,ibin) = 0.0
6811 if(dum_nh3 .gt. 0.0)then
6812 df_gas_l(inh3_g,ibin) = gas(inh3_g) - sfc_a(inh3_g)
6813 phi_volatile_l(inh3_g,ibin) = df_gas_l(inh3_g,ibin)/dum_nh3
6815 phi_volatile_l(inh3_g,ibin) = 0.0
6820 if(phi_volatile_l(ihcl_g,ibin) .le. rtol_eqb_astem .and. &
6821 phi_volatile_l(inh3_g,ibin) .le. rtol_eqb_astem)then
6830 Heff(ihcl_g,ibin)= &
6831 kel(ihcl_g,ibin)*gam(jhcl,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6832 (water_a(ibin)*Keq_gl(4))
6833 integrate(ihcl_g,jliquid,ibin) = mYES
6836 Heff(inh3_g,ibin) = &
6837 kel(inh3_g,ibin)*gam_ratio(ibin)*1.e-9*Keq_ll(3)/ &
6838 (water_a(ibin)*mc(jc_h,ibin)*Keq_ll(2)*Keq_gl(2))
6839 integrate(inh3_g,jliquid,ibin) = mYES
6847 end subroutine ASTEM_flux_wet_case3b
6857 !-----------------------------------------------------------------------
6858 ! CASE 4: NH3 = 0 (in gas and aerosol). hno3 and hcl exchange may happen here
6860 subroutine ASTEM_flux_wet_case4(ibin)
6862 ! include 'mosaic.h'
6866 real(kind=8) dum_numer, dum_denom, gas_eqb_ratio, dum_hno3, dum_hcl
6869 dum_numer = kel(ihno3_g,ibin)*Keq_gl(4)*ma(ja_no3,ibin)* &
6871 dum_denom = kel(ihcl_g,ibin)*Keq_gl(3)*ma(ja_cl ,ibin)* &
6875 if(dum_denom .eq. 0.0 .or. dum_numer .eq. 0.0)then
6876 mc(jc_h,ibin) = sqrt(Keq_ll(3))
6880 gas_eqb_ratio = dum_numer/dum_denom ! Ce,hno3/Ce,hcl
6883 ! compute equilibrium surface concentrations
6885 ( kg(ihno3_g,ibin)*gas(ihno3_g)+kg(ihcl_g,ibin)*gas(ihcl_g) )/ &
6886 ( kg(ihcl_g,ibin) + gas_eqb_ratio*kg(ihno3_g,ibin) )
6887 sfc_a(ihno3_g)= gas_eqb_ratio*sfc_a(ihcl_g)
6891 if(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
6892 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
6893 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
6894 elseif(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
6895 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
6896 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
6898 mc(jc_h,ibin) = sqrt(Keq_ll(3))
6903 dum_hno3 = max(sfc_a(ihno3_g), gas(ihno3_g)) ! raz-30apr07
6904 dum_hcl = max(sfc_a(ihcl_g), gas(ihcl_g)) ! raz-30apr07
6906 ! compute relative driving forces
6907 if(dum_hno3 .gt. 0.0)then
6908 df_gas_l(ihno3_g,ibin) = gas(ihno3_g) - sfc_a(ihno3_g)
6909 phi_volatile_l(ihno3_g,ibin)= df_gas_l(ihno3_g,ibin)/dum_hno3
6911 phi_volatile_l(ihno3_g,ibin)= 0.0
6914 if(dum_hcl .gt. 0.0)then
6915 df_gas_l(ihcl_g,ibin) = gas(ihcl_g) - sfc_a(ihcl_g)
6916 phi_volatile_l(ihcl_g,ibin)= df_gas_l(ihcl_g,ibin)/dum_hcl
6918 phi_volatile_l(ihcl_g,ibin)= 0.0
6922 if(phi_volatile_l(ihno3_g,ibin) .le. rtol_eqb_astem .and. &
6923 phi_volatile_l(ihcl_g,ibin) .le. rtol_eqb_astem)then
6932 Heff(ihno3_g,ibin)= &
6933 kel(ihno3_g,ibin)*gam(jhno3,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6934 (water_a(ibin)*Keq_gl(3))
6935 integrate(ihno3_g,jliquid,ibin)= mYES
6938 Heff(ihcl_g,ibin)= &
6939 kel(ihcl_g,ibin)*gam(jhcl,ibin)**2*mc(jc_h,ibin)*1.e-9/ &
6940 (water_a(ibin)*Keq_gl(4))
6941 integrate(ihcl_g,jliquid,ibin) = mYES
6949 end subroutine ASTEM_flux_wet_case4
6964 !===========================================================
6968 !===========================================================
6969 !***********************************************************************
6970 ! part of ASTEM: computes gas-aerosol fluxes over dry aerosols
6972 ! author: Rahul A. Zaveri
6974 !-----------------------------------------------------------------------
6975 subroutine ASTEM_flux_dry(ibin)
6977 ! include 'mosaic.h'
6982 real(kind=8) XT, prod_nh4no3, prod_nh4cl, volatile_cl
6987 call calculate_XT(ibin,jsolid,XT)
6989 !-----------------------------------------------------------------
6990 ! CASE 1: caco3 > 0 absorb all acids (and indirectly degas co2)
6992 if(electrolyte(jcaco3,jsolid,ibin) .gt. 0.0)then
6994 call ASTEM_flux_dry_case1(ibin)
6999 !-----------------------------------------------------------------
7000 ! CASE 2: Sulfate-Rich Domain
7002 if(XT.lt.1.9999 .and. XT.ge.0.)then ! excess sulfate (acidic)
7004 call ASTEM_flux_dry_case2(ibin)
7009 !-------------------------------------------------------------------
7010 ! CASE 3: hno3 and hcl exchange may happen here and nh4cl may form/evaporate
7012 volatile_cl = electrolyte(jnacl,jsolid,ibin) + &
7013 electrolyte(jcacl2,jsolid,ibin)
7016 if(volatile_cl .gt. 0.0 .and. gas(ihno3_g).gt. 0.0 )then
7018 call ASTEM_flux_dry_case3a(ibin)
7020 Keq_nh4cl_0 = min(Kp_nh4cl_0, Keq_sg(2)) ! raz update 6/25/2008
7022 prod_nh4cl = max( (gas(inh3_g)*gas(ihcl_g)-Keq_nh4cl_0), 0.0d0) + &
7023 electrolyte(jnh4cl, jsolid,ibin) ! raz update 6/25/2008
7025 if(prod_nh4cl .gt. 0.0)then
7026 call ASTEM_flux_dry_case3b(ibin)
7032 !-----------------------------------------------------------------
7033 ! CASE 4: nh4no3 or nh4cl or both may be active
7035 Keq_nh4no3_0 = min(Kp_nh4no3_0, Keq_sg(1)) ! raz update 6/25/2008
7036 Keq_nh4cl_0 = min(Kp_nh4cl_0, Keq_sg(2)) ! raz update 6/25/2008
7038 prod_nh4no3 = max( (gas(inh3_g)*gas(ihno3_g)-Keq_nh4no3_0), 0.0d0) + &
7039 electrolyte(jnh4no3,jsolid,ibin) ! raz update 6/25/2008
7040 prod_nh4cl = max( (gas(inh3_g)*gas(ihcl_g) -Keq_nh4cl_0), 0.0d0) + &
7041 electrolyte(jnh4cl, jsolid,ibin) ! raz update 6/25/2008
7043 if(prod_nh4no3 .gt. 0.0 .or. prod_nh4cl .gt. 0.0)then
7044 call ASTEM_flux_dry_case4(ibin)
7048 !-----------------------------------------------------------------
7051 end subroutine ASTEM_flux_dry
7053 !----------------------------------------------------------------------
7067 !***********************************************************************
7068 ! part of ASTEM: subroutines for flux_dry cases
7070 ! author: Rahul A. Zaveri
7072 !-----------------------------------------------------------------------
7074 ! CASE 1: caco3 > 0 absorb all acids (and indirectly degas co2)
7076 subroutine ASTEM_flux_dry_case1(ibin)
7078 ! include 'mosaic.h'
7083 if(gas(ihno3_g) .gt. 1.e-5)then
7084 sfc_a(ihno3_g) = 0.0
7085 df_gas_s(ihno3_g,ibin) = gas(ihno3_g)
7086 phi_volatile_s(ihno3_g,ibin) = 1.0
7087 flux_s(ihno3_g,ibin) = kg(ihno3_g,ibin)*df_gas_s(ihno3_g,ibin)
7088 integrate(ihno3_g,jsolid,ibin) = mYES
7092 if(gas(ihcl_g) .gt. 1.e-5)then
7094 df_gas_s(ihcl_g,ibin) = gas(ihcl_g)
7095 phi_volatile_s(ihcl_g,ibin) = 1.0
7096 flux_s(ihcl_g,ibin) = kg(ihcl_g,ibin)*df_gas_s(ihcl_g,ibin)
7097 integrate(ihcl_g,jsolid,ibin) = mYES
7103 end subroutine ASTEM_flux_dry_case1
7107 !---------------------------------------------------------------------
7108 ! CASE 2: Sulfate-Rich Domain
7110 subroutine ASTEM_flux_dry_case2(ibin) ! TOUCH
7112 ! include 'mosaic.h'
7117 if(gas(inh3_g).gt.1.e-5)then
7119 df_gas_s(inh3_g,ibin) = gas(inh3_g)
7120 phi_volatile_s(inh3_g,ibin) = 1.0
7121 flux_s(inh3_g,ibin) = kg(inh3_g,ibin)*gas(inh3_g)
7122 integrate(inh3_g,jsolid,ibin) = mYES
7128 end subroutine ASTEM_flux_dry_case2
7133 !---------------------------------------------------------------------
7134 ! CASE 3a: degas hcl from nacl or cacl2 by flux_s balance with hno3
7136 subroutine ASTEM_flux_dry_case3a(ibin)
7138 ! include 'mosaic.h'
7143 if(gas(ihno3_g) .gt. 1.e-5)then
7144 sfc_a(ihno3_g) = 0.0
7145 sfc_a(ihcl_g) = gas(ihcl_g) + aer(icl_a,jsolid,ibin)
7147 df_gas_s(ihno3_g,ibin) = gas(ihno3_g)
7148 df_gas_s(ihcl_g,ibin) = -aer(icl_a,jsolid,ibin)
7150 flux_s(ihno3_g,ibin) = kg(ihno3_g,ibin)*gas(ihno3_g)
7151 flux_s(ihcl_g,ibin) = -flux_s(ihno3_g,ibin)
7153 phi_volatile_s(ihno3_g,ibin) = 1.0
7154 phi_volatile_s(ihcl_g,ibin)=df_gas_s(ihcl_g,ibin)/sfc_a(ihcl_g)
7156 integrate(ihno3_g,jsolid,ibin) = mYES
7157 integrate(ihcl_g,jsolid,ibin) = mYES
7159 idry_case3a(ibin) = mYES
7164 end subroutine ASTEM_flux_dry_case3a
7169 !---------------------------------------------------------------------
7170 ! CASE 3b: nh4cl may form/evaporate here
7172 subroutine ASTEM_flux_dry_case3b(ibin) ! TOUCH
7174 ! include 'mosaic.h'
7178 integer iactive_nh4cl, js ! raz update 11/13/2008
7179 real(kind=8) a, b, c, sum_dum ! raz update 11/13/2008
7181 ! real(kind=8) quadratic
7184 ! calculate percent composition ! raz update 11/13/2008
7187 sum_dum = sum_dum + electrolyte(js,jsolid,ibin)
7190 if(sum_dum .eq. 0.)sum_dum = 1.0
7192 epercent(jnh4cl,jsolid,ibin) = 100.*electrolyte(jnh4cl,jsolid,ibin)/sum_dum
7197 !-------------------
7198 ! set default values for flags
7202 ! compute relative driving force
7203 phi_nh4cl_s = (gas(inh3_g)*gas(ihcl_g) - Keq_sg(2))/ &
7204 max(gas(inh3_g)*gas(ihcl_g),Keq_sg(2))
7207 !-------------------
7208 ! now determine if nh4cl is active or significant
7210 if( abs(phi_nh4cl_s) .lt. rtol_eqb_ASTEM )then
7212 elseif(gas(inh3_g)*gas(ihcl_g) .lt. Keq_sg(2) .and. &
7213 epercent(jnh4cl, jsolid,ibin) .le. ptol_mol_ASTEM)then
7215 if(epercent(jnh4cl, jsolid,ibin) .gt. 0.0)then
7216 call degas_solid_nh4cl(ibin)
7222 if(iactive_nh4cl .eq. 0)return
7230 b = - kg(inh3_g,ibin)*gas(inh3_g) &
7231 + kg(ihcl_g,ibin)*gas(ihcl_g)
7232 c = -(kg(ihcl_g,ibin)*Keq_sg(2))
7234 sfc_a(inh3_g) = quadratic(a,b,c)
7235 sfc_a(ihcl_g) = Keq_sg(2)/sfc_a(inh3_g)
7237 df_gas_s(ihcl_g,ibin) = gas(ihcl_g) - sfc_a(ihcl_g)
7238 df_gas_s(inh3_g,ibin) = gas(inh3_g) - sfc_a(inh3_g)
7240 flux_s(inh3_g,ibin) = kg(inh3_g,ibin)*df_gas_s(inh3_g,ibin)
7241 flux_s(ihcl_g,ibin) = flux_s(ihcl_g,ibin) + flux_s(inh3_g,ibin)
7243 phi_volatile_s(inh3_g,ibin) = phi_nh4cl_s
7245 if(flux_s(ihcl_g,ibin) .gt. 0.0)then
7246 df_gas_s(ihcl_g,ibin) = flux_s(ihcl_g,ibin)/kg(ihcl_g,ibin) ! recompute df_gas
7247 phi_volatile_s(ihcl_g,ibin) = phi_nh4cl_s
7249 sfc_a(ihcl_g) = gas(ihcl_g) + aer(icl_a,jsolid,ibin)
7250 df_gas_s(ihcl_g,ibin) = -aer(icl_a,jsolid,ibin)
7251 phi_volatile_s(ihcl_g,ibin)=df_gas_s(ihcl_g,ibin)/sfc_a(ihcl_g) ! not to be used
7254 integrate(inh3_g,jsolid,ibin) = mYES
7255 integrate(ihcl_g,jsolid,ibin) = mYES ! integrate HCl with explicit euler
7260 end subroutine ASTEM_flux_dry_case3b
7265 !---------------------------------------------------------------------
7266 ! Case 4: NH4NO3 and/or NH4Cl may be active
7268 subroutine ASTEM_flux_dry_case4(ibin) ! TOUCH
7270 ! include 'mosaic.h'
7274 integer iactive_nh4no3, iactive_nh4cl, iactive, js ! raz update 11/13/2008
7275 real(kind=8) a, b, c, sum_dum ! raz update 11/13/2008
7277 ! real(kind=8) quadratic
7281 ! calculate percent composition ! raz update 11/13/2008
7284 sum_dum = sum_dum + electrolyte(js,jsolid,ibin)
7287 if(sum_dum .eq. 0.)sum_dum = 1.0
7289 epercent(jnh4no3,jsolid,ibin) = 100.*electrolyte(jnh4no3,jsolid,ibin)/sum_dum
7290 epercent(jnh4cl, jsolid,ibin) = 100.*electrolyte(jnh4cl, jsolid,ibin)/sum_dum
7294 !-------------------
7295 ! set default values for flags
7300 ! compute diagnostic products and ratios
7301 phi_nh4no3_s = (gas(inh3_g)*gas(ihno3_g) - Keq_sg(1))/ &
7302 max(gas(inh3_g)*gas(ihno3_g),Keq_sg(1))
7303 phi_nh4cl_s = (gas(inh3_g)*gas(ihcl_g) - Keq_sg(2))/ &
7304 max(gas(inh3_g)*gas(ihcl_g),Keq_sg(2))
7307 !-------------------
7308 ! now determine if nh4no3 and/or nh4cl are active or significant
7311 if( abs(phi_nh4no3_s) .lt. rtol_eqb_ASTEM )then
7313 elseif(gas(inh3_g)*gas(ihno3_g) .lt. Keq_sg(1) .and. &
7314 epercent(jnh4no3,jsolid,ibin) .le. ptol_mol_ASTEM)then
7316 if(epercent(jnh4no3,jsolid,ibin) .gt. 0.0)then
7317 call degas_solid_nh4no3(ibin)
7322 if( abs(phi_nh4cl_s) .lt. rtol_eqb_ASTEM )then
7324 elseif(gas(inh3_g)*gas(ihcl_g) .lt. Keq_sg(2) .and. &
7325 epercent(jnh4cl, jsolid,ibin) .le. ptol_mol_ASTEM)then
7327 if(epercent(jnh4cl, jsolid,ibin) .gt. 0.0)then
7328 call degas_solid_nh4cl(ibin)
7333 iactive = iactive_nh4no3 + iactive_nh4cl
7336 if(iactive .eq. 0)return
7339 goto (1,2,3),iactive
7341 !---------------------------------
7342 ! only nh4no3 solid is active
7343 1 call ASTEM_flux_dry_case4a(ibin)
7349 ! only nh4cl solid is active
7350 2 call ASTEM_flux_dry_case4b(ibin)
7356 ! both nh4no3 and nh4cl are active
7357 3 call ASTEM_flux_dry_case4ab(ibin)
7363 end subroutine ASTEM_flux_dry_case4
7371 !---------------------------------------------------------------------
7374 subroutine ASTEM_flux_dry_case4a(ibin) ! NH4NO3 solid
7376 ! include 'mosaic.h'
7380 real(kind=8) a, b, c
7382 ! real(kind=8) quadratic
7387 b = - kg(inh3_g,ibin)*gas(inh3_g) &
7388 + kg(ihno3_g,ibin)*gas(ihno3_g)
7389 c = -(kg(ihno3_g,ibin)*Keq_nh4no3_0) ! raz update 6/25/2008
7391 sfc_a(inh3_g) = quadratic(a,b,c)
7392 sfc_a(ihno3_g) = Keq_nh4no3_0/sfc_a(inh3_g) ! raz update 6/25/2008
7394 integrate(ihno3_g,jsolid,ibin) = mYES
7395 integrate(inh3_g,jsolid,ibin) = mYES
7397 df_gas_s(ihno3_g,ibin)=gas(ihno3_g)-sfc_a(ihno3_g)
7398 df_gas_s(inh3_g,ibin) =gas(inh3_g) -sfc_a(inh3_g)
7400 phi_volatile_s(ihno3_g,ibin)= phi_nh4no3_s
7401 phi_volatile_s(inh3_g,ibin) = phi_nh4no3_s
7403 flux_s(ihno3_g,ibin) = kg(ihno3_g,ibin)*df_gas_s(ihno3_g,ibin)
7404 flux_s(inh3_g,ibin) = flux_s(ihno3_g,ibin)
7409 end subroutine ASTEM_flux_dry_case4a
7414 !---------------------------------------------------------
7417 subroutine ASTEM_flux_dry_case4b(ibin) ! NH4Cl solid
7419 ! include 'mosaic.h'
7423 real(kind=8) a, b, c
7425 ! real(kind=8) quadratic
7429 b = - kg(inh3_g,ibin)*gas(inh3_g) &
7430 + kg(ihcl_g,ibin)*gas(ihcl_g)
7431 c = -(kg(ihcl_g,ibin)*Keq_nh4cl_0) ! raz update 6/25/2008
7433 sfc_a(inh3_g) = quadratic(a,b,c)
7434 sfc_a(ihcl_g) = Keq_nh4cl_0 /sfc_a(inh3_g) ! raz update 6/25/2008
7436 integrate(ihcl_g,jsolid,ibin) = mYES
7437 integrate(inh3_g,jsolid,ibin) = mYES
7439 df_gas_s(ihcl_g,ibin) = gas(ihcl_g)-sfc_a(ihcl_g)
7440 df_gas_s(inh3_g,ibin) = gas(inh3_g)-sfc_a(inh3_g)
7442 phi_volatile_s(ihcl_g,ibin) = phi_nh4cl_s
7443 phi_volatile_s(inh3_g,ibin) = phi_nh4cl_s
7445 flux_s(ihcl_g,ibin) = kg(ihcl_g,ibin)*df_gas_s(ihcl_g,ibin)
7446 flux_s(inh3_g,ibin) = flux_s(ihcl_g,ibin)
7451 end subroutine ASTEM_flux_dry_case4b
7456 !-------------------------------------------------------------------
7459 subroutine ASTEM_flux_dry_case4ab(ibin) ! NH4NO3 + NH4Cl (solid)
7461 ! include 'mosaic.h'
7465 real(kind=8) a, b, c, &
7466 flux_nh3_est, flux_nh3_max, ratio_flux
7468 ! real(kind=8) quadratic
7470 call ASTEM_flux_dry_case4a(ibin)
7471 call ASTEM_flux_dry_case4b(ibin)
7474 ! estimate nh3 flux and adjust hno3 and/or hcl if necessary
7476 flux_nh3_est = flux_s(ihno3_g,ibin)+flux_s(ihcl_g,ibin)
7477 flux_nh3_max = kg(inh3_g,ibin)*gas(inh3_g)
7480 if(flux_nh3_est .le. flux_nh3_max)then
7482 flux_s(inh3_g,ibin) = flux_nh3_est ! all ok - no adjustments needed
7483 sfc_a(inh3_g) = gas(inh3_g) - & ! recompute sfc_a(ihno3_g)
7484 flux_s(inh3_g,ibin)/kg(inh3_g,ibin)
7485 phi_volatile_s(inh3_g,ibin) = max(abs(phi_nh4no3_s), &
7488 else ! reduce hno3 and hcl flux_ses as necessary so that nh3 flux_s = flux_s_nh3_max
7490 ratio_flux = flux_nh3_max/flux_nh3_est
7491 flux_s(inh3_g,ibin) = flux_nh3_max
7492 flux_s(ihno3_g,ibin)= flux_s(ihno3_g,ibin)*ratio_flux
7493 flux_s(ihcl_g,ibin) = flux_s(ihcl_g,ibin) *ratio_flux
7496 sfc_a(ihno3_g)= gas(ihno3_g) - & ! recompute sfc_a(ihno3_g)
7497 flux_s(ihno3_g,ibin)/kg(ihno3_g,ibin)
7498 sfc_a(ihcl_g) = gas(ihcl_g) - & ! recompute sfc_a(ihcl_g)
7499 flux_s(ihcl_g,ibin)/kg(ihcl_g,ibin)
7501 df_gas_s(inh3_g,ibin) =gas(inh3_g) -sfc_a(inh3_g)
7502 df_gas_s(ihno3_g,ibin)=gas(ihno3_g)-sfc_a(ihno3_g)
7503 df_gas_s(ihcl_g,ibin) =gas(ihcl_g) -sfc_a(ihcl_g)
7505 phi_volatile_s(inh3_g,ibin) = max(abs(phi_nh4no3_s), &
7513 end subroutine ASTEM_flux_dry_case4ab
7525 !=======================================================================
7527 ! MIXED-PHASE PARTICLES
7529 !***********************************************************************
7530 ! part of ASTEM: computes gas-aerosol fluxes over mixed-phase aerosols
7532 ! author: Rahul A. Zaveri
7534 !-----------------------------------------------------------------------
7536 subroutine ASTEM_flux_mix(ibin)
7537 use module_data_mosaic_other, only: lunerr
7539 ! include 'mosaic.h'
7543 integer iv, iadjust, iadjust_intermed, js ! raz update 11/13/2008
7544 real(kind=8) XT, g_nh3_hno3, g_nh3_hcl, &
7545 a_nh4_no3, a_nh4_cl, a_no3, a_cl, &
7546 prod_nh4no3, prod_nh4cl
7547 real(kind=8) volatile_cl, sum_dum ! raz update 11/13/2008
7550 call ions_to_electrolytes(jliquid,ibin,XT) ! for water content calculation
7551 call compute_activities(ibin)
7553 if(water_a(ibin) .eq. 0.0)then
7554 write(6,*)'Water is zero in liquid phase'
7555 call peg_error_fatal( lunerr, "Stopping in ASTEM_flux_wet" )
7560 ! calculate percent composition ! raz update 11/13/2008
7563 sum_dum = sum_dum + electrolyte(js,jsolid,ibin)
7566 if(sum_dum .eq. 0.)sum_dum = 1.0
7568 epercent(jcaco3,jsolid,ibin) = 100.*electrolyte(jcaco3,jsolid,ibin)/sum_dum
7572 Keq_nh4no3_0 = Keq_sg(1) ! raz update 6/25/2008
7573 Keq_nh4cl_0 = Keq_sg(2) ! raz update 6/25/2008
7575 !-----------------------------------------------------------------
7576 ! MIXED CASE 1: caco3 > 0 absorb all acids (and indirectly degas co2)
7578 if(epercent(jcaco3,jsolid,ibin) .gt. 0.0)then
7579 jphase(ibin) = jliquid
7580 call ASTEM_flux_wet_case1(ibin)
7584 !-----------------------------------------------------------------
7585 ! MIXED CASE 2: Sulfate-Rich Domain
7587 if(XT.lt.1.9999 .and. XT.ge.0.)then ! excess sulfate (acidic)
7588 jphase(ibin) = jliquid
7589 call ASTEM_flux_wet_case2(ibin)
7593 !-------------------------------------------------------------------
7594 ! MIXED CASE 3: hno3 and hcl exchange may happen here and nh4cl may form/evaporate
7596 volatile_cl = electrolyte(jnacl,jsolid,ibin) + &
7597 electrolyte(jcacl2,jsolid,ibin)
7600 if(volatile_cl .gt. 0.0 .and. gas(ihno3_g).gt. 0.0 )then
7602 call ASTEM_flux_dry_case3a(ibin)
7604 prod_nh4cl = max( (gas(inh3_g)*gas(ihcl_g)-Keq_sg(2)), 0.0d0) + &
7605 electrolyte(jnh4cl, jsolid,ibin)
7607 if(prod_nh4cl .gt. 0.0)then
7608 call ASTEM_flux_dry_case3b(ibin)
7611 jphase(ibin) = jsolid
7616 !-------------------------------------------------------------------
7617 ! MIXED CASE 4: nh4no3 or nh4cl or both may be active
7619 if( electrolyte(jnh4no3,jsolid,ibin).gt.0. .and. &
7620 electrolyte(jnh4cl,jsolid,ibin) .gt.0. )then
7621 jphase(ibin) = jsolid
7622 call ASTEM_flux_dry_case4(ibin)
7624 if(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
7625 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
7626 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
7627 elseif(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
7628 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
7629 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
7631 mc(jc_h,ibin) = sqrt(Keq_ll(3))
7636 elseif( electrolyte(jnh4no3,jsolid,ibin).gt.0. )then
7637 ! do small adjustments for nh4cl aq
7638 g_nh3_hcl= gas(inh3_g)*gas(ihcl_g)
7639 a_nh4_cl = aer(inh4_a,jliquid,ibin)*aer(icl_a,jliquid,ibin)
7641 iadjust = mNO ! initialize
7642 if(g_nh3_hcl .gt. 0.0 .and. a_nh4_cl .eq. 0.0)then
7643 call absorb_tiny_nh4cl(ibin)
7645 elseif(g_nh3_hcl .eq. 0.0 .and. a_nh4_cl .gt. 0.0)then
7646 call degas_tiny_nh4cl(ibin)
7650 if(iadjust .eq. mYES)then
7651 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
7652 call compute_activities(ibin) ! update after adjustments
7655 call ASTEM_flux_mix_case4a(ibin) ! nh4no3 solid + nh4cl aq
7656 jphase(ibin) = jtotal
7659 elseif( electrolyte(jnh4cl,jsolid,ibin).gt.0.)then
7660 ! do small adjustments for nh4no3 aq
7661 g_nh3_hno3= gas(inh3_g)*gas(ihno3_g)
7662 a_nh4_no3 = aer(inh4_a,jliquid,ibin)*aer(ino3_a,jliquid,ibin)
7664 iadjust = mNO ! initialize
7665 if(g_nh3_hno3 .gt. 0.0 .and. a_nh4_no3 .eq. 0.0)then
7666 call absorb_tiny_nh4no3(ibin)
7668 elseif(g_nh3_hno3 .eq. 0.0 .and. a_nh4_no3 .gt. 0.0)then
7669 call degas_tiny_nh4no3(ibin)
7673 if(iadjust .eq. mYES)then
7674 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
7675 call compute_activities(ibin) ! update after adjustments
7678 kelvin_nh4no3 = kel(inh3_g,ibin)*kel(ihno3_g,ibin)
7679 Keq_nh4no3 = kelvin_nh4no3*activity(jnh4no3,ibin)*Kp_nh4no3 ! = [NH3]s * [HNO3]s
7681 call ASTEM_flux_mix_case4b(ibin) ! nh4cl solid + nh4no3 aq
7682 jphase(ibin) = jtotal
7687 !-------------------------------------------------------------------
7689 if( (gas(inh3_g)+aer(inh4_a,jliquid,ibin)) .lt. 1.e-25)goto 10 ! no ammonia in the system
7691 !-------------------------------------------------------------------
7692 ! MIXED CASE 5: liquid nh4no3 and/or nh4cl maybe active
7693 ! do some small adjustments (if needed) before deciding case 3
7695 iadjust = mNO ! default
7696 iadjust_intermed = mNO ! default
7699 g_nh3_hno3 = gas(inh3_g)*gas(ihno3_g)
7700 a_nh4_no3 = aer(inh4_a,jliquid,ibin)*aer(ino3_a,jliquid,ibin)
7702 if(g_nh3_hno3 .gt. 0. .and. a_nh4_no3 .eq. 0.)then
7703 call absorb_tiny_nh4no3(ibin)
7705 iadjust_intermed = mYES
7708 if(iadjust_intermed .eq. mYES)then
7709 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
7710 iadjust_intermed = mNO ! reset
7714 g_nh3_hcl = gas(inh3_g)*gas(ihcl_g)
7715 a_nh4_cl = aer(inh4_a,jliquid,ibin)*aer(icl_a,jliquid,ibin)
7717 if(g_nh3_hcl .gt. 0. .and. a_nh4_cl .eq. 0.)then
7718 call absorb_tiny_nh4cl(ibin)
7720 iadjust_intermed = mYES
7723 if(iadjust_intermed .eq. mYES)then
7724 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
7727 if(iadjust .eq. mYES)then
7728 call compute_activities(ibin) ! update after adjustments
7732 ! all adjustments done...
7735 kelvin_nh4no3 = kel(inh3_g,ibin)*kel(ihno3_g,ibin)
7736 Keq_nh4no3 = kelvin_nh4no3*activity(jnh4no3,ibin)*Kp_nh4no3 ! = [NH3]s * [HNO3]s
7738 kelvin_nh4cl = kel(inh3_g,ibin)*kel(ihcl_g,ibin)
7739 Keq_nh4cl = kelvin_nh4cl*activity(jnh4cl,ibin)*Kp_nh4cl ! = [NH3]s * [HCl]s
7741 call ASTEM_flux_wet_case3(ibin)
7742 jphase(ibin) = jliquid
7747 !-------------------------------------------------------------------
7748 ! MIXED CASE 6: ammonia = 0. liquid hno3 and hcl exchange may happen here
7749 ! do small adjustments (if needed) before deciding case 4
7751 10 iadjust = mNO ! default
7752 iadjust_intermed = mNO ! default
7755 if(gas(ihno3_g).gt.0. .and. aer(ino3_a,jliquid,ibin).eq.0. .and. &
7756 aer(icl_a,jliquid,ibin) .gt. 0.0)then
7757 call absorb_tiny_hno3(ibin) ! and degas tiny hcl
7759 iadjust_intermed = mYES
7762 if(iadjust_intermed .eq. mYES)then
7763 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
7764 iadjust_intermed = mNO ! reset
7768 if(gas(ihcl_g).gt.0. .and. aer(icl_a,jliquid,ibin) .eq. 0. .and. &
7769 aer(ino3_a,jliquid,ibin) .gt. 0.0)then
7770 call absorb_tiny_hcl(ibin) ! and degas tiny hno3
7772 iadjust_intermed = mYES
7775 if(iadjust_intermed .eq. mYES)then
7776 call ions_to_electrolytes(jliquid,ibin,XT) ! update after adjustments
7779 if(iadjust .eq. mYES)then
7780 call compute_activities(ibin) ! update after adjustments
7783 ! all adjustments done...
7785 call ASTEM_flux_wet_case4(ibin)
7786 jphase(ibin) = jliquid
7791 end subroutine ASTEM_flux_mix
7793 !----------------------------------------------------------------------
7802 !------------------------------------------------------------------
7803 ! Mix Case 4a: NH4NO3 solid maybe active. NH4Cl aq maybe active
7805 subroutine ASTEM_flux_mix_case4a(ibin) ! TOUCH
7807 ! include 'mosaic.h'
7811 integer iactive_nh4no3, iactive_nh4cl, js ! raz update 11/13/2008
7812 real(kind=8) sum_dum ! raz update 11/13/2008
7815 ! set default values for flags
7816 iactive_nh4no3 = mYES
7817 iactive_nh4cl = mYES
7820 ! calculate percent composition ! raz update 11/13/2008
7823 sum_dum = sum_dum + electrolyte(js,jsolid,ibin)
7826 if(sum_dum .eq. 0.)sum_dum = 1.0
7828 epercent(jnh4no3,jsolid,ibin) = 100.*electrolyte(jnh4no3,jsolid,ibin)/sum_dum
7833 phi_nh4no3_s = (gas(inh3_g)*gas(ihno3_g) - Keq_sg(1))/ &
7834 max(gas(inh3_g)*gas(ihno3_g),Keq_sg(1))
7837 kelvin_nh4cl = kel(inh3_g,ibin)*kel(ihcl_g,ibin)
7838 Keq_nh4cl = kelvin_nh4cl*activity(jnh4cl,ibin)*Kp_nh4cl ! = [NH3]s * [HCl]s
7841 !-------------------
7842 ! now determine if nh4no3 and/or nh4cl are active or significant
7844 if( abs(phi_nh4no3_s) .le. rtol_eqb_ASTEM )then
7845 iactive_nh4no3 = mNO
7846 elseif(gas(inh3_g)*gas(ihno3_g) .lt. Keq_sg(1) .and. &
7847 epercent(jnh4no3,jsolid,ibin) .le. ptol_mol_ASTEM)then
7848 iactive_nh4no3 = mNO
7849 if(epercent(jnh4no3,jsolid,ibin) .gt. 0.0)then
7850 call degas_solid_nh4no3(ibin)
7855 if( gas(inh3_g)*gas(ihcl_g).eq.0. .or. Keq_nh4cl.eq.0. )then
7860 !---------------------------------
7861 if(iactive_nh4no3 .eq. mYES)then
7863 jphase(ibin) = jsolid
7864 call ASTEM_flux_dry_case4a(ibin) ! NH4NO3 (solid)
7866 if(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
7867 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
7868 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
7869 elseif(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
7870 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
7871 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
7873 mc(jc_h,ibin) = sqrt(Keq_ll(3))
7879 if(iactive_nh4cl .eq. mYES)then
7881 jphase(ibin) = jliquid
7882 call ASTEM_flux_wet_case3b(ibin) ! NH4Cl (liquid)
7884 if(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
7885 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
7886 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
7888 mc(jc_h,ibin) = sqrt(Keq_ll(3))
7894 if(iactive_nh4cl .eq. mYES .and. iactive_nh4no3 .eq. mYES)then
7895 jphase(ibin) = jtotal
7901 end subroutine ASTEM_flux_mix_case4a
7910 !------------------------------------------------------------------
7911 ! Mix Case 4b: NH4Cl solid maybe active. NH4NO3 aq may or maybe active
7913 subroutine ASTEM_flux_mix_case4b(ibin) ! TOUCH
7915 ! include 'mosaic.h'
7919 integer iactive_nh4no3, iactive_nh4cl, js ! raz update 11/13/2008
7920 real(kind=8) sum_dum ! raz update 11/13/2008
7923 ! set default values for flags
7924 iactive_nh4cl = mYES
7925 iactive_nh4no3 = mYES
7928 ! calculate percent composition ! raz update 11/13/2008
7931 sum_dum = sum_dum + electrolyte(js,jsolid,ibin)
7934 if(sum_dum .eq. 0.)sum_dum = 1.0
7936 epercent(jnh4cl,jsolid,ibin) = 100.*electrolyte(jnh4cl,jsolid,ibin)/sum_dum
7941 phi_nh4cl_s = (gas(inh3_g)*gas(ihcl_g) - Keq_sg(2))/ &
7942 max(gas(inh3_g)*gas(ihcl_g),Keq_sg(2))
7945 kelvin_nh4no3 = kel(inh3_g,ibin)*kel(ihno3_g,ibin)
7946 Keq_nh4no3 = kelvin_nh4no3*activity(jnh4no3,ibin)*Kp_nh4no3 ! = [NH3]s * [HNO3]s
7949 !-------------------
7950 ! now determine if nh4no3 and/or nh4cl are active or significant
7952 if( abs(phi_nh4cl_s) .le. rtol_eqb_ASTEM )then
7954 elseif(gas(inh3_g)*gas(ihcl_g) .lt. Keq_sg(2) .and. &
7955 epercent(jnh4cl,jsolid,ibin) .le. ptol_mol_ASTEM)then
7957 if(epercent(jnh4cl,jsolid,ibin) .gt. 0.0)then
7958 call degas_solid_nh4cl(ibin)
7963 if( gas(inh3_g)*gas(ihno3_g).eq.0. .or. Keq_nh4no3.eq.0. )then
7964 iactive_nh4no3 = mNO
7968 !---------------------------------
7969 if(iactive_nh4cl .eq. mYES)then
7971 jphase(ibin) = jsolid
7972 call ASTEM_flux_dry_case4b(ibin) ! NH4Cl (solid)
7974 if(sfc_a(ihcl_g).gt.0.0 .and. ma(ja_cl,ibin).gt.0.0)then
7975 mc(jc_h,ibin) = Keq_gl(4)*sfc_a(ihcl_g)/ &
7976 (kel(ihcl_g,ibin)*gam(jhcl,ibin)**2 * ma(ja_cl,ibin))
7977 elseif(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
7978 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
7979 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
7981 mc(jc_h,ibin) = sqrt(Keq_ll(3))
7987 if(iactive_nh4no3 .eq. mYES)then
7989 jphase(ibin) = jliquid
7990 call ASTEM_flux_wet_case3a(ibin) ! NH4NO3 (liquid)
7992 if(sfc_a(ihno3_g).gt.0.0 .and. ma(ja_no3,ibin).gt.0.0)then
7993 mc(jc_h,ibin) = Keq_gl(3)*sfc_a(ihno3_g)/ &
7994 (kel(ihno3_g,ibin)*gam(jhno3,ibin)**2 * ma(ja_no3,ibin))
7996 mc(jc_h,ibin) = sqrt(Keq_ll(3))
8002 if(iactive_nh4cl .eq. mYES .and. iactive_nh4no3 .eq. mYES)then
8003 jphase(ibin) = jtotal
8009 end subroutine ASTEM_flux_mix_case4b
8021 !***********************************************************************
8022 ! part of ASTEM: condenses h2so4, msa, and nh3 analytically over dtchem [s]
8024 ! author: Rahul A. Zaveri
8026 !-----------------------------------------------------------------------
8028 subroutine ASTEM_non_volatiles(dtchem) ! TOUCH
8030 ! include 'mosaic.h'
8034 integer ibin, iupdate_phase_state
8035 real(kind=8) decay_h2so4, decay_msa, &
8036 delta_h2so4, delta_tmsa, delta_nh3, delta_hno3, delta_hcl, &
8037 delta_so4(nbin_a), delta_msa(nbin_a), &
8039 ! DL (10/7/2012) - move N2O5 het uptake into non-volatile subroutine, so that
8040 ! NH3 uptake to balance acid uptake takes place too
8041 real(kind=8) :: decay_n2o5, &
8042 delta_n2o5, delta_clno2, &
8043 delta_no3_rct1(nbin_a), delta_no3_rct2(nbin_a)
8055 sumkg_h2so4 = sumkg_h2so4 + kg(ih2so4_g,ibin)
8056 sumkg_msa = sumkg_msa + kg(imsa_g,ibin)
8057 sumkg_nh3 = sumkg_nh3 + kg(inh3_g,ibin)
8058 sumkg_hno3 = sumkg_hno3 + kg(ihno3_g,ibin)
8059 sumkg_hcl = sumkg_hcl + kg(ihcl_g,ibin)
8064 sumkg_n2o5 = sumkg_n2o5 + kg(in2o5_g,ibin)
8069 !--------------------------------------
8071 if(gas(ih2so4_g) .gt. 1.e-14)then
8073 ! integrate h2so4 condensation analytically
8074 decay_h2so4 = exp(-sumkg_h2so4*dtchem)
8075 delta_h2so4 = gas(ih2so4_g)*(1.0 - decay_h2so4)
8076 gas(ih2so4_g) = gas(ih2so4_g)*decay_h2so4
8079 ! now distribute delta_h2so4 to each bin and conform the particle (may degas by massbal)
8081 if(jaerosolstate(ibin) .ne. no_aerosol)then
8082 delta_so4(ibin) = delta_h2so4*kg(ih2so4_g,ibin)/sumkg_h2so4
8083 aer(iso4_a,jtotal,ibin) = aer(iso4_a,jtotal,ibin) + &
8092 delta_so4(ibin) = 0.0
8096 ! h2so4 condensation is now complete
8097 !--------------------------------------
8102 if(gas(imsa_g) .gt. 1.e-14)then
8104 ! integrate msa condensation analytically
8105 decay_msa = exp(-sumkg_msa*dtchem)
8106 delta_tmsa = gas(imsa_g)*(1.0 - decay_msa)
8107 gas(imsa_g) = gas(imsa_g)*decay_msa
8109 ! now distribute delta_msa to each bin and conform the particle (may degas by massbal)
8111 if(jaerosolstate(ibin) .ne. no_aerosol)then
8112 delta_msa(ibin) = delta_tmsa*kg(imsa_g,ibin)/sumkg_msa
8113 aer(imsa_a,jtotal,ibin) = aer(imsa_a,jtotal,ibin) + &
8122 delta_msa(ibin) = 0.0
8126 ! msa condensation is now complete
8127 !-------------------------------------
8131 if(n2o5_flag .gt. 0) then
8132 ! DL (10/7/2012) moved from separate subroutine into involatile subroutine
8133 !--------------------------------------
8134 ! N2O5 uptake, if there is enough gas, and uptake is non-zero
8135 ! (currently we only calculate uptake for aqueous particles,
8136 ! so in some circumstances we could have aerosol but no reaction)
8137 if(gas(in2o5_g) .gt. 1.e-14 .and. sumkg_n2o5 .gt. 0.0)then
8139 ! integrate n2o5 condensation analytically
8140 decay_n2o5 = exp(-sumkg_n2o5*dtchem)
8141 delta_n2o5 = gas(in2o5_g)*(1.0 - decay_n2o5)
8142 gas(in2o5_g) = gas(in2o5_g)*decay_n2o5
8145 ! now distribute delta_n2o5 to each bin and conform the particle (may degas by massbal)
8147 if(jaerosolstate(ibin) .ne. no_aerosol)then
8148 delta_no3_rct1(ibin) = delta_n2o5*frac_n2o5_h2o(ibin)*kg(in2o5_g,ibin)/sumkg_n2o5
8149 delta_no3_rct2(ibin) = delta_n2o5*(1.0-frac_n2o5_h2o(ibin))*kg(in2o5_g,ibin)/sumkg_n2o5
8151 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jtotal,ibin) + &
8152 (2.0*delta_no3_rct1(ibin)+delta_no3_rct2(ibin))
8153 ! check to ensure we don't get negative Cl- concentrations
8154 ! - if this will occur then branch the remaining N2O5 to reaction 1
8155 if(aer(icl_a,jtotal,ibin).ge.delta_no3_rct2(ibin))then
8156 aer(icl_a,jtotal,ibin) = aer(icl_a,jtotal,ibin) - &
8157 delta_no3_rct2(ibin)
8158 gas(iclno2_g) = gas(iclno2_g) + &
8159 delta_no3_rct2(ibin)
8161 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jtotal,ibin) + &
8162 (delta_no3_rct2(ibin)-aer(icl_a,jtotal,ibin))
8163 gas(iclno2_g) = gas(iclno2_g) + &
8164 aer(icl_a,jtotal,ibin)
8166 ! record the amount of remaining N2O5 which branches to reaction 1 (this is
8167 ! for the purposes of determining NH3 uptake later)
8168 delta_no3_rct1(ibin) = delta_no3_rct1(ibin) + (delta_no3_rct2(ibin)-aer(icl_a,jtotal,ibin))
8169 delta_no3_rct2(ibin) = aer(icl_a,jtotal,ibin)
8171 aer(icl_a,jtotal,ibin) = 0.0
8180 delta_no3_rct1(ibin) = 0.0
8181 delta_no3_rct2(ibin) = 0.0
8186 delta_n2o5 = 0.0 ! if we're not using the N2O5 het scheme then set these to zero for ion balance calculations below
8188 delta_no3_rct1(ibin) = 0.0
8189 delta_no3_rct2(ibin) = 0.0
8196 ! compute max allowable nh3, hno3, and hcl condensation
8197 delta_nh3 = gas(inh3_g) *(1.0 - exp(-sumkg_nh3*dtchem))
8198 delta_hno3= gas(ihno3_g)*(1.0 - exp(-sumkg_hno3*dtchem))
8199 delta_hcl = gas(ihcl_g) *(1.0 - exp(-sumkg_hcl*dtchem))
8201 ! compute max possible nh4 condensation for each bin
8203 if(jaerosolstate(ibin) .ne. no_aerosol)then
8204 delta_nh3_max(ibin) = delta_nh3*kg(inh3_g,ibin)/sumkg_nh3
8205 delta_hno3_max(ibin)= delta_hno3*kg(ihno3_g,ibin)/sumkg_hno3
8206 delta_hcl_max(ibin) = delta_hcl*kg(ihcl_g,ibin)/sumkg_hcl
8211 if(delta_h2so4 .eq. 0.0 .and. delta_tmsa .eq. 0.0 .and. delta_n2o5 .eq. 0.0)then
8212 iupdate_phase_state = mNO
8217 ! now condense appropriate amounts of nh3 to each bin
8220 if(epercent(jnacl,jtotal,ibin) .eq. 0.0 .and. &
8221 epercent(jcacl2,jtotal,ibin) .eq. 0.0 .and. &
8222 epercent(jnano3,jtotal,ibin) .eq. 0.0 .and. &
8223 epercent(jcano3,jtotal,ibin) .eq. 0.0 .and. &
8224 epercent(jcaco3,jtotal,ibin) .eq. 0.0 .and. &
8225 jaerosolstate(ibin) .ne. no_aerosol)then
8227 delta_nh4(ibin)=min( (2.*delta_so4(ibin)+delta_msa(ibin)+2.*delta_no3_rct1(ibin)+delta_no3_rct2(ibin)), &
8228 delta_nh3_max(ibin) )
8230 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jtotal,ibin) + & ! update aer-phase
8233 gas(inh3_g) = gas(inh3_g) - delta_nh4(ibin) ! update gas-phase
8237 delta_nh4(ibin) = 0.0
8243 iupdate_phase_state = mYES
8246 ! recompute phase equilibrium
8247 100 if(iupdate_phase_state .eq. mYES)then
8249 if(jaerosolstate(ibin) .ne. no_aerosol)then
8250 call conform_electrolytes(jtotal,ibin,XT)
8251 call aerosol_phase_state(ibin)
8257 end subroutine ASTEM_non_volatiles
8265 !***********************************************************************
8266 ! computes mass transfer coefficients for each condensing species for
8267 ! all the aerosol bins
8269 ! author: rahul a. zaveri
8271 !-----------------------------------------------------------------------
8272 subroutine aerosolmtc(vbs_nbin)
8274 use module_data_mosaic_asect
8277 ! include 'v33com9a'
8278 ! include 'mosaic.h'
8280 integer nghq,vbs_nbin(1)
8282 parameter (nghq = 2) ! gauss-hermite quadrature order
8283 integer ibin, iq, iv
8284 real(kind=8) tworootpi, root2, beta
8285 parameter (tworootpi = 3.5449077, root2 = 1.4142135, beta = 2.0)
8286 real(kind=8) cdum, dp, dp_avg, fkn, kn, lnsg, lndpgn, lndp, speed, &
8288 real(kind=8) xghq(nghq), wghq(nghq) ! quadrature abscissae and weights
8289 real(kind=8) mw_vol(ngas_volatile+ngas_het), v_molar(ngas_volatile+ngas_het), & ! mw and molar vols of volatile species
8290 freepath(ngas_volatile+ngas_het), accom(ngas_volatile+ngas_het), &
8291 dg(ngas_volatile+ngas_het) ! keep local
8292 ! real(kind=8) fuchs_sutugin ! mosaic func
8293 ! real(kind=8) gas_diffusivity ! mosaic func
8294 ! real(kind=8) mean_molecular_speed ! mosaic func
8301 mw_vol(ih2so4_g) = 98.0
8302 mw_vol(ihno3_g) = 63.0
8303 mw_vol(ihcl_g) = 36.5
8304 mw_vol(inh3_g) = 17.0
8305 mw_vol(in2o5_g) = 108.0
8306 mw_vol(iclno2_g) = 81.5
8307 mw_vol(imsa_g) = 96.0
8308 mw_vol(ipcg1_b_c_g) =250.0
8309 mw_vol(ipcg2_b_c_g) =250.0
8310 mw_vol(ipcg3_b_c_g)=250.0
8311 mw_vol(ipcg4_b_c_g)=250.0
8312 mw_vol(ipcg5_b_c_g)=250.0
8313 mw_vol(ipcg6_b_c_g)=250.0
8314 mw_vol(ipcg7_b_c_g)=250.0
8315 mw_vol(ipcg8_b_c_g)=250.0
8316 mw_vol(ipcg9_b_c_g)=250.0
8317 mw_vol(iopcg1_b_c_g)=250.0
8318 mw_vol(iopcg2_b_c_g)=250.0
8319 mw_vol(iopcg3_b_c_g)=250.0
8320 mw_vol(iopcg4_b_c_g)=250.0
8321 mw_vol(iopcg5_b_c_g)=250.0
8322 mw_vol(iopcg6_b_c_g)=250.0
8323 mw_vol(iopcg7_b_c_g)=250.0
8324 mw_vol(iopcg8_b_c_g)=250.0
8325 mw_vol(ipcg1_b_o_g)=250.0
8326 mw_vol(ipcg2_b_o_g)=250.0
8327 mw_vol(ipcg3_b_o_g)=250.0
8328 mw_vol(ipcg4_b_o_g)=250.0
8329 mw_vol(ipcg5_b_o_g)=250.0
8330 mw_vol(ipcg6_b_o_g)=250.0
8331 mw_vol(ipcg7_b_o_g)=250.0
8332 mw_vol(ipcg8_b_o_g)=250.0
8333 mw_vol(ipcg9_b_o_g)=250.0
8334 mw_vol(iopcg1_b_o_g)=250.0
8335 mw_vol(iopcg2_b_o_g)=250.0
8336 mw_vol(iopcg3_b_o_g)=250.0
8337 mw_vol(iopcg4_b_o_g)=250.0
8338 mw_vol(iopcg5_b_o_g)=250.0
8339 mw_vol(iopcg6_b_o_g)=250.0
8340 mw_vol(iopcg7_b_o_g)=250.0
8341 mw_vol(iopcg8_b_o_g)=250.0
8342 mw_vol(ipcg1_f_c_g) =250.0
8343 mw_vol(ipcg2_f_c_g) =250.0
8344 mw_vol(ipcg3_f_c_g)=250.0
8345 mw_vol(ipcg4_f_c_g)=250.0
8346 mw_vol(ipcg5_f_c_g)=250.0
8347 mw_vol(ipcg6_f_c_g)=250.0
8348 mw_vol(ipcg7_f_c_g)=250.0
8349 mw_vol(ipcg8_f_c_g)=250.0
8350 mw_vol(ipcg9_f_c_g)=250.0
8351 mw_vol(iopcg1_f_c_g)=250.0
8352 mw_vol(iopcg2_f_c_g)=250.0
8353 mw_vol(iopcg3_f_c_g)=250.0
8354 mw_vol(iopcg4_f_c_g)=250.0
8355 mw_vol(iopcg5_f_c_g)=250.0
8356 mw_vol(iopcg6_f_c_g)=250.0
8357 mw_vol(iopcg7_f_c_g)=250.0
8358 mw_vol(iopcg8_f_c_g)=250.0
8359 mw_vol(ipcg1_f_o_g)=250.0
8360 mw_vol(ipcg2_f_o_g)=250.0
8361 mw_vol(ipcg3_f_o_g)=250.0
8362 mw_vol(ipcg4_f_o_g)=250.0
8363 mw_vol(ipcg5_f_o_g)=250.0
8364 mw_vol(ipcg6_f_o_g)=250.0
8365 mw_vol(ipcg7_f_o_g)=250.0
8366 mw_vol(ipcg8_f_o_g)=250.0
8367 mw_vol(ipcg9_f_o_g)=250.0
8368 mw_vol(iopcg1_f_o_g)=250.0
8369 mw_vol(iopcg2_f_o_g)=250.0
8370 mw_vol(iopcg3_f_o_g)=250.0
8371 mw_vol(iopcg4_f_o_g)=250.0
8372 mw_vol(iopcg5_f_o_g)=250.0
8373 mw_vol(iopcg6_f_o_g)=250.0
8374 mw_vol(iopcg7_f_o_g)=250.0
8375 mw_vol(iopcg8_f_o_g)=250.0
8376 mw_vol(ismpa_g)=250.0
8377 mw_vol(ismpbb_g)=250.0
8380 mw_vol(iant1_c_g)=250.0
8381 mw_vol(iant2_c_g)=250.0
8382 mw_vol(iant3_c_g)=250.0
8383 mw_vol(iant4_c_g)=250.0
8384 mw_vol(iant1_o_g)=250.0
8385 mw_vol(iant2_o_g)=250.0
8386 mw_vol(iant3_o_g)=250.0
8387 mw_vol(iant4_o_g)=250.0
8388 mw_vol(ibiog1_c_g)=250.0
8389 mw_vol(ibiog2_c_g)=250.0
8390 mw_vol(ibiog3_c_g)=250.0
8391 mw_vol(ibiog4_c_g)=250.0
8392 mw_vol(ibiog1_o_g)=250.0
8393 mw_vol(ibiog2_o_g)=250.0
8394 mw_vol(ibiog3_o_g)=250.0
8395 mw_vol(ibiog4_o_g)=250.0
8396 mw_vol(iasoaX_g)=250.0
8397 mw_vol(iasoa1_g)=250.0
8398 mw_vol(iasoa2_g)=250.0
8399 mw_vol(iasoa3_g)=250.0
8400 mw_vol(iasoa4_g)=250.0
8401 mw_vol(ibsoaX_g)=250.0
8402 mw_vol(ibsoa1_g)=250.0
8403 mw_vol(ibsoa2_g)=250.0
8404 mw_vol(ibsoa3_g)=250.0
8405 mw_vol(ibsoa4_g)=250.0
8411 v_molar(ih2so4_g)= 42.88
8412 v_molar(ihno3_g) = 24.11
8413 v_molar(ihcl_g) = 21.48
8414 v_molar(inh3_g) = 14.90
8415 v_molar(imsa_g) = 58.00
8416 v_molar(in2o5_g) = 60.40
8417 v_molar(iclno2_g)= 52.70
8419 ! mass accommodation coefficients
8420 accom(ih2so4_g) = 0.1
8421 accom(ihno3_g) = 0.1
8424 accom(in2o5_g) = 0.1 ! dummy variable - will recalc later..
8425 accom(iclno2_g) = 0.1 ! dummy - for convenience of calcs
8427 accom(ipcg1_b_c_g) =0.1
8428 accom(ipcg2_b_c_g) =0.1
8429 accom(ipcg3_b_c_g)=0.1
8430 accom(ipcg4_b_c_g)=0.1
8431 accom(ipcg5_b_c_g)=0.1
8432 accom(ipcg6_b_c_g)=0.1
8433 accom(ipcg7_b_c_g)=0.1
8434 accom(ipcg8_b_c_g)=0.1
8435 accom(ipcg9_b_c_g)=0.1
8436 accom(iopcg1_b_c_g)=0.1
8437 accom(iopcg2_b_c_g)=0.1
8438 accom(iopcg3_b_c_g)=0.1
8439 accom(iopcg4_b_c_g)=0.1
8440 accom(iopcg5_b_c_g)=0.1
8441 accom(iopcg6_b_c_g)=0.1
8442 accom(iopcg7_b_c_g)=0.1
8443 accom(iopcg8_b_c_g)=0.1
8444 accom(ipcg1_b_o_g)=0.1
8445 accom(ipcg2_b_o_g)=0.1
8446 accom(ipcg3_b_o_g)=0.1
8447 accom(ipcg4_b_o_g)=0.1
8448 accom(ipcg5_b_o_g)=0.1
8449 accom(ipcg6_b_o_g)=0.1
8450 accom(ipcg7_b_o_g)=0.1
8451 accom(ipcg8_b_o_g)=0.1
8452 accom(ipcg9_b_o_g)=0.1
8453 accom(iopcg1_b_o_g)=0.1
8454 accom(iopcg2_b_o_g)=0.1
8455 accom(iopcg3_b_o_g)=0.1
8456 accom(iopcg4_b_o_g)=0.1
8457 accom(iopcg5_b_o_g)=0.1
8458 accom(iopcg6_b_o_g)=0.1
8459 accom(iopcg7_b_o_g)=0.1
8460 accom(iopcg8_b_o_g)=0.1
8461 accom(ipcg1_f_c_g) =0.1
8462 accom(ipcg2_f_c_g) =0.1
8463 accom(ipcg3_f_c_g)=0.1
8464 accom(ipcg4_f_c_g)=0.1
8465 accom(ipcg5_f_c_g)=0.1
8466 accom(ipcg6_f_c_g)=0.1
8467 accom(ipcg7_f_c_g)=0.1
8468 accom(ipcg8_f_c_g)=0.1
8469 accom(ipcg9_f_c_g)=0.1
8470 accom(iopcg1_f_c_g)=0.1
8471 accom(iopcg2_f_c_g)=0.1
8472 accom(iopcg3_f_c_g)=0.1
8473 accom(iopcg4_f_c_g)=0.1
8474 accom(iopcg5_f_c_g)=0.1
8475 accom(iopcg6_f_c_g)=0.1
8476 accom(iopcg7_f_c_g)=0.1
8477 accom(iopcg8_f_c_g)=0.1
8478 accom(ipcg1_f_o_g)=0.1
8479 accom(ipcg2_f_o_g)=0.1
8480 accom(ipcg3_f_o_g)=0.1
8481 accom(ipcg4_f_o_g)=0.1
8482 accom(ipcg5_f_o_g)=0.1
8483 accom(ipcg6_f_o_g)=0.1
8484 accom(ipcg7_f_o_g)=0.1
8485 accom(ipcg8_f_o_g)=0.1
8486 accom(ipcg9_f_o_g)=0.1
8487 accom(iopcg1_f_o_g)=0.1
8488 accom(iopcg2_f_o_g)=0.1
8489 accom(iopcg3_f_o_g)=0.1
8490 accom(iopcg4_f_o_g)=0.1
8491 accom(iopcg5_f_o_g)=0.1
8492 accom(iopcg6_f_o_g)=0.1
8493 accom(iopcg7_f_o_g)=0.1
8494 accom(iopcg8_f_o_g)=0.1
8497 ! added glyoxal, but only for completeness - is hopefully never used
8500 accom(iant1_c_g)=0.1
8501 accom(iant2_c_g)=0.1
8502 accom(iant3_c_g)=0.1
8503 accom(iant4_c_g)=0.1
8504 accom(iant1_o_g)=0.1
8505 accom(iant2_o_g)=0.1
8506 accom(iant3_o_g)=0.1
8507 accom(iant4_o_g)=0.1
8508 accom(ibiog1_c_g)=0.1
8509 accom(ibiog2_c_g)=0.1
8510 accom(ibiog3_c_g)=0.1
8511 accom(ibiog4_c_g)=0.1
8512 accom(ibiog1_o_g)=0.1
8513 accom(ibiog2_o_g)=0.1
8514 accom(ibiog3_o_g)=0.1
8515 accom(ibiog4_o_g)=0.1
8530 ! quadrature weights
8531 xghq(1) = 0.70710678
8532 xghq(2) = -0.70710678
8533 wghq(1) = 0.88622693
8534 wghq(2) = 0.88622693
8538 ! calculate gas diffusivity and mean free path for condensing gases
8541 speed = mean_molecular_speed(t_k,mw_vol(iv)) ! cm/s
8542 dg(iv) = gas_diffusivity(t_k,p_atm,mw_vol(iv),v_molar(iv)) ! cm^2/s
8543 freepath(iv) = 3.*dg(iv)/speed ! cm
8548 if(vbs_nbin(1) .eq. 0) then
8550 else if (vbs_nbin(1) .eq. 4) then
8551 start_ind = iasoaX_g
8553 start_ind = ipcg1_b_c_g
8555 !BSINGH(03/10/2015): Added 2 in the following do-loop to accomodate oh and gly species.
8556 ! *IMPORTANT*:This is a TEMPORARY fix, we need a better fix for this problem.
8557 do iv = start_ind, ngas_ioa + ngas_soa+2
8558 speed = mean_molecular_speed(t_k,mw_vol(iv)) ! cm/s
8559 dg(iv) = 0.1 ! cm^2/s (increased from 0.2 to 0.035 by Manish Shrivastava)
8560 freepath(iv) = 3.*dg(iv)/speed
8563 ! het-rct gases ! DL 9/9/2011
8564 do iv = (ngas_volatile+1), (ngas_volatile+ngas_het)
8565 speed = mean_molecular_speed(t_k,mw_vol(iv)) ! cm/s
8566 dg(iv) = gas_diffusivity(t_k,p_atm,mw_vol(iv),v_molar(iv)) ! cm^2/s
8567 freepath(iv) = 3.*dg(iv)/speed ! cm
8571 ! calc mass transfer coefficients for gases over various aerosol bins
8573 if (msize_framework .eq. mmodal) then
8575 ! for modal approach
8576 do 10 ibin = 1, nbin_a
8578 if(jaerosolstate(ibin) .eq. no_aerosol)goto 10
8579 call calc_dry_n_wet_aerosol_props(ibin)
8581 dpgn_a(ibin) = dp_wet_a(ibin) ! cm
8583 lnsg = log(sigmag_a(ibin))
8584 lndpgn = log(dpgn_a(ibin))
8585 cdum = tworootpi*num_a(ibin)* &
8586 exp(beta*lndpgn + 0.5*(beta*lnsg)**2)
8588 do 20 iv = 1, ngas_volatile + ngas_het
8590 if(iv.eq.in2o5_g)then ! recalculate accom coeff for N2O5
8591 ! for each different aerosol composition
8592 ! (use total aerosol composition for now)
8593 if(n2o5_flag.gt.0)then
8594 accom(iv) = acc_n2o5_bert_thorn(water_a(ibin),&
8595 aer(ino3_a,jtotal,ibin),&
8596 aer(icl_a,jtotal,ibin),&
8604 do 30 iq = 1, nghq ! sum over gauss-hermite quadrature points
8605 lndp = lndpgn + beta*lnsg**2 + root2*lnsg*xghq(iq)
8607 kn = 2.*freepath(iv)/dp
8608 fkn = fuchs_sutugin(kn,accom(iv))
8609 sumghq = sumghq + wghq(iq)*dp*fkn/(dp**beta)
8612 kg(iv,ibin) = cdum*dg(iv)*sumghq ! 1/s
8615 if(n2o5_flag.gt.0)then
8616 ! calculate the reaction path splitting for
8617 ! heterogeneous N2O5 reactions
8618 frac_n2o5_h2o(ibin) = split_n2o5_bert_thorn(water_a(ibin),&
8619 aer(icl_a,jtotal,ibin),&
8622 frac_n2o5_h2o(ibin) = 0.0
8627 elseif(msize_framework .eq. msection)then
8629 ! for sectional approach
8630 do 11 ibin = 1, nbin_a
8632 if(jaerosolstate(ibin) .eq. no_aerosol)goto 11
8634 call calc_dry_n_wet_aerosol_props(ibin)
8636 dp_avg = dp_wet_a(ibin)
8637 cdum = 6.283185*dp_avg*num_a(ibin)
8639 do 21 iv = 1, ngas_volatile+ngas_het
8640 if(iv.eq.in2o5_g)then ! recalculate accom coeff for N2O5
8641 ! for each different aerosol composition
8642 ! (use total aerosol composition for now)
8643 if(n2o5_flag.gt.0)then
8644 accom(iv) = acc_n2o5_bert_thorn(water_a(ibin),&
8645 aer(ino3_a,jtotal,ibin),&
8646 aer(icl_a,jtotal,ibin),&
8652 kn = 2.*freepath(iv)/dp_avg
8653 fkn = fuchs_sutugin(kn,accom(iv))
8654 kg(iv,ibin) = cdum*dg(iv)*fkn ! 1/s!Increased by a factor of 10000 by Manish Shrivastava to force to equilibrium
8655 ! fraceq(iv,ibin)=num_a(ibin)*dp_wet_a(ibin)/(kn/accom(iv)+1)
8657 if(n2o5_flag.gt.0)then
8658 ! calculate the reaction path splitting for
8659 ! heterogeneous N2O5 reactions
8660 frac_n2o5_h2o(ibin) = split_n2o5_bert_thorn(water_a(ibin),&
8661 aer(icl_a,jtotal,ibin),&
8664 frac_n2o5_h2o(ibin) = 0.0
8671 if (iprint_mosaic_fe1 .gt. 0) then
8672 write(6,*)'error in the choice of msize_framework'
8673 write(6,*)'mosaic fatal error in subr. aerosolmtc'
8676 istat_mosaic_fe1 = -1900
8683 end subroutine aerosolmtc
8696 !***********************************************************************
8697 ! calculates dry and wet aerosol properties: density, refractive indices
8699 ! author: rahul a. zaveri
8701 !-----------------------------------------------------------------------
8702 subroutine calc_dry_n_wet_aerosol_props(ibin)
8704 use module_data_mosaic_asect
8707 ! include 'v33com9a'
8708 ! include 'mosaic.h'
8712 integer jc, je, iaer, isize, itype
8714 complex(kind=8) ri_dum
8717 ! calculate dry mass and dry volume of a bin
8718 mass_dry_a(ibin) = 0.0 ! initialize to 0.0
8719 vol_dry_a(ibin) = 0.0 ! initialize to 0.0
8720 area_dry_a(ibin) = 0.0 ! initialize to 0.0
8722 if(jaerosolstate(ibin) .ne. no_aerosol)then
8724 aer_H = (2.*aer(iso4_a,jtotal,ibin) + &
8725 aer(ino3_a,jtotal,ibin) + &
8726 aer(icl_a,jtotal,ibin) + &
8727 aer(imsa_a,jtotal,ibin) + &
8728 2.*aer(ico3_a,jtotal,ibin))- &
8729 (2.*aer(ica_a,jtotal,ibin) + &
8730 aer(ina_a,jtotal,ibin) + &
8731 aer(inh4_a,jtotal,ibin))
8734 mass_dry_a(ibin) = mass_dry_a(ibin) + &
8735 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer) ! ng/m^3(air)
8736 vol_dry_a(ibin) = vol_dry_a(ibin) + &
8737 aer(iaer,jtotal,ibin)*mw_aer_mac(iaer)/dens_aer_mac(iaer) ! ncc/m^3(air)
8739 mass_dry_a(ibin) = mass_dry_a(ibin) + aer_H
8740 vol_dry_a(ibin) = vol_dry_a(ibin) + aer_H
8742 mass_dry_a(ibin) = mass_dry_a(ibin)*1.e-15 ! g/cc(air)
8743 vol_dry_a(ibin) = vol_dry_a(ibin)*1.e-15 ! cc(aer)/cc(air)
8745 ! wet mass and wet volume
8746 mass_wet_a(ibin) = mass_dry_a(ibin) + water_a(ibin)*1.e-3 ! g/cc(air)
8747 vol_wet_a(ibin) = vol_dry_a(ibin) + water_a(ibin)*1.e-3 ! cc(aer)/cc(air)
8749 ! calculate mean dry and wet particle densities
8750 dens_dry_a(ibin) = mass_dry_a(ibin)/vol_dry_a(ibin) ! g/cc(aerosol)
8751 dens_wet_a(ibin) = mass_wet_a(ibin)/vol_wet_a(ibin) ! g/cc(aerosol)
8753 ! calculate mean dry and wet particle diameters
8754 dp_dry_a(ibin)=(1.90985*vol_dry_a(ibin)/num_a(ibin))**0.3333333 ! cm
8755 dp_wet_a(ibin)=(1.90985*vol_wet_a(ibin)/num_a(ibin))**0.3333333 ! cm
8757 ! calculate mean dry and wet particle surface areas
8758 area_dry_a(ibin)= 3.14159*num_a(ibin)*dp_dry_a(ibin)**2 ! cm^2/cc(air)
8759 area_wet_a(ibin)= 3.14159*num_a(ibin)*dp_wet_a(ibin)**2 ! cm^2/cc(air)
8761 ! calculate volume average refractive index
8763 do je = 1, nelectrolyte
8764 comp_a(je)=electrolyte(je,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8766 comp_a(joc) = aer(ioc_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8767 comp_a(jbc) = aer(ibc_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8768 comp_a(join) = aer(ioin_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8769 comp_a(jpcg1_b_c)= aer(ipcg1_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8770 comp_a(jpcg2_b_c)= aer(ipcg2_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8771 comp_a(jpcg3_b_c)= aer(ipcg3_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8772 comp_a(jpcg4_b_c)= aer(ipcg4_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8773 comp_a(jpcg5_b_c)= aer(ipcg5_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8774 comp_a(jpcg6_b_c)= aer(ipcg6_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8775 comp_a(jpcg7_b_c)= aer(ipcg7_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8776 comp_a(jpcg8_b_c)= aer(ipcg8_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8777 comp_a(jpcg9_b_c)= aer(ipcg9_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8778 comp_a(jopcg1_b_c)= aer(iopcg1_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8779 comp_a(jopcg2_b_c)= aer(iopcg2_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8780 comp_a(jopcg3_b_c)= aer(iopcg3_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8781 comp_a(jopcg4_b_c)= aer(iopcg4_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8782 comp_a(jopcg5_b_c)= aer(iopcg5_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8783 comp_a(jopcg6_b_c)= aer(iopcg6_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8784 comp_a(jopcg7_b_c)= aer(iopcg7_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8785 comp_a(jopcg8_b_c)= aer(iopcg8_b_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8786 comp_a(jpcg1_b_o)= aer(ipcg1_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8787 comp_a(jpcg2_b_o)= aer(ipcg2_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8788 comp_a(jpcg3_b_o)= aer(ipcg3_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8789 comp_a(jpcg4_b_o)= aer(ipcg4_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8790 comp_a(jpcg5_b_o)= aer(ipcg5_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8791 comp_a(jpcg6_b_o)= aer(ipcg6_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8792 comp_a(jpcg7_b_o)= aer(ipcg7_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8793 comp_a(jpcg8_b_o)= aer(ipcg8_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8794 comp_a(jpcg9_b_o)= aer(ipcg9_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8795 comp_a(jopcg1_b_o)= aer(iopcg1_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8796 comp_a(jopcg2_b_o)= aer(iopcg2_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8797 comp_a(jopcg3_b_o)= aer(iopcg3_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8798 comp_a(jopcg4_b_o)= aer(iopcg4_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8799 comp_a(jopcg5_b_o)= aer(iopcg5_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8800 comp_a(jopcg6_b_o)= aer(iopcg6_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8801 comp_a(jopcg7_b_o)= aer(iopcg7_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8802 comp_a(jopcg8_b_o)= aer(iopcg8_b_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8803 comp_a(jpcg1_f_c)= aer(ipcg1_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8804 comp_a(jpcg2_f_c)= aer(ipcg2_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8805 comp_a(jpcg3_f_c)= aer(ipcg3_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8806 comp_a(jpcg4_f_c)= aer(ipcg4_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8807 comp_a(jpcg5_f_c)= aer(ipcg5_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8808 comp_a(jpcg6_f_c)= aer(ipcg6_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8809 comp_a(jpcg7_f_c)= aer(ipcg7_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8810 comp_a(jpcg8_f_c)= aer(ipcg8_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8811 comp_a(jpcg9_f_c)= aer(ipcg9_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8812 comp_a(jopcg1_f_c)= aer(iopcg1_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8813 comp_a(jopcg2_f_c)= aer(iopcg2_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8814 comp_a(jopcg3_f_c)= aer(iopcg3_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8815 comp_a(jopcg4_f_c)= aer(iopcg4_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8816 comp_a(jopcg5_f_c)= aer(iopcg5_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8817 comp_a(jopcg6_f_c)= aer(iopcg6_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8818 comp_a(jopcg7_f_c)= aer(iopcg7_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8819 comp_a(jopcg8_f_c)= aer(iopcg8_f_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8820 comp_a(jpcg1_f_o)= aer(ipcg1_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8821 comp_a(jpcg2_f_o)= aer(ipcg2_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8822 comp_a(jpcg3_f_o)= aer(ipcg3_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8823 comp_a(jpcg4_f_o)= aer(ipcg4_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8824 comp_a(jpcg5_f_o)= aer(ipcg5_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8825 comp_a(jpcg6_f_o)= aer(ipcg6_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8826 comp_a(jpcg7_f_o)= aer(ipcg7_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8827 comp_a(jpcg8_f_o)= aer(ipcg8_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8828 comp_a(jpcg9_f_o)= aer(ipcg9_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8829 comp_a(jopcg1_f_o)= aer(iopcg1_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8830 comp_a(jopcg2_f_o)= aer(iopcg2_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8831 comp_a(jopcg3_f_o)= aer(iopcg3_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8832 comp_a(jopcg4_f_o)= aer(iopcg4_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8833 comp_a(jopcg5_f_o)= aer(iopcg5_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8834 comp_a(jopcg6_f_o)= aer(iopcg6_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8835 comp_a(jopcg7_f_o)= aer(iopcg7_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8836 comp_a(jopcg8_f_o)= aer(iopcg8_f_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8837 comp_a(jsmpa)= aer(ismpa_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8838 comp_a(jsmpbb)= aer(ismpbb_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8839 comp_a(jglysoa_r1)= aer(iglysoa_r1_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8840 comp_a(jglysoa_r2)= aer(iglysoa_r2_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8841 comp_a(jglysoa_sfc)= aer(iglysoa_sfc_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8842 comp_a(jglysoa_nh4)= aer(iglysoa_nh4_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8843 comp_a(jglysoa_oh)= aer(iglysoa_oh_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8844 comp_a(jant1_c)= aer(iant1_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8845 comp_a(jant2_c)= aer(iant2_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8846 comp_a(jant3_c)= aer(iant3_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8847 comp_a(jant4_c)= aer(iant4_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8848 comp_a(jant1_o)= aer(iant1_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8849 comp_a(jant2_o)= aer(iant2_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8850 comp_a(jant3_o)= aer(iant3_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8851 comp_a(jant4_o)= aer(iant4_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8852 comp_a(jbiog1_c)= aer(ibiog1_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8853 comp_a(jbiog2_c)= aer(ibiog2_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8854 comp_a(jbiog3_c)= aer(ibiog3_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8855 comp_a(jbiog4_c)= aer(ibiog4_c_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8856 comp_a(jbiog1_o)= aer(ibiog1_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8857 comp_a(jbiog2_o)= aer(ibiog2_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8858 comp_a(jbiog3_o)= aer(ibiog3_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8859 comp_a(jbiog4_o)= aer(ibiog4_o_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8860 comp_a(jasoaX)= aer(iasoaX_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8861 comp_a(jasoa1)= aer(iasoa1_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8862 comp_a(jasoa2)= aer(iasoa2_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8863 comp_a(jasoa3)= aer(iasoa3_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8864 comp_a(jasoa4)= aer(iasoa4_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8865 comp_a(jbsoaX)= aer(ibsoaX_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8866 comp_a(jbsoa1)= aer(ibsoa1_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8867 comp_a(jbsoa2)= aer(ibsoa2_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8868 comp_a(jbsoa3)= aer(ibsoa3_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8869 comp_a(jbsoa4)= aer(ibsoa4_a,jtotal,ibin)*mw_comp_a(je)*1.e-15 ! g/cc(air)
8873 comp_a(jh2o) = water_a(ibin)*1.e-3 ! g/cc(air)
8877 if (dens_comp_a(jc).gt.0) then
8878 ri_dum = ri_dum + ref_index_a(jc)*comp_a(jc)/dens_comp_a(jc)
8882 ri_avg_a(ibin) = ri_dum/vol_wet_a(ibin)
8886 dens_dry_a(ibin) = 1.0 ! g/cc(aerosol)
8887 dens_wet_a(ibin) = 1.0 ! g/cc(aerosol)
8889 call isize_itype_from_ibin( ibin, isize, itype )
8890 dp_dry_a(ibin) = dcen_sect(isize,itype) ! cm
8891 dp_wet_a(ibin) = dcen_sect(isize,itype) ! cm
8893 ri_avg_a(ibin) = (1.5,0.0)
8898 end subroutine calc_dry_n_wet_aerosol_props
8919 !***********************************************************************
8920 ! computes activities
8922 ! author: rahul a. zaveri
8924 !-----------------------------------------------------------------------
8925 subroutine compute_activities(ibin)
8927 ! include 'mosaic.h'
8932 real(kind=8) xt, xmol(nelectrolyte), sum_elec, dumK, c_bal, a_c
8933 real(kind=8) quad, aq, bq, cq, xq, dum
8935 ! real(kind=8) aerosol_water
8938 water_a(ibin) = aerosol_water(jliquid,ibin) ! kg/m^3(air)
8939 if(water_a(ibin) .eq. 0.0)return
8942 call calculate_xt(ibin,jliquid,xt)
8944 if(xt.gt.2.0 .or. xt.lt.0.)then
8945 ! sulfate poor: fully dissociated electrolytes
8948 ! anion molalities (mol/kg water)
8949 ma(ja_so4,ibin) = 1.e-9*aer(iso4_a,jliquid,ibin)/water_a(ibin)
8950 ma(ja_hso4,ibin) = 0.0
8951 ma(ja_no3,ibin) = 1.e-9*aer(ino3_a,jliquid,ibin)/water_a(ibin)
8952 ma(ja_cl,ibin) = 1.e-9*aer(icl_a, jliquid,ibin)/water_a(ibin)
8953 ma(ja_msa,ibin) = 1.e-9*aer(imsa_a,jliquid,ibin)/water_a(ibin)
8955 ! cation molalities (mol/kg water)
8956 mc(jc_ca,ibin) = 1.e-9*aer(ica_a, jliquid,ibin)/water_a(ibin)
8957 mc(jc_nh4,ibin) = 1.e-9*aer(inh4_a,jliquid,ibin)/water_a(ibin)
8958 mc(jc_na,ibin) = 1.e-9*aer(ina_a, jliquid,ibin)/water_a(ibin)
8959 a_c = ( 2.d0*ma(ja_so4,ibin)+ &
8962 ma(ja_msa,ibin) ) - &
8963 ( 2.d0*mc(jc_ca,ibin) + &
8966 mc(jc_h,ibin) = 0.5*a_c + sqrt(a_c**2 + 4.*Keq_ll(3))
8968 if(mc(jc_h,ibin) .eq. 0.0)then
8969 mc(jc_h,ibin) = sqrt(Keq_ll(3))
8976 sum_elec = 2.*electrolyte(jnh4no3,jp,ibin) + &
8977 2.*electrolyte(jnh4cl,jp,ibin) + &
8978 3.*electrolyte(jnh4so4,jp,ibin) + &
8979 3.*electrolyte(jna2so4,jp,ibin) + &
8980 2.*electrolyte(jnano3,jp,ibin) + &
8981 2.*electrolyte(jnacl,jp,ibin) + &
8982 3.*electrolyte(jcano3,jp,ibin) + &
8983 3.*electrolyte(jcacl2,jp,ibin) + &
8984 2.*electrolyte(jhno3,jp,ibin) + &
8985 2.*electrolyte(jhcl,jp,ibin)
8987 if(sum_elec .eq. 0.0)then
8988 do ja = 1, nelectrolyte
8995 ! ionic mole fractions
8996 xmol(jnh4no3) = 2.*electrolyte(jnh4no3,jp,ibin)/sum_elec
8997 xmol(jnh4cl) = 2.*electrolyte(jnh4cl,jp,ibin) /sum_elec
8998 xmol(jnh4so4) = 3.*electrolyte(jnh4so4,jp,ibin)/sum_elec
8999 xmol(jna2so4) = 3.*electrolyte(jna2so4,jp,ibin)/sum_elec
9000 xmol(jnano3) = 2.*electrolyte(jnano3,jp,ibin) /sum_elec
9001 xmol(jnacl) = 2.*electrolyte(jnacl,jp,ibin) /sum_elec
9002 xmol(jcano3) = 3.*electrolyte(jcano3,jp,ibin) /sum_elec
9003 xmol(jcacl2) = 3.*electrolyte(jcacl2,jp,ibin) /sum_elec
9004 xmol(jhno3) = 2.*electrolyte(jhno3,jp,ibin) /sum_elec
9005 xmol(jhcl) = 2.*electrolyte(jhcl,jp,ibin) /sum_elec
9009 if(xmol(ja).gt.0.0)then
9010 log_gam(ja) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9011 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9012 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9013 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9014 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9015 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9016 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9017 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9018 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9019 xmol(jhcl) *log_gamZ(jA,jhcl)
9020 gam(jA,ibin) = 10.**log_gam(jA)
9021 activity(jnh4so4,ibin) = mc(jc_nh4,ibin)**2*ma(ja_so4,ibin)* &
9022 gam(jnh4so4,ibin)**3
9028 if(xmol(jA).gt.0.0)then
9029 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9030 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9031 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9032 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9033 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9034 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9035 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9036 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9037 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9038 xmol(jhcl) *log_gamZ(jA,jhcl)
9039 gam(jA,ibin) = 10.**log_gam(jA)
9040 activity(jnh4no3,ibin) = mc(jc_nh4,ibin)*ma(ja_no3,ibin)* &
9041 gam(jnh4no3,ibin)**2
9046 if(xmol(jA).gt.0.0)then
9047 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9048 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9049 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9050 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9051 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9052 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9053 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9054 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9055 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9056 xmol(jhcl) *log_gamZ(jA,jhcl)
9057 gam(jA,ibin) = 10.**log_gam(jA)
9058 activity(jnh4cl,ibin) = mc(jc_nh4,ibin)*ma(ja_cl,ibin)* &
9064 if(xmol(jA).gt.0.0)then
9065 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9066 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9067 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9068 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9069 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9070 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9071 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9072 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9073 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9074 xmol(jhcl) *log_gamZ(jA,jhcl)
9075 gam(jA,ibin) = 10.**log_gam(jA)
9076 activity(jna2so4,ibin) = mc(jc_na,ibin)**2*ma(ja_so4,ibin)* &
9077 gam(jna2so4,ibin)**3
9082 if(xmol(jA).gt.0.0)then
9083 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9084 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9085 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9086 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9087 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9088 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9089 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9090 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9091 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9092 xmol(jhcl) *log_gamZ(jA,jhcl)
9093 gam(jA,ibin) = 10.**log_gam(jA)
9094 activity(jnano3,ibin) = mc(jc_na,ibin)*ma(ja_no3,ibin)* &
9101 if(xmol(jA).gt.0.0)then
9102 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9103 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9104 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9105 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9106 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9107 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9108 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9109 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9110 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9111 xmol(jhcl) *log_gamZ(jA,jhcl)
9112 gam(jA,ibin) = 10.**log_gam(jA)
9113 activity(jnacl,ibin) = mc(jc_na,ibin)*ma(ja_cl,ibin)* &
9120 ! if(xmol(jA).gt.0.0)then
9121 ! gam(jA,ibin) = 1.0
9122 ! activity(jcano3,ibin) = 1.0
9128 ! if(xmol(jA).gt.0.0)then
9129 ! gam(jA,ibin) = 1.0
9130 ! activity(jcacl2,ibin) = 1.0
9134 if(xmol(jA).gt.0.0)then
9135 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9136 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9137 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9138 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9139 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9140 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9141 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9142 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9143 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9144 xmol(jhcl) *log_gamZ(jA,jhcl)
9145 gam(jA,ibin) = 10.**log_gam(jA)
9146 activity(jcano3,ibin) = mc(jc_ca,ibin)*ma(ja_no3,ibin)**2* &
9153 if(xmol(jA).gt.0.0)then
9154 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9155 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9156 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9157 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9158 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9159 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9160 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9161 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9162 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9163 xmol(jhcl) *log_gamZ(jA,jhcl)
9164 gam(jA,ibin) = 10.**log_gam(jA)
9165 activity(jcacl2,ibin) = mc(jc_ca,ibin)*ma(ja_cl,ibin)**2* &
9171 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9172 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9173 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9174 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9175 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9176 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9177 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9178 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9179 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9180 xmol(jhcl) *log_gamZ(jA,jhcl)
9181 gam(jA,ibin) = 10.**log_gam(jA)
9182 activity(jhno3,ibin) = mc(jc_h,ibin)*ma(ja_no3,ibin)* &
9187 log_gam(jA) = xmol(jnh4no3)*log_gamZ(jA,jnh4no3) + &
9188 xmol(jnh4cl) *log_gamZ(jA,jnh4cl) + &
9189 xmol(jnh4so4)*log_gamZ(jA,jnh4so4) + &
9190 xmol(jna2so4)*log_gamZ(jA,jna2so4) + &
9191 xmol(jnano3) *log_gamZ(jA,jnano3) + &
9192 xmol(jnacl) *log_gamZ(jA,jnacl) + &
9193 xmol(jcano3) *log_gamZ(jA,jcano3) + &
9194 xmol(jcacl2) *log_gamZ(jA,jcacl2) + &
9195 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9196 xmol(jhcl) *log_gamZ(jA,jhcl)
9197 gam(jA,ibin) = 10.**log_gam(jA)
9198 activity(jhcl,ibin) = mc(jc_h,ibin)*ma(ja_cl,ibin)* &
9202 10 gam(jlvcite,ibin) = 1.0
9204 gam(jnh4hso4,ibin)= 1.0
9206 gam(jnh4msa,ibin) = 1.0
9208 gam(jna3hso4,ibin) = 1.0
9210 gam(jnahso4,ibin) = 1.0
9212 gam(jnamsa,ibin) = 1.0
9214 gam(jcamsa2,ibin) = 1.0 ! raz-30apr07
9216 activity(jlvcite,ibin) = 0.0
9218 activity(jnh4hso4,ibin)= 0.0
9220 activity(jnh4msa,ibin) = mc(jc_nh4,ibin)*ma(ja_msa,ibin)* &
9221 gam(jnh4msa,ibin)**2
9223 activity(jna3hso4,ibin)= 0.0
9225 activity(jnahso4,ibin) = 0.0
9227 activity(jnamsa,ibin) = mc(jc_na,ibin)*ma(ja_msa,ibin)* & ! raz-30apr07
9230 activity(jcamsa2,ibin) = mc(jc_ca,ibin) * ma(ja_msa,ibin)**2 * & ! raz-30apr07
9231 gam(jcamsa2,ibin)**3
9233 gam_ratio(ibin) = gam(jnh4no3,ibin)**2/gam(jhno3,ibin)**2
9237 ! SULFATE-RICH: solve for SO4= and HSO4- ions
9241 sum_elec = 3.*electrolyte(jh2so4,jp,ibin) + &
9242 2.*electrolyte(jnh4hso4,jp,ibin) + &
9243 5.*electrolyte(jlvcite,jp,ibin) + &
9244 3.*electrolyte(jnh4so4,jp,ibin) + &
9245 2.*electrolyte(jnahso4,jp,ibin) + &
9246 5.*electrolyte(jna3hso4,jp,ibin) + &
9247 3.*electrolyte(jna2so4,jp,ibin) + &
9248 2.*electrolyte(jhno3,jp,ibin) + &
9249 2.*electrolyte(jhcl,jp,ibin)
9252 if(sum_elec .eq. 0.0)then
9253 do jA = 1, nelectrolyte
9260 xmol(jh2so4) = 3.*electrolyte(jh2so4,jp,ibin)/sum_elec
9261 xmol(jnh4hso4)= 2.*electrolyte(jnh4hso4,jp,ibin)/sum_elec
9262 xmol(jlvcite) = 5.*electrolyte(jlvcite,jp,ibin)/sum_elec
9263 xmol(jnh4so4) = 3.*electrolyte(jnh4so4,jp,ibin)/sum_elec
9264 xmol(jnahso4) = 2.*electrolyte(jnahso4,jp,ibin)/sum_elec
9265 xmol(jna3hso4)= 5.*electrolyte(jna3hso4,jp,ibin)/sum_elec
9266 xmol(jna2so4) = 3.*electrolyte(jna2so4,jp,ibin)/sum_elec
9267 xmol(jhno3) = 2.*electrolyte(jhno3,jp,ibin)/sum_elec
9268 xmol(jhcl) = 2.*electrolyte(jhcl,jp,ibin)/sum_elec
9273 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9274 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9275 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9276 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9277 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9278 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9279 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9280 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9281 xmol(jhcl) *log_gamZ(jA,jhcl)
9282 gam(jA,ibin) = 10.**log_gam(jA)
9287 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9288 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9289 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9290 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9291 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9292 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9293 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9294 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9295 xmol(jhcl) *log_gamZ(jA,jhcl)
9296 gam(jA,ibin) = 10.**log_gam(jA)
9301 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9302 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9303 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9304 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9305 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9306 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9307 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9308 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9309 xmol(jhcl) *log_gamZ(jA,jhcl)
9310 gam(jA,ibin) = 10.**log_gam(jA)
9315 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9316 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9317 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9318 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9319 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9320 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9321 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9322 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9323 xmol(jhcl) *log_gamZ(jA,jhcl)
9324 gam(jA,ibin) = 10.**log_gam(jA)
9329 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9330 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9331 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9332 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9333 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9334 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9335 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9336 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9337 xmol(jhcl) *log_gamZ(jA,jhcl)
9338 gam(jA,ibin) = 10.**log_gam(jA)
9343 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9344 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9345 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9346 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9347 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9348 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9349 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9350 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9351 xmol(jhcl) *log_gamZ(jA,jhcl)
9352 gam(jA,ibin) = 10.**log_gam(jA)
9357 ! log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9358 ! xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9359 ! xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9360 ! xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9361 ! xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9362 ! xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9363 ! xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9364 ! xmol(jhno3) *log_gamZ(jA,jhno3) + &
9365 ! xmol(jhcl) *log_gamZ(jA,jhcl)
9366 ! gam(jA,ibin) = 10.**log_gam(jA)
9372 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9373 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9374 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9375 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9376 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9377 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9378 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9379 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9380 xmol(jhcl) *log_gamZ(jA,jhcl)
9381 gam(jA,ibin) = 10.**log_gam(jA)
9386 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9387 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9388 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9389 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9390 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9391 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9392 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9393 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9394 xmol(jhcl) *log_gamZ(jA,jhcl)
9395 gam(jA,ibin) = 10.**log_gam(jA)
9400 log_gam(jA) = xmol(jh2so4) *log_gamZ(jA,jh2so4) + &
9401 xmol(jnh4hso4)*log_gamZ(jA,jnh4hso4)+ &
9402 xmol(jlvcite) *log_gamZ(jA,jlvcite) + &
9403 xmol(jnh4so4) *log_gamZ(jA,jnh4so4) + &
9404 xmol(jnahso4) *log_gamZ(jA,jnahso4) + &
9405 xmol(jna3hso4)*log_gamZ(jA,jna3hso4)+ &
9406 xmol(jna2so4) *log_gamZ(jA,jna2so4) + &
9407 xmol(jhno3) *log_gamZ(jA,jhno3) + &
9408 xmol(jhcl) *log_gamZ(jA,jhcl)
9409 gam(jA,ibin) = 10.**log_gam(jA)
9412 20 gam(jnh4no3,ibin) = 1.0
9413 gam(jnh4cl,ibin) = 1.0
9414 gam(jnano3,ibin) = 1.0
9415 gam(jnacl,ibin) = 1.0
9416 gam(jcano3,ibin) = 1.0
9417 gam(jcacl2,ibin) = 1.0
9419 gam(jnh4msa,ibin) = 1.0
9420 gam(jnamsa,ibin) = 1.0
9421 gam(jcamsa2,ibin) = 1.0 ! raz-30apr07
9424 ! compute equilibrium pH
9425 ! cation molalities (mol/kg water)
9426 mc(jc_ca,ibin) = 0.0 ! aqueous ca never exists in sulfate rich cases
9427 mc(jc_nh4,ibin) = 1.e-9*aer(inh4_a,jliquid,ibin)/water_a(ibin)
9428 mc(jc_na,ibin) = 1.e-9*aer(ina_a, jliquid,ibin)/water_a(ibin)
9430 ! anion molalities (mol/kg water)
9431 mSULF = 1.e-9*aer(iso4_a,jliquid,ibin)/water_a(ibin)
9432 ma(ja_hso4,ibin) = 0.0
9433 ma(ja_so4,ibin) = 0.0
9434 ma(ja_no3,ibin) = 1.e-9*aer(ino3_a,jliquid,ibin)/water_a(ibin)
9435 ma(ja_cl,ibin) = 1.e-9*aer(icl_a, jliquid,ibin)/water_a(ibin)
9436 ma(ja_msa,ibin) = 1.e-9*aer(imsa_a,jliquid,ibin)/water_a(ibin)
9438 gam_ratio(ibin) = gam(jnh4hso4,ibin)**2/gam(jhhso4,ibin)**2
9439 dumK = Keq_ll(1)*gam(jhhso4,ibin)**2/gam(jh2so4,ibin)**3
9441 c_bal = mc(jc_nh4,ibin) + mc(jc_na,ibin) + 2.*mc(jc_ca,ibin) & ! raz-30apr07
9442 - ma(ja_no3,ibin) - ma(ja_cl,ibin) - mSULF - ma(ja_msa,ibin)
9446 cq = dumK*(c_bal - mSULF)
9449 !--quadratic solution
9451 xq = 4.*(1./bq)*(cq/bq)
9456 if(abs(xq) .lt. 1.e-6)then
9457 dum = xq*(0.5 + xq*(0.125 + xq*0.0625))
9458 quad = (-0.5*bq/aq)*dum
9459 if(quad .lt. 0.)then
9460 quad = -bq/aq - quad
9463 quad = 0.5*(-bq+sqrt(bq*bq - 4.*cq))
9465 !--end of quadratic solution
9467 mc(jc_h,ibin) = max(quad, 1.D-7)
9468 ma(ja_so4,ibin) = mSULF*dumK/(mc(jc_h,ibin) + dumK)
9469 ma(ja_hso4,ibin)= mSULF - ma(ja_so4,ibin)
9472 activity(jcamsa2,ibin) = mc(jc_ca,ibin) * ma(ja_msa,ibin)**2 * & ! raz-30apr07
9473 gam(jcamsa2,ibin)**3
9475 activity(jnh4so4,ibin) = mc(jc_nh4,ibin)**2*ma(ja_so4,ibin)* &
9476 gam(jnh4so4,ibin)**3
9478 activity(jlvcite,ibin) = mc(jc_nh4,ibin)**3*ma(ja_hso4,ibin)* &
9479 ma(ja_so4,ibin) * gam(jlvcite,ibin)**5
9481 activity(jnh4hso4,ibin)= mc(jc_nh4,ibin)*ma(ja_hso4,ibin)* &
9482 gam(jnh4hso4,ibin)**2
9484 activity(jnh4msa,ibin) = mc(jc_nh4,ibin)*ma(ja_msa,ibin)* &
9485 gam(jnh4msa,ibin)**2
9487 activity(jna2so4,ibin) = mc(jc_na,ibin)**2*ma(ja_so4,ibin)* &
9488 gam(jna2so4,ibin)**3
9490 activity(jnahso4,ibin) = mc(jc_na,ibin)*ma(ja_hso4,ibin)* &
9491 gam(jnahso4,ibin)**2
9493 activity(jnamsa,ibin) = mc(jc_na,ibin)*ma(ja_msa,ibin)* &
9496 ! activity(jna3hso4,ibin)= mc(jc_na,ibin)**3*ma(ja_hso4,ibin)* &
9497 ! ma(ja_so4,ibin)*gam(jna3hso4,ibin)**5
9499 activity(jna3hso4,ibin)= 0.0
9501 activity(jhno3,ibin) = mc(jc_h,ibin)*ma(ja_no3,ibin)* &
9504 activity(jhcl,ibin) = mc(jc_h,ibin)*ma(ja_cl,ibin)* &
9507 activity(jmsa,ibin) = mc(jc_h,ibin)*ma(ja_msa,ibin)* &
9511 ! sulfate-poor species
9512 activity(jnh4no3,ibin) = 0.0
9514 activity(jnh4cl,ibin) = 0.0
9516 activity(jnano3,ibin) = 0.0
9518 activity(jnacl,ibin) = 0.0
9520 activity(jcano3,ibin) = 0.0
9522 activity(jcacl2,ibin) = 0.0
9531 end subroutine compute_activities
9544 !***********************************************************************
9545 ! computes mtem ternary parameters only once per transport time-step
9546 ! for a given ah2o (= rh)
9548 ! author: rahul a. zaveri
9550 ! reference: zaveri, r.a., r.c. easter, and a.s. wexler,
9551 ! a new method for multicomponent activity coefficients of electrolytes
9552 ! in aqueous atmospheric aerosols, j. geophys. res., 2005.
9553 !-----------------------------------------------------------------------
9554 subroutine mtem_compute_log_gamz
9556 ! include 'mosaic.h'
9560 ! real(kind=8) fnlog_gamz, bin_molality
9563 ! sulfate-poor species
9565 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9566 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9567 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9568 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9569 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9570 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9571 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9572 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9573 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9574 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9575 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9576 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9577 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9578 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9579 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9583 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9584 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9585 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9586 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9587 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9588 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9589 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9590 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9591 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9592 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9593 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9594 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9595 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9596 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9597 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9601 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9602 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9603 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9604 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9605 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9606 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9607 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9608 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9609 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9610 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9611 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9612 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9613 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9614 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9615 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9619 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9620 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9621 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9622 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9623 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9624 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9625 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9626 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9627 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9628 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9632 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9633 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9634 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9635 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9636 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9637 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9638 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9639 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9640 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9641 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9645 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9646 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9647 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9648 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9649 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9650 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9651 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9652 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9653 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9654 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9655 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9656 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9657 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9658 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9659 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9663 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9664 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9665 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9666 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9667 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9668 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9669 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9670 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9671 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9672 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9676 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9677 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9678 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9679 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9680 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9681 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9682 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9683 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9684 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9685 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9689 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9690 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9691 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9692 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9693 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9694 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9695 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9696 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9697 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9698 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9702 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9703 log_gamz(ja,jnh4no3) = fnlog_gamz(ja,jnh4no3)
9704 log_gamz(ja,jnh4cl) = fnlog_gamz(ja,jnh4cl)
9705 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9706 log_gamz(ja,jnano3) = fnlog_gamz(ja,jnano3)
9707 log_gamz(ja,jnacl) = fnlog_gamz(ja,jnacl)
9708 log_gamz(ja,jcano3) = fnlog_gamz(ja,jcano3)
9709 log_gamz(ja,jcacl2) = fnlog_gamz(ja,jcacl2)
9710 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9711 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9714 ! sulfate-rich species
9716 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9717 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9718 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9719 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9720 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9721 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9722 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9723 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9724 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9728 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9729 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9730 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9731 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9732 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9733 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9734 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9735 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9736 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9740 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9741 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9742 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9743 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9744 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9745 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9746 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9747 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9748 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9752 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9753 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9754 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9755 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9756 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9757 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9758 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9759 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9760 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9764 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9765 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9766 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9767 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9768 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9769 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9770 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9771 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9772 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9776 log_gamz(ja,jh2so4) = fnlog_gamz(ja,jh2so4)
9777 log_gamz(ja,jnh4hso4)= fnlog_gamz(ja,jnh4hso4)
9778 log_gamz(ja,jlvcite) = fnlog_gamz(ja,jlvcite)
9779 log_gamz(ja,jnh4so4) = fnlog_gamz(ja,jnh4so4)
9780 log_gamz(ja,jnahso4) = fnlog_gamz(ja,jnahso4)
9781 log_gamz(ja,jna3hso4)= fnlog_gamz(ja,jna3hso4)
9782 log_gamz(ja,jna2so4) = fnlog_gamz(ja,jna2so4)
9783 log_gamz(ja,jhno3) = fnlog_gamz(ja,jhno3)
9784 log_gamz(ja,jhcl) = fnlog_gamz(ja,jhcl)
9787 end subroutine mtem_compute_log_gamz
9816 !***********************************************************************
9817 ! computes sulfate ratio
9819 ! author: rahul a. zaveri
9821 !-----------------------------------------------------------------------
9822 subroutine calculate_xt(ibin,jp,xt)
9824 ! include 'mosaic.h'
9830 if( (aer(iso4_a,jp,ibin)+aer(imsa_a,jp,ibin)) .gt.0.0)then
9831 xt = ( aer(inh4_a,jp,ibin) + &
9832 & aer(ina_a,jp,ibin) + &
9833 & 2.*aer(ica_a,jp,ibin) )/ &
9834 & (aer(iso4_a,jp,ibin)+0.5*aer(imsa_a,jp,ibin))
9841 end subroutine calculate_xt
9847 !***********************************************************************
9848 ! computes ions from electrolytes
9850 ! author: rahul a. zaveri
9852 !-----------------------------------------------------------------------
9853 subroutine electrolytes_to_ions(jp,ibin)
9855 ! include 'mosaic.h'
9860 aer(iso4_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
9861 electrolyte(jna2so4,jp,ibin) + &
9862 2.*electrolyte(jna3hso4,jp,ibin)+ &
9863 electrolyte(jnahso4,jp,ibin) + &
9864 electrolyte(jnh4so4,jp,ibin) + &
9865 2.*electrolyte(jlvcite,jp,ibin) + &
9866 electrolyte(jnh4hso4,jp,ibin)+ &
9867 electrolyte(jh2so4,jp,ibin)
9869 aer(ino3_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
9870 2.*electrolyte(jcano3,jp,ibin) + &
9871 electrolyte(jnh4no3,jp,ibin) + &
9872 electrolyte(jhno3,jp,ibin)
9874 aer(icl_a,jp,ibin) = electrolyte(jnacl,jp,ibin) + &
9875 2.*electrolyte(jcacl2,jp,ibin) + &
9876 electrolyte(jnh4cl,jp,ibin) + &
9877 electrolyte(jhcl,jp,ibin)
9879 aer(imsa_a,jp,ibin) = electrolyte(jnh4msa,jp,ibin) + &
9880 electrolyte(jnamsa,jp,ibin) + &
9881 2.*electrolyte(jcamsa2,jp,ibin) + &
9882 electrolyte(jmsa,jp,ibin)
9884 aer(ico3_a,jp,ibin) = electrolyte(jcaco3,jp,ibin)
9886 aer(ica_a,jp,ibin) = electrolyte(jcaso4,jp,ibin) + &
9887 electrolyte(jcano3,jp,ibin) + &
9888 electrolyte(jcacl2,jp,ibin) + &
9889 electrolyte(jcaco3,jp,ibin) + &
9890 electrolyte(jcamsa2,jp,ibin)
9892 aer(ina_a,jp,ibin) = electrolyte(jnano3,jp,ibin) + &
9893 electrolyte(jnacl,jp,ibin) + &
9894 2.*electrolyte(jna2so4,jp,ibin) + &
9895 3.*electrolyte(jna3hso4,jp,ibin)+ &
9896 electrolyte(jnahso4,jp,ibin) + &
9897 electrolyte(jnamsa,jp,ibin)
9899 aer(inh4_a,jp,ibin) = electrolyte(jnh4no3,jp,ibin) + &
9900 electrolyte(jnh4cl,jp,ibin) + &
9901 2.*electrolyte(jnh4so4,jp,ibin) + &
9902 3.*electrolyte(jlvcite,jp,ibin) + &
9903 electrolyte(jnh4hso4,jp,ibin)+ &
9904 electrolyte(jnh4msa,jp,ibin)
9908 end subroutine electrolytes_to_ions
9919 !***********************************************************************
9920 ! combinatorial method for computing electrolytes from ions
9923 ! - to be used for liquid-phase or total-phase only
9924 ! - transfers caso4 and caco3 from liquid to solid phase
9926 ! author: rahul a. zaveri (based on code provided by a.s. wexler
9928 !-----------------------------------------------------------------------
9929 subroutine ions_to_electrolytes(jp,ibin,xt)
9931 ! include 'mosaic.h'
9936 integer iaer, je, jc, ja, icase
9937 real(kind=8) store(naer), sum_dum, sum_naza, sum_nczc, sum_na_nh4, &
9938 f_nh4, f_na, xh, xb, xl, xs, cat_net, rem_nh4, rem_na
9939 real(kind=8) nc(ncation), na(nanion)
9944 if(jp .ne. jliquid)then
9945 if (iprint_mosaic_fe1 .gt. 0) then
9946 write(6,*)' jp must be jliquid'
9947 write(6,*)' in ions_to_electrolytes sub'
9948 write(6,*)' wrong jp = ', jp
9949 write(6,*)' mosaic fatal error in ions_to_electrolytes'
9952 istat_mosaic_fe1 = -2000
9956 ! remove negative concentrations, if any
9958 aer(iaer,jp,ibin) = max(0.0D0, aer(iaer,jp,ibin))
9962 ! first transfer caso4 from liquid to solid phase (caco3 should not be present here)
9963 store(ica_a) = aer(ica_a, jp,ibin)
9964 store(iso4_a) = aer(iso4_a,jp,ibin)
9966 call form_caso4(store,jp,ibin)
9968 if(jp .eq. jliquid)then ! transfer caso4 from liquid to solid phase
9969 aer(ica_a,jliquid,ibin) = aer(ica_a,jliquid,ibin) - &
9970 electrolyte(jcaso4,jliquid,ibin)
9972 aer(iso4_a,jliquid,ibin)= aer(iso4_a,jliquid,ibin)- &
9973 electrolyte(jcaso4,jliquid,ibin)
9975 aer(ica_a,jsolid,ibin) = aer(ica_a,jsolid,ibin) + &
9976 electrolyte(jcaso4,jliquid,ibin)
9978 aer(iso4_a,jsolid,ibin) = aer(iso4_a,jsolid,ibin) + &
9979 electrolyte(jcaso4,jliquid,ibin)
9981 electrolyte(jcaso4,jsolid,ibin)=electrolyte(jcaso4,jsolid,ibin) &
9982 +electrolyte(jcaso4,jliquid,ibin)
9983 electrolyte(jcaso4,jliquid,ibin)= 0.0
9987 ! calculate sulfate ratio
9988 call calculate_xt(ibin,jp,xt)
9990 if(xt .ge. 1.9999 .or. xt.lt.0.)then
9991 icase = 1 ! near neutral (acidity is caused by hcl and/or hno3)
9993 icase = 2 ! acidic (acidity is caused by excess so4)
9997 ! initialize to zero
9998 do je = 1, nelectrolyte
9999 electrolyte(je,jp,ibin) = 0.0
10002 !---------------------------------------------------------
10003 ! initialize moles of ions depending on the sulfate domain
10005 if(icase.eq.1)then ! xt >= 2 : sulfate poor domain
10008 na(ja_so4) = aer(iso4_a,jp,ibin)
10009 na(ja_no3) = aer(ino3_a,jp,ibin)
10010 na(ja_cl) = aer(icl_a, jp,ibin)
10011 na(ja_msa) = aer(imsa_a,jp,ibin)
10013 nc(jc_ca) = aer(ica_a, jp,ibin)
10014 nc(jc_na) = aer(ina_a, jp,ibin)
10015 nc(jc_nh4) = aer(inh4_a,jp,ibin)
10018 ( 2.*na(ja_so4)+na(ja_no3)+na(ja_cl)+na(ja_msa) )- &
10019 ( 2.*nc(jc_ca) +nc(jc_nh4)+nc(jc_na) )
10021 if(cat_net .lt. 0.0)then
10025 else ! cat_net must be 0.0 or positive
10032 ! now compute equivalent fractions
10035 sum_naza = sum_naza + na(ja)*za(ja)
10040 sum_nczc = sum_nczc + nc(jc)*zc(jc)
10043 if(sum_naza .eq. 0. .or. sum_nczc .eq. 0.)then
10044 if (iprint_mosaic_diag1 .gt. 0) then
10045 write(6,*)'mosaic ions_to_electrolytes'
10046 write(6,*)'ionic concentrations are zero'
10047 write(6,*)'sum_naza = ', sum_naza
10048 write(6,*)'sum_nczc = ', sum_nczc
10054 xeq_a(ja) = na(ja)*za(ja)/sum_naza
10058 xeq_c(jc) = nc(jc)*zc(jc)/sum_nczc
10061 na_ma(ja_so4) = na(ja_so4) *mw_a(ja_so4)
10062 na_ma(ja_no3) = na(ja_no3) *mw_a(ja_no3)
10063 na_ma(ja_cl) = na(ja_cl) *mw_a(ja_cl)
10064 na_ma(ja_msa) = na(ja_msa) *mw_a(ja_msa)
10065 na_ma(ja_hso4)= na(ja_hso4)*mw_a(ja_hso4)
10067 nc_mc(jc_ca) = nc(jc_ca) *mw_c(jc_ca)
10068 nc_mc(jc_na) = nc(jc_na) *mw_c(jc_na)
10069 nc_mc(jc_nh4) = nc(jc_nh4)*mw_c(jc_nh4)
10070 nc_mc(jc_h) = nc(jc_h) *mw_c(jc_h)
10073 ! now compute electrolyte moles
10074 if(xeq_c(jc_na) .gt. 0. .and. xeq_a(ja_so4) .gt. 0.)then
10075 electrolyte(jna2so4,jp,ibin) = (xeq_c(jc_na) *na_ma(ja_so4) + &
10076 xeq_a(ja_so4)*nc_mc(jc_na))/ &
10077 mw_electrolyte(jna2so4)
10080 electrolyte(jnahso4,jp,ibin) = 0.0
10082 if(xeq_c(jc_na) .gt. 0. .and. xeq_a(ja_msa) .gt. 0.)then
10083 electrolyte(jnamsa,jp,ibin) = (xeq_c(jc_na) *na_Ma(ja_msa) + &
10084 xeq_a(ja_msa)*nc_Mc(jc_na))/ &
10085 mw_electrolyte(jnamsa)
10088 if(xeq_c(jc_na) .gt. 0. .and. xeq_a(ja_no3) .gt. 0.)then
10089 electrolyte(jnano3, jp,ibin) = (xeq_c(jc_na) *na_ma(ja_no3) + &
10090 xeq_a(ja_no3)*nc_mc(jc_na))/ &
10091 mw_electrolyte(jnano3)
10094 if(xeq_c(jc_na) .gt. 0. .and. xeq_a(ja_cl) .gt. 0.)then
10095 electrolyte(jnacl, jp,ibin) = (xeq_c(jc_na) *na_ma(ja_cl) + &
10096 xeq_a(ja_cl) *nc_mc(jc_na))/ &
10097 mw_electrolyte(jnacl)
10100 if(xeq_c(jc_nh4) .gt. 0. .and. xeq_a(ja_so4) .gt. 0.)then
10101 electrolyte(jnh4so4,jp,ibin) = (xeq_c(jc_nh4)*na_ma(ja_so4) + &
10102 xeq_a(ja_so4)*nc_mc(jc_nh4))/ &
10103 mw_electrolyte(jnh4so4)
10106 electrolyte(jnh4hso4,jp,ibin)= 0.0
10108 if(xeq_c(jc_nh4) .gt. 0. .and. xeq_a(ja_msa) .gt. 0.)then
10109 electrolyte(jnh4msa,jp,ibin) = (xeq_c(jc_nh4)*na_Ma(ja_msa) + &
10110 xeq_a(ja_msa)*nc_Mc(jc_nh4))/ &
10111 mw_electrolyte(jnh4msa)
10114 if(xeq_c(jc_nh4) .gt. 0. .and. xeq_a(ja_no3) .gt. 0.)then
10115 electrolyte(jnh4no3,jp,ibin) = (xeq_c(jc_nh4)*na_ma(ja_no3) + &
10116 xeq_a(ja_no3)*nc_mc(jc_nh4))/ &
10117 mw_electrolyte(jnh4no3)
10120 if(xeq_c(jc_nh4) .gt. 0. .and. xeq_a(ja_cl) .gt. 0.)then
10121 electrolyte(jnh4cl, jp,ibin) = (xeq_c(jc_nh4)*na_ma(ja_cl) + &
10122 xeq_a(ja_cl) *nc_mc(jc_nh4))/ &
10123 mw_electrolyte(jnh4cl)
10126 if(xeq_c(jc_ca) .gt. 0. .and. xeq_a(ja_no3) .gt. 0.0)then
10127 electrolyte(jcano3, jp,ibin) = (xeq_c(jc_ca) *na_ma(ja_no3) + &
10128 xeq_a(ja_no3)*nc_mc(jc_ca))/ &
10129 mw_electrolyte(jcano3)
10132 if(xeq_c(jc_ca) .gt. 0. .and. xeq_a(ja_cl) .gt. 0.)then
10133 electrolyte(jcacl2, jp,ibin) = (xeq_c(jc_ca) *na_ma(ja_cl) + &
10134 xeq_a(ja_cl) *nc_mc(jc_ca))/ &
10135 mw_electrolyte(jcacl2)
10138 if(xeq_c(jc_ca) .gt. 0. .and. xeq_a(ja_msa) .gt. 0.)then
10139 electrolyte(jcamsa2,jp,ibin) = (xeq_c(jc_ca) *na_Ma(ja_msa) + &
10140 xeq_a(ja_msa) *nc_Mc(jc_ca))/ &
10141 mw_electrolyte(jcamsa2)
10144 electrolyte(jh2so4, jp,ibin) = 0.0
10146 if(xeq_c(jc_h) .gt. 0. .and. xeq_a(ja_no3) .gt. 0.)then
10147 electrolyte(jhno3, jp,ibin) = (xeq_c(jc_h) *na_ma(ja_no3) + &
10148 xeq_a(ja_no3)*nc_mc(jc_h))/ &
10149 mw_electrolyte(jhno3)
10152 if(xeq_c(jc_h) .gt. 0. .and. xeq_a(ja_cl) .gt. 0.)then
10153 electrolyte(jhcl, jp,ibin) = (xeq_c(jc_h) *na_ma(ja_cl) + &
10154 xeq_a(ja_cl)*nc_mc(jc_h))/ &
10155 mw_electrolyte(jhcl)
10158 if(xeq_c(jc_h) .gt. 0. .and. xeq_a(ja_msa) .gt. 0.)then
10159 electrolyte(jmsa,jp,ibin) = (xeq_c(jc_h) *na_ma(ja_msa) + &
10160 xeq_a(ja_msa)*nc_mc(jc_h))/ &
10161 mw_electrolyte(jmsa)
10164 !--------------------------------------------------------------------
10166 elseif(icase.eq.2)then ! xt < 2 : sulfate rich domain
10168 store(imsa_a) = aer(imsa_a,jp,ibin)
10169 store(ica_a) = aer(ica_a, jp,ibin)
10171 call form_camsa2(store,jp,ibin)
10173 sum_na_nh4 = aer(ina_a,jp,ibin) + aer(inh4_a,jp,ibin)
10175 if(sum_na_nh4 .gt. 0.0)then
10176 f_nh4 = aer(inh4_a,jp,ibin)/sum_na_nh4
10177 f_na = aer(ina_a,jp,ibin)/sum_na_nh4
10183 ! first form msa electrolytes
10184 if(sum_na_nh4 .gt. store(imsa_a))then
10185 electrolyte(jnamsa,jp,ibin) = f_na *store(imsa_a)
10186 electrolyte(jnh4msa,jp,ibin) = f_nh4*store(imsa_a)
10187 rem_na = aer(ina_a,jp,ibin) - electrolyte(jnamsa,jp,ibin) ! remaining na
10188 rem_nh4= aer(inh4_a,jp,ibin)- electrolyte(jnh4msa,jp,ibin) ! remaining nh4
10190 electrolyte(jnamsa,jp,ibin) = aer(ina_a,jp,ibin)
10191 electrolyte(jnh4msa,jp,ibin) = aer(inh4_a,jp,ibin)
10192 electrolyte(jmsa,jp,ibin) = store(imsa_a) - sum_na_nh4
10193 rem_nh4 = 0.0 ! remaining nh4
10194 rem_na = 0.0 ! remaining na
10199 if(aer(iso4_a,jp,ibin).gt.0.0)then
10200 xt = (rem_nh4 + rem_na)/aer(iso4_a,jp,ibin)
10205 if(xt .le. 1.0)then ! h2so4 + bisulfate
10208 electrolyte(jh2so4,jp,ibin) = xh*aer(iso4_a,jp,ibin)
10209 electrolyte(jnh4hso4,jp,ibin) = xb*f_nh4*aer(iso4_a,jp,ibin)
10210 electrolyte(jnahso4,jp,ibin) = xb*f_na *aer(iso4_a,jp,ibin)
10211 elseif(xt .le. 1.5)then ! bisulfate + letovicite
10214 electrolyte(jnh4hso4,jp,ibin) = xb*f_nh4*aer(iso4_a,jp,ibin)
10215 electrolyte(jnahso4,jp,ibin) = xb*f_na *aer(iso4_a,jp,ibin)
10216 electrolyte(jlvcite,jp,ibin) = xl*f_nh4*aer(iso4_a,jp,ibin)
10217 electrolyte(jna3hso4,jp,ibin) = xl*f_na *aer(iso4_a,jp,ibin)
10218 else ! letovicite + sulfate
10221 electrolyte(jlvcite,jp,ibin) = xl*f_nh4*aer(iso4_a,jp,ibin)
10222 electrolyte(jna3hso4,jp,ibin) = xl*f_na *aer(iso4_a,jp,ibin)
10223 electrolyte(jnh4so4,jp,ibin) = xs*f_nh4*aer(iso4_a,jp,ibin)
10224 electrolyte(jna2so4,jp,ibin) = xs*f_na *aer(iso4_a,jp,ibin)
10227 electrolyte(jhno3,jp,ibin) = aer(ino3_a,jp,ibin)
10228 electrolyte(jhcl,jp,ibin) = aer(icl_a,jp,ibin)
10231 !---------------------------------------------------------
10233 ! calculate % composition
10234 !! 10 sum_dum = 0.0
10235 !! do je = 1, nelectrolyte
10236 !! sum_dum = sum_dum + electrolyte(je,jp,ibin)
10239 !! if(sum_dum .eq. 0.)sum_dum = 1.0
10240 !! electrolyte_sum(jp,ibin) = sum_dum
10242 !! do je = 1, nelectrolyte
10243 !! epercent(je,jp,ibin) = 100.*electrolyte(je,jp,ibin)/sum_dum
10247 end subroutine ions_to_electrolytes
10275 !***********************************************************************
10276 ! conforms aerosol generic species to a valid electrolyte composition
10278 ! author: rahul a. zaveri
10279 ! update: june 2000
10280 !-----------------------------------------------------------------------
10281 subroutine conform_electrolytes(jp,ibin,xt)
10283 ! include 'mosaic.h'
10288 integer i, ixt_case, je
10289 real(kind=8) sum_dum, xna_prime, xnh4_prime, xt_prime
10290 real(kind=8) store(naer)
10292 ! remove negative concentrations, if any
10294 aer(i,jp,ibin) = max(0.0D0, aer(i,jp,ibin))
10298 call calculate_xt(ibin,jp,xt)
10300 if(xt .ge. 1.9999 .or. xt.lt.0.)then
10301 ixt_case = 1 ! near neutral (acidity is caused by hcl and/or hno3)
10303 ixt_case = 2 ! acidic (acidity is caused by excess so4)
10308 ! put total aer(*) into store(*)
10309 store(iso4_a) = aer(iso4_a,jp,ibin)
10310 store(ino3_a) = aer(ino3_a,jp,ibin)
10311 store(icl_a) = aer(icl_a, jp,ibin)
10312 store(imsa_a) = aer(imsa_a,jp,ibin)
10313 store(ico3_a) = aer(ico3_a,jp,ibin)
10314 store(inh4_a) = aer(inh4_a,jp,ibin)
10315 store(ina_a) = aer(ina_a, jp,ibin)
10316 store(ica_a) = aer(ica_a, jp,ibin)
10318 do je=1,nelectrolyte
10319 electrolyte(je,jp,ibin) = 0.0
10322 !---------------------------------------------------------
10324 if(ixt_case.eq.1)then
10326 ! xt >= 2 : sulfate deficient
10328 call form_caso4(store,jp,ibin)
10329 call form_camsa2(store,jp,ibin)
10330 call form_na2so4(store,jp,ibin)
10331 call form_namsa(store,jp,ibin)
10332 call form_cano3(store,jp,ibin)
10333 call form_nano3(store,jp,ibin)
10334 call form_nacl(store,jp,ibin)
10335 call form_cacl2(store,jp,ibin)
10336 call form_caco3(store,jp,ibin)
10337 call form_nh4so4(store,jp,ibin)
10338 call form_nh4msa(store,jp,ibin)
10339 call form_nh4no3(store,jp,ibin)
10340 call form_nh4cl(store,jp,ibin)
10341 call form_msa(store,jp,ibin)
10342 call degas_hno3(store,jp,ibin)
10343 call degas_hcl(store,jp,ibin)
10344 call degas_nh3(store,jp,ibin)
10346 elseif(ixt_case.eq.2)then
10348 ! xt < 2 : sulfate enough or sulfate excess
10350 call form_caso4(store,jp,ibin)
10351 call form_camsa2(store,jp,ibin)
10352 call form_namsa(store,jp,ibin)
10353 call form_nh4msa(store,jp,ibin)
10354 call form_msa(store,jp,ibin)
10356 if(store(iso4_a).eq.0.0)goto 10
10359 xt_prime =(store(ina_a)+store(inh4_a))/ &
10361 xna_prime=0.5*store(ina_a)/store(iso4_a) + 1.
10363 if(xt_prime.ge.xna_prime)then
10364 call form_na2so4(store,jp,ibin)
10366 if(store(iso4_a).gt.1.e-15)then
10367 xnh4_prime = store(inh4_a)/store(iso4_a)
10370 if(xnh4_prime .ge. 1.5)then
10371 call form_nh4so4_lvcite(store,jp,ibin)
10373 call form_lvcite_nh4hso4(store,jp,ibin)
10376 elseif(xt_prime.ge.1.)then
10377 call form_nh4hso4(store,jp,ibin)
10378 call form_na2so4_nahso4(store,jp,ibin)
10379 elseif(xt_prime.lt.1.)then
10380 call form_nahso4(store,jp,ibin)
10381 call form_nh4hso4(store,jp,ibin)
10382 call form_h2so4(store,jp,ibin)
10385 10 call degas_hno3(store,jp,ibin)
10386 call degas_hcl(store,jp,ibin)
10387 call degas_nh3(store,jp,ibin)
10392 ! re-calculate ions to eliminate round-off errors
10393 call electrolytes_to_ions(jp, ibin)
10394 !---------------------------------------------------------
10396 ! calculate % composition
10398 !! do je = 1, nelectrolyte
10399 !! electrolyte(je,jp,ibin) = max(0.D0,electrolyte(je,jp,ibin)) ! remove -ve
10400 !! sum_dum = sum_dum + electrolyte(je,jp,ibin)
10403 !! if(sum_dum .eq. 0.)sum_dum = 1.0
10404 !! electrolyte_sum(jp,ibin) = sum_dum
10406 !! do je = 1, nelectrolyte
10407 !! epercent(je,jp,ibin) = 100.*electrolyte(je,jp,ibin)/sum_dum
10411 end subroutine conform_electrolytes
10423 !***********************************************************************
10424 ! forms electrolytes from ions
10426 ! author: rahul a. zaveri
10427 ! update: june 2000
10428 !-----------------------------------------------------------------------
10429 subroutine form_electrolytes(jp,ibin,xt)
10431 ! include 'mosaic.h'
10436 integer i, ixt_case, j, je
10437 real(kind=8) sum_dum, xna_prime, xnh4_prime, xt_prime
10438 real(kind=8) store(naer)
10440 ! remove negative concentrations, if any
10442 aer(i,jp,ibin) = max(0.0D0, aer(i,jp,ibin))
10446 call calculate_xt(ibin,jp,xt)
10448 if(xt .ge. 1.9999 .or. xt.lt.0.)then
10449 ixt_case = 1 ! near neutral (acidity is caused by hcl and/or hno3)
10451 ixt_case = 2 ! acidic (acidity is caused by excess so4)
10456 ! put total aer(*) into store(*)
10457 store(iso4_a) = aer(iso4_a,jp,ibin)
10458 store(ino3_a) = aer(ino3_a,jp,ibin)
10459 store(icl_a) = aer(icl_a, jp,ibin)
10460 store(imsa_a) = aer(imsa_a,jp,ibin)
10461 store(ico3_a) = aer(ico3_a,jp,ibin)
10462 store(inh4_a) = aer(inh4_a,jp,ibin)
10463 store(ina_a) = aer(ina_a, jp,ibin)
10464 store(ica_a) = aer(ica_a, jp,ibin)
10466 do j=1,nelectrolyte
10467 electrolyte(j,jp,ibin) = 0.0
10470 !---------------------------------------------------------
10472 if(ixt_case.eq.1)then
10474 ! xt >= 2 : sulfate deficient
10475 call form_caso4(store,jp,ibin)
10476 call form_camsa2(store,jp,ibin)
10477 call form_na2so4(store,jp,ibin)
10478 call form_namsa(store,jp,ibin)
10479 call form_cano3(store,jp,ibin)
10480 call form_nano3(store,jp,ibin)
10481 call form_nacl(store,jp,ibin)
10482 call form_cacl2(store,jp,ibin)
10483 call form_caco3(store,jp,ibin)
10484 call form_nh4so4(store,jp,ibin)
10485 call form_nh4msa(store,jp,ibin)
10486 call form_nh4no3(store,jp,ibin)
10487 call form_nh4cl(store,jp,ibin)
10488 call form_msa(store,jp,ibin)
10490 if(jp .eq. jsolid)then
10491 call degas_hno3(store,jp,ibin)
10492 call degas_hcl(store,jp,ibin)
10493 call degas_nh3(store,jp,ibin)
10495 call form_hno3(store,jp,ibin)
10496 call form_hcl(store,jp,ibin)
10497 call degas_nh3(store,jp,ibin)
10502 elseif(ixt_case.eq.2)then
10504 ! xt < 2 : sulfate enough or sulfate excess
10506 call form_caso4(store,jp,ibin)
10507 call form_camsa2(store,jp,ibin)
10508 call form_namsa(store,jp,ibin)
10509 call form_nh4msa(store,jp,ibin)
10510 call form_msa(store,jp,ibin)
10512 if(store(iso4_a).eq.0.0)goto 10
10515 xt_prime =(store(ina_a)+store(inh4_a))/ &
10517 xna_prime=0.5*store(ina_a)/store(iso4_a) + 1.
10519 if(xt_prime.ge.xna_prime)then
10520 call form_na2so4(store,jp,ibin)
10522 if(store(iso4_a).gt.1.e-15)then
10523 xnh4_prime = store(inh4_a)/store(iso4_a)
10526 if(xnh4_prime .ge. 1.5)then
10527 call form_nh4so4_lvcite(store,jp,ibin)
10529 call form_lvcite_nh4hso4(store,jp,ibin)
10532 elseif(xt_prime.ge.1.)then
10533 call form_nh4hso4(store,jp,ibin)
10534 call form_na2so4_nahso4(store,jp,ibin)
10535 elseif(xt_prime.lt.1.)then
10536 call form_nahso4(store,jp,ibin)
10537 call form_nh4hso4(store,jp,ibin)
10538 call form_h2so4(store,jp,ibin)
10541 10 if(jp .eq. jsolid)then
10542 call degas_hno3(store,jp,ibin)
10543 call degas_hcl(store,jp,ibin)
10544 call degas_nh3(store,jp,ibin)
10546 call form_hno3(store,jp,ibin)
10547 call form_hcl(store,jp,ibin)
10548 call degas_nh3(store,jp,ibin)
10554 ! re-calculate ions to eliminate round-off errors
10555 call electrolytes_to_ions(jp, ibin)
10556 !---------------------------------------------------------
10558 ! calculate % composition
10560 !! do je = 1, nelectrolyte
10561 !! electrolyte(je,jp,ibin) = max(0.D0,electrolyte(je,jp,ibin)) ! remove -ve
10562 !! sum_dum = sum_dum + electrolyte(je,jp,ibin)
10565 !! if(sum_dum .eq. 0.)sum_dum = 1.0
10566 !! electrolyte_sum(jp,ibin) = sum_dum
10568 !! do je = 1, nelectrolyte
10569 !! epercent(je,jp,ibin) = 100.*electrolyte(je,jp,ibin)/sum_dum
10573 end subroutine form_electrolytes
10588 !***********************************************************************
10589 ! electrolyte formation subroutines
10591 ! author: rahul a. zaveri
10592 ! update: june 2000
10593 !-----------------------------------------------------------------------
10594 subroutine form_caso4(store,jp,ibin)
10596 ! include 'mosaic.h'
10599 real(kind=8) store(naer)
10601 electrolyte(jcaso4,jp,ibin) = min(store(ica_a),store(iso4_a))
10602 store(ica_a) = store(ica_a) - electrolyte(jcaso4,jp,ibin)
10603 store(iso4_a) = store(iso4_a) - electrolyte(jcaso4,jp,ibin)
10604 store(ica_a) = max(0.D0, store(ica_a))
10605 store(iso4_a) = max(0.D0, store(iso4_a))
10608 end subroutine form_caso4
10612 subroutine form_camsa2(store,jp,ibin)
10614 ! include 'mosaic.h'
10617 real(kind=8) store(naer)
10619 electrolyte(jcamsa2,jp,ibin) = min(store(ica_a),0.5*store(imsa_a))
10620 store(ica_a) = store(ica_a) - electrolyte(jcamsa2,jp,ibin)
10621 store(imsa_a) = store(imsa_a) - 2.d0*electrolyte(jcamsa2,jp,ibin)
10622 store(ica_a) = max(0.D0, store(ica_a))
10623 store(imsa_a) = max(0.D0, store(imsa_a))
10626 end subroutine form_camsa2
10630 subroutine form_cano3(store,jp,ibin) ! ca(no3)2
10632 ! include 'mosaic.h'
10635 real(kind=8) store(naer)
10637 electrolyte(jcano3,jp,ibin) = min(store(ica_a),0.5*store(ino3_a))
10639 store(ica_a) = store(ica_a) - electrolyte(jcano3,jp,ibin)
10640 store(ino3_a) = store(ino3_a) - 2.*electrolyte(jcano3,jp,ibin)
10641 store(ica_a) = max(0.D0, store(ica_a))
10642 store(ino3_a) = max(0.D0, store(ino3_a))
10645 end subroutine form_cano3
10648 subroutine form_cacl2(store,jp,ibin)
10650 ! include 'mosaic.h'
10653 real(kind=8) store(naer)
10655 electrolyte(jcacl2,jp,ibin) = min(store(ica_a),0.5*store(icl_a))
10657 store(ica_a) = store(ica_a) - electrolyte(jcacl2,jp,ibin)
10658 store(icl_a) = store(icl_a) - 2.*electrolyte(jcacl2,jp,ibin)
10659 store(ica_a) = max(0.D0, store(ica_a))
10660 store(icl_a) = max(0.D0, store(icl_a))
10663 end subroutine form_cacl2
10666 subroutine form_caco3(store,jp,ibin)
10668 ! include 'mosaic.h'
10671 real(kind=8) store(naer)
10673 if(jp.eq.jtotal .or. jp.eq.jsolid)then
10674 electrolyte(jcaco3,jp,ibin) = store(ica_a)
10676 aer(ico3_a,jp,ibin)= electrolyte(jcaco3,jp,ibin) ! force co3 = caco3
10683 end subroutine form_caco3
10686 subroutine form_na2so4(store,jp,ibin)
10688 ! include 'mosaic.h'
10691 real(kind=8) store(naer)
10693 electrolyte(jna2so4,jp,ibin) = min(.5*store(ina_a), &
10695 store(ina_a) = store(ina_a) - 2.*electrolyte(jna2so4,jp,ibin)
10696 store(iso4_a)= store(iso4_a) - electrolyte(jna2so4,jp,ibin)
10697 store(ina_a) = max(0.D0, store(ina_a))
10698 store(iso4_a)= max(0.D0, store(iso4_a))
10701 end subroutine form_na2so4
10705 subroutine form_nahso4(store,jp,ibin)
10707 ! include 'mosaic.h'
10710 real(kind=8) store(naer)
10712 electrolyte(jnahso4,jp,ibin) = min(store(ina_a), &
10714 store(ina_a) = store(ina_a) - electrolyte(jnahso4,jp,ibin)
10715 store(iso4_a) = store(iso4_a) - electrolyte(jnahso4,jp,ibin)
10716 store(ina_a) = max(0.D0, store(ina_a))
10717 store(iso4_a) = max(0.D0, store(iso4_a))
10720 end subroutine form_nahso4
10724 subroutine form_namsa(store,jp,ibin)
10726 ! include 'mosaic.h'
10729 real(kind=8) store(naer)
10731 electrolyte(jnamsa,jp,ibin) = min(store(ina_a), &
10733 store(ina_a) = store(ina_a) - electrolyte(jnamsa,jp,ibin)
10734 store(imsa_a) = store(imsa_a) - electrolyte(jnamsa,jp,ibin)
10735 store(ina_a) = max(0.D0, store(ina_a))
10736 store(imsa_a) = max(0.D0, store(imsa_a))
10739 end subroutine form_namsa
10743 subroutine form_nano3(store,jp,ibin)
10745 ! include 'mosaic.h'
10748 real(kind=8) store(naer)
10750 electrolyte(jnano3,jp,ibin)=min(store(ina_a),store(ino3_a))
10751 store(ina_a) = store(ina_a) - electrolyte(jnano3,jp,ibin)
10752 store(ino3_a) = store(ino3_a) - electrolyte(jnano3,jp,ibin)
10753 store(ina_a) = max(0.D0, store(ina_a))
10754 store(ino3_a) = max(0.D0, store(ino3_a))
10757 end subroutine form_nano3
10761 subroutine form_nacl(store,jp,ibin)
10763 ! include 'mosaic.h'
10766 real(kind=8) store(naer)
10768 electrolyte(jnacl,jp,ibin) = store(ina_a)
10771 store(icl_a) = store(icl_a) - electrolyte(jnacl,jp,ibin)
10773 if(store(icl_a) .lt. 0.)then ! cl deficit in aerosol. take some from gas
10774 aer(icl_a,jp,ibin)= aer(icl_a,jp,ibin)- store(icl_a) ! update aer(icl_a)
10776 if(jp .ne. jtotal)then
10777 aer(icl_a,jtotal,ibin)= aer(icl_a,jliquid,ibin)+ & ! update for jtotal
10778 aer(icl_a,jsolid,ibin)
10781 gas(ihcl_g) = gas(ihcl_g) + store(icl_a) ! update gas(ihcl_g)
10783 if(gas(ihcl_g) .lt. 0.0)then
10784 total_species(ihcl_g) = total_species(ihcl_g) - gas(ihcl_g) ! update total_species
10785 tot_cl_in = tot_cl_in - gas(ihcl_g) ! update tot_cl_in
10788 gas(ihcl_g) = max(0.D0, gas(ihcl_g)) ! restrict gas(ihcl_g) to >= 0.
10789 store(icl_a) = 0. ! force store(icl_a) to 0.
10793 store(icl_a) = max(0.D0, store(icl_a))
10796 end subroutine form_nacl
10800 subroutine form_nh4so4(store,jp,ibin) ! (nh4)2so4
10802 ! include 'mosaic.h'
10805 real(kind=8) store(naer)
10807 electrolyte(jnh4so4,jp,ibin)= min(.5*store(inh4_a), &
10809 store(inh4_a)= store(inh4_a) - 2.*electrolyte(jnh4so4,jp,ibin)
10810 store(iso4_a)= store(iso4_a) - electrolyte(jnh4so4,jp,ibin)
10811 store(inh4_a) = max(0.D0, store(inh4_a))
10812 store(iso4_a) = max(0.D0, store(iso4_a))
10815 end subroutine form_nh4so4
10819 subroutine form_nh4hso4(store,jp,ibin) ! nh4hso4
10821 ! include 'mosaic.h'
10824 real(kind=8) store(naer)
10826 electrolyte(jnh4hso4,jp,ibin) = min(store(inh4_a), &
10828 store(inh4_a)= store(inh4_a) - electrolyte(jnh4hso4,jp,ibin)
10829 store(iso4_a)= store(iso4_a) - electrolyte(jnh4hso4,jp,ibin)
10830 store(inh4_a) = max(0.D0, store(inh4_a))
10831 store(iso4_a) = max(0.D0, store(iso4_a))
10834 end subroutine form_nh4hso4
10838 subroutine form_nh4msa(store,jp,ibin)
10840 ! include 'mosaic.h'
10843 real(kind=8) store(naer)
10845 electrolyte(jnh4msa,jp,ibin) = min(store(inh4_a), &
10847 store(inh4_a) = store(inh4_a) - electrolyte(jnh4msa,jp,ibin)
10848 store(imsa_a) = store(imsa_a) - electrolyte(jnh4msa,jp,ibin)
10849 store(inh4_a) = max(0.D0, store(inh4_a))
10850 store(imsa_a) = max(0.D0, store(imsa_a))
10853 end subroutine form_nh4msa
10857 subroutine form_nh4cl(store,jp,ibin)
10859 ! include 'mosaic.h'
10862 real(kind=8) store(naer)
10864 electrolyte(jnh4cl,jp,ibin) = min(store(inh4_a), &
10866 store(inh4_a) = store(inh4_a) - electrolyte(jnh4cl,jp,ibin)
10867 store(icl_a) = store(icl_a) - electrolyte(jnh4cl,jp,ibin)
10868 store(inh4_a) = max(0.D0, store(inh4_a))
10869 store(icl_a) = max(0.D0, store(icl_a))
10872 end subroutine form_nh4cl
10876 subroutine form_nh4no3(store,jp,ibin)
10878 ! include 'mosaic.h'
10881 real(kind=8) store(naer)
10883 electrolyte(jnh4no3,jp,ibin) = min(store(inh4_a), &
10885 store(inh4_a) = store(inh4_a) - electrolyte(jnh4no3,jp,ibin)
10886 store(ino3_a) = store(ino3_a) - electrolyte(jnh4no3,jp,ibin)
10887 store(inh4_a) = max(0.D0, store(inh4_a))
10888 store(ino3_a) = max(0.D0, store(ino3_a))
10891 end subroutine form_nh4no3
10895 subroutine form_nh4so4_lvcite(store,jp,ibin) ! (nh4)2so4 + (nh4)3h(so4)2
10897 ! include 'mosaic.h'
10900 real(kind=8) store(naer)
10902 electrolyte(jnh4so4,jp,ibin)= 2.*store(inh4_a) - 3.*store(iso4_a)
10903 electrolyte(jlvcite,jp,ibin)= 2.*store(iso4_a) - store(inh4_a)
10904 electrolyte(jnh4so4,jp,ibin)= max(0.D0, &
10905 electrolyte(jnh4so4,jp,ibin))
10906 electrolyte(jlvcite,jp,ibin)= max(0.D0, &
10907 electrolyte(jlvcite,jp,ibin))
10912 end subroutine form_nh4so4_lvcite
10916 subroutine form_lvcite_nh4hso4(store,jp,ibin) ! (nh4)3h(so4)2 + nh4hso4
10918 ! include 'mosaic.h'
10921 real(kind=8) store(naer)
10923 electrolyte(jlvcite,jp,ibin) = store(inh4_a) - store(iso4_a)
10924 electrolyte(jnh4hso4,jp,ibin)= 3.*store(iso4_a) - 2.*store(inh4_a)
10925 electrolyte(jlvcite,jp,ibin) = max(0.D0, &
10926 electrolyte(jlvcite,jp,ibin))
10927 electrolyte(jnh4hso4,jp,ibin)= max(0.D0, &
10928 electrolyte(jnh4hso4,jp,ibin))
10933 end subroutine form_lvcite_nh4hso4
10937 subroutine form_na2so4_nahso4(store,jp,ibin) ! na2so4 + nahso4
10939 ! include 'mosaic.h'
10942 real(kind=8) store(naer)
10944 electrolyte(jna2so4,jp,ibin)= store(ina_a) - store(iso4_a)
10945 electrolyte(jnahso4,jp,ibin)= 2.*store(iso4_a) - store(ina_a)
10946 electrolyte(jna2so4,jp,ibin)= max(0.D0, &
10947 electrolyte(jna2so4,jp,ibin))
10948 electrolyte(jnahso4,jp,ibin)= max(0.D0, &
10949 electrolyte(jnahso4,jp,ibin))
10953 ! write(6,*)'na2so4 + nahso4'
10956 end subroutine form_na2so4_nahso4
10961 subroutine form_h2so4(store,jp,ibin)
10963 ! include 'mosaic.h'
10966 real(kind=8) store(naer)
10968 electrolyte(jh2so4,jp,ibin) = max(0.0D0, store(iso4_a))
10969 store(iso4_a) = 0.0
10972 end subroutine form_h2so4
10977 subroutine form_msa(store,jp,ibin)
10979 ! include 'mosaic.h'
10982 real(kind=8) store(naer)
10984 electrolyte(jmsa,jp,ibin) = max(0.0D0, store(imsa_a))
10985 store(imsa_a) = 0.0
10988 end subroutine form_msa
10992 subroutine form_hno3(store,jp,ibin)
10994 ! include 'mosaic.h'
10997 real(kind=8) store(naer)
10999 electrolyte(jhno3,jp,ibin) = max(0.0D0, store(ino3_a))
11000 store(ino3_a) = 0.0
11003 end subroutine form_hno3
11008 subroutine form_hcl(store,jp,ibin)
11010 ! include 'mosaic.h'
11013 real(kind=8) store(naer)
11015 electrolyte(jhcl,jp,ibin) = max(0.0D0, store(icl_a))
11019 end subroutine form_hcl
11024 subroutine degas_hno3(store,jp,ibin)
11026 ! include 'mosaic.h'
11029 real(kind=8) store(naer)
11031 store(ino3_a) = max(0.0D0, store(ino3_a))
11032 gas(ihno3_g) = gas(ihno3_g) + store(ino3_a)
11033 aer(ino3_a,jp,ibin) = aer(ino3_a,jp,ibin) - store(ino3_a)
11034 aer(ino3_a,jp,ibin) = max(0.0D0,aer(ino3_a,jp,ibin))
11036 ! also do it for jtotal
11037 if(jp .ne. jtotal)then
11038 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid, ibin) + &
11039 aer(ino3_a,jliquid,ibin)
11042 electrolyte(jhno3,jp,ibin) = 0.0
11043 store(ino3_a) = 0.0
11046 end subroutine degas_hno3
11050 subroutine degas_hcl(store,jp,ibin)
11052 ! include 'mosaic.h'
11055 real(kind=8) store(naer)
11057 store(icl_a) = max(0.0D0, store(icl_a))
11058 gas(ihcl_g) = gas(ihcl_g) + store(icl_a)
11059 aer(icl_a,jp,ibin) = aer(icl_a,jp,ibin) - store(icl_a)
11060 aer(icl_a,jp,ibin) = max(0.0D0,aer(icl_a,jp,ibin))
11062 ! also do it for jtotal
11063 if(jp .ne. jtotal)then
11064 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid, ibin) + &
11065 aer(icl_a,jliquid,ibin)
11068 electrolyte(jhcl,jp,ibin) = 0.0
11072 end subroutine degas_hcl
11076 subroutine degas_nh3(store,jp,ibin)
11078 ! include 'mosaic.h'
11081 real(kind=8) store(naer)
11083 store(inh4_a) = max(0.0D0, store(inh4_a))
11084 gas(inh3_g) = gas(inh3_g) + store(inh4_a)
11085 aer(inh4_a,jp,ibin) = aer(inh4_a,jp,ibin) - store(inh4_a)
11086 aer(inh4_a,jp,ibin) = max(0.0D0,aer(inh4_a,jp,ibin))
11088 ! also do it for jtotal
11089 if(jp .ne. jtotal)then
11090 aer(inh4_a,jtotal,ibin)= aer(inh4_a,jsolid, ibin) + &
11091 aer(inh4_a,jliquid,ibin)
11094 store(inh4_a) = 0.0
11097 end subroutine degas_nh3
11107 subroutine degas_acids(jp,ibin,xt)
11109 ! include 'mosaic.h'
11114 real(kind=8) ehno3, ehcl
11118 if(jp .ne. jliquid)then
11119 if (iprint_mosaic_diag1 .gt. 0) then
11120 write(6,*)'mosaic - error in degas_acids'
11121 write(6,*)'wrong jp'
11125 ehno3 = electrolyte(jhno3,jp,ibin)
11126 ehcl = electrolyte(jhcl,jp,ibin)
11129 gas(ihno3_g) = gas(ihno3_g) + ehno3
11130 gas(ihcl_g) = gas(ihcl_g) + ehcl
11133 aer(ino3_a,jp,ibin) = aer(ino3_a,jp,ibin) - ehno3
11134 aer(icl_a, jp,ibin) = aer(icl_a, jp,ibin) - ehcl
11137 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jliquid,ibin) + &
11138 aer(ino3_a,jsolid, ibin)
11140 aer(icl_a,jtotal,ibin) = aer(icl_a,jliquid,ibin) + &
11141 aer(icl_a,jsolid, ibin)
11143 electrolyte(jhno3,jp,ibin) = 0.0
11144 electrolyte(jhcl,jp,ibin) = 0.0
11147 end subroutine degas_acids
11162 !***********************************************************************
11163 ! subroutines to evaporate solid volatile species
11165 ! author: rahul a. zaveri
11167 !-----------------------------------------------------------------------
11170 subroutine degas_solid_nh4no3(ibin)
11172 ! include 'mosaic.h'
11177 real(kind=8) a, b, c, xgas, xt
11178 ! real(kind=8) quadratic ! mosaic func
11184 b = gas(inh3_g) + gas(ihno3_g)
11185 c = gas(inh3_g)*gas(ihno3_g) - keq_sg(1)
11186 xgas = quadratic(a,b,c)
11188 if(xgas .ge. electrolyte(jnh4no3,jp,ibin))then ! degas all nh4no3
11190 gas(inh3_g) = gas(inh3_g) + electrolyte(jnh4no3,jp,ibin)
11191 gas(ihno3_g)= gas(ihno3_g) + electrolyte(jnh4no3,jp,ibin)
11192 aer(inh4_a,jp,ibin) = aer(inh4_a,jp,ibin) - &
11193 electrolyte(jnh4no3,jp,ibin)
11194 aer(ino3_a,jp,ibin) = aer(ino3_a,jp,ibin) - &
11195 electrolyte(jnh4no3,jp,ibin)
11197 else ! degas only xgas amount of nh4no3
11199 gas(inh3_g) = gas(inh3_g) + xgas
11200 gas(ihno3_g)= gas(ihno3_g) + xgas
11201 aer(inh4_a,jp,ibin) = aer(inh4_a,jp,ibin) - xgas
11202 aer(ino3_a,jp,ibin) = aer(ino3_a,jp,ibin) - xgas
11207 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin) + &
11208 aer(inh4_a,jliquid,ibin)
11209 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid,ibin) + &
11210 aer(ino3_a,jliquid,ibin)
11213 end subroutine degas_solid_nh4no3
11224 subroutine degas_solid_nh4cl(ibin)
11226 ! include 'mosaic.h'
11231 real(kind=8) a, b, c, xgas, xt
11232 ! real(kind=8) quadratic ! mosaic func
11238 b = gas(inh3_g) + gas(ihcl_g)
11239 c = gas(inh3_g)*gas(ihcl_g) - keq_sg(2)
11240 xgas = quadratic(a,b,c)
11242 if(xgas .ge. electrolyte(jnh4cl,jp,ibin))then ! degas all nh4cl
11244 gas(inh3_g) = gas(inh3_g) + electrolyte(jnh4cl,jp,ibin)
11245 gas(ihcl_g) = gas(ihcl_g) + electrolyte(jnh4cl,jp,ibin)
11246 aer(inh4_a,jp,ibin) = aer(inh4_a,jp,ibin) - &
11247 electrolyte(jnh4cl,jp,ibin)
11248 aer(icl_a,jp,ibin) = aer(icl_a,jp,ibin) - &
11249 electrolyte(jnh4cl,jp,ibin)
11251 else ! degas only xgas amount of nh4cl
11253 gas(inh3_g) = gas(inh3_g) + xgas
11254 gas(ihcl_g) = gas(ihcl_g) + xgas
11255 aer(inh4_a,jp,ibin) = aer(inh4_a,jp,ibin) - xgas
11256 aer(icl_a,jp,ibin) = aer(icl_a,jp,ibin) - xgas
11262 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin) + &
11263 aer(inh4_a,jliquid,ibin)
11264 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid,ibin) + &
11265 aer(icl_a,jliquid,ibin)
11268 end subroutine degas_solid_nh4cl
11280 !***********************************************************************
11281 ! subroutines to absorb and degas small amounts of volatile species
11283 ! author: rahul a. zaveri
11285 !-----------------------------------------------------------------------
11288 subroutine absorb_tiny_nh4no3(ibin)
11290 ! include 'mosaic.h'
11294 real(kind=8) small_aer, small_gas, small_amt
11295 integer je ! raz update 11/13/2008
11299 electrolyte_sum(jtotal,ibin) = 0.0 ! raz update 11/13/2008
11300 do je = 1, nelectrolyte
11301 electrolyte_sum(jtotal,ibin) = electrolyte_sum(jtotal,ibin) + &
11302 electrolyte(je,jtotal,ibin)
11306 small_gas = 0.01 * min(gas(inh3_g), gas(ihno3_g))
11307 small_aer = 0.01 * electrolyte_sum(jtotal,ibin)
11308 if(small_aer .eq. 0.0)small_aer = small_gas
11310 small_amt = min(small_gas, small_aer)
11312 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + small_amt
11313 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) + small_amt
11316 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin) + &
11317 aer(inh4_a,jliquid,ibin)
11318 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid,ibin) + &
11319 aer(ino3_a,jliquid,ibin)
11322 gas(inh3_g) = gas(inh3_g) - small_amt
11323 gas(ihno3_g) = gas(ihno3_g) - small_amt
11326 end subroutine absorb_tiny_nh4no3
11333 !--------------------------------------------------------------------
11335 subroutine absorb_tiny_nh4cl(ibin)
11337 ! include 'mosaic.h'
11341 real(kind=8) small_aer, small_gas, small_amt
11342 integer je ! raz update 11/13/2008
11346 electrolyte_sum(jtotal,ibin) = 0.0 ! raz update 11/13/2008
11347 do je = 1, nelectrolyte
11348 electrolyte_sum(jtotal,ibin) = electrolyte_sum(jtotal,ibin) + &
11349 electrolyte(je,jtotal,ibin)
11353 small_gas = 0.01 * min(gas(inh3_g), gas(ihcl_g))
11354 small_aer = 0.01 * electrolyte_sum(jtotal,ibin)
11355 if(small_aer .eq. 0.0)small_aer = small_gas
11357 small_amt = min(small_gas, small_aer)
11359 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) + small_amt
11360 aer(icl_a,jliquid,ibin) = aer(icl_a,jliquid,ibin) + small_amt
11363 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin) + &
11364 aer(inh4_a,jliquid,ibin)
11365 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid,ibin) + &
11366 aer(icl_a,jliquid,ibin)
11369 gas(inh3_g) = gas(inh3_g) - small_amt
11370 gas(ihcl_g) = gas(ihcl_g) - small_amt
11373 end subroutine absorb_tiny_nh4cl
11387 !--------------------------------------------------------------
11389 subroutine degas_tiny_nh4no3(ibin)
11391 ! include 'mosaic.h'
11395 real(kind=8) small_amt
11397 small_amt = 0.01 * electrolyte(jnh4no3,jliquid,ibin)
11399 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) - small_amt
11400 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) - small_amt
11403 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin) + &
11404 aer(inh4_a,jliquid,ibin)
11405 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid,ibin) + &
11406 aer(ino3_a,jliquid,ibin)
11409 gas(inh3_g) = gas(inh3_g) + small_amt
11410 gas(ihno3_g) = gas(ihno3_g) + small_amt
11413 end subroutine degas_tiny_nh4no3
11418 !--------------------------------------------------------------------
11419 ! liquid nh4cl (liquid)
11420 subroutine degas_tiny_nh4cl(ibin)
11422 ! include 'mosaic.h'
11426 real(kind=8) small_amt
11429 small_amt = 0.01 * electrolyte(jnh4cl,jliquid,ibin)
11431 aer(inh4_a,jliquid,ibin) = aer(inh4_a,jliquid,ibin) - small_amt
11432 aer(icl_a,jliquid,ibin) = aer(icl_a,jliquid,ibin) - small_amt
11435 aer(inh4_a,jtotal,ibin) = aer(inh4_a,jsolid,ibin) + &
11436 aer(inh4_a,jliquid,ibin)
11437 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid,ibin) + &
11438 aer(icl_a,jliquid,ibin)
11441 gas(inh3_g) = gas(inh3_g) + small_amt
11442 gas(ihcl_g) = gas(ihcl_g) + small_amt
11445 end subroutine degas_tiny_nh4cl
11453 !--------------------------------------------------------------------
11455 subroutine absorb_tiny_hcl(ibin) ! and degas tiny hno3
11457 ! include 'mosaic.h'
11461 real(kind=8) small_aer, small_amt, small_gas
11463 small_gas = 0.01 * gas(ihcl_g)
11464 small_aer = 0.01 * aer(ino3_a,jliquid,ibin)
11466 small_amt = min(small_gas, small_aer)
11469 aer(icl_a,jliquid,ibin)= aer(icl_a,jliquid,ibin) + small_amt
11470 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid,ibin) + &
11471 aer(icl_a,jliquid,ibin)
11472 gas(ihcl_g) = gas(ihcl_g) - small_amt
11475 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) - small_amt
11476 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid,ibin) + &
11477 aer(ino3_a,jliquid,ibin)
11480 gas(ihno3_g) = gas(ihno3_g) + small_amt
11483 end subroutine absorb_tiny_hcl
11487 !--------------------------------------------------------------------
11489 subroutine absorb_tiny_hno3(ibin) ! and degas tiny hcl
11491 ! include 'mosaic.h'
11495 real(kind=8) small_aer, small_amt, small_gas
11497 small_gas = 0.01 * gas(ihno3_g)
11498 small_aer = 0.01 * aer(icl_a,jliquid,ibin)
11500 small_amt = min(small_gas, small_aer)
11503 aer(ino3_a,jliquid,ibin) = aer(ino3_a,jliquid,ibin) + small_amt
11504 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jsolid,ibin) + &
11505 aer(ino3_a,jliquid,ibin)
11506 gas(ihno3_g) = gas(ihno3_g) - small_amt
11509 aer(icl_a,jliquid,ibin) = aer(icl_a,jliquid,ibin) - small_amt
11510 aer(icl_a,jtotal,ibin) = aer(icl_a,jsolid,ibin) + &
11511 aer(icl_a,jliquid,ibin)
11514 gas(ihcl_g) = gas(ihcl_g) + small_amt
11517 end subroutine absorb_tiny_hno3
11527 !***********************************************************************
11528 ! subroutines to equilibrate volatile acids
11530 ! author: rahul a. zaveri
11532 !-----------------------------------------------------------------------
11533 subroutine equilibrate_acids(ibin)
11535 ! include 'mosaic.h'
11541 if(gas(ihcl_g)*gas(ihno3_g) .gt. 0.)then
11542 call equilibrate_hcl_and_hno3(ibin)
11543 elseif(gas(ihcl_g) .gt. 0.)then
11544 call equilibrate_hcl(ibin)
11545 elseif(gas(ihno3_g) .gt. 0.)then
11546 call equilibrate_hno3(ibin)
11551 end subroutine equilibrate_acids
11561 subroutine equilibrate_hcl(ibin)
11563 ! include 'mosaic.h'
11567 real(kind=8) a, aerh, aerhso4, aerso4, b, c, dum, kdash_hcl, mh, tcl, &
11569 ! real(kind=8) quadratic ! mosaic func
11571 aerso4 = ma(ja_so4,ibin)*water_a(ibin)*1.e+9
11572 aerhso4= ma(ja_hso4,ibin)*water_a(ibin)*1.e+9
11574 tcl = aer(icl_a,jliquid,ibin) + gas(ihcl_g) ! nmol/m^3(air)
11575 kdash_hcl = keq_gl(4)*1.e+18/gam(jhcl,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11576 z = ( aer(ina_a, jliquid,ibin) + & ! nmol/m^3(air)
11577 aer(inh4_a,jliquid,ibin) + &
11578 2.*aer(ica_a, jliquid,ibin) ) - &
11581 aer(ino3_a,jliquid,ibin) )
11584 w = water_a(ibin) ! kg/m^3(air)
11586 kdash_hcl = keq_gl(4)*1.e+18/gam(jhcl,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11588 b = (kdash_hcl*w + z/w)*1.e-9
11589 c = kdash_hcl*(z - tcl)*1.e-18
11593 if (dum .lt. 0.) return ! no real root
11597 mh = quadratic(a,b,c) ! mol/kg(water)
11599 aer(icl_a,jliquid,ibin) = aerh + z
11601 mh = sqrt(keq_ll(3))
11604 call form_electrolytes(jliquid,ibin,xt)
11606 ! update gas phase concentration
11607 gas(ihcl_g) = tcl - aer(icl_a,jliquid,ibin)
11610 ! update the following molalities
11611 ma(ja_so4,ibin) = 1.e-9*aerso4/water_a(ibin)
11612 ma(ja_hso4,ibin) = 1.e-9*aerhso4/water_a(ibin)
11613 ma(ja_no3,ibin) = 1.e-9*aer(ino3_a,jliquid,ibin)/water_a(ibin)
11614 ma(ja_cl,ibin) = 1.e-9*aer(icl_a, jliquid,ibin)/water_a(ibin)
11617 mc(jc_ca,ibin) = 1.e-9*aer(ica_a, jliquid,ibin)/water_a(ibin)
11618 mc(jc_nh4,ibin) = 1.e-9*aer(inh4_a,jliquid,ibin)/water_a(ibin)
11619 mc(jc_na,ibin) = 1.e-9*aer(ina_a, jliquid,ibin)/water_a(ibin)
11622 ! update the following activities
11623 activity(jhcl,ibin) = mc(jc_h,ibin) *ma(ja_cl,ibin) * &
11626 activity(jhno3,ibin) = mc(jc_h,ibin) *ma(ja_no3,ibin) * &
11629 activity(jnh4cl,ibin) = mc(jc_nh4,ibin)*ma(ja_cl,ibin) * &
11630 gam(jnh4cl,ibin)**2
11633 ! also update xyz(jtotal)
11634 aer(icl_a,jtotal,ibin) = aer(icl_a,jliquid,ibin) + &
11635 aer(icl_a,jsolid,ibin)
11637 electrolyte(jhcl,jtotal,ibin) = electrolyte(jhcl,jliquid,ibin)
11640 end subroutine equilibrate_hcl
11646 subroutine equilibrate_hno3(ibin)
11648 ! include 'mosaic.h'
11652 real(kind=8) a, aerh, aerhso4, aerso4, b, c, dum, kdash_hno3, mh, &
11654 ! real(kind=8) quadratic ! mosaic func
11656 aerso4 = ma(ja_so4,ibin)*water_a(ibin)*1.e+9
11657 aerhso4= ma(ja_hso4,ibin)*water_a(ibin)*1.e+9
11659 tno3 = aer(ino3_a,jliquid,ibin) + gas(ihno3_g) ! nmol/m^3(air)
11660 kdash_hno3 = keq_gl(3)*1.e+18/gam(jhno3,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11661 z = ( aer(ina_a, jliquid,ibin) + & ! nmol/m^3(air)
11662 aer(inh4_a,jliquid,ibin) + &
11663 2.*aer(ica_a, jliquid,ibin) ) - &
11666 aer(icl_a,jliquid,ibin) )
11669 w = water_a(ibin) ! kg/m^3(air)
11671 kdash_hno3 = keq_gl(3)*1.e+18/gam(jhno3,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11673 b = (kdash_hno3*w + z/w)*1.e-9
11674 c = kdash_hno3*(z - tno3)*1.e-18
11677 if (dum .lt. 0.) return ! no real root
11682 mh = quadratic(a,b,c) ! mol/kg(water)
11684 aer(ino3_a,jliquid,ibin) = aerh + z
11686 mh = sqrt(keq_ll(3))
11689 call form_electrolytes(jliquid,ibin,xt)
11691 ! update gas phase concentration
11692 gas(ihno3_g)= tno3 - aer(ino3_a,jliquid,ibin)
11695 ! update the following molalities
11696 ma(ja_so4,ibin) = 1.e-9*aerso4/water_a(ibin)
11697 ma(ja_hso4,ibin) = 1.e-9*aerhso4/water_a(ibin)
11698 ma(ja_no3,ibin) = 1.e-9*aer(ino3_a,jliquid,ibin)/water_a(ibin)
11699 ma(ja_cl,ibin) = 1.e-9*aer(icl_a, jliquid,ibin)/water_a(ibin)
11702 mc(jc_ca,ibin) = 1.e-9*aer(ica_a, jliquid,ibin)/water_a(ibin)
11703 mc(jc_nh4,ibin) = 1.e-9*aer(inh4_a,jliquid,ibin)/water_a(ibin)
11704 mc(jc_na,ibin) = 1.e-9*aer(ina_a, jliquid,ibin)/water_a(ibin)
11707 ! update the following activities
11708 activity(jhcl,ibin) = mc(jc_h,ibin) *ma(ja_cl,ibin) * &
11711 activity(jhno3,ibin) = mc(jc_h,ibin) *ma(ja_no3,ibin) * &
11714 activity(jnh4no3,ibin) = mc(jc_nh4,ibin)*ma(ja_no3,ibin) * &
11715 gam(jnh4no3,ibin)**2
11718 ! also update xyz(jtotal)
11719 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jliquid,ibin) + &
11720 aer(ino3_a,jsolid,ibin)
11722 electrolyte(jhno3,jtotal,ibin) = electrolyte(jhno3,jliquid,ibin)
11725 end subroutine equilibrate_hno3
11736 ! both hcl and hno3
11737 subroutine equilibrate_hcl_and_hno3(ibin)
11739 ! include 'mosaic.h'
11743 real(kind=8) aerh, aerhso4, aerso4, kdash_hcl, kdash_hno3, &
11744 mh, p, q, r, tcl, tno3, w, xt, z
11745 ! real(kind=8) cubic ! mosaic func
11748 aerso4 = ma(ja_so4,ibin)*water_a(ibin)*1.e+9
11749 aerhso4= ma(ja_hso4,ibin)*water_a(ibin)*1.e+9
11751 tcl = aer(icl_a,jliquid,ibin) + gas(ihcl_g) ! nmol/m^3(air)
11752 tno3 = aer(ino3_a,jliquid,ibin) + gas(ihno3_g) ! nmol/m^3(air)
11754 kdash_hcl = keq_gl(4)*1.e+18/gam(jhcl,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11755 kdash_hno3 = keq_gl(3)*1.e+18/gam(jhno3,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11757 z = ( aer(ina_a, jliquid,ibin) + & ! nmol/m^3(air)
11758 aer(inh4_a,jliquid,ibin) + &
11759 2.*aer(ica_a, jliquid,ibin) ) - &
11760 (2.*aerso4 + aerhso4 )
11765 kdash_hcl = keq_gl(4)*1.e+18/gam(jhcl,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11766 kdash_hno3 = keq_gl(3)*1.e+18/gam(jhno3,ibin)**2 ! (nmol^2/kg^2)/(nmol/m^3(air))
11768 p = (z/w + w*(kdash_hcl + kdash_hno3))*1.e-9
11770 q = 1.e-18*kdash_hcl*kdash_hno3*w**2 + &
11771 1.e-18*z*(kdash_hcl + kdash_hno3) - &
11772 1.e-18*kdash_hcl*tcl - &
11773 1.e-18*kdash_hno3*tno3
11775 r = 1.e-18*kdash_hcl*kdash_hno3*w*(z - tcl - tno3)*1.e-9
11779 if(mh .gt. 0.0)then
11781 aer(ino3_a,jliquid,ibin) = kdash_hno3*w*w*tno3/ &
11782 (aerh + kdash_hno3*w*w)
11783 aer(icl_a, jliquid,ibin) = kdash_hcl*w*w*tcl/ &
11784 (aerh + kdash_hcl*w*w)
11786 mh = sqrt(keq_ll(3))
11789 call form_electrolytes(jliquid,ibin,xt)
11791 ! update gas phase concentration
11792 gas(ihno3_g)= tno3 - aer(ino3_a,jliquid,ibin)
11793 gas(ihcl_g) = tcl - aer(icl_a,jliquid,ibin)
11796 ! update the following molalities
11797 ma(ja_so4,ibin) = 1.e-9*aerso4/water_a(ibin)
11798 ma(ja_hso4,ibin) = 1.e-9*aerhso4/water_a(ibin)
11799 ma(ja_no3,ibin) = 1.e-9*aer(ino3_a,jliquid,ibin)/water_a(ibin)
11800 ma(ja_cl,ibin) = 1.e-9*aer(icl_a, jliquid,ibin)/water_a(ibin)
11803 mc(jc_ca,ibin) = 1.e-9*aer(ica_a, jliquid,ibin)/water_a(ibin)
11804 mc(jc_nh4,ibin) = 1.e-9*aer(inh4_a,jliquid,ibin)/water_a(ibin)
11805 mc(jc_na,ibin) = 1.e-9*aer(ina_a, jliquid,ibin)/water_a(ibin)
11808 ! update the following activities
11809 activity(jhcl,ibin) = mc(jc_h,ibin)*ma(ja_cl,ibin) * &
11812 activity(jhno3,ibin) = mc(jc_h,ibin)*ma(ja_no3,ibin) * &
11815 activity(jnh4no3,ibin) = mc(jc_nh4,ibin)*ma(ja_no3,ibin)* &
11816 gam(jnh4no3,ibin)**2
11818 activity(jnh4cl,ibin) = mc(jc_nh4,ibin)*ma(ja_cl,ibin) * &
11819 gam(jnh4cl,ibin)**2
11822 ! also update xyz(jtotal)
11823 aer(icl_a,jtotal,ibin) = aer(icl_a,jliquid,ibin) + &
11824 aer(icl_a,jsolid,ibin)
11826 aer(ino3_a,jtotal,ibin) = aer(ino3_a,jliquid,ibin) + &
11827 aer(ino3_a,jsolid,ibin)
11829 electrolyte(jhno3,jtotal,ibin) = electrolyte(jhno3,jliquid,ibin)
11830 electrolyte(jhcl, jtotal,ibin) = electrolyte(jhcl, jliquid,ibin)
11833 end subroutine equilibrate_hcl_and_hno3
11847 !***********************************************************************
11848 ! called only once per entire simulation to load gas and aerosol
11849 ! indices, parameters, physico-chemical constants, polynomial coeffs, etc.
11851 ! author: rahul a. zaveri
11853 !-----------------------------------------------------------------------
11854 subroutine load_mosaic_parameters
11856 ! include 'v33com2'
11857 ! include 'mosaic.h'
11859 integer iaer, je, ja, j_index, ibin
11862 ! data first/.true./
11863 logical, save :: first = .true.
11870 !----------------------------------------------------------------
11872 msize_framework = msection ! mmodal or msection
11873 mgas_aer_xfer = myes ! myes, mno
11876 nmax_astem = 200 ! max number of time steps in astem
11877 alpha_astem = 0.05 ! choose a value between 0.01 and 1.0
11878 ! Changed alpha_astem from 0.5 to 0.05 by Manish Shrivastava on 01/08/2010
11879 rtol_eqb_astem = 0.01 ! equilibrium tolerance in astem
11880 ptol_mol_astem = 0.01 ! mol percent tolerance in astem
11883 nmax_mesa = 80 ! max number of iterations in mesa_ptc
11884 rtol_mesa = 0.01 ! mesa equilibrium tolerance
11885 !----------------------------------------------------------------
11887 ! set gas and aerosol indices
11892 ih2so4_g = 1 ! ioa (inorganic aerosol)
11983 ! in2o5_g =92 ! ioa --> NO3-
11984 ! iclno2_g =93 ! ioa N2O5+Cl- -->
11985 ! the order of species is ngas_ioa, then ngas_soa, then the rest...
11986 ! for the "equilibrium" routine i*_a and i*_g species
11987 ! have to have the same index.
11998 in2o5_g =102 ! ioa --> NO3-
11999 iclno2_g =103 ! ioa N2O5+Cl- -->
12005 ! ico2_g = 14 ! currently not used
12007 ! aerosol (local): used for total species
12008 iso4_a = 1 ! <-> ih2so4_g
12009 ino3_a = 2 ! <-> ihno3_g
12010 icl_a = 3 ! <-> ihcl_g
12011 inh4_a = 4 ! <-> inh3_g
12012 imsa_a = 5 ! <-> imsa_g
12099 ! for the "equilibrium" routine,
12100 ! i*_g and i*_a species have to have the same index...
12101 ! ico3_a = 92 ! <-> ico2_g ! ico3_a was 14 earlier, changed to 82 by Manish Shrivastava
12119 iglysoa_sfc_a = 104
12120 iglysoa_nh4_a = 105
12123 ico3_a = 107 ! <-> ico2_g ! ico3_a was 14 earlier, changed to 82 by Manish Shrivastava
12130 ! electrolyte indices (used for water content calculations)
12131 ! these indices are order sensitive
12133 jnh4so4 = 1 ! soluble
12134 jlvcite = 2 ! soluble
12135 jnh4hso4 = 3 ! soluble
12136 jnh4msa = 4 ! soluble new
12137 jnh4no3 = 5 ! soluble
12138 jnh4cl = 6 ! soluble
12139 jna2so4 = 7 ! soluble
12140 jna3hso4 = 8 ! soluble
12141 jnahso4 = 9 ! soluble
12142 jnamsa = 10 ! soluble new
12143 jnano3 = 11 ! soluble
12144 jnacl = 12 ! soluble
12145 jcano3 = 13 ! soluble
12146 jcacl2 = 14 ! soluble
12147 jcamsa2 = 15 ! soluble new nsalt
12148 jh2so4 = 16 ! soluble
12149 jmsa = 17 ! soluble new
12150 jhno3 = 18 ! soluble
12151 jhcl = 19 ! soluble
12152 jhhso4 = 20 ! soluble
12153 jcaso4 = 21 ! insoluble
12154 jcaco3 = 22 ! insoluble
12155 joc = 23 ! insoluble - part of naercomp
12156 jbc = 24 ! insoluble - part of naercomp
12157 join = 25 ! insoluble - part of naercomp
12244 ! jh2o = 112 ! water - part of naercomp
12260 jh2o = 127 ! water - part of naercomp
12262 ! local aerosol ions
12277 !--------------------------------------------------------------------
12278 ! phase state names
12279 ! phasestate(no_aerosol) = "NOAERO"
12280 ! phasestate(all_solid) = "SOLID "
12281 ! phasestate(all_liquid) = "LIQUID"
12282 ! phasestate(mixed) = "MIXED "
12284 ! names of aer species
12285 aer_name(iso4_a) = 'so4'
12286 aer_name(ino3_a) = 'no3'
12287 aer_name(icl_a) = 'cl '
12288 aer_name(inh4_a) = 'nh4'
12289 aer_name(ioc_a) = 'oc '
12290 aer_name(imsa_a) = 'msa'
12291 aer_name(ico3_a) = 'co3'
12292 aer_name(ina_a) = 'na '
12293 aer_name(ica_a) = 'ca '
12294 aer_name(ibc_a) = 'bc '
12295 aer_name(ioin_a) = 'oin'
12296 aer_name(ipcg1_b_c_a)="pcg1_b_c"
12297 aer_name(ipcg2_b_c_a)="pcg2_b_c"
12298 aer_name(ipcg3_b_c_a)="pcg3_b_c"
12299 aer_name(ipcg4_b_c_a)="pcg4_b_c"
12300 aer_name(ipcg5_b_c_a)="pcg5_b_c"
12301 aer_name(ipcg6_b_c_a)="pcg6_b_c"
12302 aer_name(ipcg7_b_c_a)="pcg7_b_c"
12303 aer_name(ipcg8_b_c_a)="pcg8_b_c"
12304 aer_name(ipcg9_b_c_a)="pcg9_b_c"
12305 aer_name(iopcg1_b_c_a)="opcg1_b_c"
12306 aer_name(iopcg2_b_c_a)="opcg2_b_c"
12307 aer_name(iopcg3_b_c_a)="opcg3_b_c"
12308 aer_name(iopcg4_b_c_a)="opcg4_b_c"
12309 aer_name(iopcg5_b_c_a)="opcg5_b_c"
12310 aer_name(iopcg6_b_c_a)="opcg6_b_c"
12311 aer_name(iopcg7_b_c_a)="opcg7_b_c"
12312 aer_name(iopcg8_b_c_a)="opcg8_b_c"
12313 aer_name(ipcg1_b_o_a)="pcg1_b_o"
12314 aer_name(ipcg2_b_o_a)="pcg2_b_o"
12315 aer_name(ipcg3_b_o_a)="pcg3_b_o"
12316 aer_name(ipcg4_b_o_a)="pcg4_b_o"
12317 aer_name(ipcg5_b_o_a)="pcg5_b_o"
12318 aer_name(ipcg6_b_o_a)="pcg6_b_o"
12319 aer_name(ipcg7_b_o_a)="pcg7_b_o"
12320 aer_name(ipcg8_b_o_a)="pcg8_b_o"
12321 aer_name(ipcg9_b_o_a)="pcg9_b_o"
12322 aer_name(iopcg1_b_o_a)="opcg1_b_o"
12323 aer_name(iopcg2_b_o_a)="opcg2_b_o"
12324 aer_name(iopcg3_b_o_a)="opcg3_b_o"
12325 aer_name(iopcg4_b_o_a)="opcg4_b_o"
12326 aer_name(iopcg5_b_o_a)="opcg5_b_o"
12327 aer_name(iopcg6_b_o_a)="opcg6_b_o"
12328 aer_name(iopcg7_b_o_a)="opcg7_b_o"
12329 aer_name(iopcg8_b_o_a)="opcg8_b_o"
12330 aer_name(ipcg1_f_c_a)="pcg1_f_c"
12331 aer_name(ipcg2_f_c_a)="pcg2_f_c"
12332 aer_name(ipcg3_f_c_a)="pcg3_f_c"
12333 aer_name(ipcg4_f_c_a)="pcg4_f_c"
12334 aer_name(ipcg5_f_c_a)="pcg5_f_c"
12335 aer_name(ipcg6_f_c_a)="pcg6_f_c"
12336 aer_name(ipcg7_f_c_a)="pcg7_f_c"
12337 aer_name(ipcg8_f_c_a)="pcg8_f_c"
12338 aer_name(ipcg9_f_c_a)="pcg9_f_c"
12339 aer_name(iopcg1_f_c_a)="opcg1_f_c"
12340 aer_name(iopcg2_f_c_a)="opcg2_f_c"
12341 aer_name(iopcg3_f_c_a)="opcg3_f_c"
12342 aer_name(iopcg4_f_c_a)="opcg4_f_c"
12343 aer_name(iopcg5_f_c_a)="opcg5_f_c"
12344 aer_name(iopcg6_f_c_a)="opcg6_f_c"
12345 aer_name(iopcg7_f_c_a)="opcg7_f_c"
12346 aer_name(iopcg8_f_c_a)="opcg8_f_c"
12347 aer_name(ipcg1_f_o_a)="pcg1_f_o"
12348 aer_name(ipcg2_f_o_a)="pcg2_f_o"
12349 aer_name(ipcg3_f_o_a)="pcg3_f_o"
12350 aer_name(ipcg4_f_o_a)="pcg4_f_o"
12351 aer_name(ipcg5_f_o_a)="pcg5_f_o"
12352 aer_name(ipcg6_f_o_a)="pcg6_f_o"
12353 aer_name(ipcg7_f_o_a)="pcg7_f_o"
12354 aer_name(ipcg8_f_o_a)="pcg8_f_o"
12355 aer_name(ipcg9_f_o_a)="pcg9_f_o"
12356 aer_name(iopcg1_f_o_a)="opcg1_f_o"
12357 aer_name(iopcg2_f_o_a)="opcg2_f_o"
12358 aer_name(iopcg3_f_o_a)="opcg3_f_o"
12359 aer_name(iopcg4_f_o_a)="opcg4_f_o"
12360 aer_name(iopcg5_f_o_a)="opcg5_f_o"
12361 aer_name(iopcg6_f_o_a)="opcg6_f_o"
12362 aer_name(iopcg7_f_o_a)="opcg7_f_o"
12363 aer_name(iopcg8_f_o_a)="opcg8_f_o"
12364 aer_name(ismpa_a)="smpa"
12365 aer_name(ismpbb_a)="smpbb"
12366 aer_name(iglysoa_r1_a)="glysoa_r1"
12367 aer_name(iglysoa_r2_a)="glysoa_r2"
12368 aer_name(iglysoa_sfc_a)="glysoa_sfc"
12369 aer_name(iglysoa_nh4_a)="glysoa_nh4"
12370 aer_name(iglysoa_oh_a)="glysoa_oh"
12371 aer_name(iant1_c_a)="ant1_c"
12372 aer_name(iant2_c_a)="ant2_c"
12373 aer_name(iant3_c_a)="ant3_c"
12374 aer_name(iant4_c_a)="ant4_c"
12375 aer_name(iant1_o_a)="ant1_o"
12376 aer_name(iant2_o_a)="ant2_o"
12377 aer_name(iant3_o_a)="ant3_o"
12378 aer_name(iant4_o_a)="ant4_o"
12379 aer_name(ibiog1_c_a)="biog1_c"
12380 aer_name(ibiog2_c_a)="biog2_c"
12381 aer_name(ibiog3_c_a)="biog3_c"
12382 aer_name(ibiog4_c_a)="biog4_c"
12383 aer_name(ibiog1_o_a)="biog1_o"
12384 aer_name(ibiog2_o_a)="biog2_o"
12385 aer_name(ibiog3_o_a)="biog3_o"
12386 aer_name(ibiog4_o_a)="biog4_o"
12387 aer_name(iasoaX_a)="asoaX"
12388 aer_name(iasoa1_a)="asoa1"
12389 aer_name(iasoa2_a)="asoa2"
12390 aer_name(iasoa3_a)="asoa3"
12391 aer_name(iasoa4_a)="asoa4"
12392 aer_name(ibsoaX_a)="bsoaX"
12393 aer_name(ibsoa1_a)="bsoa1"
12394 aer_name(ibsoa2_a)="bsoa2"
12395 aer_name(ibsoa3_a)="bsoa3"
12396 aer_name(ibsoa4_a)="bsoa4"
12398 ! names of gas species
12399 gas_name(ih2so4_g) = 'h2so4'
12400 gas_name(ihno3_g) = 'hno3 '
12401 gas_name(ihcl_g) = 'hcl '
12402 gas_name(inh3_g) = 'nh3 '
12403 gas_name(imsa_g) = "msa "
12404 gas_name(ipcg1_b_c_g)="pcg1_b_c"
12405 gas_name(ipcg2_b_c_g)="pcg2_b_c"
12406 gas_name(ipcg3_b_c_g)="pcg3_b_c"
12407 gas_name(ipcg4_b_c_g)="pcg4_b_c"
12408 gas_name(ipcg5_b_c_g)="pcg5_b_c"
12409 gas_name(ipcg6_b_c_g)="pcg6_b_c"
12410 gas_name(ipcg7_b_c_g)="pcg7_b_c"
12411 gas_name(ipcg8_b_c_g)="pcg8_b_c"
12412 gas_name(ipcg9_b_c_g)="pcg9_b_c"
12413 gas_name(iopcg1_b_c_g)="opcg1_b_c"
12414 gas_name(iopcg2_b_c_g)="opcg2_b_c"
12415 gas_name(iopcg3_b_c_g)="opcg3_b_c"
12416 gas_name(iopcg4_b_c_g)="opcg4_b_c"
12417 gas_name(iopcg5_b_c_g)="opcg5_b_c"
12418 gas_name(iopcg6_b_c_g)="opcg6_b_c"
12419 gas_name(iopcg7_b_c_g)="opcg7_b_c"
12420 gas_name(iopcg8_b_c_g)="opcg8_b_c"
12421 gas_name(ipcg1_b_o_g)="pcg1_b_o"
12422 gas_name(ipcg2_b_o_g)="pcg2_b_o"
12423 gas_name(ipcg3_b_o_g)="pcg3_b_o"
12424 gas_name(ipcg4_b_o_g)="pcg4_b_o"
12425 gas_name(ipcg5_b_o_g)="pcg5_b_o"
12426 gas_name(ipcg6_b_o_g)="pcg6_b_o"
12427 gas_name(ipcg7_b_o_g)="pcg7_b_o"
12428 gas_name(ipcg8_b_o_g)="pcg8_b_o"
12429 gas_name(ipcg9_b_o_g)="pcg9_b_o"
12430 gas_name(iopcg1_b_o_g)="opcg1_b_o"
12431 gas_name(iopcg2_b_o_g)="opcg2_b_o"
12432 gas_name(iopcg3_b_o_g)="opcg3_b_o"
12433 gas_name(iopcg4_b_o_g)="opcg4_b_o"
12434 gas_name(iopcg5_b_o_g)="opcg5_b_o"
12435 gas_name(iopcg6_b_o_g)="opcg6_b_o"
12436 gas_name(iopcg7_b_o_g)="opcg7_b_o"
12437 gas_name(iopcg8_b_o_g)="opcg8_b_o"
12438 gas_name(ipcg1_f_c_g)="pcg1_f_c"
12439 gas_name(ipcg2_f_c_g)="pcg2_f_c"
12440 gas_name(ipcg3_f_c_g)="pcg3_f_c"
12441 gas_name(ipcg4_f_c_g)="pcg4_f_c"
12442 gas_name(ipcg5_f_c_g)="pcg5_f_c"
12443 gas_name(ipcg6_f_c_g)="pcg6_f_c"
12444 gas_name(ipcg7_f_c_g)="pcg7_f_c"
12445 gas_name(ipcg8_f_c_g)="pcg8_f_c"
12446 gas_name(ipcg9_f_c_g)="pcg9_f_c"
12447 gas_name(iopcg1_f_c_g)="opcg1_f_c"
12448 gas_name(iopcg2_f_c_g)="opcg2_f_c"
12449 gas_name(iopcg3_f_c_g)="opcg3_f_c"
12450 gas_name(iopcg4_f_c_g)="opcg4_f_c"
12451 gas_name(iopcg5_f_c_g)="opcg5_f_c"
12452 gas_name(iopcg6_f_c_g)="opcg6_f_c"
12453 gas_name(iopcg7_f_c_g)="opcg7_f_c"
12454 gas_name(iopcg8_f_c_g)="opcg8_f_c"
12455 gas_name(ipcg1_f_o_g)="pcg1_f_o"
12456 gas_name(ipcg2_f_o_g)="pcg2_f_o"
12457 gas_name(ipcg3_f_o_g)="pcg3_f_o"
12458 gas_name(ipcg4_f_o_g)="pcg4_f_o"
12459 gas_name(ipcg5_f_o_g)="pcg5_f_o"
12460 gas_name(ipcg6_f_o_g)="pcg6_f_o"
12461 gas_name(ipcg7_f_o_g)="pcg7_f_o"
12462 gas_name(ipcg8_f_o_g)="pcg8_f_o"
12463 gas_name(ipcg9_f_o_g)="pcg9_f_o"
12464 gas_name(iopcg1_f_o_g)="opcg1_f_o"
12465 gas_name(iopcg2_f_o_g)="opcg2_f_o"
12466 gas_name(iopcg3_f_o_g)="opcg3_f_o"
12467 gas_name(iopcg4_f_o_g)="opcg4_f_o"
12468 gas_name(iopcg5_f_o_g)="opcg5_f_o"
12469 gas_name(iopcg6_f_o_g)="opcg6_f_o"
12470 gas_name(iopcg7_f_o_g)="opcg7_f_o"
12471 gas_name(iopcg8_f_o_g)="opcg8_f_o"
12472 gas_name(ismpa_g)="smpa"
12473 gas_name(ismpbb_g)="smpbb"
12474 gas_name(iant1_c_g)="ant1_c"
12475 gas_name(iant2_c_g)="ant2_c"
12476 gas_name(iant3_c_g)="ant3_c"
12477 gas_name(iant4_c_g)="ant4_c"
12478 gas_name(iant1_o_g)="ant1_o"
12479 gas_name(iant2_o_g)="ant2_o"
12480 gas_name(iant3_o_g)="ant3_o"
12481 gas_name(iant4_o_g)="ant4_o"
12482 gas_name(ibiog1_c_g)="biog1_c"
12483 gas_name(ibiog2_c_g)="biog2_c"
12484 gas_name(ibiog3_c_g)="biog3_c"
12485 gas_name(ibiog4_c_g)="biog4_c"
12486 gas_name(ibiog1_o_g)="biog1_o"
12487 gas_name(ibiog2_o_g)="biog2_o"
12488 gas_name(ibiog3_o_g)="biog3_o"
12489 gas_name(ibiog4_o_g)="biog4_o"
12490 gas_name(in2o5_g) = "n2o5 "
12491 gas_name(iclno2_g)= "clno2"
12492 gas_name(iasoaX_g)="asoaX"
12493 gas_name(iasoa1_g)="asoa1"
12494 gas_name(iasoa2_g)="asoa2"
12495 gas_name(iasoa3_g)="asoa3"
12496 gas_name(iasoa4_g)="asoa4"
12497 gas_name(ibsoaX_g)="bsoaX"
12498 gas_name(ibsoa1_g)="bsoa1"
12499 gas_name(ibsoa2_g)="bsoa2"
12500 gas_name(ibsoa3_g)="bsoa3"
12501 gas_name(ibsoa4_g)="bsoa4"
12502 gas_name(igly)="gly"
12505 ! names of electrolytes
12506 ename(jnh4so4) = 'amso4'
12507 ename(jlvcite) = '(nh4)3h(so4)2'
12508 ename(jnh4hso4)= 'nh4hso4'
12509 ename(jnh4msa) = "ch3so3nh4"
12510 ename(jnh4no3) = 'nh4no3'
12511 ename(jnh4cl) = 'nh4cl'
12512 ename(jnacl) = 'nacl'
12513 ename(jnano3) = 'nano3'
12514 ename(jna2so4) = 'na2so4'
12515 ename(jna3hso4)= 'na3h(so4)2'
12516 ename(jnamsa) = "ch3so3na"
12517 ename(jnahso4) = 'nahso4'
12518 ename(jcaso4) = 'caso4'
12519 ename(jcamsa2) = "(ch3so3)2ca"
12520 ename(jcano3) = 'ca(no3)2'
12521 ename(jcacl2) = 'cacl2'
12522 ename(jcaco3) = 'caco3'
12523 ename(jh2so4) = 'h2so4'
12524 ename(jhhso4) = 'hhso4'
12525 ename(jhno3) = 'hno3'
12526 ename(jhcl) = 'hcl'
12527 ename(jmsa) = "ch3so3h"
12529 ! molecular weights of electrolytes
12530 mw_electrolyte(jnh4so4) = 132.0
12531 mw_electrolyte(jlvcite) = 247.0
12532 mw_electrolyte(jnh4hso4)= 115.0
12533 mw_electrolyte(jnh4msa) = 113.0
12534 mw_electrolyte(jnh4no3) = 80.0
12535 mw_electrolyte(jnh4cl) = 53.5
12536 mw_electrolyte(jnacl) = 58.5
12537 mw_electrolyte(jnano3) = 85.0
12538 mw_electrolyte(jna2so4) = 142.0
12539 mw_electrolyte(jna3hso4)= 262.0
12540 mw_electrolyte(jnahso4) = 120.0
12541 mw_electrolyte(jnamsa) = 118.0
12542 mw_electrolyte(jcaso4) = 136.0
12543 mw_electrolyte(jcamsa2) = 230.0
12544 mw_electrolyte(jcano3) = 164.0
12545 mw_electrolyte(jcacl2) = 111.0
12546 mw_electrolyte(jcaco3) = 100.0
12547 mw_electrolyte(jh2so4) = 98.0
12548 mw_electrolyte(jhno3) = 63.0
12549 mw_electrolyte(jhcl) = 36.5
12550 mw_electrolyte(jmsa) = 96.0
12553 ! molecular weights of ions [g/mol]
12559 mw_a(ja_so4) = 96.0
12560 mw_a(ja_hso4)= 97.0
12561 mw_a(ja_no3) = 62.0
12563 MW_a(ja_msa) = 95.0
12566 ! magnitude of the charges on ions
12579 ! densities of pure electrolytes in g/cc
12580 dens_electrolyte(jnh4so4) = 1.8
12581 dens_electrolyte(jlvcite) = 1.8
12582 dens_electrolyte(jnh4hso4) = 1.8
12583 dens_electrolyte(jnh4msa) = 1.8 ! assumed same as nh4hso4
12584 dens_electrolyte(jnh4no3) = 1.8
12585 dens_electrolyte(jnh4cl) = 1.8
12586 dens_electrolyte(jnacl) = 2.2
12587 dens_electrolyte(jnano3) = 2.2
12588 dens_electrolyte(jna2so4) = 2.2
12589 dens_electrolyte(jna3hso4) = 2.2
12590 dens_electrolyte(jnahso4) = 2.2
12591 dens_electrolyte(jnamsa) = 2.2 ! assumed same as nahso4
12592 dens_electrolyte(jcaso4) = 2.6
12593 dens_electrolyte(jcamsa2) = 2.6 ! assumed same as caso4
12594 dens_electrolyte(jcano3) = 2.6
12595 dens_electrolyte(jcacl2) = 2.6
12596 dens_electrolyte(jcaco3) = 2.6
12597 dens_electrolyte(jh2so4) = 1.8
12598 dens_electrolyte(jhhso4) = 1.8
12599 dens_electrolyte(jhno3) = 1.8
12600 dens_electrolyte(jhcl) = 1.8
12601 dens_electrolyte(jmsa) = 1.8 ! assumed same as h2so4
12604 ! densities of compounds in g/cc
12605 dens_comp_a(jnh4so4) = 1.8
12606 dens_comp_a(jlvcite) = 1.8
12607 dens_comp_a(jnh4hso4) = 1.8
12608 dens_comp_a(jnh4msa) = 1.8 ! assumed same as nh4hso4
12609 dens_comp_a(jnh4no3) = 1.7
12610 dens_comp_a(jnh4cl) = 1.5
12611 dens_comp_a(jnacl) = 2.2
12612 dens_comp_a(jnano3) = 2.2
12613 dens_comp_a(jna2so4) = 2.2
12614 dens_comp_a(jna3hso4) = 2.2
12615 dens_comp_a(jnahso4) = 2.2
12616 dens_comp_a(jnamsa) = 2.2 ! assumed same as nahso4
12617 dens_comp_a(jcaso4) = 2.6
12618 dens_comp_a(jcamsa2) = 2.6 ! assumed same as caso4
12619 dens_comp_a(jcano3) = 2.6
12620 dens_comp_a(jcacl2) = 2.6
12621 dens_comp_a(jcaco3) = 2.6
12622 dens_comp_a(jh2so4) = 1.8
12623 dens_comp_a(jhhso4) = 1.8
12624 dens_comp_a(jhno3) = 1.8
12625 dens_comp_a(jhcl) = 1.8
12626 dens_comp_a(jmsa) = 1.8 ! assumed same as h2so4
12627 dens_comp_a(joc) = 1.0
12628 dens_comp_a(jbc) = 1.8
12629 dens_comp_a(join) = 2.6
12630 dens_comp_a(jh2o) = 1.0
12631 dens_comp_a(ipcg1_b_c_a) =1.0
12632 dens_comp_a(ipcg2_b_c_a) =1.0
12633 dens_comp_a(ipcg3_b_c_a)=1.0
12634 dens_comp_a(ipcg4_b_c_a)=1.0
12635 dens_comp_a(ipcg5_b_c_a)=1.0
12636 dens_comp_a(ipcg6_b_c_a)=1.0
12637 dens_comp_a(ipcg7_b_c_a)=1.0
12638 dens_comp_a(ipcg8_b_c_a)=1.0
12639 dens_comp_a(ipcg9_b_c_a)=1.0
12640 dens_comp_a(iopcg1_b_c_a)=1.0
12641 dens_comp_a(iopcg2_b_c_a)=1.0
12642 dens_comp_a(iopcg3_b_c_a)=1.0
12643 dens_comp_a(iopcg4_b_c_a)=1.0
12644 dens_comp_a(iopcg5_b_c_a)=1.0
12645 dens_comp_a(iopcg6_b_c_a)=1.0
12646 dens_comp_a(iopcg7_b_c_a)=1.0
12647 dens_comp_a(iopcg8_b_c_a)=1.0
12648 dens_comp_a(ipcg1_b_o_a)=1.0
12649 dens_comp_a(ipcg2_b_o_a)=1.0
12650 dens_comp_a(ipcg3_b_o_a)=1.0
12651 dens_comp_a(ipcg4_b_o_a)=1.0
12652 dens_comp_a(ipcg5_b_o_a)=1.0
12653 dens_comp_a(ipcg6_b_o_a)=1.0
12654 dens_comp_a(ipcg7_b_o_a)=1.0
12655 dens_comp_a(ipcg8_b_o_a)=1.0
12656 dens_comp_a(ipcg9_b_o_a)=1.0
12657 dens_comp_a(iopcg1_b_o_a)=1.0
12658 dens_comp_a(iopcg2_b_o_a)=1.0
12659 dens_comp_a(iopcg3_b_o_a)=1.0
12660 dens_comp_a(iopcg4_b_o_a)=1.0
12661 dens_comp_a(iopcg5_b_o_a)=1.0
12662 dens_comp_a(iopcg6_b_o_a)=1.0
12663 dens_comp_a(iopcg7_b_o_a)=1.0
12664 dens_comp_a(iopcg8_b_o_a)=1.0
12665 dens_comp_a(ipcg1_f_c_a) =1.0
12666 dens_comp_a(ipcg2_f_c_a) =1.0
12667 dens_comp_a(ipcg3_f_c_a)=1.0
12668 dens_comp_a(ipcg4_f_c_a)=1.0
12669 dens_comp_a(ipcg5_f_c_a)=1.0
12670 dens_comp_a(ipcg6_f_c_a)=1.0
12671 dens_comp_a(ipcg7_f_c_a)=1.0
12672 dens_comp_a(ipcg8_f_c_a)=1.0
12673 dens_comp_a(ipcg9_f_c_a)=1.0
12674 dens_comp_a(iopcg1_f_c_a)=1.0
12675 dens_comp_a(iopcg2_f_c_a)=1.0
12676 dens_comp_a(iopcg3_f_c_a)=1.0
12677 dens_comp_a(iopcg4_f_c_a)=1.0
12678 dens_comp_a(iopcg5_f_c_a)=1.0
12679 dens_comp_a(iopcg6_f_c_a)=1.0
12680 dens_comp_a(iopcg7_f_c_a)=1.0
12681 dens_comp_a(iopcg8_f_c_a)=1.0
12682 dens_comp_a(ipcg1_f_o_a)=1.0
12683 dens_comp_a(ipcg2_f_o_a)=1.0
12684 dens_comp_a(ipcg3_f_o_a)=1.0
12685 dens_comp_a(ipcg4_f_o_a)=1.0
12686 dens_comp_a(ipcg5_f_o_a)=1.0
12687 dens_comp_a(ipcg6_f_o_a)=1.0
12688 dens_comp_a(ipcg7_f_o_a)=1.0
12689 dens_comp_a(ipcg8_f_o_a)=1.0
12690 dens_comp_a(ipcg9_f_o_a)=1.0
12691 dens_comp_a(iopcg1_f_o_a)=1.0
12692 dens_comp_a(iopcg2_f_o_a)=1.0
12693 dens_comp_a(iopcg3_f_o_a)=1.0
12694 dens_comp_a(iopcg4_f_o_a)=1.0
12695 dens_comp_a(iopcg5_f_o_a)=1.0
12696 dens_comp_a(iopcg6_f_o_a)=1.0
12697 dens_comp_a(iopcg7_f_o_a)=1.0
12698 dens_comp_a(iopcg8_f_o_a)=1.0
12699 dens_comp_a(ismpa_a)=1.0
12700 dens_comp_a(ismpbb_a)=1.0
12701 dens_comp_a(iglysoa_r1_a)=1.0
12702 dens_comp_a(iglysoa_r2_a)=1.0
12703 dens_comp_a(iglysoa_sfc_a)=1.0
12704 dens_comp_a(iglysoa_nh4_a)=1.0
12705 dens_comp_a(iglysoa_oh_a)=1.0
12706 dens_comp_a(iant1_c_a)=1.0
12707 dens_comp_a(iant2_c_a)=1.0
12708 dens_comp_a(iant3_c_a)=1.0
12709 dens_comp_a(iant4_c_a)=1.0
12710 dens_comp_a(iant1_o_a)=1.0
12711 dens_comp_a(iant2_o_a)=1.0
12712 dens_comp_a(iant3_o_a)=1.0
12713 dens_comp_a(iant4_o_a)=1.0
12714 dens_comp_a(ibiog1_c_a)=1.0
12715 dens_comp_a(ibiog2_c_a)=1.0
12716 dens_comp_a(ibiog3_c_a)=1.0
12717 dens_comp_a(ibiog4_c_a)=1.0
12718 dens_comp_a(ibiog1_o_a)=1.0
12719 dens_comp_a(ibiog2_o_a)=1.0
12720 dens_comp_a(ibiog3_o_a)=1.0
12721 dens_comp_a(ibiog4_o_a)=1.0
12722 dens_comp_a(iasoaX_a)=1.5
12723 dens_comp_a(iasoa1_a)=1.5
12724 dens_comp_a(iasoa2_a)=1.5
12725 dens_comp_a(iasoa3_a)=1.5
12726 dens_comp_a(iasoa4_a)=1.5
12727 dens_comp_a(ibsoaX_a)=1.5
12728 dens_comp_a(ibsoa1_a)=1.5
12729 dens_comp_a(ibsoa2_a)=1.5
12730 dens_comp_a(ibsoa3_a)=1.5
12731 dens_comp_a(ibsoa4_a)=1.5
12733 ! molecular weights of generic aerosol species
12734 mw_aer_mac(iso4_a) = 96.0
12735 mw_aer_mac(ino3_a) = 62.0
12736 mw_aer_mac(icl_a) = 35.5
12737 mw_aer_mac(imsa_a) = 95.0 ! ch3so3
12738 mw_aer_mac(ico3_a) = 60.0
12739 mw_aer_mac(inh4_a) = 18.0
12740 mw_aer_mac(ina_a) = 23.0
12741 mw_aer_mac(ica_a) = 40.0
12742 mw_aer_mac(ioin_a) = 1.0 ! not used
12743 mw_aer_mac(ibc_a) = 1.0 ! not used
12744 mw_aer_mac(ioc_a) = 250.0 ! 200 assumed for primary organics
12745 mw_aer_mac(ipcg1_b_c_a) =250.0
12746 mw_aer_mac(ipcg2_b_c_a) =250.0
12747 mw_aer_mac(ipcg3_b_c_a)=250.0
12748 mw_aer_mac(ipcg4_b_c_a)=250.0
12749 mw_aer_mac(ipcg5_b_c_a)=250.0
12750 mw_aer_mac(ipcg6_b_c_a)=250.0
12751 mw_aer_mac(ipcg7_b_c_a)=250.0
12752 mw_aer_mac(ipcg8_b_c_a)=250.0
12753 mw_aer_mac(ipcg9_b_c_a)=250.0
12754 mw_aer_mac(iopcg1_b_c_a)=250.0
12755 mw_aer_mac(iopcg2_b_c_a)=250.0
12756 mw_aer_mac(iopcg3_b_c_a)=250.0
12757 mw_aer_mac(iopcg4_b_c_a)=250.0
12758 mw_aer_mac(iopcg5_b_c_a)=250.0
12759 mw_aer_mac(iopcg6_b_c_a)=250.0
12760 mw_aer_mac(iopcg7_b_c_a)=250.0
12761 mw_aer_mac(iopcg8_b_c_a)=250.0
12762 mw_aer_mac(ipcg1_b_o_a)=250.0
12763 mw_aer_mac(ipcg2_b_o_a)=250.0
12764 mw_aer_mac(ipcg3_b_o_a)=250.0
12765 mw_aer_mac(ipcg4_b_o_a)=250.0
12766 mw_aer_mac(ipcg5_b_o_a)=250.0
12767 mw_aer_mac(ipcg6_b_o_a)=250.0
12768 mw_aer_mac(ipcg7_b_o_a)=250.0
12769 mw_aer_mac(ipcg8_b_o_a)=250.0
12770 mw_aer_mac(ipcg9_b_o_a)=250.0
12771 mw_aer_mac(iopcg1_b_o_a)=250.0
12772 mw_aer_mac(iopcg2_b_o_a)=250.0
12773 mw_aer_mac(iopcg3_b_o_a)=250.0
12774 mw_aer_mac(iopcg4_b_o_a)=250.0
12775 mw_aer_mac(iopcg5_b_o_a)=250.0
12776 mw_aer_mac(iopcg6_b_o_a)=250.0
12777 mw_aer_mac(iopcg7_b_o_a)=250.0
12778 mw_aer_mac(iopcg8_b_o_a)=250.0
12779 mw_aer_mac(ipcg1_f_c_a) =250.0
12780 mw_aer_mac(ipcg2_f_c_a) =250.0
12781 mw_aer_mac(ipcg3_f_c_a)=250.0
12782 mw_aer_mac(ipcg4_f_c_a)=250.0
12783 mw_aer_mac(ipcg5_f_c_a)=250.0
12784 mw_aer_mac(ipcg6_f_c_a)=250.0
12785 mw_aer_mac(ipcg7_f_c_a)=250.0
12786 mw_aer_mac(ipcg8_f_c_a)=250.0
12787 mw_aer_mac(ipcg9_f_c_a)=250.0
12788 mw_aer_mac(iopcg1_f_c_a)=250.0
12789 mw_aer_mac(iopcg2_f_c_a)=250.0
12790 mw_aer_mac(iopcg3_f_c_a)=250.0
12791 mw_aer_mac(iopcg4_f_c_a)=250.0
12792 mw_aer_mac(iopcg5_f_c_a)=250.0
12793 mw_aer_mac(iopcg6_f_c_a)=250.0
12794 mw_aer_mac(iopcg7_f_c_a)=250.0
12795 mw_aer_mac(iopcg8_f_c_a)=250.0
12796 mw_aer_mac(ipcg1_f_o_a)=250.0
12797 mw_aer_mac(ipcg2_f_o_a)=250.0
12798 mw_aer_mac(ipcg3_f_o_a)=250.0
12799 mw_aer_mac(ipcg4_f_o_a)=250.0
12800 mw_aer_mac(ipcg5_f_o_a)=250.0
12801 mw_aer_mac(ipcg6_f_o_a)=250.0
12802 mw_aer_mac(ipcg7_f_o_a)=250.0
12803 mw_aer_mac(ipcg8_f_o_a)=250.0
12804 mw_aer_mac(ipcg9_f_o_a)=250.0
12805 mw_aer_mac(iopcg1_f_o_a)=250.0
12806 mw_aer_mac(iopcg2_f_o_a)=250.0
12807 mw_aer_mac(iopcg3_f_o_a)=250.0
12808 mw_aer_mac(iopcg4_f_o_a)=250.0
12809 mw_aer_mac(iopcg5_f_o_a)=250.0
12810 mw_aer_mac(iopcg6_f_o_a)=250.0
12811 mw_aer_mac(iopcg7_f_o_a)=250.0
12812 mw_aer_mac(iopcg8_f_o_a)=250.0
12813 mw_aer_mac(ismpa_a) = 250.0
12814 mw_aer_mac(ismpbb_a) = 250.0
12815 mw_aer_mac(iglysoa_r1_a) = 250.0
12816 mw_aer_mac(iglysoa_r2_a) = 250.0
12817 mw_aer_mac(iglysoa_sfc_a) = 250.0
12818 mw_aer_mac(iglysoa_nh4_a) = 250.0
12819 mw_aer_mac(iglysoa_oh_a) = 250.0
12820 mw_aer_mac(iant1_c_a) = 250.0
12821 mw_aer_mac(iant2_c_a) = 250.0
12822 mw_aer_mac(iant3_c_a) = 250.0
12823 mw_aer_mac(iant4_c_a) = 250.0
12824 mw_aer_mac(iant1_o_a) = 250.0
12825 mw_aer_mac(iant2_o_a) = 250.0
12826 mw_aer_mac(iant3_o_a) = 250.0
12827 mw_aer_mac(iant4_o_a) = 250.0
12828 mw_aer_mac(ibiog1_c_a) = 250.0
12829 mw_aer_mac(ibiog2_c_a) = 250.0
12830 mw_aer_mac(ibiog3_c_a) = 250.0
12831 mw_aer_mac(ibiog4_c_a) = 250.0
12832 mw_aer_mac(ibiog1_o_a) = 250.0
12833 mw_aer_mac(ibiog2_o_a) = 250.0
12834 mw_aer_mac(ibiog3_o_a) = 250.0
12835 mw_aer_mac(ibiog4_o_a) = 250.0
12836 mw_aer_mac(iasoaX_a) = 250.0
12837 mw_aer_mac(iasoa1_a) = 250.0
12838 mw_aer_mac(iasoa2_a) = 250.0
12839 mw_aer_mac(iasoa3_a) = 250.0
12840 mw_aer_mac(iasoa4_a) = 250.0
12841 mw_aer_mac(ibsoaX_a) = 250.0
12842 mw_aer_mac(ibsoa1_a) = 250.0
12843 mw_aer_mac(ibsoa2_a) = 250.0
12844 mw_aer_mac(ibsoa3_a) = 250.0
12845 mw_aer_mac(ibsoa4_a) = 250.0
12848 ! molecular weights of compounds
12849 mw_comp_a(jnh4so4) = 132.0
12850 mw_comp_a(jlvcite) = 247.0
12851 mw_comp_a(jnh4hso4)= 115.0
12852 mw_comp_a(jnh4msa) = 113.0
12853 mw_comp_a(jnh4no3) = 80.0
12854 mw_comp_a(jnh4cl) = 53.5
12855 mw_comp_a(jnacl) = 58.5
12856 mw_comp_a(jnano3) = 85.0
12857 mw_comp_a(jna2so4) = 142.0
12858 mw_comp_a(jna3hso4)= 262.0
12859 mw_comp_a(jnahso4) = 120.0
12860 mw_comp_a(jnamsa) = 118.0
12861 mw_comp_a(jcaso4) = 136.0
12862 mw_comp_a(jcamsa2) = 230.0
12863 mw_comp_a(jcano3) = 164.0
12864 mw_comp_a(jcacl2) = 111.0
12865 mw_comp_a(jcaco3) = 100.0
12866 mw_comp_a(jh2so4) = 98.0
12867 mw_comp_a(jhhso4) = 98.0
12868 mw_comp_a(jhno3) = 63.0
12869 mw_comp_a(jhcl) = 36.5
12870 mw_comp_a(jmsa) = 96.0
12871 mw_comp_a(joc) = 250.0
12872 mw_comp_a(jbc) = 1.0
12873 mw_comp_a(join) = 1.0
12874 mw_comp_a(jh2o) = 18.0
12875 mw_comp_a(jpcg1_b_c) =250.0
12876 mw_comp_a(jpcg2_b_c) =250.0
12877 mw_comp_a(jpcg3_b_c)=250.0
12878 mw_comp_a(jpcg4_b_c)=250.0
12879 mw_comp_a(jpcg5_b_c)=250.0
12880 mw_comp_a(jpcg6_b_c)=250.0
12881 mw_comp_a(jpcg7_b_c)=250.0
12882 mw_comp_a(jpcg8_b_c)=250.0
12883 mw_comp_a(jpcg9_b_c)=250.0
12884 mw_comp_a(jopcg1_b_c)=250.0
12885 mw_comp_a(jopcg2_b_c)=250.0
12886 mw_comp_a(jopcg3_b_c)=250.0
12887 mw_comp_a(jopcg4_b_c)=250.0
12888 mw_comp_a(jopcg5_b_c)=250.0
12889 mw_comp_a(jopcg6_b_c)=250.0
12890 mw_comp_a(jopcg7_b_c)=250.0
12891 mw_comp_a(jopcg8_b_c)=250.0
12892 mw_comp_a(jpcg1_b_o)=250.0
12893 mw_comp_a(jpcg2_b_o)=250.0
12894 mw_comp_a(jpcg3_b_o)=250.0
12895 mw_comp_a(jpcg4_b_o)=250.0
12896 mw_comp_a(jpcg5_b_o)=250.0
12897 mw_comp_a(jpcg6_b_o)=250.0
12898 mw_comp_a(jpcg7_b_o)=250.0
12899 mw_comp_a(jpcg8_b_o)=250.0
12900 mw_comp_a(jpcg9_b_o)=250.0
12901 mw_comp_a(jopcg1_b_o)=250.0
12902 mw_comp_a(jopcg2_b_o)=250.0
12903 mw_comp_a(jopcg3_b_o)=250.0
12904 mw_comp_a(jopcg4_b_o)=250.0
12905 mw_comp_a(jopcg5_b_o)=250.0
12906 mw_comp_a(jopcg6_b_o)=250.0
12907 mw_comp_a(jopcg7_b_o)=250.0
12908 mw_comp_a(jopcg8_b_o)=250.0
12909 mw_comp_a(jpcg1_f_c) =250.0
12910 mw_comp_a(jpcg2_f_c) =250.0
12911 mw_comp_a(jpcg3_f_c)=250.0
12912 mw_comp_a(jpcg4_f_c)=250.0
12913 mw_comp_a(jpcg5_f_c)=250.0
12914 mw_comp_a(jpcg6_f_c)=250.0
12915 mw_comp_a(jpcg7_f_c)=250.0
12916 mw_comp_a(jpcg8_f_c)=250.0
12917 mw_comp_a(jpcg9_f_c)=250.0
12918 mw_comp_a(jopcg1_f_c)=250.0
12919 mw_comp_a(jopcg2_f_c)=250.0
12920 mw_comp_a(jopcg3_f_c)=250.0
12921 mw_comp_a(jopcg4_f_c)=250.0
12922 mw_comp_a(jopcg5_f_c)=250.0
12923 mw_comp_a(jopcg6_f_c)=250.0
12924 mw_comp_a(jopcg7_f_c)=250.0
12925 mw_comp_a(jopcg8_f_c)=250.0
12926 mw_comp_a(jpcg1_f_o)=250.0
12927 mw_comp_a(jpcg2_f_o)=250.0
12928 mw_comp_a(jpcg3_f_o)=250.0
12929 mw_comp_a(jpcg4_f_o)=250.0
12930 mw_comp_a(jpcg5_f_o)=250.0
12931 mw_comp_a(jpcg6_f_o)=250.0
12932 mw_comp_a(jpcg7_f_o)=250.0
12933 mw_comp_a(jpcg8_f_o)=250.0
12934 mw_comp_a(jpcg9_f_o)=250.0
12935 mw_comp_a(jopcg1_f_o)=250.0
12936 mw_comp_a(jopcg2_f_o)=250.0
12937 mw_comp_a(jopcg3_f_o)=250.0
12938 mw_comp_a(jopcg4_f_o)=250.0
12939 mw_comp_a(jopcg5_f_o)=250.0
12940 mw_comp_a(jopcg6_f_o)=250.0
12941 mw_comp_a(jopcg7_f_o)=250.0
12942 mw_comp_a(jopcg8_f_o)=250.0
12943 mw_comp_a(jsmpa)=250.0
12944 mw_comp_a(jsmpbb)=250.0
12945 mw_comp_a(jglysoa_r1)=250.0
12946 mw_comp_a(jglysoa_r2)=250.0
12947 mw_comp_a(jglysoa_sfc)=250.0
12948 mw_comp_a(jglysoa_nh4)=250.0
12949 mw_comp_a(jglysoa_oh)=250.0
12950 mw_comp_a(jant1_c)=250.0
12951 mw_comp_a(jant2_c)=250.0
12952 mw_comp_a(jant3_c)=250.0
12953 mw_comp_a(jant4_c)=250.0
12954 mw_comp_a(jant1_o)=250.0
12955 mw_comp_a(jant2_o)=250.0
12956 mw_comp_a(jant3_o)=250.0
12957 mw_comp_a(jant4_o)=250.0
12958 mw_comp_a(jbiog1_c)=250.0
12959 mw_comp_a(jbiog2_c)=250.0
12960 mw_comp_a(jbiog3_c)=250.0
12961 mw_comp_a(jbiog4_c)=250.0
12962 mw_comp_a(jbiog1_o)=250.0
12963 mw_comp_a(jbiog2_o)=250.0
12964 mw_comp_a(jbiog3_o)=250.0
12965 mw_comp_a(jbiog4_o)=250.0
12966 mw_comp_a(jasoaX)=250.0
12967 mw_comp_a(jasoa1)=250.0
12968 mw_comp_a(jasoa2)=250.0
12969 mw_comp_a(jasoa3)=250.0
12970 mw_comp_a(jasoa4)=250.0
12971 mw_comp_a(jbsoaX)=250.0
12972 mw_comp_a(jbsoa1)=250.0
12973 mw_comp_a(jbsoa2)=250.0
12974 mw_comp_a(jbsoa3)=250.0
12975 mw_comp_a(jbsoa4)=250.0
12977 ! densities of generic aerosol species
12978 dens_aer_mac(iso4_a) = 1.8 ! used
12979 dens_aer_mac(ino3_a) = 1.8 ! used
12980 dens_aer_mac(icl_a) = 2.2 ! used
12981 dens_aer_mac(imsa_a) = 1.8 ! used
12982 dens_aer_mac(ico3_a) = 2.6 ! used
12983 dens_aer_mac(inh4_a) = 1.8 ! used
12984 dens_aer_mac(ina_a) = 2.2 ! used
12985 dens_aer_mac(ica_a) = 2.6 ! used
12986 dens_aer_mac(ioin_a) = 2.6 ! used
12987 dens_aer_mac(ioc_a) = 1.0 ! used
12988 dens_aer_mac(ibc_a) = 1.7 ! used
12989 dens_aer_mac(ipcg1_b_c_a) =1.0
12990 dens_aer_mac(ipcg2_b_c_a) =1.0
12991 dens_aer_mac(ipcg3_b_c_a)=1.0
12992 dens_aer_mac(ipcg4_b_c_a)=1.0
12993 dens_aer_mac(ipcg5_b_c_a)=1.0
12994 dens_aer_mac(ipcg6_b_c_a)=1.0
12995 dens_aer_mac(ipcg7_b_c_a)=1.0
12996 dens_aer_mac(ipcg8_b_c_a)=1.0
12997 dens_aer_mac(ipcg9_b_c_a)=1.0
12998 dens_aer_mac(iopcg1_b_c_a)=1.0
12999 dens_aer_mac(iopcg2_b_c_a)=1.0
13000 dens_aer_mac(iopcg3_b_c_a)=1.0
13001 dens_aer_mac(iopcg4_b_c_a)=1.0
13002 dens_aer_mac(iopcg5_b_c_a)=1.0
13003 dens_aer_mac(iopcg6_b_c_a)=1.0
13004 dens_aer_mac(iopcg7_b_c_a)=1.0
13005 dens_aer_mac(iopcg8_b_c_a)=1.0
13006 dens_aer_mac(ipcg1_b_o_a)=1.0
13007 dens_aer_mac(ipcg2_b_o_a)=1.0
13008 dens_aer_mac(ipcg3_b_o_a)=1.0
13009 dens_aer_mac(ipcg4_b_o_a)=1.0
13010 dens_aer_mac(ipcg5_b_o_a)=1.0
13011 dens_aer_mac(ipcg6_b_o_a)=1.0
13012 dens_aer_mac(ipcg7_b_o_a)=1.0
13013 dens_aer_mac(ipcg8_b_o_a)=1.0
13014 dens_aer_mac(ipcg9_b_o_a)=1.0
13015 dens_aer_mac(iopcg1_b_o_a)=1.0
13016 dens_aer_mac(iopcg2_b_o_a)=1.0
13017 dens_aer_mac(iopcg3_b_o_a)=1.0
13018 dens_aer_mac(iopcg4_b_o_a)=1.0
13019 dens_aer_mac(iopcg5_b_o_a)=1.0
13020 dens_aer_mac(iopcg6_b_o_a)=1.0
13021 dens_aer_mac(iopcg7_b_o_a)=1.0
13022 dens_aer_mac(iopcg8_b_o_a)=1.0
13023 dens_aer_mac(ipcg1_f_c_a) =1.0
13024 dens_aer_mac(ipcg2_f_c_a) =1.0
13025 dens_aer_mac(ipcg3_f_c_a)=1.0
13026 dens_aer_mac(ipcg4_f_c_a)=1.0
13027 dens_aer_mac(ipcg5_f_c_a)=1.0
13028 dens_aer_mac(ipcg6_f_c_a)=1.0
13029 dens_aer_mac(ipcg7_f_c_a)=1.0
13030 dens_aer_mac(ipcg8_f_c_a)=1.0
13031 dens_aer_mac(ipcg9_f_c_a)=1.0
13032 dens_aer_mac(iopcg1_f_c_a)=1.0
13033 dens_aer_mac(iopcg2_f_c_a)=1.0
13034 dens_aer_mac(iopcg3_f_c_a)=1.0
13035 dens_aer_mac(iopcg4_f_c_a)=1.0
13036 dens_aer_mac(iopcg5_f_c_a)=1.0
13037 dens_aer_mac(iopcg6_f_c_a)=1.0
13038 dens_aer_mac(iopcg7_f_c_a)=1.0
13039 dens_aer_mac(iopcg8_f_c_a)=1.0
13040 dens_aer_mac(ipcg1_f_o_a)=1.0
13041 dens_aer_mac(ipcg2_f_o_a)=1.0
13042 dens_aer_mac(ipcg3_f_o_a)=1.0
13043 dens_aer_mac(ipcg4_f_o_a)=1.0
13044 dens_aer_mac(ipcg5_f_o_a)=1.0
13045 dens_aer_mac(ipcg6_f_o_a)=1.0
13046 dens_aer_mac(ipcg7_f_o_a)=1.0
13047 dens_aer_mac(ipcg8_f_o_a)=1.0
13048 dens_aer_mac(ipcg9_f_o_a)=1.0
13049 dens_aer_mac(iopcg1_f_o_a)=1.0
13050 dens_aer_mac(iopcg2_f_o_a)=1.0
13051 dens_aer_mac(iopcg3_f_o_a)=1.0
13052 dens_aer_mac(iopcg4_f_o_a)=1.0
13053 dens_aer_mac(iopcg5_f_o_a)=1.0
13054 dens_aer_mac(iopcg6_f_o_a)=1.0
13055 dens_aer_mac(iopcg7_f_o_a)=1.0
13056 dens_aer_mac(iopcg8_f_o_a)=1.0
13057 dens_aer_mac(ismpa_a)=1.0
13058 dens_aer_mac(ismpbb_a)=1.0
13059 dens_aer_mac(iglysoa_r1_a)=1.0
13060 dens_aer_mac(iglysoa_r2_a)=1.0
13061 dens_aer_mac(iglysoa_sfc_a)=1.0
13062 dens_aer_mac(iglysoa_nh4_a)=1.0
13063 dens_aer_mac(iglysoa_oh_a)=1.0
13064 dens_aer_mac(iant1_c_a)=1.0
13065 dens_aer_mac(iant2_c_a)=1.0
13066 dens_aer_mac(iant3_c_a)=1.0
13067 dens_aer_mac(iant4_c_a)=1.0
13068 dens_aer_mac(iant1_o_a)=1.0
13069 dens_aer_mac(iant2_o_a)=1.0
13070 dens_aer_mac(iant3_o_a)=1.0
13071 dens_aer_mac(iant4_o_a)=1.0
13072 dens_aer_mac(ibiog1_c_a)=1.0
13073 dens_aer_mac(ibiog2_c_a)=1.0
13074 dens_aer_mac(ibiog3_c_a)=1.0
13075 dens_aer_mac(ibiog4_c_a)=1.0
13076 dens_aer_mac(ibiog1_o_a)=1.0
13077 dens_aer_mac(ibiog2_o_a)=1.0
13078 dens_aer_mac(ibiog3_o_a)=1.0
13079 dens_aer_mac(ibiog4_o_a)=1.0
13080 dens_aer_mac(iasoaX_a)=1.5
13081 dens_aer_mac(iasoa1_a)=1.5
13082 dens_aer_mac(iasoa2_a)=1.5
13083 dens_aer_mac(iasoa3_a)=1.5
13084 dens_aer_mac(iasoa4_a)=1.5
13085 dens_aer_mac(ibsoaX_a)=1.5
13086 dens_aer_mac(ibsoa1_a)=1.5
13087 dens_aer_mac(ibsoa2_a)=1.5
13088 dens_aer_mac(ibsoa3_a)=1.5
13089 dens_aer_mac(ibsoa4_a)=1.5
13091 ! partial molar volumes of condensing species
13092 partial_molar_vol(ih2so4_g) = 51.83
13093 partial_molar_vol(ihno3_g) = 31.45
13094 partial_molar_vol(ihcl_g) = 20.96
13095 partial_molar_vol(inh3_g) = 24.03
13096 partial_molar_vol(imsa_g) = 53.33
13097 partial_molar_vol(ipcg1_b_c_g) =250.0
13098 partial_molar_vol(ipcg2_b_c_g) =250.0
13099 partial_molar_vol(ipcg3_b_c_g)=250.0
13100 partial_molar_vol(ipcg4_b_c_g)=250.0
13101 partial_molar_vol(ipcg5_b_c_g)=250.0
13102 partial_molar_vol(ipcg6_b_c_g)=250.0
13103 partial_molar_vol(ipcg7_b_c_g)=250.0
13104 partial_molar_vol(ipcg8_b_c_g)=250.0
13105 partial_molar_vol(ipcg9_b_c_g)=250.0
13106 partial_molar_vol(iopcg1_b_c_g)=250.0
13107 partial_molar_vol(iopcg2_b_c_g)=250.0
13108 partial_molar_vol(iopcg3_b_c_g)=250.0
13109 partial_molar_vol(iopcg4_b_c_g)=250.0
13110 partial_molar_vol(iopcg5_b_c_g)=250.0
13111 partial_molar_vol(iopcg6_b_c_g)=250.0
13112 partial_molar_vol(iopcg7_b_c_g)=250.0
13113 partial_molar_vol(iopcg8_b_c_g)=250.0
13114 partial_molar_vol(ipcg1_b_o_g)=250.0
13115 partial_molar_vol(ipcg2_b_o_g)=250.0
13116 partial_molar_vol(ipcg3_b_o_g)=250.0
13117 partial_molar_vol(ipcg4_b_o_g)=250.0
13118 partial_molar_vol(ipcg5_b_o_g)=250.0
13119 partial_molar_vol(ipcg6_b_o_g)=250.0
13120 partial_molar_vol(ipcg7_b_o_g)=250.0
13121 partial_molar_vol(ipcg8_b_o_g)=250.0
13122 partial_molar_vol(ipcg9_b_o_g)=250.0
13123 partial_molar_vol(iopcg1_b_o_g)=250.0
13124 partial_molar_vol(iopcg2_b_o_g)=250.0
13125 partial_molar_vol(iopcg3_b_o_g)=250.0
13126 partial_molar_vol(iopcg4_b_o_g)=250.0
13127 partial_molar_vol(iopcg5_b_o_g)=250.0
13128 partial_molar_vol(iopcg6_b_o_g)=250.0
13129 partial_molar_vol(iopcg7_b_o_g)=250.0
13130 partial_molar_vol(iopcg8_b_o_g)=250.0
13131 partial_molar_vol(ipcg1_f_c_g) =250.0
13132 partial_molar_vol(ipcg2_f_c_g) =250.0
13133 partial_molar_vol(ipcg3_f_c_g)=250.0
13134 partial_molar_vol(ipcg4_f_c_g)=250.0
13135 partial_molar_vol(ipcg5_f_c_g)=250.0
13136 partial_molar_vol(ipcg6_f_c_g)=250.0
13137 partial_molar_vol(ipcg7_f_c_g)=250.0
13138 partial_molar_vol(ipcg8_f_c_g)=250.0
13139 partial_molar_vol(ipcg9_f_c_g)=250.0
13140 partial_molar_vol(iopcg1_f_c_g)=250.0
13141 partial_molar_vol(iopcg2_f_c_g)=250.0
13142 partial_molar_vol(iopcg3_f_c_g)=250.0
13143 partial_molar_vol(iopcg4_f_c_g)=250.0
13144 partial_molar_vol(iopcg5_f_c_g)=250.0
13145 partial_molar_vol(iopcg6_f_c_g)=250.0
13146 partial_molar_vol(iopcg7_f_c_g)=250.0
13147 partial_molar_vol(iopcg8_f_c_g)=250.0
13148 partial_molar_vol(ipcg1_f_o_g)=250.0
13149 partial_molar_vol(ipcg2_f_o_g)=250.0
13150 partial_molar_vol(ipcg3_f_o_g)=250.0
13151 partial_molar_vol(ipcg4_f_o_g)=250.0
13152 partial_molar_vol(ipcg5_f_o_g)=250.0
13153 partial_molar_vol(ipcg6_f_o_g)=250.0
13154 partial_molar_vol(ipcg7_f_o_g)=250.0
13155 partial_molar_vol(ipcg8_f_o_g)=250.0
13156 partial_molar_vol(ipcg9_f_o_g)=250.0
13157 partial_molar_vol(iopcg1_f_o_g)=250.0
13158 partial_molar_vol(iopcg2_f_o_g)=250.0
13159 partial_molar_vol(iopcg3_f_o_g)=250.0
13160 partial_molar_vol(iopcg4_f_o_g)=250.0
13161 partial_molar_vol(iopcg5_f_o_g)=250.0
13162 partial_molar_vol(iopcg6_f_o_g)=250.0
13163 partial_molar_vol(iopcg7_f_o_g)=250.0
13164 partial_molar_vol(iopcg8_f_o_g)=250.0
13165 partial_molar_vol(ismpa_g)=250.0
13166 partial_molar_vol(ismpbb_g)=250.0
13167 partial_molar_vol(iant1_c_g)=250.0
13168 partial_molar_vol(iant2_c_g)=250.0
13169 partial_molar_vol(iant3_c_g)=250.0
13170 partial_molar_vol(iant4_c_g)=250.0
13171 partial_molar_vol(iant1_o_g)=250.0
13172 partial_molar_vol(iant2_o_g)=250.0
13173 partial_molar_vol(iant3_o_g)=250.0
13174 partial_molar_vol(iant4_o_g)=250.0
13175 partial_molar_vol(ibiog1_c_g)=250.0
13176 partial_molar_vol(ibiog2_c_g)=250.0
13177 partial_molar_vol(ibiog3_c_g)=250.0
13178 partial_molar_vol(ibiog4_c_g)=250.0
13179 partial_molar_vol(ibiog1_o_g)=250.0
13180 partial_molar_vol(ibiog2_o_g)=250.0
13181 partial_molar_vol(ibiog3_o_g)=250.0
13182 partial_molar_vol(ibiog4_o_g)=250.0
13183 partial_molar_vol(in2o5_g) = 200.0 ! assumed...
13184 partial_molar_vol(iclno2_g) = 200.0 ! assumed...
13185 partial_molar_vol(iasoaX_g)=250.0
13186 partial_molar_vol(iasoa1_g)=250.0
13187 partial_molar_vol(iasoa2_g)=250.0
13188 partial_molar_vol(iasoa3_g)=250.0
13189 partial_molar_vol(iasoa4_g)=250.0
13190 partial_molar_vol(ibsoaX_g)=250.0
13191 partial_molar_vol(ibsoa1_g)=250.0
13192 partial_molar_vol(ibsoa2_g)=250.0
13193 partial_molar_vol(ibsoa3_g)=250.0
13194 partial_molar_vol(ibsoa4_g)=250.0
13195 partial_molar_vol(igly)=58.0
13196 partial_molar_vol(iho)=17.0
13199 ref_index_a(jnh4so4) = cmplx(1.52,0.)
13200 ref_index_a(jlvcite) = cmplx(1.50,0.)
13201 ref_index_a(jnh4hso4)= cmplx(1.47,0.)
13202 ref_index_a(jnh4msa) = cmplx(1.50,0.) ! assumed
13203 ref_index_a(jnh4no3) = cmplx(1.50,0.)
13204 ref_index_a(jnh4cl) = cmplx(1.50,0.)
13205 ref_index_a(jnacl) = cmplx(1.45,0.)
13206 ref_index_a(jnano3) = cmplx(1.50,0.)
13207 ref_index_a(jna2so4) = cmplx(1.50,0.)
13208 ref_index_a(jna3hso4)= cmplx(1.50,0.)
13209 ref_index_a(jnahso4) = cmplx(1.50,0.)
13210 ref_index_a(jnamsa) = cmplx(1.50,0.) ! assumed
13211 ref_index_a(jcaso4) = cmplx(1.56,0.006)
13212 ref_index_a(jcamsa2) = cmplx(1.56,0.006) ! assumed
13213 ref_index_a(jcano3) = cmplx(1.56,0.006)
13214 ref_index_a(jcacl2) = cmplx(1.52,0.006)
13215 ref_index_a(jcaco3) = cmplx(1.68,0.006)
13216 ref_index_a(jh2so4) = cmplx(1.43,0.)
13217 ref_index_a(jhhso4) = cmplx(1.43,0.)
13218 ref_index_a(jhno3) = cmplx(1.50,0.)
13219 ref_index_a(jhcl) = cmplx(1.50,0.)
13220 ref_index_a(jmsa) = cmplx(1.43,0.) ! assumed
13221 ref_index_a(joc) = cmplx(1.45,0.)
13222 ref_index_a(jbc) = cmplx(1.82,0.74)
13223 ref_index_a(join) = cmplx(1.55,0.006)
13224 ref_index_a(jh2o) = cmplx(1.33,0.)
13227 jsalt_index(jnh4so4) = 5 ! as
13228 jsalt_index(jlvcite) = 2 ! lv
13229 jsalt_index(jnh4hso4)= 1 ! ab
13230 jsalt_index(jnh4no3) = 2 ! an
13231 jsalt_index(jnh4cl) = 1 ! ac
13232 jsalt_index(jna2so4) = 60 ! ss
13233 jsalt_index(jnahso4) = 10 ! sb
13234 jsalt_index(jnano3) = 40 ! sn
13235 jsalt_index(jnacl) = 10 ! sc
13236 jsalt_index(jcano3) = 120 ! cn
13237 jsalt_index(jcacl2) = 80 ! cc
13238 jsalt_index(jnh4msa) = 0 ! AM zero for now
13239 jsalt_index(jnamsa) = 0 ! SM zero for now
13240 jsalt_index(jcamsa2) = 0 ! CM zero for now
13244 ! ac = 1, an = 2, as = 5, sc = 10, sn = 40, ss = 60, cc = 80, cn = 120,
13245 ! ab = 1, lv = 2, sb = 10
13247 ! sulfate-poor domain
13248 jsulf_poor(1) = 1 ! ac
13249 jsulf_poor(2) = 2 ! an
13250 jsulf_poor(5) = 3 ! as
13251 jsulf_poor(10) = 4 ! sc
13252 jsulf_poor(40) = 5 ! sn
13253 jsulf_poor(60) = 6 ! ss
13254 jsulf_poor(80) = 7 ! cc
13255 jsulf_poor(120) = 8 ! cn
13256 jsulf_poor(3) = 9 ! an + ac
13257 jsulf_poor(6) = 10 ! as + ac
13258 jsulf_poor(7) = 11 ! as + an
13259 jsulf_poor(8) = 12 ! as + an + ac
13260 jsulf_poor(11) = 13 ! sc + ac
13261 jsulf_poor(41) = 14 ! sn + ac
13262 jsulf_poor(42) = 15 ! sn + an
13263 jsulf_poor(43) = 16 ! sn + an + ac
13264 jsulf_poor(50) = 17 ! sn + sc
13265 jsulf_poor(51) = 18 ! sn + sc + ac
13266 jsulf_poor(61) = 19 ! ss + ac
13267 jsulf_poor(62) = 20 ! ss + an
13268 jsulf_poor(63) = 21 ! ss + an + ac
13269 jsulf_poor(65) = 22 ! ss + as
13270 jsulf_poor(66) = 23 ! ss + as + ac
13271 jsulf_poor(67) = 24 ! ss + as + an
13272 jsulf_poor(68) = 25 ! ss + as + an + ac
13273 jsulf_poor(70) = 26 ! ss + sc
13274 jsulf_poor(71) = 27 ! ss + sc + ac
13275 jsulf_poor(100) = 28 ! ss + sn
13276 jsulf_poor(101) = 29 ! ss + sn + ac
13277 jsulf_poor(102) = 30 ! ss + sn + an
13278 jsulf_poor(103) = 31 ! ss + sn + an + ac
13279 jsulf_poor(110) = 32 ! ss + sn + sc
13280 jsulf_poor(111) = 33 ! ss + sn + sc + ac
13281 jsulf_poor(81) = 34 ! cc + ac
13282 jsulf_poor(90) = 35 ! cc + sc
13283 jsulf_poor(91) = 36 ! cc + sc + ac
13284 jsulf_poor(121) = 37 ! cn + ac
13285 jsulf_poor(122) = 38 ! cn + an
13286 jsulf_poor(123) = 39 ! cn + an + ac
13287 jsulf_poor(130) = 40 ! cn + sc
13288 jsulf_poor(131) = 41 ! cn + sc + ac
13289 jsulf_poor(160) = 42 ! cn + sn
13290 jsulf_poor(161) = 43 ! cn + sn + ac
13291 jsulf_poor(162) = 44 ! cn + sn + an
13292 jsulf_poor(163) = 45 ! cn + sn + an + ac
13293 jsulf_poor(170) = 46 ! cn + sn + sc
13294 jsulf_poor(171) = 47 ! cn + sn + sc + ac
13295 jsulf_poor(200) = 48 ! cn + cc
13296 jsulf_poor(201) = 49 ! cn + cc + ac
13297 jsulf_poor(210) = 50 ! cn + cc + sc
13298 jsulf_poor(211) = 51 ! cn + cc + sc + ac
13300 ! sulfate-rich domain
13301 jsulf_rich(1) = 52 ! ab
13302 jsulf_rich(2) = 53 ! lv
13303 jsulf_rich(10) = 54 ! sb
13304 jsulf_rich(3) = 55 ! ab + lv
13305 jsulf_rich(7) = 56 ! as + lv
13306 jsulf_rich(70) = 57 ! ss + sb
13307 jsulf_rich(62) = 58 ! ss + lv
13308 jsulf_rich(67) = 59 ! ss + as + lv
13309 jsulf_rich(61) = 60 ! ss + ab
13310 jsulf_rich(63) = 61 ! ss + lv + ab
13311 jsulf_rich(11) = 62 ! sb + ab
13312 jsulf_rich(71) = 63 ! ss + sb + ab
13313 jsulf_rich(5) = 3 ! as
13314 jsulf_rich(60) = 6 ! ss
13315 jsulf_rich(65) = 22 ! ss + as
13320 ! polynomial coefficients for binary molality (used in zsr equation)
13323 ! a_zsr for aw < 0.97
13327 a_zsr(1,je) = 1.30894
13328 a_zsr(2,je) = -7.09922
13329 a_zsr(3,je) = 20.62831
13330 a_zsr(4,je) = -32.19965
13331 a_zsr(5,je) = 25.17026
13332 a_zsr(6,je) = -7.81632
13337 a_zsr(1,je) = 1.10725
13338 a_zsr(2,je) = -5.17978
13339 a_zsr(3,je) = 12.29534
13340 a_zsr(4,je) = -16.32545
13341 a_zsr(5,je) = 11.29274
13342 a_zsr(6,je) = -3.19164
13347 a_zsr(1,je) = 1.15510
13348 a_zsr(2,je) = -3.20815
13349 a_zsr(3,je) = 2.71141
13350 a_zsr(4,je) = 2.01155
13351 a_zsr(5,je) = -4.71014
13352 a_zsr(6,je) = 2.04616
13355 ! nh4msa (assumed same as nh4hso4)
13357 a_zsr(1,je) = 1.15510
13358 a_zsr(2,je) = -3.20815
13359 a_zsr(3,je) = 2.71141
13360 a_zsr(4,je) = 2.01155
13361 a_zsr(5,je) = -4.71014
13362 a_zsr(6,je) = 2.04616
13367 a_zsr(1,je) = 0.43507
13368 a_zsr(2,je) = 6.38220
13369 a_zsr(3,je) = -30.19797
13370 a_zsr(4,je) = 53.36470
13371 a_zsr(5,je) = -43.44203
13372 a_zsr(6,je) = 13.46158
13375 ! nh4cl: revised on nov 13, 2003. based on chan and ha (1999) jgr.
13377 a_zsr(1,je) = 0.45309
13378 a_zsr(2,je) = 2.65606
13379 a_zsr(3,je) = -14.7730
13380 a_zsr(4,je) = 26.2936
13381 a_zsr(5,je) = -20.5735
13382 a_zsr(6,je) = 5.94255
13387 a_zsr(1,je) = 0.42922
13388 a_zsr(2,je) = -1.17718
13389 a_zsr(3,je) = 2.80208
13390 a_zsr(4,je) = -4.51097
13391 a_zsr(5,je) = 3.76963
13392 a_zsr(6,je) = -1.31359
13397 a_zsr(1,je) = 1.34966
13398 a_zsr(2,je) = -5.20116
13399 a_zsr(3,je) = 11.49011
13400 a_zsr(4,je) = -14.41380
13401 a_zsr(5,je) = 9.07037
13402 a_zsr(6,je) = -2.29769
13407 a_zsr(1,je) = 0.39888
13408 a_zsr(2,je) = -1.27150
13409 a_zsr(3,je) = 3.42792
13410 a_zsr(4,je) = -5.92632
13411 a_zsr(5,je) = 5.33351
13412 a_zsr(6,je) = -1.96541
13415 ! na3h(so4)2 added on 1/14/2004
13417 a_zsr(1,je) = 0.31480
13418 a_zsr(2,je) = -1.01087
13419 a_zsr(3,je) = 2.44029
13420 a_zsr(4,je) = -3.66095
13421 a_zsr(5,je) = 2.77632
13422 a_zsr(6,je) = -0.86058
13427 a_zsr(1,je) = 0.62764
13428 a_zsr(2,je) = -1.63520
13429 a_zsr(3,je) = 4.62531
13430 a_zsr(4,je) = -10.06925
13431 a_zsr(5,je) = 10.33547
13432 a_zsr(6,je) = -3.88729
13435 ! namsa (assumed same as nahso4)
13437 a_zsr(1,je) = 0.62764
13438 a_zsr(2,je) = -1.63520
13439 a_zsr(3,je) = 4.62531
13440 a_zsr(4,je) = -10.06925
13441 a_zsr(5,je) = 10.33547
13442 a_zsr(6,je) = -3.88729
13447 a_zsr(1,je) = 0.38895
13448 a_zsr(2,je) = -1.16013
13449 a_zsr(3,je) = 2.16819
13450 a_zsr(4,je) = -2.23079
13451 a_zsr(5,je) = 1.00268
13452 a_zsr(6,je) = -0.16923
13455 ! cacl2: kim and seinfeld
13457 a_zsr(1,je) = 0.29891
13458 a_zsr(2,je) = -1.31104
13459 a_zsr(3,je) = 3.68759
13460 a_zsr(4,je) = -5.81708
13461 a_zsr(5,je) = 4.67520
13462 a_zsr(6,je) = -1.53223
13467 a_zsr(1,je) = 0.32751
13468 a_zsr(2,je) = -1.00692
13469 a_zsr(3,je) = 2.59750
13470 a_zsr(4,je) = -4.40014
13471 a_zsr(5,je) = 3.88212
13472 a_zsr(6,je) = -1.39916
13475 ! msa (assumed same as h2so4)
13477 a_zsr(1,je) = 0.32751
13478 a_zsr(2,je) = -1.00692
13479 a_zsr(3,je) = 2.59750
13480 a_zsr(4,je) = -4.40014
13481 a_zsr(5,je) = 3.88212
13482 a_zsr(6,je) = -1.39916
13487 a_zsr(1,je) = 0.32751
13488 a_zsr(2,je) = -1.00692
13489 a_zsr(3,je) = 2.59750
13490 a_zsr(4,je) = -4.40014
13491 a_zsr(5,je) = 3.88212
13492 a_zsr(6,je) = -1.39916
13497 a_zsr(1,je) = 0.75876
13498 a_zsr(2,je) = -3.31529
13499 a_zsr(3,je) = 9.26392
13500 a_zsr(4,je) = -14.89799
13501 a_zsr(5,je) = 12.08781
13502 a_zsr(6,je) = -3.89958
13507 a_zsr(1,je) = 0.31133
13508 a_zsr(2,je) = -0.79688
13509 a_zsr(3,je) = 1.93995
13510 a_zsr(4,je) = -3.31582
13511 a_zsr(5,je) = 2.93513
13512 a_zsr(6,je) = -1.07268
13525 ! ca(msa)2 (assumed same as ca(no3)2)
13527 a_zsr(1,je) = 0.38895
13528 a_zsr(2,je) = -1.16013
13529 a_zsr(3,je) = 2.16819
13530 a_zsr(4,je) = -2.23079
13531 a_zsr(5,je) = 1.00268
13532 a_zsr(6,je) = -0.16923
13547 !-------------------------------------------
13548 ! b_zsr for aw => 0.97 to 0.99999
13551 b_zsr(jnh4so4) = 28.0811
13554 b_zsr(jlvcite) = 14.7178
13557 b_zsr(jnh4hso4) = 29.4779
13560 b_zsr(jnh4msa) = 29.4779 ! assumed same as nh4hso4
13563 b_zsr(jnh4no3) = 33.4049
13566 b_zsr(jnh4cl) = 30.8888
13569 b_zsr(jnacl) = 29.8375
13572 b_zsr(jnano3) = 32.2756
13575 b_zsr(jna2so4) = 27.6889
13578 b_zsr(jna3hso4) = 14.2184
13581 b_zsr(jnahso4) = 28.3367
13584 b_zsr(jnamsa) = 28.3367 ! assumed same as nahso4
13587 b_zsr(jcano3) = 18.3661
13590 b_zsr(jcacl2) = 20.8792
13593 b_zsr(jh2so4) = 26.7347
13596 b_zsr(jhhso4) = 26.7347
13599 b_zsr(jhno3) = 28.8257
13602 b_zsr(jhcl) = 27.7108
13605 b_zsr(jmsa) = 26.7347 ! assumed same as h2so4
13608 b_zsr(jcaso4) = 0.0
13611 b_zsr(jcamsa2) = 18.3661 ! assumed same as Ca(NO3)2
13614 b_zsr(jcaco3) = 0.0
13622 !----------------------------------------------------------------
13623 ! parameters for mtem mixing rule (zaveri, easter, and wexler, 2005)
13624 ! log_gamz(ja,je) a in e
13625 !----------------------------------------------------------------
13632 b_mtem(1,ja,je) = -2.94685
13633 b_mtem(2,ja,je) = 17.3328
13634 b_mtem(3,ja,je) = -64.8441
13635 b_mtem(4,ja,je) = 122.7070
13636 b_mtem(5,ja,je) = -114.4373
13637 b_mtem(6,ja,je) = 41.6811
13641 b_mtem(1,ja,je) = -2.7503
13642 b_mtem(2,ja,je) = 4.3806
13643 b_mtem(3,ja,je) = -1.1110
13644 b_mtem(4,ja,je) = -1.7005
13645 b_mtem(5,ja,je) = -4.4207
13646 b_mtem(6,ja,je) = 5.1990
13648 ! in nh4cl (revised on 11/15/2003)
13650 b_mtem(1,ja,je) = -2.06952
13651 b_mtem(2,ja,je) = 7.1240
13652 b_mtem(3,ja,je) = -24.4274
13653 b_mtem(4,ja,je) = 51.1458
13654 b_mtem(5,ja,je) = -54.2056
13655 b_mtem(6,ja,je) = 22.0606
13659 b_mtem(1,ja,je) = -2.17361
13660 b_mtem(2,ja,je) = 15.9919
13661 b_mtem(3,ja,je) = -69.0952
13662 b_mtem(4,ja,je) = 139.8860
13663 b_mtem(5,ja,je) = -134.9890
13664 b_mtem(6,ja,je) = 49.8877
13668 b_mtem(1,ja,je) = -4.4370
13669 b_mtem(2,ja,je) = 24.0243
13670 b_mtem(3,ja,je) = -76.2437
13671 b_mtem(4,ja,je) = 128.6660
13672 b_mtem(5,ja,je) = -110.0900
13673 b_mtem(6,ja,je) = 37.7414
13677 b_mtem(1,ja,je) = -1.5394
13678 b_mtem(2,ja,je) = 5.8671
13679 b_mtem(3,ja,je) = -22.7726
13680 b_mtem(4,ja,je) = 47.0547
13681 b_mtem(5,ja,je) = -47.8266
13682 b_mtem(6,ja,je) = 18.8489
13686 b_mtem(1,ja,je) = -0.35750
13687 b_mtem(2,ja,je) = -3.82466
13688 b_mtem(3,ja,je) = 4.55462
13689 b_mtem(4,ja,je) = 5.05402
13690 b_mtem(5,ja,je) = -14.7476
13691 b_mtem(6,ja,je) = 8.8009
13695 b_mtem(1,ja,je) = -2.15146
13696 b_mtem(2,ja,je) = 5.50205
13697 b_mtem(3,ja,je) = -19.1476
13698 b_mtem(4,ja,je) = 39.1880
13699 b_mtem(5,ja,je) = -39.9460
13700 b_mtem(6,ja,je) = 16.0700
13704 b_mtem(1,ja,je) = -2.52604
13705 b_mtem(2,ja,je) = 9.76022
13706 b_mtem(3,ja,je) = -35.2540
13707 b_mtem(4,ja,je) = 71.2981
13708 b_mtem(5,ja,je) = -71.8207
13709 b_mtem(6,ja,je) = 28.0758
13714 b_mtem(1,ja,je) = -4.13219
13715 b_mtem(2,ja,je) = 13.8863
13716 b_mtem(3,ja,je) = -34.5387
13717 b_mtem(4,ja,je) = 56.5012
13718 b_mtem(5,ja,je) = -51.8702
13719 b_mtem(6,ja,je) = 19.6232
13724 b_mtem(1,ja,je) = -2.53482
13725 b_mtem(2,ja,je) = 12.3333
13726 b_mtem(3,ja,je) = -46.1020
13727 b_mtem(4,ja,je) = 90.4775
13728 b_mtem(5,ja,je) = -88.1254
13729 b_mtem(6,ja,je) = 33.4715
13734 b_mtem(1,ja,je) = -3.23425
13735 b_mtem(2,ja,je) = 18.7842
13736 b_mtem(3,ja,je) = -78.7807
13737 b_mtem(4,ja,je) = 161.517
13738 b_mtem(5,ja,je) = -154.940
13739 b_mtem(6,ja,je) = 56.2252
13744 b_mtem(1,ja,je) = -1.25316
13745 b_mtem(2,ja,je) = 7.40960
13746 b_mtem(3,ja,je) = -34.8929
13747 b_mtem(4,ja,je) = 72.8853
13748 b_mtem(5,ja,je) = -72.4503
13749 b_mtem(6,ja,je) = 27.7706
13758 b_mtem(1,ja,je) = -3.5201
13759 b_mtem(2,ja,je) = 21.6584
13760 b_mtem(3,ja,je) = -72.1499
13761 b_mtem(4,ja,je) = 126.7000
13762 b_mtem(5,ja,je) = -111.4550
13763 b_mtem(6,ja,je) = 38.5677
13767 b_mtem(1,ja,je) = -2.2630
13768 b_mtem(2,ja,je) = -0.1518
13769 b_mtem(3,ja,je) = 17.0898
13770 b_mtem(4,ja,je) = -36.7832
13771 b_mtem(5,ja,je) = 29.8407
13772 b_mtem(6,ja,je) = -7.9314
13774 ! in nh4cl (revised on 11/15/2003)
13776 b_mtem(1,ja,je) = -1.3851
13777 b_mtem(2,ja,je) = -0.4462
13778 b_mtem(3,ja,je) = 8.4567
13779 b_mtem(4,ja,je) = -11.5988
13780 b_mtem(5,ja,je) = 2.9802
13781 b_mtem(6,ja,je) = 1.8132
13785 b_mtem(1,ja,je) = -1.7602
13786 b_mtem(2,ja,je) = 10.4044
13787 b_mtem(3,ja,je) = -35.5894
13788 b_mtem(4,ja,je) = 64.3584
13789 b_mtem(5,ja,je) = -57.8931
13790 b_mtem(6,ja,je) = 20.2141
13794 b_mtem(1,ja,je) = -3.24346
13795 b_mtem(2,ja,je) = 16.2794
13796 b_mtem(3,ja,je) = -48.7601
13797 b_mtem(4,ja,je) = 79.2246
13798 b_mtem(5,ja,je) = -65.8169
13799 b_mtem(6,ja,je) = 22.1500
13803 b_mtem(1,ja,je) = -1.75658
13804 b_mtem(2,ja,je) = 7.71384
13805 b_mtem(3,ja,je) = -22.7984
13806 b_mtem(4,ja,je) = 39.1532
13807 b_mtem(5,ja,je) = -34.6165
13808 b_mtem(6,ja,je) = 12.1283
13812 b_mtem(1,ja,je) = -0.97178
13813 b_mtem(2,ja,je) = 6.61964
13814 b_mtem(3,ja,je) = -26.2353
13815 b_mtem(4,ja,je) = 50.5259
13816 b_mtem(5,ja,je) = -47.6586
13817 b_mtem(6,ja,je) = 17.5074
13819 ! in cacl2 added on 12/22/2003
13821 b_mtem(1,ja,je) = -0.41515
13822 b_mtem(2,ja,je) = 6.44101
13823 b_mtem(3,ja,je) = -26.4473
13824 b_mtem(4,ja,je) = 49.0718
13825 b_mtem(5,ja,je) = -44.2631
13826 b_mtem(6,ja,je) = 15.3771
13830 b_mtem(1,ja,je) = -1.20644
13831 b_mtem(2,ja,je) = 5.70117
13832 b_mtem(3,ja,je) = -18.2783
13833 b_mtem(4,ja,je) = 31.7199
13834 b_mtem(5,ja,je) = -27.8703
13835 b_mtem(6,ja,je) = 9.7299
13839 b_mtem(1,ja,je) = -0.680862
13840 b_mtem(2,ja,je) = 3.59456
13841 b_mtem(3,ja,je) = -10.7969
13842 b_mtem(4,ja,je) = 17.8434
13843 b_mtem(5,ja,je) = -15.3165
13844 b_mtem(6,ja,je) = 5.17123
13853 b_mtem(1,ja,je) = -2.8850
13854 b_mtem(2,ja,je) = 20.6970
13855 b_mtem(3,ja,je) = -70.6810
13856 b_mtem(4,ja,je) = 124.3690
13857 b_mtem(5,ja,je) = -109.2880
13858 b_mtem(6,ja,je) = 37.5831
13862 b_mtem(1,ja,je) = -1.9386
13863 b_mtem(2,ja,je) = 1.3238
13864 b_mtem(3,ja,je) = 11.8500
13865 b_mtem(4,ja,je) = -28.1168
13866 b_mtem(5,ja,je) = 21.8543
13867 b_mtem(6,ja,je) = -5.1671
13869 ! in nh4cl (revised on 11/15/2003)
13871 b_mtem(1,ja,je) = -0.9559
13872 b_mtem(2,ja,je) = 0.8121
13873 b_mtem(3,ja,je) = 4.3644
13874 b_mtem(4,ja,je) = -8.9258
13875 b_mtem(5,ja,je) = 4.2362
13876 b_mtem(6,ja,je) = 0.2891
13880 b_mtem(1,ja,je) = 0.0377
13881 b_mtem(2,ja,je) = 6.0752
13882 b_mtem(3,ja,je) = -30.8641
13883 b_mtem(4,ja,je) = 63.3095
13884 b_mtem(5,ja,je) = -61.0070
13885 b_mtem(6,ja,je) = 22.1734
13889 b_mtem(1,ja,je) = -1.8336
13890 b_mtem(2,ja,je) = 12.8160
13891 b_mtem(3,ja,je) = -42.3388
13892 b_mtem(4,ja,je) = 71.1816
13893 b_mtem(5,ja,je) = -60.5708
13894 b_mtem(6,ja,je) = 20.5853
13898 b_mtem(1,ja,je) = -0.1429
13899 b_mtem(2,ja,je) = 2.3561
13900 b_mtem(3,ja,je) = -10.4425
13901 b_mtem(4,ja,je) = 20.8951
13902 b_mtem(5,ja,je) = -20.7739
13903 b_mtem(6,ja,je) = 7.9355
13907 b_mtem(1,ja,je) = 0.76235
13908 b_mtem(2,ja,je) = 3.08323
13909 b_mtem(3,ja,je) = -23.6772
13910 b_mtem(4,ja,je) = 53.7415
13911 b_mtem(5,ja,je) = -55.4043
13912 b_mtem(6,ja,je) = 21.2944
13914 ! in cacl2 (revised on 11/27/2003)
13916 b_mtem(1,ja,je) = 1.13864
13917 b_mtem(2,ja,je) = -0.340539
13918 b_mtem(3,ja,je) = -8.67025
13919 b_mtem(4,ja,je) = 22.8008
13920 b_mtem(5,ja,je) = -24.5181
13921 b_mtem(6,ja,je) = 9.3663
13925 b_mtem(1,ja,je) = 2.42532
13926 b_mtem(2,ja,je) = -14.1755
13927 b_mtem(3,ja,je) = 38.804
13928 b_mtem(4,ja,je) = -58.2437
13929 b_mtem(5,ja,je) = 43.5431
13930 b_mtem(6,ja,je) = -12.5824
13934 b_mtem(1,ja,je) = 0.330337
13935 b_mtem(2,ja,je) = 0.0778934
13936 b_mtem(3,ja,je) = -2.30492
13937 b_mtem(4,ja,je) = 4.73003
13938 b_mtem(5,ja,je) = -4.80849
13939 b_mtem(6,ja,je) = 1.78866
13948 b_mtem(1,ja,je) = -2.6982
13949 b_mtem(2,ja,je) = 22.9875
13950 b_mtem(3,ja,je) = -98.9840
13951 b_mtem(4,ja,je) = 198.0180
13952 b_mtem(5,ja,je) = -188.7270
13953 b_mtem(6,ja,je) = 69.0548
13957 b_mtem(1,ja,je) = -2.4844
13958 b_mtem(2,ja,je) = 6.5420
13959 b_mtem(3,ja,je) = -9.8998
13960 b_mtem(4,ja,je) = 11.3884
13961 b_mtem(5,ja,je) = -13.6842
13962 b_mtem(6,ja,je) = 7.7411
13964 ! in nh4cl (revised on 11/15/2003)
13966 b_mtem(1,ja,je) = -1.3325
13967 b_mtem(2,ja,je) = 13.0406
13968 b_mtem(3,ja,je) = -56.1935
13969 b_mtem(4,ja,je) = 107.1170
13970 b_mtem(5,ja,je) = -97.3721
13971 b_mtem(6,ja,je) = 34.3763
13975 b_mtem(1,ja,je) = -1.2832
13976 b_mtem(2,ja,je) = 12.8526
13977 b_mtem(3,ja,je) = -62.2087
13978 b_mtem(4,ja,je) = 130.3876
13979 b_mtem(5,ja,je) = -128.2627
13980 b_mtem(6,ja,je) = 48.0340
13984 b_mtem(1,ja,je) = -3.5384
13985 b_mtem(2,ja,je) = 21.3758
13986 b_mtem(3,ja,je) = -70.7638
13987 b_mtem(4,ja,je) = 121.1580
13988 b_mtem(5,ja,je) = -104.6230
13989 b_mtem(6,ja,je) = 36.0557
13993 b_mtem(1,ja,je) = 0.2175
13994 b_mtem(2,ja,je) = -0.5648
13995 b_mtem(3,ja,je) = -8.0288
13996 b_mtem(4,ja,je) = 25.9734
13997 b_mtem(5,ja,je) = -32.3577
13998 b_mtem(6,ja,je) = 14.3924
14002 b_mtem(1,ja,je) = -0.309617
14003 b_mtem(2,ja,je) = -1.82899
14004 b_mtem(3,ja,je) = -1.5505
14005 b_mtem(4,ja,je) = 13.3847
14006 b_mtem(5,ja,je) = -20.1284
14007 b_mtem(6,ja,je) = 9.93163
14011 b_mtem(1,ja,je) = -0.259455
14012 b_mtem(2,ja,je) = -0.819366
14013 b_mtem(3,ja,je) = -4.28964
14014 b_mtem(4,ja,je) = 16.4305
14015 b_mtem(5,ja,je) = -21.8546
14016 b_mtem(6,ja,je) = 10.3044
14020 b_mtem(1,ja,je) = -1.84257
14021 b_mtem(2,ja,je) = 7.85788
14022 b_mtem(3,ja,je) = -29.9275
14023 b_mtem(4,ja,je) = 61.7515
14024 b_mtem(5,ja,je) = -63.2308
14025 b_mtem(6,ja,je) = 24.9542
14029 b_mtem(1,ja,je) = -1.05891
14030 b_mtem(2,ja,je) = 2.84831
14031 b_mtem(3,ja,je) = -21.1827
14032 b_mtem(4,ja,je) = 57.5175
14033 b_mtem(5,ja,je) = -64.8120
14034 b_mtem(6,ja,je) = 26.1986
14038 b_mtem(1,ja,je) = -1.16584
14039 b_mtem(2,ja,je) = 8.50075
14040 b_mtem(3,ja,je) = -44.3420
14041 b_mtem(4,ja,je) = 97.3974
14042 b_mtem(5,ja,je) = -98.4549
14043 b_mtem(6,ja,je) = 37.6104
14047 b_mtem(1,ja,je) = -1.95805
14048 b_mtem(2,ja,je) = 6.62417
14049 b_mtem(3,ja,je) = -31.8072
14050 b_mtem(4,ja,je) = 77.8603
14051 b_mtem(5,ja,je) = -84.6458
14052 b_mtem(6,ja,je) = 33.4963
14056 b_mtem(1,ja,je) = -0.36045
14057 b_mtem(2,ja,je) = 3.55223
14058 b_mtem(3,ja,je) = -24.0327
14059 b_mtem(4,ja,je) = 54.4879
14060 b_mtem(5,ja,je) = -56.6531
14061 b_mtem(6,ja,je) = 22.4956
14070 b_mtem(1,ja,je) = -2.5888
14071 b_mtem(2,ja,je) = 17.6192
14072 b_mtem(3,ja,je) = -63.2183
14073 b_mtem(4,ja,je) = 115.3520
14074 b_mtem(5,ja,je) = -104.0860
14075 b_mtem(6,ja,je) = 36.7390
14079 b_mtem(1,ja,je) = -2.0669
14080 b_mtem(2,ja,je) = 1.4792
14081 b_mtem(3,ja,je) = 10.5261
14082 b_mtem(4,ja,je) = -27.0987
14083 b_mtem(5,ja,je) = 23.0591
14084 b_mtem(6,ja,je) = -6.0938
14086 ! in nh4cl (revised on 11/15/2003)
14088 b_mtem(1,ja,je) = -0.8325
14089 b_mtem(2,ja,je) = 3.9933
14090 b_mtem(3,ja,je) = -15.3789
14091 b_mtem(4,ja,je) = 30.4050
14092 b_mtem(5,ja,je) = -29.4204
14093 b_mtem(6,ja,je) = 11.0597
14097 b_mtem(1,ja,je) = -1.1233
14098 b_mtem(2,ja,je) = 8.3998
14099 b_mtem(3,ja,je) = -31.9002
14100 b_mtem(4,ja,je) = 60.1450
14101 b_mtem(5,ja,je) = -55.5503
14102 b_mtem(6,ja,je) = 19.7757
14106 b_mtem(1,ja,je) = -2.5386
14107 b_mtem(2,ja,je) = 13.9039
14108 b_mtem(3,ja,je) = -42.8467
14109 b_mtem(4,ja,je) = 69.7442
14110 b_mtem(5,ja,je) = -57.8988
14111 b_mtem(6,ja,je) = 19.4635
14115 b_mtem(1,ja,je) = -0.4351
14116 b_mtem(2,ja,je) = 2.8311
14117 b_mtem(3,ja,je) = -11.4485
14118 b_mtem(4,ja,je) = 22.7201
14119 b_mtem(5,ja,je) = -22.4228
14120 b_mtem(6,ja,je) = 8.5792
14124 b_mtem(1,ja,je) = -0.72060
14125 b_mtem(2,ja,je) = 5.64915
14126 b_mtem(3,ja,je) = -23.5020
14127 b_mtem(4,ja,je) = 46.0078
14128 b_mtem(5,ja,je) = -43.8075
14129 b_mtem(6,ja,je) = 16.1652
14133 b_mtem(1,ja,je) = 0.003928
14134 b_mtem(2,ja,je) = 3.54724
14135 b_mtem(3,ja,je) = -18.6057
14136 b_mtem(4,ja,je) = 38.1445
14137 b_mtem(5,ja,je) = -36.7745
14138 b_mtem(6,ja,je) = 13.4529
14142 b_mtem(1,ja,je) = -1.1712
14143 b_mtem(2,ja,je) = 7.20907
14144 b_mtem(3,ja,je) = -22.9215
14145 b_mtem(4,ja,je) = 38.1257
14146 b_mtem(5,ja,je) = -32.0759
14147 b_mtem(6,ja,je) = 10.6443
14151 b_mtem(1,ja,je) = 0.738022
14152 b_mtem(2,ja,je) = -1.14313
14153 b_mtem(3,ja,je) = 0.32251
14154 b_mtem(4,ja,je) = 0.838679
14155 b_mtem(5,ja,je) = -1.81747
14156 b_mtem(6,ja,je) = 0.873986
14165 b_mtem(1,ja,je) = -1.9525
14166 b_mtem(2,ja,je) = 16.6433
14167 b_mtem(3,ja,je) = -61.7090
14168 b_mtem(4,ja,je) = 112.9910
14169 b_mtem(5,ja,je) = -101.9370
14170 b_mtem(6,ja,je) = 35.7760
14174 b_mtem(1,ja,je) = -1.7525
14175 b_mtem(2,ja,je) = 3.0713
14176 b_mtem(3,ja,je) = 4.8063
14177 b_mtem(4,ja,je) = -17.5334
14178 b_mtem(5,ja,je) = 14.2872
14179 b_mtem(6,ja,je) = -3.0690
14181 ! in nh4cl (revised on 11/15/2003)
14183 b_mtem(1,ja,je) = -0.4021
14184 b_mtem(2,ja,je) = 5.2399
14185 b_mtem(3,ja,je) = -19.4278
14186 b_mtem(4,ja,je) = 33.0027
14187 b_mtem(5,ja,je) = -28.1020
14188 b_mtem(6,ja,je) = 9.5159
14192 b_mtem(1,ja,je) = 0.6692
14193 b_mtem(2,ja,je) = 4.1207
14194 b_mtem(3,ja,je) = -27.3314
14195 b_mtem(4,ja,je) = 59.3112
14196 b_mtem(5,ja,je) = -58.7998
14197 b_mtem(6,ja,je) = 21.7674
14201 b_mtem(1,ja,je) = -1.17444
14202 b_mtem(2,ja,je) = 10.9927
14203 b_mtem(3,ja,je) = -38.9013
14204 b_mtem(4,ja,je) = 66.8521
14205 b_mtem(5,ja,je) = -57.6564
14206 b_mtem(6,ja,je) = 19.7296
14210 b_mtem(1,ja,je) = 1.17679
14211 b_mtem(2,ja,je) = -2.5061
14212 b_mtem(3,ja,je) = 0.8508
14213 b_mtem(4,ja,je) = 4.4802
14214 b_mtem(5,ja,je) = -8.4945
14215 b_mtem(6,ja,je) = 4.3182
14219 b_mtem(1,ja,je) = 1.01450
14220 b_mtem(2,ja,je) = 2.10260
14221 b_mtem(3,ja,je) = -20.9036
14222 b_mtem(4,ja,je) = 49.1481
14223 b_mtem(5,ja,je) = -51.4867
14224 b_mtem(6,ja,je) = 19.9301
14226 ! in cacl2 (psc92: revised on 11/27/2003)
14228 b_mtem(1,ja,je) = 1.55463
14229 b_mtem(2,ja,je) = -3.20122
14230 b_mtem(3,ja,je) = -0.957075
14231 b_mtem(4,ja,je) = 12.103
14232 b_mtem(5,ja,je) = -17.221
14233 b_mtem(6,ja,je) = 7.50264
14237 b_mtem(1,ja,je) = 2.46187
14238 b_mtem(2,ja,je) = -12.6845
14239 b_mtem(3,ja,je) = 34.2383
14240 b_mtem(4,ja,je) = -51.9992
14241 b_mtem(5,ja,je) = 39.4934
14242 b_mtem(6,ja,je) = -11.7247
14246 b_mtem(1,ja,je) = 1.74915
14247 b_mtem(2,ja,je) = -4.65768
14248 b_mtem(3,ja,je) = 8.80287
14249 b_mtem(4,ja,je) = -12.2503
14250 b_mtem(5,ja,je) = 8.668751
14251 b_mtem(6,ja,je) = -2.50158
14260 b_mtem(1,ja,je) = -1.86260
14261 b_mtem(2,ja,je) = 11.6178
14262 b_mtem(3,ja,je) = -30.9069
14263 b_mtem(4,ja,je) = 41.7578
14264 b_mtem(5,ja,je) = -33.7338
14265 b_mtem(6,ja,je) = 12.7541
14267 ! in nh4cl (revised on 11/15/2003)
14269 b_mtem(1,ja,je) = -1.1798
14270 b_mtem(2,ja,je) = 25.9608
14271 b_mtem(3,ja,je) = -98.9373
14272 b_mtem(4,ja,je) = 160.2300
14273 b_mtem(5,ja,je) = -125.9540
14274 b_mtem(6,ja,je) = 39.5130
14278 b_mtem(1,ja,je) = -1.44384
14279 b_mtem(2,ja,je) = 13.6044
14280 b_mtem(3,ja,je) = -54.4300
14281 b_mtem(4,ja,je) = 100.582
14282 b_mtem(5,ja,je) = -91.2364
14283 b_mtem(6,ja,je) = 32.5970
14287 b_mtem(1,ja,je) = -0.099114
14288 b_mtem(2,ja,je) = 2.84091
14289 b_mtem(3,ja,je) = -16.9229
14290 b_mtem(4,ja,je) = 37.4839
14291 b_mtem(5,ja,je) = -39.5132
14292 b_mtem(6,ja,je) = 15.8564
14296 b_mtem(1,ja,je) = 0.055116
14297 b_mtem(2,ja,je) = 4.58610
14298 b_mtem(3,ja,je) = -27.6629
14299 b_mtem(4,ja,je) = 60.8288
14300 b_mtem(5,ja,je) = -61.4988
14301 b_mtem(6,ja,je) = 23.3136
14303 ! in cacl2 (psc92: revised on 11/27/2003)
14305 b_mtem(1,ja,je) = 1.57155
14306 b_mtem(2,ja,je) = -3.18486
14307 b_mtem(3,ja,je) = -3.35758
14308 b_mtem(4,ja,je) = 18.7501
14309 b_mtem(5,ja,je) = -24.5604
14310 b_mtem(6,ja,je) = 10.3798
14314 b_mtem(1,ja,je) = 1.04446
14315 b_mtem(2,ja,je) = -3.19066
14316 b_mtem(3,ja,je) = 2.44714
14317 b_mtem(4,ja,je) = 2.07218
14318 b_mtem(5,ja,je) = -6.43949
14319 b_mtem(6,ja,je) = 3.66471
14323 b_mtem(1,ja,je) = 1.05723
14324 b_mtem(2,ja,je) = -1.46826
14325 b_mtem(3,ja,je) = -1.0713
14326 b_mtem(4,ja,je) = 4.64439
14327 b_mtem(5,ja,je) = -6.32402
14328 b_mtem(6,ja,je) = 2.78202
14335 ! in nh4no3 (psc92: revised on 12/22/2003)
14337 b_mtem(1,ja,je) = -1.43626
14338 b_mtem(2,ja,je) = 13.6598
14339 b_mtem(3,ja,je) = -38.2068
14340 b_mtem(4,ja,je) = 53.9057
14341 b_mtem(5,ja,je) = -44.9018
14342 b_mtem(6,ja,je) = 16.6120
14344 ! in nh4cl (psc92: revised on 11/27/2003)
14346 b_mtem(1,ja,je) = -0.603965
14347 b_mtem(2,ja,je) = 27.6027
14348 b_mtem(3,ja,je) = -104.258
14349 b_mtem(4,ja,je) = 163.553
14350 b_mtem(5,ja,je) = -124.076
14351 b_mtem(6,ja,je) = 37.4153
14353 ! in nano3 (psc92: revised on 12/22/2003)
14355 b_mtem(1,ja,je) = 0.44648
14356 b_mtem(2,ja,je) = 8.8850
14357 b_mtem(3,ja,je) = -45.5232
14358 b_mtem(4,ja,je) = 89.3263
14359 b_mtem(5,ja,je) = -83.8604
14360 b_mtem(6,ja,je) = 30.4069
14362 ! in nacl (psc92: revised on 11/27/2003)
14364 b_mtem(1,ja,je) = 1.61927
14365 b_mtem(2,ja,je) = 0.247547
14366 b_mtem(3,ja,je) = -18.1252
14367 b_mtem(4,ja,je) = 45.2479
14368 b_mtem(5,ja,je) = -48.6072
14369 b_mtem(6,ja,je) = 19.2784
14371 ! in ca(no3)2 (psc92: revised on 11/27/2003)
14373 b_mtem(1,ja,je) = 2.36667
14374 b_mtem(2,ja,je) = -0.123309
14375 b_mtem(3,ja,je) = -24.2723
14376 b_mtem(4,ja,je) = 65.1486
14377 b_mtem(5,ja,je) = -71.8504
14378 b_mtem(6,ja,je) = 28.3696
14380 ! in cacl2 (psc92: revised on 11/27/2003)
14382 b_mtem(1,ja,je) = 3.64023
14383 b_mtem(2,ja,je) = -12.1926
14384 b_mtem(3,ja,je) = 20.2028
14385 b_mtem(4,ja,je) = -16.0056
14386 b_mtem(5,ja,je) = 1.52355
14387 b_mtem(6,ja,je) = 2.44709
14391 b_mtem(1,ja,je) = 5.88794
14392 b_mtem(2,ja,je) = -29.7083
14393 b_mtem(3,ja,je) = 78.6309
14394 b_mtem(4,ja,je) = -118.037
14395 b_mtem(5,ja,je) = 88.932
14396 b_mtem(6,ja,je) = -26.1407
14400 b_mtem(1,ja,je) = 2.40628
14401 b_mtem(2,ja,je) = -6.16566
14402 b_mtem(3,ja,je) = 10.2851
14403 b_mtem(4,ja,je) = -12.9035
14404 b_mtem(5,ja,je) = 7.7441
14405 b_mtem(6,ja,je) = -1.74821
14414 b_mtem(1,ja,je) = -3.57598
14415 b_mtem(2,ja,je) = 21.5469
14416 b_mtem(3,ja,je) = -77.4111
14417 b_mtem(4,ja,je) = 144.136
14418 b_mtem(5,ja,je) = -132.849
14419 b_mtem(6,ja,je) = 47.9412
14423 b_mtem(1,ja,je) = -2.00209
14424 b_mtem(2,ja,je) = -3.48399
14425 b_mtem(3,ja,je) = 34.9906
14426 b_mtem(4,ja,je) = -68.6653
14427 b_mtem(5,ja,je) = 54.0992
14428 b_mtem(6,ja,je) = -15.1343
14430 ! in nh4cl revised on 12/22/2003
14432 b_mtem(1,ja,je) = -0.63790
14433 b_mtem(2,ja,je) = -1.67730
14434 b_mtem(3,ja,je) = 10.1727
14435 b_mtem(4,ja,je) = -14.9097
14436 b_mtem(5,ja,je) = 7.67410
14437 b_mtem(6,ja,je) = -0.79586
14441 b_mtem(1,ja,je) = 1.3446
14442 b_mtem(2,ja,je) = -2.5578
14443 b_mtem(3,ja,je) = 1.3464
14444 b_mtem(4,ja,je) = 2.90537
14445 b_mtem(5,ja,je) = -6.53014
14446 b_mtem(6,ja,je) = 3.31339
14450 b_mtem(1,ja,je) = -0.546636
14451 b_mtem(2,ja,je) = 10.3127
14452 b_mtem(3,ja,je) = -39.9603
14453 b_mtem(4,ja,je) = 71.4609
14454 b_mtem(5,ja,je) = -63.4958
14455 b_mtem(6,ja,je) = 22.0679
14459 b_mtem(1,ja,je) = 1.35059
14460 b_mtem(2,ja,je) = 4.34557
14461 b_mtem(3,ja,je) = -35.8425
14462 b_mtem(4,ja,je) = 80.9868
14463 b_mtem(5,ja,je) = -81.6544
14464 b_mtem(6,ja,je) = 30.4841
14468 b_mtem(1,ja,je) = 0.869414
14469 b_mtem(2,ja,je) = 2.98486
14470 b_mtem(3,ja,je) = -22.255
14471 b_mtem(4,ja,je) = 50.1863
14472 b_mtem(5,ja,je) = -51.214
14473 b_mtem(6,ja,je) = 19.2235
14475 ! in cacl2 (km) revised on 12/22/2003
14477 b_mtem(1,ja,je) = 1.42800
14478 b_mtem(2,ja,je) = -1.78959
14479 b_mtem(3,ja,je) = -2.49075
14480 b_mtem(4,ja,je) = 10.1877
14481 b_mtem(5,ja,je) = -12.1948
14482 b_mtem(6,ja,je) = 4.64475
14484 ! in hno3 (added on 12/06/2004)
14486 b_mtem(1,ja,je) = 0.22035
14487 b_mtem(2,ja,je) = 2.94973
14488 b_mtem(3,ja,je) = -12.1469
14489 b_mtem(4,ja,je) = 20.4905
14490 b_mtem(5,ja,je) = -17.3966
14491 b_mtem(6,ja,je) = 5.70779
14493 ! in hcl (added on 12/06/2004)
14495 b_mtem(1,ja,je) = 1.55503
14496 b_mtem(2,ja,je) = -3.61226
14497 b_mtem(3,ja,je) = 6.28265
14498 b_mtem(4,ja,je) = -8.69575
14499 b_mtem(5,ja,je) = 6.09372
14500 b_mtem(6,ja,je) = -1.80898
14504 b_mtem(1,ja,je) = 1.10783
14505 b_mtem(2,ja,je) = -1.3363
14506 b_mtem(3,ja,je) = -1.83525
14507 b_mtem(4,ja,je) = 7.47373
14508 b_mtem(5,ja,je) = -9.72954
14509 b_mtem(6,ja,je) = 4.12248
14513 b_mtem(1,ja,je) = -0.851026
14514 b_mtem(2,ja,je) = 12.2515
14515 b_mtem(3,ja,je) = -49.788
14516 b_mtem(4,ja,je) = 91.6215
14517 b_mtem(5,ja,je) = -81.4877
14518 b_mtem(6,ja,je) = 28.0002
14522 b_mtem(1,ja,je) = -3.09464
14523 b_mtem(2,ja,je) = 14.9303
14524 b_mtem(3,ja,je) = -43.0454
14525 b_mtem(4,ja,je) = 72.6695
14526 b_mtem(5,ja,je) = -65.2140
14527 b_mtem(6,ja,je) = 23.4814
14531 b_mtem(1,ja,je) = 1.22973
14532 b_mtem(2,ja,je) = 2.82702
14533 b_mtem(3,ja,je) = -17.5869
14534 b_mtem(4,ja,je) = 28.9564
14535 b_mtem(5,ja,je) = -23.5814
14536 b_mtem(6,ja,je) = 7.91153
14540 b_mtem(1,ja,je) = 1.64773
14541 b_mtem(2,ja,je) = 0.94188
14542 b_mtem(3,ja,je) = -19.1242
14543 b_mtem(4,ja,je) = 46.9887
14544 b_mtem(5,ja,je) = -50.9494
14545 b_mtem(6,ja,je) = 20.2169
14554 b_mtem(1,ja,je) = -2.93783
14555 b_mtem(2,ja,je) = 20.5546
14556 b_mtem(3,ja,je) = -75.8548
14557 b_mtem(4,ja,je) = 141.729
14558 b_mtem(5,ja,je) = -130.697
14559 b_mtem(6,ja,je) = 46.9905
14563 b_mtem(1,ja,je) = -1.69063
14564 b_mtem(2,ja,je) = -1.85303
14565 b_mtem(3,ja,je) = 29.0927
14566 b_mtem(4,ja,je) = -58.7401
14567 b_mtem(5,ja,je) = 44.999
14568 b_mtem(6,ja,je) = -11.9988
14570 ! in nh4cl (revised on 11/15/2003)
14572 b_mtem(1,ja,je) = -0.2073
14573 b_mtem(2,ja,je) = -0.4322
14574 b_mtem(3,ja,je) = 6.1271
14575 b_mtem(4,ja,je) = -12.3146
14576 b_mtem(5,ja,je) = 8.9919
14577 b_mtem(6,ja,je) = -2.3388
14581 b_mtem(1,ja,je) = 2.95913
14582 b_mtem(2,ja,je) = -7.92254
14583 b_mtem(3,ja,je) = 13.736
14584 b_mtem(4,ja,je) = -15.433
14585 b_mtem(5,ja,je) = 7.40386
14586 b_mtem(6,ja,je) = -0.918641
14590 b_mtem(1,ja,je) = 0.893272
14591 b_mtem(2,ja,je) = 6.53768
14592 b_mtem(3,ja,je) = -32.3458
14593 b_mtem(4,ja,je) = 61.2834
14594 b_mtem(5,ja,je) = -56.4446
14595 b_mtem(6,ja,je) = 19.9202
14599 b_mtem(1,ja,je) = 3.14484
14600 b_mtem(2,ja,je) = 0.077019
14601 b_mtem(3,ja,je) = -31.4199
14602 b_mtem(4,ja,je) = 80.5865
14603 b_mtem(5,ja,je) = -85.392
14604 b_mtem(6,ja,je) = 32.6644
14608 b_mtem(1,ja,je) = 2.60432
14609 b_mtem(2,ja,je) = -0.55909
14610 b_mtem(3,ja,je) = -19.6671
14611 b_mtem(4,ja,je) = 53.3446
14612 b_mtem(5,ja,je) = -58.9076
14613 b_mtem(6,ja,je) = 22.9927
14615 ! in cacl2 (km) revised on 3/13/2003 and again on 11/27/2003
14617 b_mtem(1,ja,je) = 2.98036
14618 b_mtem(2,ja,je) = -8.55365
14619 b_mtem(3,ja,je) = 15.2108
14620 b_mtem(4,ja,je) = -15.9359
14621 b_mtem(5,ja,je) = 7.41772
14622 b_mtem(6,ja,je) = -1.32143
14624 ! in hno3 (added on 12/06/2004)
14626 b_mtem(1,ja,je) = 3.8533
14627 b_mtem(2,ja,je) = -16.9427
14628 b_mtem(3,ja,je) = 45.0056
14629 b_mtem(4,ja,je) = -69.6145
14630 b_mtem(5,ja,je) = 54.1491
14631 b_mtem(6,ja,je) = -16.6513
14633 ! in hcl (added on 12/06/2004)
14635 b_mtem(1,ja,je) = 2.56665
14636 b_mtem(2,ja,je) = -7.13585
14637 b_mtem(3,ja,je) = 14.8103
14638 b_mtem(4,ja,je) = -21.8881
14639 b_mtem(5,ja,je) = 16.6808
14640 b_mtem(6,ja,je) = -5.22091
14644 b_mtem(1,ja,je) = 2.50179
14645 b_mtem(2,ja,je) = -6.69364
14646 b_mtem(3,ja,je) = 11.6551
14647 b_mtem(4,ja,je) = -13.6897
14648 b_mtem(5,ja,je) = 7.36796
14649 b_mtem(6,ja,je) = -1.33245
14653 b_mtem(1,ja,je) = 0.149955
14654 b_mtem(2,ja,je) = 11.8213
14655 b_mtem(3,ja,je) = -53.9164
14656 b_mtem(4,ja,je) = 101.574
14657 b_mtem(5,ja,je) = -91.4123
14658 b_mtem(6,ja,je) = 31.5487
14662 b_mtem(1,ja,je) = -2.36927
14663 b_mtem(2,ja,je) = 14.8359
14664 b_mtem(3,ja,je) = -44.3443
14665 b_mtem(4,ja,je) = 73.6229
14666 b_mtem(5,ja,je) = -65.3366
14667 b_mtem(6,ja,je) = 23.3250
14671 b_mtem(1,ja,je) = 2.72993
14672 b_mtem(2,ja,je) = -0.23406
14673 b_mtem(3,ja,je) = -10.4103
14674 b_mtem(4,ja,je) = 13.1586
14675 b_mtem(5,ja,je) = -7.79925
14676 b_mtem(6,ja,je) = 2.30843
14680 b_mtem(1,ja,je) = 3.51258
14681 b_mtem(2,ja,je) = -3.95107
14682 b_mtem(3,ja,je) = -11.0175
14683 b_mtem(4,ja,je) = 38.8617
14684 b_mtem(5,ja,je) = -48.1575
14685 b_mtem(6,ja,je) = 20.4717
14694 b_mtem(1,ja,je) = 0.76734
14695 b_mtem(2,ja,je) = -1.12263
14696 b_mtem(3,ja,je) = -9.08728
14697 b_mtem(4,ja,je) = 30.3836
14698 b_mtem(5,ja,je) = -38.4133
14699 b_mtem(6,ja,je) = 17.0106
14703 b_mtem(1,ja,je) = -2.03879
14704 b_mtem(2,ja,je) = 15.7033
14705 b_mtem(3,ja,je) = -58.7363
14706 b_mtem(4,ja,je) = 109.242
14707 b_mtem(5,ja,je) = -102.237
14708 b_mtem(6,ja,je) = 37.5350
14712 b_mtem(1,ja,je) = -3.10228
14713 b_mtem(2,ja,je) = 16.6920
14714 b_mtem(3,ja,je) = -59.1522
14715 b_mtem(4,ja,je) = 113.487
14716 b_mtem(5,ja,je) = -110.890
14717 b_mtem(6,ja,je) = 42.4578
14721 b_mtem(1,ja,je) = -3.43885
14722 b_mtem(2,ja,je) = 21.0372
14723 b_mtem(3,ja,je) = -84.7026
14724 b_mtem(4,ja,je) = 165.324
14725 b_mtem(5,ja,je) = -156.101
14726 b_mtem(6,ja,je) = 57.3101
14730 b_mtem(1,ja,je) = 0.33164
14731 b_mtem(2,ja,je) = 6.55864
14732 b_mtem(3,ja,je) = -33.5876
14733 b_mtem(4,ja,je) = 65.1798
14734 b_mtem(5,ja,je) = -63.2046
14735 b_mtem(6,ja,je) = 24.1783
14739 b_mtem(1,ja,je) = 3.06830
14740 b_mtem(2,ja,je) = -3.18408
14741 b_mtem(3,ja,je) = -19.6332
14742 b_mtem(4,ja,je) = 61.3657
14743 b_mtem(5,ja,je) = -73.4438
14744 b_mtem(6,ja,je) = 31.2334
14748 b_mtem(1,ja,je) = 2.58649
14749 b_mtem(2,ja,je) = 0.87921
14750 b_mtem(3,ja,je) = -39.3023
14751 b_mtem(4,ja,je) = 101.603
14752 b_mtem(5,ja,je) = -109.469
14753 b_mtem(6,ja,je) = 43.0188
14757 b_mtem(1,ja,je) = 1.54587
14758 b_mtem(2,ja,je) = -7.50976
14759 b_mtem(3,ja,je) = 12.8237
14760 b_mtem(4,ja,je) = -10.1452
14761 b_mtem(5,ja,je) = -0.541956
14762 b_mtem(6,ja,je) = 3.34536
14766 b_mtem(1,ja,je) = 0.829757
14767 b_mtem(2,ja,je) = -4.11316
14768 b_mtem(3,ja,je) = 3.67111
14769 b_mtem(4,ja,je) = 3.6833
14770 b_mtem(5,ja,je) = -11.2711
14771 b_mtem(6,ja,je) = 6.71421
14780 b_mtem(1,ja,je) = 2.63953
14781 b_mtem(2,ja,je) = -6.01532
14782 b_mtem(3,ja,je) = 10.0204
14783 b_mtem(4,ja,je) = -12.4840
14784 b_mtem(5,ja,je) = 7.78853
14785 b_mtem(6,ja,je) = -2.12638
14789 b_mtem(1,ja,je) = -0.77412
14790 b_mtem(2,ja,je) = 14.1656
14791 b_mtem(3,ja,je) = -53.4087
14792 b_mtem(4,ja,je) = 93.2013
14793 b_mtem(5,ja,je) = -80.5723
14794 b_mtem(6,ja,je) = 27.1577
14798 b_mtem(1,ja,je) = -2.98882
14799 b_mtem(2,ja,je) = 14.4436
14800 b_mtem(3,ja,je) = -40.1774
14801 b_mtem(4,ja,je) = 67.5937
14802 b_mtem(5,ja,je) = -61.5040
14803 b_mtem(6,ja,je) = 22.3695
14807 b_mtem(1,ja,je) = -1.15502
14808 b_mtem(2,ja,je) = 8.12309
14809 b_mtem(3,ja,je) = -38.4726
14810 b_mtem(4,ja,je) = 80.8861
14811 b_mtem(5,ja,je) = -80.1644
14812 b_mtem(6,ja,je) = 30.4717
14816 b_mtem(1,ja,je) = 1.99641
14817 b_mtem(2,ja,je) = -2.96061
14818 b_mtem(3,ja,je) = 5.54778
14819 b_mtem(4,ja,je) = -14.5488
14820 b_mtem(5,ja,je) = 14.8492
14821 b_mtem(6,ja,je) = -5.1389
14825 b_mtem(1,ja,je) = 2.23816
14826 b_mtem(2,ja,je) = -3.20847
14827 b_mtem(3,ja,je) = -4.82853
14828 b_mtem(4,ja,je) = 20.9192
14829 b_mtem(5,ja,je) = -27.2819
14830 b_mtem(6,ja,je) = 11.8655
14834 b_mtem(1,ja,je) = 2.56907
14835 b_mtem(2,ja,je) = 1.13444
14836 b_mtem(3,ja,je) = -34.6853
14837 b_mtem(4,ja,je) = 87.9775
14838 b_mtem(5,ja,je) = -93.2330
14839 b_mtem(6,ja,je) = 35.9260
14843 b_mtem(1,ja,je) = 2.00024
14844 b_mtem(2,ja,je) = -4.80868
14845 b_mtem(3,ja,je) = 8.29222
14846 b_mtem(4,ja,je) = -11.0849
14847 b_mtem(5,ja,je) = 7.51262
14848 b_mtem(6,ja,je) = -2.07654
14852 b_mtem(1,ja,je) = 2.8009
14853 b_mtem(2,ja,je) = -6.98416
14854 b_mtem(3,ja,je) = 14.3146
14855 b_mtem(4,ja,je) = -22.0068
14856 b_mtem(5,ja,je) = 17.5557
14857 b_mtem(6,ja,je) = -5.84917
14866 b_mtem(1,ja,je) = 0.169160
14867 b_mtem(2,ja,je) = 2.15094
14868 b_mtem(3,ja,je) = -9.62904
14869 b_mtem(4,ja,je) = 18.2631
14870 b_mtem(5,ja,je) = -17.3333
14871 b_mtem(6,ja,je) = 6.19835
14875 b_mtem(1,ja,je) = -2.34457
14876 b_mtem(2,ja,je) = 12.8035
14877 b_mtem(3,ja,je) = -35.2513
14878 b_mtem(4,ja,je) = 53.6153
14879 b_mtem(5,ja,je) = -42.7655
14880 b_mtem(6,ja,je) = 13.7129
14884 b_mtem(1,ja,je) = -2.56109
14885 b_mtem(2,ja,je) = 11.1414
14886 b_mtem(3,ja,je) = -30.2361
14887 b_mtem(4,ja,je) = 50.0320
14888 b_mtem(5,ja,je) = -44.1586
14889 b_mtem(6,ja,je) = 15.5393
14893 b_mtem(1,ja,je) = -0.97315
14894 b_mtem(2,ja,je) = 7.06295
14895 b_mtem(3,ja,je) = -29.3032
14896 b_mtem(4,ja,je) = 57.6101
14897 b_mtem(5,ja,je) = -54.9020
14898 b_mtem(6,ja,je) = 20.2222
14902 b_mtem(1,ja,je) = -0.44450
14903 b_mtem(2,ja,je) = 3.33451
14904 b_mtem(3,ja,je) = -15.2791
14905 b_mtem(4,ja,je) = 30.1413
14906 b_mtem(5,ja,je) = -26.7710
14907 b_mtem(6,ja,je) = 8.78462
14911 b_mtem(1,ja,je) = -0.99780
14912 b_mtem(2,ja,je) = 4.69200
14913 b_mtem(3,ja,je) = -16.1219
14914 b_mtem(4,ja,je) = 29.3100
14915 b_mtem(5,ja,je) = -26.3383
14916 b_mtem(6,ja,je) = 9.20695
14920 b_mtem(1,ja,je) = -0.52694
14921 b_mtem(2,ja,je) = 7.02684
14922 b_mtem(3,ja,je) = -33.7508
14923 b_mtem(4,ja,je) = 70.0565
14924 b_mtem(5,ja,je) = -68.3226
14925 b_mtem(6,ja,je) = 25.2692
14929 b_mtem(1,ja,je) = 0.572926
14930 b_mtem(2,ja,je) = -2.04791
14931 b_mtem(3,ja,je) = 2.1134
14932 b_mtem(4,ja,je) = 0.246654
14933 b_mtem(5,ja,je) = -3.06019
14934 b_mtem(6,ja,je) = 1.98126
14938 b_mtem(1,ja,je) = 0.56514
14939 b_mtem(2,ja,je) = 0.22287
14940 b_mtem(3,ja,je) = -2.76973
14941 b_mtem(4,ja,je) = 4.54444
14942 b_mtem(5,ja,je) = -3.86549
14943 b_mtem(6,ja,je) = 1.13441
14947 ! (nh4)3h(so4)2 in e
14952 b_mtem(1,ja,je) = -1.44811
14953 b_mtem(2,ja,je) = 6.71815
14954 b_mtem(3,ja,je) = -25.0141
14955 b_mtem(4,ja,je) = 50.1109
14956 b_mtem(5,ja,je) = -50.0561
14957 b_mtem(6,ja,je) = 19.3370
14961 b_mtem(1,ja,je) = -3.41707
14962 b_mtem(2,ja,je) = 13.4496
14963 b_mtem(3,ja,je) = -34.8018
14964 b_mtem(4,ja,je) = 55.2987
14965 b_mtem(5,ja,je) = -48.1839
14966 b_mtem(6,ja,je) = 17.2444
14970 b_mtem(1,ja,je) = -2.54479
14971 b_mtem(2,ja,je) = 11.8501
14972 b_mtem(3,ja,je) = -39.7286
14973 b_mtem(4,ja,je) = 74.2479
14974 b_mtem(5,ja,je) = -70.4934
14975 b_mtem(6,ja,je) = 26.2836
14979 b_mtem(1,ja,je) = -2.30561
14980 b_mtem(2,ja,je) = 14.5806
14981 b_mtem(3,ja,je) = -55.1238
14982 b_mtem(4,ja,je) = 103.451
14983 b_mtem(5,ja,je) = -95.2571
14984 b_mtem(6,ja,je) = 34.2218
14988 b_mtem(1,ja,je) = -2.20809
14989 b_mtem(2,ja,je) = 13.6391
14990 b_mtem(3,ja,je) = -57.8246
14991 b_mtem(4,ja,je) = 117.907
14992 b_mtem(5,ja,je) = -112.154
14993 b_mtem(6,ja,je) = 40.3058
14997 b_mtem(1,ja,je) = -1.15099
14998 b_mtem(2,ja,je) = 6.32269
14999 b_mtem(3,ja,je) = -27.3860
15000 b_mtem(4,ja,je) = 55.4592
15001 b_mtem(5,ja,je) = -54.0100
15002 b_mtem(6,ja,je) = 20.3469
15006 b_mtem(1,ja,je) = -1.15678
15007 b_mtem(2,ja,je) = 8.28718
15008 b_mtem(3,ja,je) = -37.3231
15009 b_mtem(4,ja,je) = 76.6124
15010 b_mtem(5,ja,je) = -74.9307
15011 b_mtem(6,ja,je) = 28.0559
15015 b_mtem(1,ja,je) = 0.01502
15016 b_mtem(2,ja,je) = -3.1197
15017 b_mtem(3,ja,je) = 3.61104
15018 b_mtem(4,ja,je) = 3.05196
15019 b_mtem(5,ja,je) = -9.98957
15020 b_mtem(6,ja,je) = 6.04155
15024 b_mtem(1,ja,je) = -1.06477
15025 b_mtem(2,ja,je) = 3.38801
15026 b_mtem(3,ja,je) = -12.5784
15027 b_mtem(4,ja,je) = 25.2823
15028 b_mtem(5,ja,je) = -25.4611
15029 b_mtem(6,ja,je) = 10.0754
15038 b_mtem(1,ja,je) = 0.68259
15039 b_mtem(2,ja,je) = 0.71468
15040 b_mtem(3,ja,je) = -5.59003
15041 b_mtem(4,ja,je) = 11.0089
15042 b_mtem(5,ja,je) = -10.7983
15043 b_mtem(6,ja,je) = 3.82335
15047 b_mtem(1,ja,je) = -0.03956
15048 b_mtem(2,ja,je) = 4.52828
15049 b_mtem(3,ja,je) = -25.2557
15050 b_mtem(4,ja,je) = 54.4225
15051 b_mtem(5,ja,je) = -52.5105
15052 b_mtem(6,ja,je) = 18.6562
15056 b_mtem(1,ja,je) = -1.53503
15057 b_mtem(2,ja,je) = 8.27608
15058 b_mtem(3,ja,je) = -28.9539
15059 b_mtem(4,ja,je) = 55.2876
15060 b_mtem(5,ja,je) = -51.9563
15061 b_mtem(6,ja,je) = 18.6576
15065 b_mtem(1,ja,je) = -0.38793
15066 b_mtem(2,ja,je) = 7.14680
15067 b_mtem(3,ja,je) = -38.7201
15068 b_mtem(4,ja,je) = 84.3965
15069 b_mtem(5,ja,je) = -84.7453
15070 b_mtem(6,ja,je) = 32.1283
15074 b_mtem(1,ja,je) = -0.41982
15075 b_mtem(2,ja,je) = 4.26491
15076 b_mtem(3,ja,je) = -20.2351
15077 b_mtem(4,ja,je) = 42.6764
15078 b_mtem(5,ja,je) = -40.7503
15079 b_mtem(6,ja,je) = 14.2868
15083 b_mtem(1,ja,je) = -0.32912
15084 b_mtem(2,ja,je) = 1.80808
15085 b_mtem(3,ja,je) = -8.01286
15086 b_mtem(4,ja,je) = 15.5791
15087 b_mtem(5,ja,je) = -14.5494
15088 b_mtem(6,ja,je) = 5.27052
15092 b_mtem(1,ja,je) = 0.10271
15093 b_mtem(2,ja,je) = 5.09559
15094 b_mtem(3,ja,je) = -30.3295
15095 b_mtem(4,ja,je) = 66.2975
15096 b_mtem(5,ja,je) = -66.3458
15097 b_mtem(6,ja,je) = 24.9443
15101 b_mtem(1,ja,je) = 0.608309
15102 b_mtem(2,ja,je) = -0.541905
15103 b_mtem(3,ja,je) = -2.52084
15104 b_mtem(4,ja,je) = 6.63297
15105 b_mtem(5,ja,je) = -7.24599
15106 b_mtem(6,ja,je) = 2.88811
15110 b_mtem(1,ja,je) = 1.98399
15111 b_mtem(2,ja,je) = -4.51562
15112 b_mtem(3,ja,je) = 8.36059
15113 b_mtem(4,ja,je) = -12.4948
15114 b_mtem(5,ja,je) = 9.67514
15115 b_mtem(6,ja,je) = -3.18004
15124 b_mtem(1,ja,je) = -0.83214
15125 b_mtem(2,ja,je) = 4.99572
15126 b_mtem(3,ja,je) = -20.1697
15127 b_mtem(4,ja,je) = 41.4066
15128 b_mtem(5,ja,je) = -42.2119
15129 b_mtem(6,ja,je) = 16.4855
15133 b_mtem(1,ja,je) = -0.65139
15134 b_mtem(2,ja,je) = 3.52300
15135 b_mtem(3,ja,je) = -22.8220
15136 b_mtem(4,ja,je) = 56.2956
15137 b_mtem(5,ja,je) = -59.9028
15138 b_mtem(6,ja,je) = 23.1844
15142 b_mtem(1,ja,je) = -1.31331
15143 b_mtem(2,ja,je) = 8.40835
15144 b_mtem(3,ja,je) = -38.1757
15145 b_mtem(4,ja,je) = 80.5312
15146 b_mtem(5,ja,je) = -79.8346
15147 b_mtem(6,ja,je) = 30.0219
15151 b_mtem(1,ja,je) = -1.03054
15152 b_mtem(2,ja,je) = 8.08155
15153 b_mtem(3,ja,je) = -38.1046
15154 b_mtem(4,ja,je) = 78.7168
15155 b_mtem(5,ja,je) = -77.2263
15156 b_mtem(6,ja,je) = 29.1521
15160 b_mtem(1,ja,je) = -1.90695
15161 b_mtem(2,ja,je) = 11.6241
15162 b_mtem(3,ja,je) = -50.3175
15163 b_mtem(4,ja,je) = 105.884
15164 b_mtem(5,ja,je) = -103.258
15165 b_mtem(6,ja,je) = 37.6588
15169 b_mtem(1,ja,je) = -0.34780
15170 b_mtem(2,ja,je) = 2.85363
15171 b_mtem(3,ja,je) = -17.6224
15172 b_mtem(4,ja,je) = 38.9220
15173 b_mtem(5,ja,je) = -39.8106
15174 b_mtem(6,ja,je) = 15.6055
15178 b_mtem(1,ja,je) = -0.75230
15179 b_mtem(2,ja,je) = 10.0140
15180 b_mtem(3,ja,je) = -50.5677
15181 b_mtem(4,ja,je) = 106.941
15182 b_mtem(5,ja,je) = -105.534
15183 b_mtem(6,ja,je) = 39.5196
15187 b_mtem(1,ja,je) = 0.057456
15188 b_mtem(2,ja,je) = -1.31264
15189 b_mtem(3,ja,je) = -1.94662
15190 b_mtem(4,ja,je) = 10.7024
15191 b_mtem(5,ja,je) = -14.9946
15192 b_mtem(6,ja,je) = 7.12161
15196 b_mtem(1,ja,je) = 0.637894
15197 b_mtem(2,ja,je) = -2.29719
15198 b_mtem(3,ja,je) = 0.765361
15199 b_mtem(4,ja,je) = 4.8748
15200 b_mtem(5,ja,je) = -9.25978
15201 b_mtem(6,ja,je) = 4.91773
15205 !----------------------------------------------------------
15206 ! coefficients for %mdrh(t) = d1 + d2*t + d3*t^2 + d4*t^3 (t in kelvin)
15207 ! valid temperature range: 240 - 320 k
15208 !----------------------------------------------------------
15210 ! sulfate-poor systems
15213 d_mdrh(j_index,1) = -58.00268351
15214 d_mdrh(j_index,2) = 2.031077573
15215 d_mdrh(j_index,3) = -0.008281218
15216 d_mdrh(j_index,4) = 1.00447e-05
15220 d_mdrh(j_index,1) = 1039.137773
15221 d_mdrh(j_index,2) = -11.47847095
15222 d_mdrh(j_index,3) = 0.047702786
15223 d_mdrh(j_index,4) = -6.77675e-05
15227 d_mdrh(j_index,1) = 115.8366357
15228 d_mdrh(j_index,2) = 0.491881663
15229 d_mdrh(j_index,3) = -0.00422807
15230 d_mdrh(j_index,4) = 7.29274e-06
15234 d_mdrh(j_index,1) = 253.2424151
15235 d_mdrh(j_index,2) = -1.429957864
15236 d_mdrh(j_index,3) = 0.003727554
15237 d_mdrh(j_index,4) = -3.13037e-06
15241 d_mdrh(j_index,1) = -372.4306506
15242 d_mdrh(j_index,2) = 5.3955633
15243 d_mdrh(j_index,3) = -0.019804438
15244 d_mdrh(j_index,4) = 2.25662e-05
15248 d_mdrh(j_index,1) = 286.1271416
15249 d_mdrh(j_index,2) = -1.670787758
15250 d_mdrh(j_index,3) = 0.004431373
15251 d_mdrh(j_index,4) = -3.57757e-06
15255 d_mdrh(j_index,1) = -1124.07059
15256 d_mdrh(j_index,2) = 14.26364209
15257 d_mdrh(j_index,3) = -0.054816822
15258 d_mdrh(j_index,4) = 6.70107e-05
15262 d_mdrh(j_index,1) = 1855.413934
15263 d_mdrh(j_index,2) = -20.29219473
15264 d_mdrh(j_index,3) = 0.07807482
15265 d_mdrh(j_index,4) = -1.017887858e-4
15269 d_mdrh(j_index,1) = 1761.176886
15270 d_mdrh(j_index,2) = -19.29811062
15271 d_mdrh(j_index,3) = 0.075676987
15272 d_mdrh(j_index,4) = -1.0116959e-4
15276 d_mdrh(j_index,1) = 122.1074303
15277 d_mdrh(j_index,2) = 0.429692122
15278 d_mdrh(j_index,3) = -0.003928277
15279 d_mdrh(j_index,4) = 6.43275e-06
15283 d_mdrh(j_index,1) = 2424.634678
15284 d_mdrh(j_index,2) = -26.54031307
15285 d_mdrh(j_index,3) = 0.101625387
15286 d_mdrh(j_index,4) = -1.31544547798e-4
15290 d_mdrh(j_index,1) = 2912.082599
15291 d_mdrh(j_index,2) = -31.8894185
15292 d_mdrh(j_index,3) = 0.121185849
15293 d_mdrh(j_index,4) = -1.556534623e-4
15297 d_mdrh(j_index,1) = 172.2596493
15298 d_mdrh(j_index,2) = -0.511006195
15299 d_mdrh(j_index,3) = 4.27244597e-4
15300 d_mdrh(j_index,4) = 4.12797e-07
15304 d_mdrh(j_index,1) = 1596.184935
15305 d_mdrh(j_index,2) = -16.37945565
15306 d_mdrh(j_index,3) = 0.060281218
15307 d_mdrh(j_index,4) = -7.6161e-05
15311 d_mdrh(j_index,1) = 1916.072988
15312 d_mdrh(j_index,2) = -20.85594868
15313 d_mdrh(j_index,3) = 0.081140141
15314 d_mdrh(j_index,4) = -1.07954274796e-4
15318 d_mdrh(j_index,1) = 1467.165935
15319 d_mdrh(j_index,2) = -16.01166196
15320 d_mdrh(j_index,3) = 0.063505582
15321 d_mdrh(j_index,4) = -8.66722e-05
15325 d_mdrh(j_index,1) = 158.447059
15326 d_mdrh(j_index,2) = -0.628167358
15327 d_mdrh(j_index,3) = 0.002014448
15328 d_mdrh(j_index,4) = -3.13037e-06
15332 d_mdrh(j_index,1) = 1115.892468
15333 d_mdrh(j_index,2) = -11.76936534
15334 d_mdrh(j_index,3) = 0.045577399
15335 d_mdrh(j_index,4) = -6.05779e-05
15339 d_mdrh(j_index,1) = 269.5432407
15340 d_mdrh(j_index,2) = -1.319963885
15341 d_mdrh(j_index,3) = 0.002592363
15342 d_mdrh(j_index,4) = -1.44479e-06
15346 d_mdrh(j_index,1) = 2841.334784
15347 d_mdrh(j_index,2) = -31.1889487
15348 d_mdrh(j_index,3) = 0.118809274
15349 d_mdrh(j_index,4) = -1.53007e-4
15353 d_mdrh(j_index,1) = 2199.36914
15354 d_mdrh(j_index,2) = -24.11926569
15355 d_mdrh(j_index,3) = 0.092932361
15356 d_mdrh(j_index,4) = -1.21774e-4
15360 d_mdrh(j_index,1) = 395.0051604
15361 d_mdrh(j_index,2) = -2.521101657
15362 d_mdrh(j_index,3) = 0.006139319
15363 d_mdrh(j_index,4) = -4.43756e-06
15367 d_mdrh(j_index,1) = 386.5150675
15368 d_mdrh(j_index,2) = -2.4632138
15369 d_mdrh(j_index,3) = 0.006139319
15370 d_mdrh(j_index,4) = -4.98796e-06
15374 d_mdrh(j_index,1) = 3101.538491
15375 d_mdrh(j_index,2) = -34.19978105
15376 d_mdrh(j_index,3) = 0.130118605
15377 d_mdrh(j_index,4) = -1.66873e-4
15379 ! ss + as + an + ac
15381 d_mdrh(j_index,1) = 2307.579403
15382 d_mdrh(j_index,2) = -25.43136774
15383 d_mdrh(j_index,3) = 0.098064728
15384 d_mdrh(j_index,4) = -1.28301e-4
15388 d_mdrh(j_index,1) = 291.8309602
15389 d_mdrh(j_index,2) = -1.828912974
15390 d_mdrh(j_index,3) = 0.005053148
15391 d_mdrh(j_index,4) = -4.57516e-06
15395 d_mdrh(j_index,1) = 188.3914345
15396 d_mdrh(j_index,2) = -0.631345031
15397 d_mdrh(j_index,3) = 0.000622807
15398 d_mdrh(j_index,4) = 4.47196e-07
15402 d_mdrh(j_index,1) = -167.1252839
15403 d_mdrh(j_index,2) = 2.969828002
15404 d_mdrh(j_index,3) = -0.010637255
15405 d_mdrh(j_index,4) = 1.13175e-05
15409 d_mdrh(j_index,1) = 1516.782768
15410 d_mdrh(j_index,2) = -15.7922661
15411 d_mdrh(j_index,3) = 0.058942209
15412 d_mdrh(j_index,4) = -7.5301e-05
15416 d_mdrh(j_index,1) = 1739.963163
15417 d_mdrh(j_index,2) = -19.06576022
15418 d_mdrh(j_index,3) = 0.07454963
15419 d_mdrh(j_index,4) = -9.94302e-05
15421 ! ss + sn + an + ac
15423 d_mdrh(j_index,1) = 2152.104877
15424 d_mdrh(j_index,2) = -23.74998008
15425 d_mdrh(j_index,3) = 0.092256654
15426 d_mdrh(j_index,4) = -1.21953e-4
15430 d_mdrh(j_index,1) = 221.9976265
15431 d_mdrh(j_index,2) = -1.311331272
15432 d_mdrh(j_index,3) = 0.004406089
15433 d_mdrh(j_index,4) = -5.88235e-06
15435 ! ss + sn + sc + ac
15437 d_mdrh(j_index,1) = 1205.645615
15438 d_mdrh(j_index,2) = -12.71353459
15439 d_mdrh(j_index,3) = 0.048803922
15440 d_mdrh(j_index,4) = -6.41899e-05
15444 d_mdrh(j_index,1) = 506.6737879
15445 d_mdrh(j_index,2) = -3.723520818
15446 d_mdrh(j_index,3) = 0.010814242
15447 d_mdrh(j_index,4) = -1.21087e-05
15451 d_mdrh(j_index,1) = -1123.523841
15452 d_mdrh(j_index,2) = 14.08345977
15453 d_mdrh(j_index,3) = -0.053687823
15454 d_mdrh(j_index,4) = 6.52219e-05
15458 d_mdrh(j_index,1) = -1159.98607
15459 d_mdrh(j_index,2) = 14.44309169
15460 d_mdrh(j_index,3) = -0.054841073
15461 d_mdrh(j_index,4) = 6.64259e-05
15465 d_mdrh(j_index,1) = 756.0747916
15466 d_mdrh(j_index,2) = -8.546826257
15467 d_mdrh(j_index,3) = 0.035798677
15468 d_mdrh(j_index,4) = -5.06629e-05
15472 d_mdrh(j_index,1) = 338.668191
15473 d_mdrh(j_index,2) = -2.971223403
15474 d_mdrh(j_index,3) = 0.012294866
15475 d_mdrh(j_index,4) = -1.87558e-05
15479 d_mdrh(j_index,1) = -53.18033508
15480 d_mdrh(j_index,2) = 0.663911748
15481 d_mdrh(j_index,3) = 9.16326e-4
15482 d_mdrh(j_index,4) = -6.70354e-06
15486 d_mdrh(j_index,1) = 3623.831129
15487 d_mdrh(j_index,2) = -39.27226457
15488 d_mdrh(j_index,3) = 0.144559515
15489 d_mdrh(j_index,4) = -1.78159e-4
15493 d_mdrh(j_index,1) = 3436.656743
15494 d_mdrh(j_index,2) = -37.16192684
15495 d_mdrh(j_index,3) = 0.136641377
15496 d_mdrh(j_index,4) = -1.68262e-4
15500 d_mdrh(j_index,1) = 768.608476
15501 d_mdrh(j_index,2) = -8.051517149
15502 d_mdrh(j_index,3) = 0.032342332
15503 d_mdrh(j_index,4) = -4.52224e-05
15507 d_mdrh(j_index,1) = 33.58027951
15508 d_mdrh(j_index,2) = -0.308772182
15509 d_mdrh(j_index,3) = 0.004713639
15510 d_mdrh(j_index,4) = -1.19658e-05
15514 d_mdrh(j_index,1) = 57.80183041
15515 d_mdrh(j_index,2) = 0.215264604
15516 d_mdrh(j_index,3) = 4.11406e-4
15517 d_mdrh(j_index,4) = -4.30702e-06
15519 ! cn + sn + an + ac
15521 d_mdrh(j_index,1) = -234.368984
15522 d_mdrh(j_index,2) = 2.721045204
15523 d_mdrh(j_index,3) = -0.006688341
15524 d_mdrh(j_index,4) = 2.31729e-06
15528 d_mdrh(j_index,1) = 3879.080557
15529 d_mdrh(j_index,2) = -42.13562874
15530 d_mdrh(j_index,3) = 0.155235005
15531 d_mdrh(j_index,4) = -1.91387e-4
15533 ! cn + sn + sc + ac
15535 d_mdrh(j_index,1) = 3600.576985
15536 d_mdrh(j_index,2) = -39.0283489
15537 d_mdrh(j_index,3) = 0.143710316
15538 d_mdrh(j_index,4) = -1.77167e-4
15542 d_mdrh(j_index,1) = -1009.729826
15543 d_mdrh(j_index,2) = 12.9145339
15544 d_mdrh(j_index,3) = -0.049811146
15545 d_mdrh(j_index,4) = 6.09563e-05
15549 d_mdrh(j_index,1) = -577.0919514
15550 d_mdrh(j_index,2) = 8.020324227
15551 d_mdrh(j_index,3) = -0.031469556
15552 d_mdrh(j_index,4) = 3.82181e-05
15556 d_mdrh(j_index,1) = -728.9983499
15557 d_mdrh(j_index,2) = 9.849458215
15558 d_mdrh(j_index,3) = -0.03879257
15559 d_mdrh(j_index,4) = 4.78844e-05
15561 ! cn + cc + sc + ac
15563 d_mdrh(j_index,1) = -803.7026845
15564 d_mdrh(j_index,2) = 10.61881494
15565 d_mdrh(j_index,3) = -0.041402993
15566 d_mdrh(j_index,4) = 5.08084e-05
15569 ! sulfate-rich systems
15572 d_mdrh(j_index,1) = -493.6190458
15573 d_mdrh(j_index,2) = 6.747053851
15574 d_mdrh(j_index,3) = -0.026955267
15575 d_mdrh(j_index,4) = 3.45118e-05
15579 d_mdrh(j_index,1) = 53.37874093
15580 d_mdrh(j_index,2) = 1.01368249
15581 d_mdrh(j_index,3) = -0.005887513
15582 d_mdrh(j_index,4) = 8.94393e-06
15586 d_mdrh(j_index,1) = 206.619047
15587 d_mdrh(j_index,2) = -1.342735684
15588 d_mdrh(j_index,3) = 0.003197691
15589 d_mdrh(j_index,4) = -1.93603e-06
15593 d_mdrh(j_index,1) = -493.6190458
15594 d_mdrh(j_index,2) = 6.747053851
15595 d_mdrh(j_index,3) = -0.026955267
15596 d_mdrh(j_index,4) = 3.45118e-05
15600 d_mdrh(j_index,1) = 53.37874093
15601 d_mdrh(j_index,2) = 1.01368249
15602 d_mdrh(j_index,3) = -0.005887513
15603 d_mdrh(j_index,4) = 8.94393e-06
15607 d_mdrh(j_index,1) = 206.619047
15608 d_mdrh(j_index,2) = -1.342735684
15609 d_mdrh(j_index,3) = 0.003197691
15610 d_mdrh(j_index,4) = -1.93603e-06
15614 d_mdrh(j_index,1) = 41.7619047
15615 d_mdrh(j_index,2) = 1.303872053
15616 d_mdrh(j_index,3) = -0.007647908
15617 d_mdrh(j_index,4) = 1.17845e-05
15621 d_mdrh(j_index,1) = 41.7619047
15622 d_mdrh(j_index,2) = 1.303872053
15623 d_mdrh(j_index,3) = -0.007647908
15624 d_mdrh(j_index,4) = 1.17845e-05
15628 d_mdrh(j_index,1) = -369.7142842
15629 d_mdrh(j_index,2) = 5.512878771
15630 d_mdrh(j_index,3) = -0.02301948
15631 d_mdrh(j_index,4) = 3.0303e-05
15635 d_mdrh(j_index,1) = -369.7142842
15636 d_mdrh(j_index,2) = 5.512878771
15637 d_mdrh(j_index,3) = -0.02301948
15638 d_mdrh(j_index,4) = 3.0303e-05
15642 d_mdrh(j_index,1) = -162.8095232
15643 d_mdrh(j_index,2) = 2.399326592
15644 d_mdrh(j_index,3) = -0.009336219
15645 d_mdrh(j_index,4) = 1.17845e-05
15649 d_mdrh(j_index,1) = -735.4285689
15650 d_mdrh(j_index,2) = 8.885521857
15651 d_mdrh(j_index,3) = -0.033488456
15652 d_mdrh(j_index,4) = 4.12458e-05
15654 call load_kappa_nonelectro
15659 end subroutine load_mosaic_parameters
15664 subroutine load_kappa_nonelectro
15666 use module_data_mosaic_asect, only: &
15667 hygro_oin_aer, hygro_oc_aer, hygro_bc_aer, &
15668 hygro_pcg1_b_c_aer, hygro_pcg2_b_c_aer, hygro_pcg3_b_c_aer, &
15669 hygro_pcg4_b_c_aer, hygro_pcg5_b_c_aer, hygro_pcg6_b_c_aer, &
15670 hygro_pcg7_b_c_aer, hygro_pcg8_b_c_aer, hygro_pcg9_b_c_aer, &
15671 hygro_pcg1_b_o_aer, hygro_pcg2_b_o_aer, hygro_pcg3_b_o_aer, &
15672 hygro_pcg4_b_o_aer, hygro_pcg5_b_o_aer, hygro_pcg6_b_o_aer, &
15673 hygro_pcg7_b_o_aer, hygro_pcg8_b_o_aer, hygro_pcg9_b_o_aer, &
15674 hygro_opcg1_b_c_aer, hygro_opcg2_b_c_aer, hygro_opcg3_b_c_aer, &
15675 hygro_opcg4_b_c_aer, hygro_opcg5_b_c_aer, hygro_opcg6_b_c_aer, &
15676 hygro_opcg7_b_c_aer, hygro_opcg8_b_c_aer, &
15677 hygro_opcg1_b_o_aer, hygro_opcg2_b_o_aer, hygro_opcg3_b_o_aer, &
15678 hygro_opcg4_b_o_aer, hygro_opcg5_b_o_aer, hygro_opcg6_b_o_aer, &
15679 hygro_opcg7_b_o_aer, hygro_opcg8_b_o_aer, &
15680 hygro_pcg1_f_c_aer, hygro_pcg2_f_c_aer, hygro_pcg3_f_c_aer, &
15681 hygro_pcg4_f_c_aer, hygro_pcg5_f_c_aer, hygro_pcg6_f_c_aer, &
15682 hygro_pcg7_f_c_aer, hygro_pcg8_f_c_aer, hygro_pcg9_f_c_aer, &
15683 hygro_pcg1_f_o_aer, hygro_pcg2_f_o_aer, hygro_pcg3_f_o_aer, &
15684 hygro_pcg4_f_o_aer, hygro_pcg5_f_o_aer, hygro_pcg6_f_o_aer, &
15685 hygro_pcg7_f_o_aer, hygro_pcg8_f_o_aer, hygro_pcg9_f_o_aer, &
15686 hygro_opcg1_f_c_aer, hygro_opcg2_f_c_aer, hygro_opcg3_f_c_aer, &
15687 hygro_opcg4_f_c_aer, hygro_opcg5_f_c_aer, hygro_opcg6_f_c_aer, &
15688 hygro_opcg7_f_c_aer, hygro_opcg8_f_c_aer, &
15689 hygro_opcg1_f_o_aer, hygro_opcg2_f_o_aer, hygro_opcg3_f_o_aer, &
15690 hygro_opcg4_f_o_aer, hygro_opcg5_f_o_aer, hygro_opcg6_f_o_aer, &
15691 hygro_opcg7_f_o_aer, hygro_opcg8_f_o_aer, &
15692 hygro_ant1_c_aer, hygro_ant2_c_aer, hygro_ant3_c_aer, hygro_ant4_c_aer, &
15693 hygro_ant1_o_aer, hygro_ant2_o_aer, hygro_ant3_o_aer, hygro_ant4_o_aer, &
15694 hygro_biog1_c_aer, hygro_biog2_c_aer, hygro_biog3_c_aer, hygro_biog4_c_aer, &
15695 hygro_biog1_o_aer, hygro_biog2_o_aer, hygro_biog3_o_aer, hygro_biog4_o_aer, &
15696 hygro_smpa_aer, hygro_smpbb_aer, &
15697 hygro_glysoa_r1_aer, hygro_glysoa_r2_aer, hygro_glysoa_oh_aer, &
15698 hygro_glysoa_nh4_aer, hygro_glysoa_sfc_aer, &
15699 hygro_asoaX_aer, hygro_asoa1_aer, hygro_asoa2_aer, &
15700 hygro_asoa3_aer, hygro_asoa4_aer, &
15701 hygro_bsoaX_aer, hygro_bsoa1_aer, hygro_bsoa2_aer, &
15702 hygro_bsoa3_aer, hygro_bsoa4_aer
15704 if (ioin_a > 0) kappa_nonelectro(ioin_a ) = hygro_oin_aer
15705 if (ioc_a > 0) kappa_nonelectro(ioc_a ) = hygro_oc_aer
15706 if (ibc_a > 0) kappa_nonelectro(ibc_a ) = hygro_bc_aer
15708 if (ipcg1_b_c_a > 0) kappa_nonelectro(ipcg1_b_c_a ) = hygro_pcg1_b_c_aer
15709 if (ipcg2_b_c_a > 0) kappa_nonelectro(ipcg2_b_c_a ) = hygro_pcg2_b_c_aer
15710 if (ipcg3_b_c_a > 0) kappa_nonelectro(ipcg3_b_c_a ) = hygro_pcg3_b_c_aer
15711 if (ipcg4_b_c_a > 0) kappa_nonelectro(ipcg4_b_c_a ) = hygro_pcg4_b_c_aer
15712 if (ipcg5_b_c_a > 0) kappa_nonelectro(ipcg5_b_c_a ) = hygro_pcg5_b_c_aer
15713 if (ipcg6_b_c_a > 0) kappa_nonelectro(ipcg6_b_c_a ) = hygro_pcg6_b_c_aer
15714 if (ipcg7_b_c_a > 0) kappa_nonelectro(ipcg7_b_c_a ) = hygro_pcg7_b_c_aer
15715 if (ipcg8_b_c_a > 0) kappa_nonelectro(ipcg8_b_c_a ) = hygro_pcg8_b_c_aer
15716 if (ipcg9_b_c_a > 0) kappa_nonelectro(ipcg9_b_c_a ) = hygro_pcg9_b_c_aer
15717 if (ipcg1_b_o_a > 0) kappa_nonelectro(ipcg1_b_o_a ) = hygro_pcg1_b_o_aer
15718 if (ipcg2_b_o_a > 0) kappa_nonelectro(ipcg2_b_o_a ) = hygro_pcg2_b_o_aer
15719 if (ipcg3_b_o_a > 0) kappa_nonelectro(ipcg3_b_o_a ) = hygro_pcg3_b_o_aer
15720 if (ipcg4_b_o_a > 0) kappa_nonelectro(ipcg4_b_o_a ) = hygro_pcg4_b_o_aer
15721 if (ipcg5_b_o_a > 0) kappa_nonelectro(ipcg5_b_o_a ) = hygro_pcg5_b_o_aer
15722 if (ipcg6_b_o_a > 0) kappa_nonelectro(ipcg6_b_o_a ) = hygro_pcg6_b_o_aer
15723 if (ipcg7_b_o_a > 0) kappa_nonelectro(ipcg7_b_o_a ) = hygro_pcg7_b_o_aer
15724 if (ipcg8_b_o_a > 0) kappa_nonelectro(ipcg8_b_o_a ) = hygro_pcg8_b_o_aer
15725 if (ipcg9_b_o_a > 0) kappa_nonelectro(ipcg9_b_o_a ) = hygro_pcg9_b_o_aer
15726 if (iopcg1_b_c_a > 0) kappa_nonelectro(iopcg1_b_c_a ) = hygro_opcg1_b_c_aer
15727 if (iopcg2_b_c_a > 0) kappa_nonelectro(iopcg2_b_c_a ) = hygro_opcg2_b_c_aer
15728 if (iopcg3_b_c_a > 0) kappa_nonelectro(iopcg3_b_c_a ) = hygro_opcg3_b_c_aer
15729 if (iopcg4_b_c_a > 0) kappa_nonelectro(iopcg4_b_c_a ) = hygro_opcg4_b_c_aer
15730 if (iopcg5_b_c_a > 0) kappa_nonelectro(iopcg5_b_c_a ) = hygro_opcg5_b_c_aer
15731 if (iopcg6_b_c_a > 0) kappa_nonelectro(iopcg6_b_c_a ) = hygro_opcg6_b_c_aer
15732 if (iopcg7_b_c_a > 0) kappa_nonelectro(iopcg7_b_c_a ) = hygro_opcg7_b_c_aer
15733 if (iopcg8_b_c_a > 0) kappa_nonelectro(iopcg8_b_c_a ) = hygro_opcg8_b_c_aer
15734 if (iopcg1_b_o_a > 0) kappa_nonelectro(iopcg1_b_o_a ) = hygro_opcg1_b_o_aer
15735 if (iopcg2_b_o_a > 0) kappa_nonelectro(iopcg2_b_o_a ) = hygro_opcg2_b_o_aer
15736 if (iopcg3_b_o_a > 0) kappa_nonelectro(iopcg3_b_o_a ) = hygro_opcg3_b_o_aer
15737 if (iopcg4_b_o_a > 0) kappa_nonelectro(iopcg4_b_o_a ) = hygro_opcg4_b_o_aer
15738 if (iopcg5_b_o_a > 0) kappa_nonelectro(iopcg5_b_o_a ) = hygro_opcg5_b_o_aer
15739 if (iopcg6_b_o_a > 0) kappa_nonelectro(iopcg6_b_o_a ) = hygro_opcg6_b_o_aer
15740 if (iopcg7_b_o_a > 0) kappa_nonelectro(iopcg7_b_o_a ) = hygro_opcg7_b_o_aer
15741 if (iopcg8_b_o_a > 0) kappa_nonelectro(iopcg8_b_o_a ) = hygro_opcg8_b_o_aer
15742 if (ipcg1_f_c_a > 0) kappa_nonelectro(ipcg1_f_c_a ) = hygro_pcg1_f_c_aer
15743 if (ipcg2_f_c_a > 0) kappa_nonelectro(ipcg2_f_c_a ) = hygro_pcg2_f_c_aer
15744 if (ipcg3_f_c_a > 0) kappa_nonelectro(ipcg3_f_c_a ) = hygro_pcg3_f_c_aer
15745 if (ipcg4_f_c_a > 0) kappa_nonelectro(ipcg4_f_c_a ) = hygro_pcg4_f_c_aer
15746 if (ipcg5_f_c_a > 0) kappa_nonelectro(ipcg5_f_c_a ) = hygro_pcg5_f_c_aer
15747 if (ipcg6_f_c_a > 0) kappa_nonelectro(ipcg6_f_c_a ) = hygro_pcg6_f_c_aer
15748 if (ipcg7_f_c_a > 0) kappa_nonelectro(ipcg7_f_c_a ) = hygro_pcg7_f_c_aer
15749 if (ipcg8_f_c_a > 0) kappa_nonelectro(ipcg8_f_c_a ) = hygro_pcg8_f_c_aer
15750 if (ipcg9_f_c_a > 0) kappa_nonelectro(ipcg9_f_c_a ) = hygro_pcg9_f_c_aer
15751 if (ipcg1_f_o_a > 0) kappa_nonelectro(ipcg1_f_o_a ) = hygro_pcg1_f_o_aer
15752 if (ipcg2_f_o_a > 0) kappa_nonelectro(ipcg2_f_o_a ) = hygro_pcg2_f_o_aer
15753 if (ipcg3_f_o_a > 0) kappa_nonelectro(ipcg3_f_o_a ) = hygro_pcg3_f_o_aer
15754 if (ipcg4_f_o_a > 0) kappa_nonelectro(ipcg4_f_o_a ) = hygro_pcg4_f_o_aer
15755 if (ipcg5_f_o_a > 0) kappa_nonelectro(ipcg5_f_o_a ) = hygro_pcg5_f_o_aer
15756 if (ipcg6_f_o_a > 0) kappa_nonelectro(ipcg6_f_o_a ) = hygro_pcg6_f_o_aer
15757 if (ipcg7_f_o_a > 0) kappa_nonelectro(ipcg7_f_o_a ) = hygro_pcg7_f_o_aer
15758 if (ipcg8_f_o_a > 0) kappa_nonelectro(ipcg8_f_o_a ) = hygro_pcg8_f_o_aer
15759 if (ipcg9_f_o_a > 0) kappa_nonelectro(ipcg9_f_o_a ) = hygro_pcg9_f_o_aer
15760 if (iopcg1_f_c_a > 0) kappa_nonelectro(iopcg1_f_c_a ) = hygro_opcg1_f_c_aer
15761 if (iopcg2_f_c_a > 0) kappa_nonelectro(iopcg2_f_c_a ) = hygro_opcg2_f_c_aer
15762 if (iopcg3_f_c_a > 0) kappa_nonelectro(iopcg3_f_c_a ) = hygro_opcg3_f_c_aer
15763 if (iopcg4_f_c_a > 0) kappa_nonelectro(iopcg4_f_c_a ) = hygro_opcg4_f_c_aer
15764 if (iopcg5_f_c_a > 0) kappa_nonelectro(iopcg5_f_c_a ) = hygro_opcg5_f_c_aer
15765 if (iopcg6_f_c_a > 0) kappa_nonelectro(iopcg6_f_c_a ) = hygro_opcg6_f_c_aer
15766 if (iopcg7_f_c_a > 0) kappa_nonelectro(iopcg7_f_c_a ) = hygro_opcg7_f_c_aer
15767 if (iopcg8_f_c_a > 0) kappa_nonelectro(iopcg8_f_c_a ) = hygro_opcg8_f_c_aer
15768 if (iopcg1_f_o_a > 0) kappa_nonelectro(iopcg1_f_o_a ) = hygro_opcg1_f_o_aer
15769 if (iopcg2_f_o_a > 0) kappa_nonelectro(iopcg2_f_o_a ) = hygro_opcg2_f_o_aer
15770 if (iopcg3_f_o_a > 0) kappa_nonelectro(iopcg3_f_o_a ) = hygro_opcg3_f_o_aer
15771 if (iopcg4_f_o_a > 0) kappa_nonelectro(iopcg4_f_o_a ) = hygro_opcg4_f_o_aer
15772 if (iopcg5_f_o_a > 0) kappa_nonelectro(iopcg5_f_o_a ) = hygro_opcg5_f_o_aer
15773 if (iopcg6_f_o_a > 0) kappa_nonelectro(iopcg6_f_o_a ) = hygro_opcg6_f_o_aer
15774 if (iopcg7_f_o_a > 0) kappa_nonelectro(iopcg7_f_o_a ) = hygro_opcg7_f_o_aer
15775 if (iopcg8_f_o_a > 0) kappa_nonelectro(iopcg8_f_o_a ) = hygro_opcg8_f_o_aer
15777 if (iant1_c_a > 0) kappa_nonelectro(iant1_c_a ) = hygro_ant1_c_aer
15778 if (iant2_c_a > 0) kappa_nonelectro(iant2_c_a ) = hygro_ant2_c_aer
15779 if (iant3_c_a > 0) kappa_nonelectro(iant3_c_a ) = hygro_ant3_c_aer
15780 if (iant4_c_a > 0) kappa_nonelectro(iant4_c_a ) = hygro_ant4_c_aer
15781 if (iant1_o_a > 0) kappa_nonelectro(iant1_o_a ) = hygro_ant1_o_aer
15782 if (iant2_o_a > 0) kappa_nonelectro(iant2_o_a ) = hygro_ant2_o_aer
15783 if (iant3_o_a > 0) kappa_nonelectro(iant3_o_a ) = hygro_ant3_o_aer
15784 if (iant4_o_a > 0) kappa_nonelectro(iant4_o_a ) = hygro_ant4_o_aer
15785 if (ibiog1_c_a > 0) kappa_nonelectro(ibiog1_c_a ) = hygro_biog1_c_aer
15786 if (ibiog2_c_a > 0) kappa_nonelectro(ibiog2_c_a ) = hygro_biog2_c_aer
15787 if (ibiog3_c_a > 0) kappa_nonelectro(ibiog3_c_a ) = hygro_biog3_c_aer
15788 if (ibiog4_c_a > 0) kappa_nonelectro(ibiog4_c_a ) = hygro_biog4_c_aer
15789 if (ibiog1_o_a > 0) kappa_nonelectro(ibiog1_o_a ) = hygro_biog1_o_aer
15790 if (ibiog2_o_a > 0) kappa_nonelectro(ibiog2_o_a ) = hygro_biog2_o_aer
15791 if (ibiog3_o_a > 0) kappa_nonelectro(ibiog3_o_a ) = hygro_biog3_o_aer
15792 if (ibiog4_o_a > 0) kappa_nonelectro(ibiog4_o_a ) = hygro_biog4_o_aer
15794 if (ismpa_a > 0) kappa_nonelectro(ismpa_a ) = hygro_smpa_aer
15795 if (ismpbb_a > 0) kappa_nonelectro(ismpbb_a ) = hygro_smpbb_aer
15796 if (iglysoa_r1_a > 0) kappa_nonelectro(iglysoa_r1_a ) = hygro_glysoa_r1_aer
15797 if (iglysoa_r2_a > 0) kappa_nonelectro(iglysoa_r2_a ) = hygro_glysoa_r2_aer
15798 if (iglysoa_oh_a > 0) kappa_nonelectro(iglysoa_oh_a ) = hygro_glysoa_oh_aer
15799 if (iglysoa_nh4_a > 0) kappa_nonelectro(iglysoa_nh4_a) = hygro_glysoa_nh4_aer
15800 if (iglysoa_sfc_a > 0) kappa_nonelectro(iglysoa_sfc_a) = hygro_glysoa_sfc_aer
15801 if (iasoaX_a > 0) kappa_nonelectro(iasoaX_a ) = hygro_asoaX_aer
15802 if (iasoa1_a > 0) kappa_nonelectro(iasoa1_a ) = hygro_asoa1_aer
15803 if (iasoa2_a > 0) kappa_nonelectro(iasoa2_a ) = hygro_asoa2_aer
15804 if (iasoa3_a > 0) kappa_nonelectro(iasoa3_a ) = hygro_asoa3_aer
15805 if (iasoa4_a > 0) kappa_nonelectro(iasoa4_a ) = hygro_asoa4_aer
15806 if (ibsoaX_a > 0) kappa_nonelectro(ibsoaX_a ) = hygro_bsoaX_aer
15807 if (ibsoa1_a > 0) kappa_nonelectro(ibsoa1_a ) = hygro_bsoa1_aer
15808 if (ibsoa2_a > 0) kappa_nonelectro(ibsoa2_a ) = hygro_bsoa2_aer
15809 if (ibsoa3_a > 0) kappa_nonelectro(ibsoa3_a ) = hygro_bsoa3_aer
15810 if (ibsoa4_a > 0) kappa_nonelectro(ibsoa4_a ) = hygro_bsoa4_aer
15813 end subroutine load_kappa_nonelectro
15818 !***********************************************************************
15819 ! updates all temperature dependent thermodynamic parameters
15821 ! author: rahul a. zaveri
15823 !-----------------------------------------------------------------------
15824 subroutine update_thermodynamic_constants(vbs_nbin)
15826 ! include 'mosaic.h'
15828 integer iv, j_index, ibin, je,vbs_nbin(1)
15830 real(kind=8) :: tr, rt, term
15831 real(kind=8) :: gam_nh4no3_0, gam_nh4cl_0, m_nh4no3_0, m_nh4cl_0 ! raz update 6/25/2008
15833 ! real(kind=8) :: fn_keq, fn_po, drh_mutual, bin_molality, molality_0
15836 tr = 298.15 ! reference temperature
15837 rt = 82.056*t_k/(1.e9*1.e6) ! [m^3 atm/nmol]
15840 keq_gl(1)= 1.0 ! kelvin effect (default)
15841 keq_gl(2)= fn_keq(57.64d0 , 13.79d0, -5.39d0,t_k)*rt ! nh3(g) <=> nh3(l)
15842 keq_gl(3)= fn_keq(2.63d6, 29.17d0, 16.83d0,t_k)*rt ! hno3(g) <=> no3- + h+
15843 keq_gl(4)= fn_keq(2.00d6, 30.20d0, 19.91d0,t_k)*rt ! hcl(g) <=> cl- + h+
15846 keq_ll(1)= fn_keq(1.0502d-2, 8.85d0, 25.14d0,t_k) ! hso4- <=> so4= + h+
15847 keq_ll(2)= fn_keq(1.805d-5, -1.50d0, 26.92d0,t_k) ! nh3(l) + h2o = nh4+ + oh-
15848 keq_ll(3)= fn_keq(1.01d-14,-22.52d0, 26.92d0,t_k) ! h2o(l) <=> h+ + oh-
15851 kp_nh3 = keq_ll(3)/(keq_ll(2)*keq_gl(2))
15852 kp_nh4no3= kp_nh3/keq_gl(3)
15853 kp_nh4cl = kp_nh3/keq_gl(4)
15857 keq_sg(1)= fn_keq(4.72d-17,-74.38d0,6.12d0,t_k)/rt**2 ! nh4no3<=>nh3(g)+hno3(g)
15858 keq_sg(2)= fn_keq(8.43d-17,-71.00d0,2.40d0,t_k)/rt**2 ! nh4cl <=>nh3(g)+hcl(g)
15862 keq_sl(jnh4so4) = fn_keq(1.040d0,-2.65d0, 38.57d0, t_k) ! amso4(s) = 2nh4+ + so4=
15863 keq_sl(jlvcite) = fn_keq(11.8d0, -5.19d0, 54.40d0, t_k) ! lvcite(s)= 3nh4+ + hso4- + so4=
15864 keq_sl(jnh4hso4)= fn_keq(117.0d0,-2.87d0, 15.83d0, t_k) ! amhso4(s)= nh4+ + hso4-
15865 keq_sl(jnh4msa) = 1.e15 ! NH4MSA(s)= NH4+ + MSA-
15866 keq_sl(jnh4no3) = fn_keq(12.21d0,-10.4d0, 17.56d0, t_k) ! nh4no3(s)= nh4+ + no3-
15867 keq_sl(jnh4cl) = fn_keq(17.37d0,-6.03d0, 16.92d0, t_k) ! nh4cl(s) = nh4+ + cl-
15868 keq_sl(jna2so4) = fn_keq(0.491d0, 0.98d0, 39.75d0, t_k) ! na2so4(s)= 2na+ + so4=
15869 keq_sl(jnahso4) = fn_keq(313.0d0, 0.8d0, 14.79d0, t_k) ! nahso4(s)= na+ + hso4-
15870 keq_sl(jna3hso4)= 1.e15 ! na3h(so4)2(s) = 2na+ + hso4- + so4=
15871 keq_sl(jnamsa) = 1.e15 ! NaMSA(s) = Na+ + MSA-
15872 keq_sl(jnano3) = fn_keq(11.95d0,-8.22d0, 16.01d0, t_k) ! nano3(s) = na+ + no3-
15873 keq_sl(jnacl) = fn_keq(38.28d0,-1.52d0, 16.89d0, t_k) ! nacl(s) = na+ + cl-
15874 keq_sl(jcacl2) = fn_keq(8.0d11,32.84d0,44.79d0, t_k)*1.e5 ! cacl2(s) = ca++ + 2cl-
15875 keq_sl(jcano3) = fn_keq(4.31d5, 7.83d0,42.01d0, t_k)*1.e5 ! ca(no3)2(s) = ca++ + 2no3-
15876 keq_sl(jcamsa2) = 1.e15 ! CaMSA2(s)= Ca+ + 2MSA-
15879 if (vbs_nbin(1).eq.0) then
15880 start_ind = ismpa_g
15881 else if (vbs_nbin(1) .eq. 4) then
15882 start_ind = iasoaX_g
15884 start_ind = ipcg1_b_c_g
15887 do iv = start_ind, ngas_ioa + ngas_soa
15888 sat_soa(iv) = 0.0 ! [nmol/m^3(air)]
15891 if (vbs_nbin(1).eq.9) then
15892 ! vapor pressures of soa species
15893 po_soa(ipcg1_b_c_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15894 po_soa(ipcg2_b_c_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15895 po_soa(ipcg3_b_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15896 po_soa(ipcg4_b_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15897 po_soa(ipcg5_b_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15898 po_soa(ipcg6_b_c_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15899 po_soa(ipcg7_b_c_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15900 po_soa(ipcg8_b_c_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15901 po_soa(ipcg9_b_c_g) = fn_po(9.91d0, 64.0d0, T_K) ! [Pascal]
15902 po_soa(iopcg1_b_c_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15903 po_soa(iopcg2_b_c_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15904 po_soa(iopcg3_b_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15905 po_soa(iopcg4_b_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15906 po_soa(iopcg5_b_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15907 po_soa(iopcg6_b_c_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15908 po_soa(iopcg7_b_c_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15909 po_soa(iopcg8_b_c_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15910 po_soa(ipcg1_b_o_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15911 po_soa(ipcg2_b_o_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15912 po_soa(ipcg3_b_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15913 po_soa(ipcg4_b_o_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15914 po_soa(ipcg5_b_o_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15915 po_soa(ipcg6_b_o_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15916 po_soa(ipcg7_b_o_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15917 po_soa(ipcg8_b_o_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15918 po_soa(ipcg9_b_o_g) = fn_po(9.91d0, 64.0d0, T_K) ! [Pascal]
15919 po_soa(iopcg1_b_o_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15920 po_soa(iopcg2_b_o_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15921 po_soa(iopcg3_b_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15922 po_soa(iopcg4_b_o_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15923 po_soa(iopcg5_b_o_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15924 po_soa(iopcg6_b_o_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15925 po_soa(iopcg7_b_o_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15926 po_soa(iopcg8_b_o_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15927 po_soa(ipcg1_f_c_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15928 po_soa(ipcg2_f_c_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15929 po_soa(ipcg3_f_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15930 po_soa(ipcg4_f_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15931 po_soa(ipcg5_f_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15932 po_soa(ipcg6_f_c_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15933 po_soa(ipcg7_f_c_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15934 po_soa(ipcg8_f_c_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15935 po_soa(ipcg9_f_c_g) = fn_po(9.91d0, 64.0d0, T_K) ! [Pascal]
15936 po_soa(iopcg1_f_c_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15937 po_soa(iopcg2_f_c_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15938 po_soa(iopcg3_f_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15939 po_soa(iopcg4_f_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15940 po_soa(iopcg5_f_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15941 po_soa(iopcg6_f_c_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15942 po_soa(iopcg7_f_c_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15943 po_soa(iopcg8_f_c_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15944 po_soa(ipcg1_f_o_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15945 po_soa(ipcg2_f_o_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15946 po_soa(ipcg3_f_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15947 po_soa(ipcg4_f_o_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15948 po_soa(ipcg5_f_o_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15949 po_soa(ipcg6_f_o_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15950 po_soa(ipcg7_f_o_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15951 po_soa(ipcg8_f_o_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15952 po_soa(ipcg9_f_o_g) = fn_po(9.91d0, 64.0d0, T_K) ! [Pascal]
15953 po_soa(iopcg1_f_o_g) = fn_po(9.91d-8, 112.0d0, T_K) ! [Pascal]
15954 po_soa(iopcg2_f_o_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
15955 po_soa(iopcg3_f_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15956 po_soa(iopcg4_f_o_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15957 po_soa(iopcg5_f_o_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15958 po_soa(iopcg6_f_o_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15959 po_soa(iopcg7_f_o_g) = fn_po(9.91d-2, 76.0d0, T_K) ! [Pascal]
15960 po_soa(iopcg8_f_o_g) = fn_po(9.91d-1, 70.0d0, T_K) ! [Pascal]
15962 po_soa(iant1_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15963 po_soa(iant2_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15964 po_soa(iant3_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15965 po_soa(iant4_c_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15966 po_soa(iant1_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15967 po_soa(iant2_o_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15968 po_soa(iant3_o_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15969 po_soa(iant4_o_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15970 po_soa(ibiog1_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15971 po_soa(ibiog2_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15972 po_soa(ibiog3_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15973 po_soa(ibiog4_c_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15974 po_soa(ibiog1_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
15975 po_soa(ibiog2_o_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
15976 po_soa(ibiog3_o_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
15977 po_soa(ibiog4_o_g) = fn_po(9.91d-3, 82.0d0, T_K) ! [Pascal]
15980 if (vbs_nbin(1).eq.4) then
15981 po_soa(iasoaX_g) = fn_po(9.91d-10, 40.0d0, T_K) ! [Pascal]
15982 po_soa(iasoa1_g) = fn_po(9.91d-6, dhr_approx(0.0d0), T_K) ! [Pascal]
15983 po_soa(iasoa2_g) = fn_po(9.91d-5, dhr_approx(1.0d0), T_K) ! [Pascal]
15984 po_soa(iasoa3_g) = fn_po(9.91d-4, dhr_approx(2.0d0), T_K) ! [Pascal]
15985 po_soa(iasoa4_g) = fn_po(9.91d-3, dhr_approx(3.0d0), T_K) ! [Pascal]
15986 po_soa(ibsoaX_g) = fn_po(9.91d-10, 40.0d0, T_K) ! [Pascal]
15987 po_soa(ibsoa1_g) = fn_po(9.91d-6, dhr_approx(0.0d0), T_K) ! [Pascal]
15988 po_soa(ibsoa2_g) = fn_po(9.91d-5, dhr_approx(1.0d0), T_K) ! [Pascal]
15989 po_soa(ibsoa3_g) = fn_po(9.91d-4, dhr_approx(2.0d0), T_K) ! [Pascal]
15990 po_soa(ibsoa4_g) = fn_po(9.91d-3, dhr_approx(3.0d0), T_K) ! [Pascal]
15993 if (vbs_nbin(1).eq.3) then
15994 ! these values for pcg and opcg gases are the same as vbs_nbin(1)==2
15996 po_soa(ipcg1_b_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
15997 po_soa(ipcg2_b_c_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
15998 po_soa(iopcg1_b_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
15999 po_soa(ipcg1_b_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16000 po_soa(ipcg2_b_o_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16001 po_soa(iopcg1_b_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16002 po_soa(ipcg1_f_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16003 po_soa(ipcg2_f_c_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16004 po_soa(iopcg1_f_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16005 po_soa(ipcg1_f_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16006 po_soa(ipcg2_f_o_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16007 po_soa(iopcg1_f_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16008 ! these values for ant and bio gases are from manish wrfchem 3.5
16009 po_soa(iant1_c_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
16010 po_soa(iant2_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
16011 po_soa(iant3_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
16012 po_soa(iant4_c_g) = fn_po(9.91d-4, 88.0d0, T_K) ! [Pascal]
16013 po_soa(ibiog1_c_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
16014 po_soa(ibiog2_c_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
16015 po_soa(ibiog3_c_g) = fn_po(9.91d-5, 94.0d0, T_K) ! [Pascal]
16016 po_soa(ibiog1_o_g) = fn_po(9.91d-7, 106.0d0, T_K) ! [Pascal]
16017 po_soa(ibiog2_o_g) = fn_po(9.91d-6, 100.0d0, T_K) ! [Pascal]
16020 if (vbs_nbin(1).eq.2) then
16021 po_soa(ipcg1_b_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16022 po_soa(ipcg2_b_c_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16023 po_soa(iopcg1_b_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16024 po_soa(ipcg1_b_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16025 po_soa(ipcg2_b_o_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16026 po_soa(iopcg1_b_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16027 po_soa(ipcg1_f_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16028 po_soa(ipcg2_f_c_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16029 po_soa(iopcg1_f_c_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16030 po_soa(ipcg1_f_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16031 po_soa(ipcg2_f_o_g) = fn_po(9.91d-1, 83.0d0, T_K) ! [Pascal]
16032 po_soa(iopcg1_f_o_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16033 po_soa(iant1_c_g) = fn_po(9.91d-6, 83.0d0, T_K) ! [Pascal]
16034 po_soa(iant1_o_g) = fn_po(9.91d-6, 83.0d0, T_K) ! [Pascal]
16035 po_soa(ibiog1_c_g) = fn_po(9.91d-6, 83.0d0, T_K) ! [Pascal]
16036 po_soa(ibiog1_o_g) = fn_po(9.91d-6, 83.0d0, T_K) ! [Pascal]
16038 if (vbs_nbin(1).eq.0) then
16039 po_soa(ismpa_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16040 po_soa(ismpbb_g) = fn_po(9.91d-8, 83.0d0, T_K) ! [Pascal]
16041 po_soa(ibiog1_c_g) = fn_po(9.91d-6, 83.0d0, T_K) ! [Pascal]
16042 po_soa(ibiog1_o_g) = fn_po(9.91d-6, 83.0d0, T_K) ! [Pascal]
16046 if (vbs_nbin(1).eq.0) then
16047 start_ind = ismpa_g
16048 else if (vbs_nbin(1).eq.4) then
16049 start_ind = iasoaX_g
16051 start_ind = ipcg1_b_c_g
16054 do iv = start_ind, ngas_ioa + ngas_soa
16055 sat_soa(iv) = 1.e9*po_soa(iv)/(8.314*t_k) ! [nmol/m^3(air)]
16058 ! water surface tension
16059 term = (647.15 - t_k)/647.15
16060 sigma_water = 0.2358*term**1.256 * (1. - 0.625*term) ! surface tension of pure water in n/m
16064 mdrh_t(j_index) = drh_mutual(j_index)
16069 ! rh dependent parameters
16070 do ibin = 1, nbin_a
16071 ah2o_a(ibin) = ah2o ! initialize
16074 call mtem_compute_log_gamz ! function of ah2o and t
16076 ! raz update 6/25/2008 - start
16077 gam_nh4no3_0 = 10.**log_gamZ(jnh4no3,jnh4no3)
16078 gam_nh4cl_0 = 10.**log_gamZ(jnh4cl,jnh4cl)
16080 m_nh4no3_0 = molality_0(jnh4no3)
16081 m_nh4cl_0 = molality_0(jnh4cl)
16083 Kp_nh4no3_0 = Kp_nh4no3*(m_nh4no3_0*gam_nh4no3_0)**2
16084 Kp_nh4cl_0 = Kp_nh4cl *(m_nh4cl_0 *gam_nh4cl_0 )**2
16085 ! raz update 6/25/2008 - end
16090 end subroutine update_thermodynamic_constants
16092 ! Function to approximate enthalpy of vaporization for
16093 ! semi-volatile organic aerosols as a function of volatility
16094 ! from Epstein et al., ES&T, 2010
16095 ! http://pubs.acs.org/doi/abs/10.1021/es902497z
16096 real(kind=8) function dhr_approx(log10_Csat_298)
16098 real(kind=8), intent(in) :: log10_Csat_298
16100 dhr_approx = -11.0 * log10_Csat_298 + 131.0 ! kJ/mol
16102 end function dhr_approx
16106 !***********************************************************************
16107 ! functions used in mosaic
16109 ! author: rahul a. zaveri
16111 !-----------------------------------------------------------------------
16115 !----------------------------------------------------------
16116 real(kind=8) function fn_keq(keq_298, a, b, t)
16119 real(kind=8) keq_298, a, b, t
16125 fn_keq = keq_298*exp(a*(tt-1.)+b*(1.+log(tt)-tt))
16128 end function fn_keq
16129 !----------------------------------------------------------
16135 !----------------------------------------------------------
16136 real(kind=8) function fn_po(po_298, dh, t) ! touch
16139 real(kind=8) po_298, dh, t
16142 fn_po = po_298*exp(-(dh/8.314e-3)*(1./t - 3.354016435e-3))
16146 !----------------------------------------------------------
16152 !----------------------------------------------------------
16153 real(kind=8) function drh_mutual(j_index)
16155 ! include 'mosaic.h'
16164 if(j_index .eq. 7 .or. j_index .eq. 8 .or. &
16165 (j_index.ge. 34 .and. j_index .le. 51))then
16167 drh_mutual = 10.0 ! cano3 or cacl2 containing mixtures
16171 drh_mutual = d_mdrh(j,1) + t_k* &
16172 (d_mdrh(j,2) + t_k* &
16173 (d_mdrh(j,3) + t_k* &
16174 d_mdrh(j,4) )) + 1.0
16180 end function drh_mutual
16181 !----------------------------------------------------------
16188 !----------------------------------------------------------
16189 ! zsr method at 60% rh
16191 real(kind=8) function aerosol_water_up(ibin) ! kg (water)/m^3 (air)
16193 ! include 'mosaic.h'
16200 ! real(kind=8) bin_molality_60
16206 do je = 1, (nsalt+4) ! include hno3 and hcl in water calculation
16207 dum = dum + 1.e-9*electrolyte(je,jp,ibin)/bin_molality_60(je)
16210 aerosol_water_up = dum
16213 end function aerosol_water_up
16214 !----------------------------------------------------------
16221 !----------------------------------------------------------
16224 ! RAZ 5/21/2014: Included organics, oin, and bc in water absorption (but does not include organic-inorganic interactions)
16226 real(kind=8) function aerosol_water(jp,ibin) ! kg (water)/m^3 (air)
16228 ! include 'mosaic.h'
16233 real(kind=8) dum, tmpa
16235 ! real(kind=8) bin_molality
16239 do je = 1, (nsalt+4) ! include hno3 and hcl in water calculation
16240 dum = dum + electrolyte(je,jp,ibin)/bin_molality(je,ibin)
16243 if (mwater_kappa_nonelectro > 0) then
16246 if (kappa_nonelectro(ja) > 0.0) then
16247 tmpa = tmpa + (aer(ja,jtotal,ibin)*mw_aer_mac(ja)/dens_aer_mac(ja))*kappa_nonelectro(ja)
16250 dum = dum + 1.0e-3*tmpa*aH2O_a(ibin)/(1.0-aH2O_a(ibin))
16253 aerosol_water = dum*1.e-9 ! kg(water)/m^3(air)
16255 if(aerosol_water .le. 0.0)then
16256 if (iprint_mosaic_diag1 .gt. 0) then
16257 write(6,*)'mosaic aerosol_water - water .le. 0'
16258 write(6,*)'iclm jclm ibin jp = ', &
16259 iclm_aer, jclm_aer, ibin, jp
16260 write(6,*)'ah2o, water = ', ah2o, aerosol_water
16261 write(6,*)'dry mass = ', mass_dry_a(ibin)
16262 write(6,*)'soluble mass = ', mass_soluble_a(ibin)
16263 write(6,*)'number = ', num_a(ibin)
16264 do je = 1, nsoluble
16265 write(6,44)ename(je), electrolyte(je,jp,ibin)
16267 write(6,*)'error in water calculation'
16268 write(6,*)'ibin = ', ibin
16269 write(6,*)'water content cannot be negative or zero'
16270 write(6,*)'setting jaerosolstate to all_solid'
16275 jaerosolstate(ibin) = all_solid
16276 jphase(ibin) = jsolid
16277 jhyst_leg(ibin) = jhyst_lo
16279 !c write(6,*)'stopping execution in function aerosol_water'
16283 44 format(a7, 2x, e11.3)
16287 end function aerosol_water
16288 !----------------------------------------------------------
16294 !----------------------------------------------------------
16295 real(kind=8) function bin_molality(je,ibin)
16297 ! include 'mosaic.h'
16301 real(kind=8) aw, xm
16304 aw = max(ah2o_a(ibin), aw_min(je))
16305 aw = min(aw, 0.999999D0)
16308 if(aw .lt. 0.97)then
16310 xm = a_zsr(1,je) + &
16311 aw*(a_zsr(2,je) + &
16312 aw*(a_zsr(3,je) + &
16313 aw*(a_zsr(4,je) + &
16314 aw*(a_zsr(5,je) + &
16315 aw* a_zsr(6,je) ))))
16317 bin_molality = 55.509*xm/(1. - xm)
16321 bin_molality = -b_zsr(je)*log(aw)
16327 end function bin_molality
16328 !----------------------------------------------------------
16334 !----------------------------------------------------------
16335 real(kind=8) function bin_molality_60(je)
16337 ! include 'mosaic.h'
16341 real(kind=8) aw, xm
16346 xm = a_zsr(1,je) + aw* &
16347 (a_zsr(2,je) + aw* &
16348 (a_zsr(3,je) + aw* &
16349 (a_zsr(4,je) + aw* &
16350 (a_zsr(5,je) + aw* &
16353 bin_molality_60 = 55.509*xm/(1. - xm)
16356 end function bin_molality_60
16357 !----------------------------------------------------------
16360 !----------------------------------------------------------
16361 ! raz update 6/25/2008 - start
16362 real(kind=8) function molality_0(je)
16367 real(kind=8) :: aw, xm
16370 aw = max(ah2o, aw_min(je))
16371 aw = min(aw, 0.999999d0)
16374 if(aw .lt. 0.97)then
16376 xm = a_zsr(1,je) + &
16377 aw*(a_zsr(2,je) + &
16378 aw*(a_zsr(3,je) + &
16379 aw*(a_zsr(4,je) + &
16380 aw*(a_zsr(5,je) + &
16381 aw* a_zsr(6,je) ))))
16383 molality_0 = 55.509*xm/(1. - xm)
16387 molality_0 = -b_zsr(je)*log(aw)
16393 end function molality_0
16394 ! raz update 6/25/2008 - end
16395 !----------------------------------------------------------
16398 !----------------------------------------------------------
16399 real(kind=8) function fnlog_gamz(ja,je) ! ja in je
16401 ! include 'mosaic.h'
16408 aw = max(ah2o, aw_min(je))
16410 fnlog_gamz = b_mtem(1,ja,je) + aw* &
16411 (b_mtem(2,ja,je) + aw* &
16412 (b_mtem(3,ja,je) + aw* &
16413 (b_mtem(4,ja,je) + aw* &
16414 (b_mtem(5,ja,je) + aw* &
16415 b_mtem(6,ja,je) ))))
16418 end function fnlog_gamz
16419 !----------------------------------------------------------
16424 !----------------------------------------------------------
16425 real(kind=8) function mean_molecular_speed(t, mw) ! in cm/s
16428 real(kind=8) t, mw ! t(k)
16430 mean_molecular_speed = 1.455e4 * sqrt(t/mw)
16433 end function mean_molecular_speed
16434 !----------------------------------------------------------
16439 !----------------------------------------------------------
16440 real(kind=8) function gas_diffusivity(t, p, mw, vm) ! in cm^2/s
16443 real(kind=8) mw, vm, t, p ! t(k), p(atm)
16446 gas_diffusivity = (1.0e-3 * t**1.75 * sqrt(1./mw + 0.035))/ &
16447 (p * (vm**0.333333 + 2.7189)**2)
16451 end function gas_diffusivity
16452 !----------------------------------------------------------
16457 !----------------------------------------------------------
16458 real(kind=8) function fuchs_sutugin(rkn,a)
16461 real(kind=8) rkn, a
16463 real(kind=8) rnum, denom
16466 rnum = 0.75*a*(1. + rkn)
16467 denom = rkn**2 + rkn + 0.283*rkn*a + 0.75*a
16468 fuchs_sutugin = rnum/denom
16471 end function fuchs_sutugin
16472 !----------------------------------------------------------
16476 !----------------------------------------------------------
16477 real(kind=8) function acc_n2o5_bert_thorn(mass_h2o,mol_no3,mol_cl,vol)
16478 ! Composition dependent mass accommodation coefficient.
16479 ! After Bertram and Thornton, ACP, 2009
16481 ! acc_N2O5 = A*(b-b*exp(-d*[H2O(l)]))
16482 ! * (1-1/(1+(k3'*[H2O(l)]/[NO3-])+(k4'*[Cl-]/[NO3-])))
16484 ! acc_N2O5 = accommodation coefficient of N2O5 on the aerosol
16485 ! A = factor for experimental conditions = 3.2e-8 s
16488 ! [H2O(l)] = H2O Molarity
16489 ! k3' (=k3/k2b) = 6.0e-2
16490 ! k4' (=k4/k2b) = 29e0
16491 ! [Cl-] = Cl- Molarity
16492 ! [NO3-] = NO3- Molarity
16494 ! define set factors for scheme
16495 real(kind=8), parameter :: A_bt = 3.2e-8
16496 real(kind=8), parameter :: b_bt = 1.15e6
16497 real(kind=8), parameter :: d_bt = 1.3e-1
16498 real(kind=8), parameter :: k3_bt = 6.0e-2
16499 real(kind=8), parameter :: k4_bt = 29e0
16501 ! internal conversion factors
16502 real(kind=8), parameter :: nmol_mol = 1e-9 ! convert nmol->mol
16503 real(kind=8), parameter :: m3_litre = 1e3 ! convert m3->litre
16504 real(kind=8), parameter :: mm_h2o = 18e-3 ! molar mass (kg/mol)
16507 real(kind=8) :: mass_h2o ! kg(water)/m^3(air)
16508 real(kind=8) :: mol_no3 ! nmol/m^3(air?)
16509 real(kind=8) :: mol_cl ! nmol/m^3(air?)
16510 real(kind=8) :: vol ! cc/cc(air) - wet volume
16512 ! internal variables
16513 real(kind=8) :: part_step
16514 real(kind=8) :: aer_h2o, aer_no3, aer_cl ! molarity - mol/litre(solution)
16517 ! extract and convert aerosol data from inputs to Moles/litre(solution)
16518 aer_h2o = mass_h2o / (mm_h2o*vol*m3_litre)
16519 aer_no3 = mol_no3*nmol_mol / (vol*m3_litre)
16520 aer_cl = mol_cl*nmol_mol / (vol*m3_litre)
16522 if(n2o5_flag.eq.1)then ! switch off Cl pathway
16526 if(aer_h2o .ne. 0.0)then
16527 part_step = b_bt - b_bt * exp(-d_bt*aer_h2o)
16528 if(aer_no3 .ne. 0.0)then
16529 acc_n2o5_bert_thorn = A_bt * part_step * &
16532 (k3_bt*aer_h2o/aer_no3) + &
16533 (k4_bt*aer_cl/aer_no3) &
16536 acc_n2o5_bert_thorn = A_bt * part_step
16538 else ! if no aerosol water then don't take up N2O5
16539 acc_n2o5_bert_thorn = 0.0
16543 end function acc_n2o5_bert_thorn
16544 !-------------------------------------------------------------
16547 !-------------------------------------------------------------
16548 real(kind=8) function split_n2o5_bert_thorn(mass_h2o,mol_cl,vol)
16549 ! Hetereogeneous reaction of N2O5 with H2O(l) and Cl-(aq)
16550 ! after Bertram and Thornton, ACP, 2009
16551 ! Subroutine for splitting reaction pathways
16553 ! R3f = 1 / (1+(k4'[Cl-])/(k3'[H2O(l)])) (H2O pathway)
16554 ! R4f = 1 / (1+(k3'[H2O(l)])/(k4'[Cl-])) (Cl- pathway)
16556 ! R3f = fraction of N2O5 that reacts with H2O
16557 ! R4f = fraction of N2O5 that reacts with Cl-
16558 ! [H2O(l)] = H2O Molarity
16559 ! [Cl-] = Cl- Molarity
16560 ! k3' (=k3/k2b) = 6.0e-2
16561 ! k4' (=k4/k2b) = 29e0
16563 ! This function outputs the fraction of N2O5 which reacts
16566 ! define parameters for the scheme
16567 real(kind=8), parameter :: k3_bt = 6.0e-2
16568 real(kind=8), parameter :: k4_bt = 29e0
16570 ! internal conversion factors
16571 real(kind=8), parameter :: nmol_mol = 1e-9 ! convert nmol->mol
16572 real(kind=8), parameter :: m3_litre = 1e3 ! convert m3->litre
16573 real(kind=8), parameter :: mm_h2o = 18e-3 ! molar mass (kg/mol)
16576 real(kind=8) :: mass_h2o ! kg(water)/m^3(air)
16577 real(kind=8) :: mol_cl ! nmol/m^3(air?)
16578 real(kind=8) :: vol ! cc/cc(air) - wet volume
16580 ! internal variables
16581 real(kind=8) :: part_step
16582 real(kind=8) :: aer_h2o, aer_cl ! molarity - mol/litre(solution)
16585 ! extract and convert aerosol data from inputs to Moles/litre(solution)
16586 aer_h2o = mass_h2o / (mm_h2o*vol*m3_litre)
16587 aer_cl = mol_cl*nmol_mol / (vol*m3_litre)
16589 if(n2o5_flag.eq.1)then ! switch off Cl pathway
16593 if(aer_h2o .ne. 0.0)then
16594 split_n2o5_bert_thorn = 1e0 / &
16595 ( 1e0 + (k4_bt*aer_cl)/(k3_bt*aer_h2o) )
16597 split_n2o5_bert_thorn = 0.0
16603 end function split_n2o5_bert_thorn
16604 !-------------------------------------------------------------
16611 !----------------------------------------------------------
16612 ! solution to x^3 + px^2 + qx + r = 0
16614 real(kind=8) function cubic( p, q, r )
16617 real(kind=8), intent(in) :: p, q, r
16619 real(kind=8) a, b, d, m, n, third, y
16620 real(kind=8) k, phi, thesign, x(3), duma
16625 a = (1.d0/3.d0)*((3.d0*q) - (p*p))
16626 b = (1.d0/27.d0)*((2.d0*p*p*p) - (9.d0*p*q) + (27.d0*r))
16628 d = ( ((a*a*a)/27.d0) + ((b*b)/4.d0) )
16630 if(d .gt. 0.)then ! => 1 real and 2 complex roots
16632 elseif(d .eq. 0.)then ! => 3 real roots, atleast 2 identical
16634 else ! d < 0 => 3 distinct real roots
16639 goto (1,2,3), icase
16648 m = thesign*((-b/2.d0) + (sqrt(d)))**(third)
16649 n = thesign*((-b/2.d0) - (sqrt(d)))**(third)
16651 cubic = real( (m) + (n) - (p/3.d0) )
16661 m = thesign*(-b/2.d0)**third
16664 x(1) = real( (m) + (n) - (p/3.d0) )
16665 x(2) = real( (-m/2.d0) + (-n/2.d0) - (p/3.d0) )
16666 x(2) = real( (-m/2.d0) + (-n/2.d0) - (p/3.d0) )
16670 if(x(kk).gt.cubic) cubic = x(kk)
16677 elseif(b.lt.0.)then
16681 ! rce 18-nov-2004 -- make sure that acos argument is between +/-1.0
16682 ! phi = acos(thesign*sqrt( (b*b/4.d0)/(-a*a*a/27.d0) )) ! radians
16683 duma = thesign*sqrt( (b*b/4.d0)/(-a*a*a/27.d0) )
16684 duma = min( duma, +1.0D0 )
16685 duma = max( duma, -1.0D0 )
16686 phi = acos( duma ) ! radians
16692 y = 2.*sqrt(-a/3.)*cos(phi + 120.*k*0.017453293)
16693 x(kk) = real((y) - (p/3.d0))
16694 if(x(kk).gt.cubic) cubic = x(kk)
16699 !----------------------------------------------------------
16704 !----------------------------------------------------------
16705 real(kind=8) function quadratic(a,b,c)
16708 real(kind=8) a, b, c
16710 real(kind=8) x, dum, quad1, quad2
16719 if(abs(x) .lt. 1.e-6)then
16724 quadratic = (-0.5*b/a)*dum
16726 if(quadratic .lt. 0.)then
16727 quadratic = -b/a - quadratic
16731 quad1 = (-b+sqrt(b*b-4.*a*c))/(2.*a)
16732 quad2 = (-b-sqrt(b*b-4.*a*c))/(2.*a)
16734 quadratic = max(quad1, quad2)
16738 end function quadratic
16739 !----------------------------------------------------------
16743 !----------------------------------------------------------
16744 ! currently not used
16746 ! two roots of a quadratic equation
16748 subroutine quadratix(a,b,c, qx1,qx2)
16751 real(kind=8) a, b, c, qx1, qx2
16753 real(kind=8) x, dum
16762 if(abs(x) .lt. 1.e-6)then
16767 qx1 = (-0.5*b/a)*dum
16772 qx1 = (-b+sqrt(b*b - 4.*a*c))/(2.*a)
16773 qx2 = (-b-sqrt(b*b - 4.*a*c))/(2.*a)
16778 end subroutine quadratix
16781 !=====================================================================
16799 !***********************************************************************
16800 ! save aerosol drymass and drydens before aerosol mass transfer is
16801 ! calculated this subr is called from within subr mosaic_dynamic_solver,
16802 ! after the initial calls to check_aerosol_mass, conform_electrolytes,
16803 ! conform_aerosol_number, and aerosol_phase_state, but before the mass
16804 ! transfer is calculated
16806 ! author: richard c. easter
16807 !-----------------------------------------------------------------------
16808 subroutine save_pregrow_props
16810 use module_data_mosaic_asect
16811 use module_data_mosaic_other
16815 ! include 'v33com9a'
16816 ! include 'v33com9b'
16817 ! include 'mosaic.h'
16819 ! subr arguments (none)
16822 integer ibin, isize, itype
16825 ! air conc in mol/cm^3
16826 cair_mol_cc = cairclm(kclm_aer)
16828 ! compute then save drymass and drydens for each bin
16829 do ibin = 1, nbin_a
16831 call calc_dry_n_wet_aerosol_props( ibin )
16833 call isize_itype_from_ibin( ibin, isize, itype )
16834 drymass_pregrow(isize,itype) = mass_dry_a(ibin)/cair_mol_cc ! g/mol(air)
16835 if(jaerosolstate(ibin) .eq. no_aerosol) then
16836 drydens_pregrow(isize,itype) = -1.
16838 drydens_pregrow(isize,itype) = dens_dry_a(ibin) ! g/cc
16844 end subroutine save_pregrow_props
16852 !***********************************************************************
16855 ! author: richard c. easter
16856 !-----------------------------------------------------------------------
16857 subroutine specialoutaa( iclm, jclm, kclm, msub, fromwhere )
16861 integer iclm, jclm, kclm, msub
16862 character*(*) fromwhere
16865 end subroutine specialoutaa
16870 !***********************************************************************
16871 ! box model test output
16873 ! author: richard c. easter
16874 !-----------------------------------------------------------------------
16875 subroutine aerchem_boxtest_output( &
16876 iflag, iclm, jclm, kclm, msub, dtchem )
16878 use module_data_mosaic_asect
16879 use module_data_mosaic_other
16883 ! include 'v33com2'
16884 ! include 'v33com9a'
16886 integer iflag, iclm, jclm, kclm, msub
16887 real(kind=8) dtchem
16892 integer, save :: ientryno = -13579
16893 integer icomp, iphase, isize, itype, k, l, m, n
16895 real(kind=8) dtchem_sv1
16897 real(kind=8) rsub_sv1(l2maxd,kmaxd,nsubareamaxd)
16900 ! bypass unless maerchem_boxtest_output > 0
16901 if (maerchem_boxtest_output .le. 0) return
16906 ! *** currently this only works for ntype_aer = 1
16911 ! do initial output
16912 if (ientryno .ne. -13579) goto 1000
16915 call peg_message( lunerr, '***' )
16916 call peg_message( lunerr, '*** doing initial aerchem_boxtest_output' )
16917 call peg_message( lunerr, '***' )
16919 write(lun) ltot, ltot2, itot, jtot, ktot
16920 write(lun) (name(l), l=1,ltot2)
16922 write(lun) maerocoag, maerchem, maeroptical
16923 write(lun) msectional, maerosolincw
16925 write(lun) nsize_aer(itype), ntot_mastercomp_aer
16927 do icomp = 1, ntot_mastercomp_aer
16929 name_mastercomp_aer(icomp)
16931 dens_mastercomp_aer(icomp), mw_mastercomp_aer(icomp)
16934 do isize = 1, nsize_aer(itype)
16936 ncomp_plustracer_aer(itype), &
16937 ncomp_aer(itype), &
16938 waterptr_aer(isize,itype), &
16939 numptr_aer(isize,itype,iphase), &
16940 mprognum_aer(isize,itype,iphase)
16942 ( mastercompptr_aer(l,itype), &
16943 massptr_aer(l,isize,itype,iphase), &
16944 l=1,ncomp_plustracer_aer(itype) )
16946 volumcen_sect(isize,itype), &
16947 volumlo_sect(isize,itype), &
16948 volumhi_sect(isize,itype), &
16949 dcen_sect(isize,itype), &
16950 dlo_sect(isize,itype), &
16951 dhi_sect(isize,itype)
16953 lptr_so4_aer(isize,itype,iphase), &
16954 lptr_msa_aer(isize,itype,iphase), &
16955 lptr_no3_aer(isize,itype,iphase), &
16956 lptr_cl_aer(isize,itype,iphase), &
16957 lptr_co3_aer(isize,itype,iphase), &
16958 lptr_nh4_aer(isize,itype,iphase), &
16959 lptr_na_aer(isize,itype,iphase), &
16960 lptr_ca_aer(isize,itype,iphase), &
16961 lptr_oin_aer(isize,itype,iphase), &
16962 lptr_oc_aer(isize,itype,iphase), &
16963 lptr_bc_aer(isize,itype,iphase), &
16964 hyswptr_aer(isize,itype)
16971 if (iflag .eq. 1) goto 1010
16972 if (iflag .eq. 2) goto 2000
16973 if (iflag .eq. 3) goto 3000
16977 ! iflag=1 -- save initial values
16980 dtchem_sv1 = dtchem
16981 do m = 1, nsubareas
16984 rsub_sv1(l,k,m) = rsub(l,k,m)
16992 ! iflag=2 -- save intermediate values before doing move_sections
16993 ! (this is deactivated for now)
17000 ! iflag=3 -- do output
17003 do m = 1, nsubareas
17006 write(lun) iymdcur, ihmscur, iclm, jclm, k, m, nsubareas
17007 write(lun) t, dtchem_sv1, cairclm(k), relhumclm(k), &
17008 ptotclm(k), afracsubarea(k,m)
17010 write(lun) (rsub_sv1(l,k,m), rsub(l,k,m), l=1,ltot2)
17017 end subroutine aerchem_boxtest_output
17021 !***********************************************************************
17022 ! 'debugging' output when mosaic encounters 'fatal error' situation
17024 ! author: richard c. easter
17025 !-----------------------------------------------------------------------
17026 subroutine mosaic_aerchem_error_dump( istop, ibin, luna, msga )
17028 ! dumps current column information when a fatal computational error occurs
17029 ! when istop>0, the simulation is halted
17031 use module_data_mosaic_asect
17032 use module_data_mosaic_other
17036 integer istop, ibin, luna
17040 integer icomp, iphase, isize, itype, k, l, lunb, m, n
17041 real(kind=8) dtchem_sv1
17045 ! *** currently this only works for ntype_aer = 1
17051 if (lunb .le. 0) lunb = 6
17054 9010 format( 7i10 )
17055 9020 format( 3(1pe19.11) )
17058 write(lunb,9000) 'begin mosaic_aerchem_error_dump - msga ='
17059 write(lunb,9000) msga
17060 write(lunb,9000) 'i, j, k, msub,ibin ='
17061 write(lunb,9010) iclm_aer, jclm_aer, kclm_aer, mclm_aer, ibin
17063 write(lunb,9010) ltot, ltot2, itot, jtot, ktot
17064 write(lunb,9000) (name(l), l=1,ltot2)
17066 write(lunb,9010) maerocoag, maerchem, maeroptical
17067 write(lunb,9010) msectional, maerosolincw
17069 write(lunb,9010) nsize_aer(itype), ntot_mastercomp_aer
17071 do icomp = 1, ntot_mastercomp_aer
17073 name_mastercomp_aer(icomp)
17075 dens_mastercomp_aer(icomp), mw_mastercomp_aer(icomp)
17078 do isize = 1, nsize_aer(itype)
17080 ncomp_plustracer_aer(itype), &
17081 ncomp_aer(itype), &
17082 waterptr_aer(isize,itype), &
17083 numptr_aer(isize,itype,iphase), &
17084 mprognum_aer(isize,itype,iphase)
17086 ( mastercompptr_aer(l,itype), &
17087 massptr_aer(l,isize,itype,iphase), &
17088 l=1,ncomp_plustracer_aer(itype) )
17090 volumcen_sect(isize,itype), &
17091 volumlo_sect(isize,itype), &
17092 volumhi_sect(isize,itype), &
17093 dcen_sect(isize,itype), &
17094 dlo_sect(isize,itype), &
17095 dhi_sect(isize,itype)
17097 lptr_so4_aer(isize,itype,iphase), &
17098 lptr_msa_aer(isize,itype,iphase), &
17099 lptr_no3_aer(isize,itype,iphase), &
17100 lptr_cl_aer(isize,itype,iphase), &
17101 lptr_co3_aer(isize,itype,iphase), &
17102 lptr_nh4_aer(isize,itype,iphase), &
17103 lptr_na_aer(isize,itype,iphase), &
17104 lptr_ca_aer(isize,itype,iphase), &
17105 lptr_oin_aer(isize,itype,iphase), &
17106 lptr_oc_aer(isize,itype,iphase), &
17107 lptr_bc_aer(isize,itype,iphase), &
17108 hyswptr_aer(isize,itype)
17113 do m = 1, nsubareas
17116 write(lunb,9010) iymdcur, ihmscur, iclm_aer, jclm_aer, k, m, nsubareas
17117 write(lunb,9020) t, dtchem_sv1, cairclm(k), relhumclm(k), &
17118 ptotclm(k), afracsubarea(k,m)
17120 write(lunb,9020) (rsub(l,k,m), l=1,ltot2)
17125 write(lunb,9000) 'end mosaic_aerchem_error_dump'
17128 if (istop .gt. 0) call peg_error_fatal( luna, msga )
17131 end subroutine mosaic_aerchem_error_dump
17132 !-----------------------------------------------------------------------
17134 end module module_mosaic_therm