tokens: density and, through a gradient descent, iterate in small steps until the solution has converged. The total electron density is given by the sum of the free electrons from hydrogen, helium, and metals. We approximate this using only the first 30 elements, as others are too scarce to contribute significantly:where Z is the atomic number, A Z is the fractional abundance of element number Z , k is the ionization stage ranging from singly to fully ionized (e.g., k = 2 corresponds to doubly ionized), and Y k is the fractional population of ionization stage k of element Z . For trace elements, we solve for the ionization fractions Y k either using an equilibrium calculation that is a function of temperature or by solving a continuity equation for nonequilibrium ionization states, as detailed in, e.g., Bradshaw Mason ( 2003a , 2003b ). The nonequilibrium solver can be used with all, some, or none of the elements, as determined by the user and appropriate for the study at hand. The code makes an initial guess for the H ii fraction, calculates the rate coefficients, solves Equations ( 1 ) and ( 16 ) for the level populations, and then recalculates the total electron density. The process iterates in small steps until the electron density has converged within a defined relative tolerance (default of 10 −6 ). 2.5. Radiative Losses In previous versions of HYDRAD, the hydrogen and electron densities were essentially equal in the corona (with only a small correction for trace elements), so that the optically thin radiative losses E R (erg s −1 cm −3 ) were approximated by setting n e = n H . We drop that approximation now and use the more accuratewhere is the sum of the emissivity over all ions and all transitions for each ion (more precisely, all in the current version of CHIANTI; Del Zanna et al. 2015 ), and the minus sign indicates that the energy is lost from the system. The loss function Λ also depends on the ionization fractions and therefore also utilizes a nonequilibrium ionization calculation when desired. In the chromosphere, we calculate radiative losses following the prescription of Carlsson Leenaarts ( 2012 ), which calculates the loss of energy from hydrogen, calcium, and magnesium. We now use the ionization fraction of hydrogen determined by the above prescription in this calculation. 2.6. Performance The calculation of the NLTE level populations is a significant computational task. A few simple tests with various parameters have found that the code slows by a factor of 10–20 compared to previous versions. To offset these losses, HYDRAD has been recently parallelized with OpenMP. In Figure 3 , we briefly show a timing test of the code. We have run an example simulation of electron beam heating (see the next section) with energy flux F 0 = 3 × 10 9 erg s −1 cm −2 for 10 s of heating. The simulations were only run for 100 s of simulation time. The timing of the simulation run with the older version of the chromosphere is shown in red, compared
ner_tags: O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Formula I-Formula I-Formula O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Citation I-Citation I-Citation I-Citation O B-Citation O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Software O O O O O O O O O O B-CelestialObjectRegion O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Database B-Citation I-Citation I-Citation I-Citation I-Citation O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-CelestialObjectRegion O O O O O O O O B-Citation I-Citation I-Citation I-Citation I-Citation O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Model O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Software O O O O O B-Software O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O