HETV2: An update the vectorized inorganic chemistry solver HETV to include Na+-Cl--Ca2+-K+-Mg2+ in the metastable state option based on ISORROPIA II algorithms
Authors: Miller Stefan , Makar Paul , Lee Colin 
Published: February 2023

Inorganic heterogeneous chemistry (the reactions taking place between inorganic components of the gas-particle system) is one of the most complex and computationally demanding parts of atmospheric chemistry models. Accurate and highly computationally efficient algorithms for carrying out these calculations are essential for these models. Here we present a revised and updated approach for carrying out these calculations, called HETV2.HETV2 updates the original HETV metastable state subroutines (Makar et al., 2003) expanding the aerosol system to include base cations (Mg2+, K+, Ca2+, Na+), and partitioning between chlorine, ammonium, and nitrate ions and HCl, NH3 and HNO3 gases. HETV2 is based on the algorithms of ISORROPIA II (Fountoukis and Nenes, 2007), with several key improvements for accuracy and computational efficiency of the calculations. First, the accuracy and stability of polynomial roots have been improved by using a Taylor series expansion of the quadratic formula, for times when the coefficients differ by orders of magnitude. Second, the new algorithms in HETV2 enforce mass conservation for cases where all species are present and the ratio of total base cations to sulfate is between 1.0 and 2.0. Third, the code has been optimized using a &#8220;vectorization by gridpoint&#8221; approach, allowing a single call to each subroutine for n sets of input conditions, reducing the subroutine call factor overhead. Fourth, the code has been optimized to remove unnecessary calculations, and the programming language has been updated from Fortran 77 to Fortran 90. Fifth, all subroutines that require bisection to obtain an equilibrium solution (i.e., the &#8216;major systems&#8217;) have had their root-finding method updated to the &#8216;Interpolate, Truncate and Project (ITP)&#8217; method (Oliveria et al., 2021); the ITP method can obtain superlinear convergence, and therefore may significantly reduce the number of iterations, and hence the computational time, required to obtain the same result as ISORROPIA II. The new algorithms significantly improve both the computational speed and accuracy for inorganic heterogeneous chemistry calculations relative to ISORROPIA II. In this talk, we will describe the inorganic heterogeneous chemistry systems that are solved, the improvements to the algorithms, and compare the computational speed of ISORROPIA II to the new HETV2 code (depending on the chemical subspace examined, the new code is up to 2x faster than ISORROPIA II).References&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Fountoukis, C., & Nenes, A., 2007. ISORROPIA II: A computationally efficient thermodynamic equilibrium model for Aerosols. Atmospheric Chemistry and Physics, 7(17), 4639&#8211;4659.Makar, P. A., Bouchet, V. S., & Nenes, A., 2003. Inorganic Chemistry calculations using HETV&#8212;a vectorized solver for the SO42&#8722;&#8211;NO3&#8722;&#8211;NH4+ system based on the ISORROPIA algorithms. Atmospheric Environment, 37(16), 2279&#8211;2294.Oliveira, I. F., & Takahashi, R. H., 2021. An enhancement of the bisection method average performance preserving Minmax optimality. ACM Transactions on Mathematical Software, 47(1), 1&#8211;24.