A Critical View of the Application of the APEX Software (Aqueous Photochemistry of Environmentally-Occurring Xenobiotics) to Predict Photoreaction Kinetics in Surface Freshwaters

The APEX (aqueous photochemistry of environmentally occurring xenobiotics) software computes the phototransformation kinetics of compounds that occur in sunlit surface waters. It is free software based on Octave, and was originally released in 2014. Since then, APEX has proven to be a remarkably flexible platform, allowing for the addressing of several environmental problems. However, considering APEX as a stand-alone software is not conducive to exploiting its full potentialities. Rather, it is part of a whole ecosystem that encompasses both the software and the laboratory protocols that allow for the measurement of substrate photoreactivity parameters. Coherently with this viewpoint, the present paper shows both how to use APEX, and how to experimentally derive or approximately assess the needed input data. Attention is also given to some issues that might provide obstacles to users, including the extension of APEX beyond the simple systems for which it was initially conceived. In particular, we show how to use APEX to deal with compounds that undergo acid–base equilibria, and with the photochemistry of systems such as stratified lakes, lakes undergoing evaporation, and rivers. Hopefully, this work will provide a reference for the smooth use of one of the most powerful instruments for the modeling of photochemical processes in freshwater environments. All authors have read and agreed to the published version of the manuscript.


Introduction
Pollutants occurring in natural waters pose a serious threat to aquatic ecosystems and human health, via both recreational activities and the use of irrigation or drinking water. The problems connected with water pollution by organic chemicals would be much more serious than currently experienced, were natural aquatic systems unable to self-depollute. Among the natural self-depollution processes are hydrolysis, redox reactions, and, most notably, bio-and photodegradation [1]. Photodegradation is particularly effective in the case of biorecalcitrant pollutants, and many contaminants of emerging concern emitted by wastewater treatment plants (WWTPs) belong to this class. Indeed, WWTPs tend to select for hardly biodegradable and water-soluble pollutants that are most likely to survive the activated sludge step, without being biodegraded or adsorbed on biosolids [2].
Photoreactions in sunlit surface waters can be divided into direct photolysis and indirect photochemistry. In the former case, sunlight is absorbed by the pollutant itself and the absorption process triggers transformation (e.g., ionization, bond breaking, or reaction with the solvent or with other dissolved molecules). Indirect photoreactions involve the absorption of sunlight by photosensitizers, CDOM + hν → 1 CDOM* → 3 CDOM* (4) 3 CDOM* + CO 3 2− → CDOM •− + CO 3 • OH + DOM → Products (9) The indirect phototransformation of pollutants is usually a minor quenching pathway for the transient species; thus, their steady-state levels ([ • OH], [CO 3 •− ], [ 3 CDOM*], and [ 1 O 2 ]) typically do not depend on the pollutant concentration. This issue means that it is possible to study or model the photochemical functioning of natural waters, independently of the occurrence of pollutant photoreactions [9]. To date, most attention has been focused on the photochemical properties of the single molecules/pollutants by dividing them into "photostable" and "photolabile" ones [10]. In contrast, very little interest has been devoted to the photochemical characterization of natural ecosystems, despite the fact that their photoreactivity can also widely vary. In fact, a photolabile molecule in a poorly photoreactive environment can have the same phototransformation kinetics as a photostable molecule in a photoreactive water body [11]. The lack of attention paid towards the photochemical functioning of the natural aquatic systems is probably due to the difficulty of extrapolating results from laboratory experiments to real outdoor conditions, which has led to an important underestimation of the environmental variability.
The use of photochemical models is a good way to bridge the gap between laboratory results and outdoor conditions [12][13][14][15][16]. Some years ago, a useful tool was released for this purpose, namely the "aqueous photochemistry of environmentally occurring xenobiotics" (APEX) software [17]. The main goal of APEX is to predict the environmental phototransformation of pollutants in environmental waters based on their photoreaction kinetics parameters (absorption spectra, direct photolysis quantum yields, second-order reaction rate constants with transient species). In several cases, it has been possible into account the formation of a given intermediate, and in this case the relevant input variables are the intermediate formation yields from the substrate upon direct photolysis and reaction with • OH, CO 3 •− , 1 O 2 , and 3 CDOM*.
It is noteworthy to observe that some of the above input variables are wavelength-dependent, while others are not. Therefore, a further subdivision into subclasses can be introduced as shown in Figure 1. This subdivision is mirrored in the way input data are introduced into the software, because the wavelength-dependent variables are accommodated in the molecule.csv input files (molecule.csv means that, by default, the file has the name of the substrate, e.g., Ibuprofen.csv or Acetaminophen.csv). In contrast, the wavelength-independent quantities are introduced in the Plotgraph or the Savetable functions.
All the wavelength-independent quantities can be introduced either as definite numerical values or as variables within a given range. Two such variables (X and Y) should be defined for each run, but it is also possible to restrict the variation range to a single numerical value if useful (i.e., to use a variable as if it were a constant). Based on these input data, the software computes a range of output variables. They are: (i) half-life times of the given molecule/pollutant, as well as the corresponding first-order degradation rate constants (relative to each single photochemical pathway, or to all the pathways pooled together); (ii) steady-state concentrations of • OH, CO 3 •− , 1  = 3 × 10 −5 (formation quantum yield of • OH by irradiated CDOM), present as a default value in APEX, takes into account the photogeneration of • OH by Fe species, including the photo-Fenton reactions [34,35]. Indeed, Fe photochemistry in surface waters largely depends on the behavior of the Fe-DOM complexes, while inorganic Fe species (and especially Fe colloids [36]) play a secondary role. A very precise knowledge of Fe speciation would thus be needed to predict the details of Fe-induced photoreactions, but this detailed knowledge is usually not available. Therefore, within APEX, Fe photochemistry leading to • OH is accounted for within CDOM photoreactions.

Wavelengthdependent
Wavelength-independent 1 The software can accommodate both wavelength-dependent and wavelength-independent photolysis quantum yields, depending on the degree of knowledge about the photochemical system.  Another issue to be considered is that the energy of photons is usually much higher than the thermal vibrational energy. For this reason, photoinduced reactions show lower temperature dependence compared with other, non-photoinduced processes [37], and the temperature effect is not taken into account here. Still, if second-order reaction rate constants are measured at different temperature values and found to be significantly different, they can be used as input data in different runs to assess a temperature effect. It is also of note that if the concentration of a pollutant is low enough, which is typically the case in surface waters, its photoreaction kinetics are independent of the concentration itself. For this purpose, APEX uses a default concentration [S]o = Another issue to be considered is that the energy of photons is usually much higher than the thermal vibrational energy. For this reason, photoinduced reactions show lower temperature dependence compared with other, non-photoinduced processes [37], and the temperature effect is not taken into account here. Still, if second-order reaction rate constants are measured at different temperature values and found to be significantly different, they can be used as input data in different runs to assess a temperature effect. It is also of note that if the concentration of a pollutant is low enough, which is typically the case in surface waters, its photoreaction kinetics are independent of the concentration itself. For this purpose, APEX uses a default concentration [S] o = 10 −8 mol·L −1 (inserted in the apex.m calculation file) that is low enough to meet the above requirement.
Extensive use of the calculation engine first (the never publicly released Turbo Pascal-based version dates back to 2009), and of the full software later, has shown that APEX can be a powerful tool to model the photochemistry of aquatic systems and of the pollutants occurring in them. However, its potential can be exploited in full only if APEX is conceived as part of a whole environment, where kinetic measurements (to provide the input data) and photochemical modeling operate together [28][29][30]. Most photochemical degradation experiments carried out in the laboratory, even on real water samples, have the important drawback that it is not easy to extrapolate results obtained in the centimeters-deep water columns of photoreactors to the depths of several meters that are typical of natural water bodies [38]. This is the main reason why most experimental approaches tend to systematically overestimate direct photolysis over indirect photochemistry, thereby providing a distorted view of the way natural aquatic systems work. To my knowledge, APEX is the only tool that allows for easy extrapolation of laboratory results to the real environment, when both direct photolysis and indirect photochemistry are concerned. However, APEX requires second-order reaction rate constants as input data, and most laboratory experiments that can be conceived simply do not allow for these data to be obtained. This is the reason why, in addition to explaining how the software works, this paper also includes a detailed explanation of how experiments should be carried out to derive meaningful input data.
APEX was initially conceived to treat well-mixed and stationary systems, such as overturning lakes. Therefore, the default calculation scenario concerns a well-mixed system of this kind. However, expert users could also employ APEX to successfully carry out calculations in stratified lakes and in rivers, also taking into account the effect of pH [27]. The tips and tricks to carry out these calculations are provided in dedicated sections (Sections 5 and 6).

Input Data
The APEX software requires as input data some quantities that depend on the environment and others that depend on the molecule. Moreover, there are two different places where input data can be inserted, namely the Savetable and Plotgraph files (to be used in alternative), as well as the molecule.csv spreadsheet(s). As preliminary remark, consideration should be made of the use of "−1" and "−2" in Savetable/Plotgraph versus molecule.csv. In the molecule.csv file, sometimes one may not want the software to read some columns, because priority should be given to calculations carried out on data reported elsewhere. This is especially true of the columns phi (wavelength trend of the photolysis quantum yield) and Aw (water absorption spectrum). To tell the software to ignore these columns, all their numerical values should be made equal to −1.
The meaning of −1 and −2 is totally different in Savetable/Plotgraph. Here, −1 is the way to define an X variable (e.g., by typing "CNO3 = −1;", one defines nitrate as an X variable), while −2 defines a Y variable (e.g., "kP_OH = −2;" defines the • OH reaction rate constant as a Y variable). Note that all the quantities present in Savetable/Plotgraph (concentration values of water parameters, water depth, second-order reaction rate constants, photolysis quantum yield, intermediate formation yields) can be defined as X or Y variables.

Environment-Dependent Variables
They may be inserted into either Savetable/Plotgraph, or molecule.csv.

Savetable/Plotgraph
The environmental variables to be inserted into Savetable/Plotgraph are water depth and the concentration values of nitrate (mol L −1 ), nitrite (mol L −1 ), bicarbonate (mol L −1 ), carbonate (mol L −1 ), and DOC or NPOC (dissolved organic carbon or non-purgeable organic carbon, which are different notations to indicate the same parameter, units of mg C ·L −1 ). The way such files look is shown in the user's guide (readme.pdf Section 6, see Supplementary Materials).
In some cases, the value of the TOC may be available (total organic carbon, sum of DOC and POC, i.e., particulate organic carbon) instead of the DOC. In this case, the following observations apply: (i) organic matter in surface waters is prevalently found in its dissolved form, thus TOC ≈ DOC as a first approximation [39]; and (ii) the photochemistry of surface freshwaters is mainly a chemistry of dissolved species, with a small to negligible contribution from suspended matter [36,40]. Thus, in this context, the TOC is a decent approximation for the DOC.
The units of mg C ·L −1 are the generally accepted measure units for organic matter. In contrast, in the case of nitrate and nitrite, it is customary to find data in units of mg NO − 3 L −1 , mg NO − 2 L −1 , or mg N L −1 (the latter also indicated as nitrate-N or nitrite-N). However, APEX needs data in molarity to carry out light-absorption calculations in a straightforward (Lambert-Beer-based) way. The conversion between different analytical units and the required mol·L −1 ones has to take into account the molecular weights of NO 3 − (62,000 mg NO − 3 mol −1 ) and NO 2 − (46,000 mg NO − 2 mol −1 ), as well as the equivalent weight of N (14,000 mg N mol −1 ). The case of HCO 3 − and CO 3 2− may be more complex, because their concentration data are often not available (unless dedicated water titration is carried out, which is relatively rare). In contrast, alkalinity (Alk) and pH are more commonly found [26]. The procedure to derive [HCO 3 − ] and [CO 3 2− ] from Alk and pH is based on the thermodynamic theory of equilibria in aqueous solution [41,42]. It is explained in detail in the Readme.pdf file (Supplementary Materials, paragraph 3.10).

Molecule.csv
The environmental variables that depend on the wavelength may be inserted into the molecule.csv input file if one needs to replace the default values (see Section 5 of readme.pdf in Supplementary Materials for insight as to how this kind of files looks; there is a different file for each molecule to be studied). The relevant variables are the sunlight spectrum (p0sun; the default spectrum is related to 45 • N, and units are Einstein cm −2 ·s −1 ·nm −1 ) and the measured water absorbance (Aw, referred to 1 cm optical path length, i.e., cm −1 units). Note that if one needs to make calculations for mid-latitude conditions and does not want to use a specific water absorption spectrum, the values of p0sun and Aw present in the default molecule.csv files provided here work well. In this case, they do not need to be modified.
The default time unit used in APEX is a fair-weather day in mid-July at 45 • N latitude, and the day-night cycle is taken into account. The APEX package can make a (approximated) post-calculation assessment of the seasonality of photochemical parameters (APEX_season.xls spreadsheet, see readme.pdf for this), but the default sunlight spectrum used in molecule.csv is referenced to the month of July at 45 • N (at 9:00 or 15:00 solar time). This issue should be taken into account when modifying the default sunlight spectrum to consider, for example, different latitudes in calculations (which can be done successfully, see Reference [43]). Note that one dedicated APEX calculation must be carried out for each given latitude value, because it is not possible to define the latitude as a variable.
If no input value of Aw is given (i.e., the Aw column of molecule.csv has a −1 value overall, as in the default files provided), APEX computes the water absorption spectrum on the basis of the DOC (NPOC) value using the following formula [34] (note that the measure unit of A 1 (λ) is [cm −1 ]): This approach is particularly useful if one wants to assess the environmental behavior of a compound as a function of varying DOC without having a particular environment in mind (or if, for a given water environment, the DOC value is available but the water absorption spectrum has not been measured). For the approach based on Equation (12) to be followed, the whole Aw column in the molecule.csv file should have the standard value −1.
In other cases, however, one might wish to assess the photochemical behavior of a compound in a particular environment, for which the absorbance of the water surface layer is available. The use of Molecules 2020, 25, 9 8 of 34 actual absorbance understandably increases the accuracy of the calculations. In this case, instead of −1, the Aw column should contain the experimental absorbance values measured at different wavelengths (note that in molecule.csv the wavelengths are not given in 1 nm increments, because the typically available sunlight spectra do not respect this requirement) over a 1 cm optical path length (or divided by the used path length in cm: the important issue is that cm −1 units are used for Aw). If the software finds different data than −1 in the Aw column of molecule.csv, these data are used with priority for light-absorption calculations.

Savetable/Plotgraph
The molecular variables that are required as input data in APEX, and that should be inserted within Savetable/Plotgraph, deal with photoreaction kinetics. In particular, they are the second-order reaction rate constants (units of L·mol One comment should concern the direct photolysis quantum yield, because very often only one wavelength-averaged value is available. The latter can be inserted into Savetable/Plotgraph (fi_P variable) as a single numerical datum (e.g., "fi_P = 0.33;"). In some other cases, a full series of wavelength-dependent data may be available, which should be inserted into the molecule.csv file (phi column), where a wavelength trend can be easily arranged.
In theory, a more straightforward option would have been to only foresee the insertion of the quantum yield value in molecule.csv, either as a constant value for all the wavelengths or as a wavelength trend. However, we judged it important to retain the possibility of defining the photolysis quantum yield as a X or Y variable in Savetable/Plotgraph. This possibility becomes very useful when the exact quantum yield is not known, but one still wants to see whether or not the direct photolysis process is significant compared to other photoreactions, making the quantum yield vary over a wide range of values [38] (this is actually an instance of the priority often given in APEX to flexibility over user-friendliness).
In practice, with the photolysis quantum yield one has the following options: 1.
Insert the known wavelength trend in molecule.csv (column phi); in this case, the software will ignore the value of fi_P provided in Savetable/Plotgraph; 2.
Insert the known constant value of fi_P (suppose it is 0.33, as for ibuprofen) in Savetable/Plotgraph; to make the software read this value with priority, the phi column in molecule.csv should be made equal to −1; note that the same result can be obtained by inserting the above constant value (0.33) in the whole phi column of molecule.csv, which will be read with priority; 3.
Similarly to the quantum yield, for all the parameters it is possible to give specific numerical values (e.g., "kP_CO3 = 1e8;", which sets k P+CO •− 3 = 10 8 L·mol −1 ·s −1 ) or to define them as variables (e.g., "kP_CO3 = −2;" to define k P+CO As already explained, this file is used to arrange wavelength-dependent parameters. The typical one is the absorption spectrum of the compound (molar absorption coefficient, units of L mol −1 cm −1 ), which should be reported in the EP column (see Section 5 of readme.pdf in Supplementary Materials). Basically, it is the content of this column that customizes each molecule.csv file. As explained in Section 3.2.1, the direct photolysis quantum yield may be placed in the phi column of the file, but this is not the only option. Note that all the 44 default molecule.csv files provided here (see the "Compounds" folder of the Supplementary Materials) contain a wavelength-averaged value of the direct photolysis quantum yield in their relevant phi columns.

Final Considerations Concerning the Input Data
The above text explains how to introduce the data concerning molecular variables into APEX, but it does not tell how to obtain these data. For all molecules for which APEX calculations have been carried out by the author's group, input values (measured photolysis quantum yields and second-order reaction rate constants, see the file readme.pdf ) and input files (of the kind molecule.csv) are provided as Supplementary Materials (there is a total of 44 such files). For some other molecules, data can be found in the literature (especially those concerning photolysis quantum yields and • OH reaction rate constants). There is also a possibility to obtain the reaction rate constants with • OH, 1 O 2 , CO 3 •− , and 3 CDOM* with a quantitative structure-activity relationship (QSAR) approach or known correlations, but the same is much more difficult for the photolysis quantum yields. In all other cases, the relevant parameters have to be measured experimentally. The following sections explain how to measure the photochemical kinetics parameters required by APEX (with two alternative approaches to determine the reaction rate constants) and how to approximately assess some of these values using QSAR.

Experimental Measurement of Photoreaction Parameters
It should be preliminarily observed that the paragraphs below were written with the use of liquid chromatography as analytical technique in mind, to monitor the degradation of the target pollutant, and UV-Vis spectrophotometry only to measure absorption spectra for light-absorption calculations. While different techniques can be and have actually been used (e.g., plate count for bacteria [44]), they are not necessarily validated or recommended. For instance, when using UV-Vis spectrophotometry to monitor the time evolution of a substrate (e.g., a dye), care should be taken to avoid spectral interference [45]. Therefore, full UV-Vis spectra should be taken instead of, for instance, carrying out single-wavelength monitoring.
Note also that in the following pages, definite concentration values (of photosensitizers, substrates and so on) will be reported in several cases. These values are only indicative, and are mentioned here because they have been found to work well under laboratory conditions that, however, cannot be necessarily replicated exactly in a different context. Therefore, corrections and optimizations will usually be needed. The reported conditions are thus only a starting point, and hopefully a useful time-saving suggestion for experimenters, but there is absolutely no guarantee that everything will work on the first attempt.

Direct Photolysis Quantum Yield
The direct photolysis of a compound can be assessed by monitoring its transformation under (natural or simulated) sunlight or under environmental UV radiation (λ > 300 nm). The photolysis quantum yield Φ is the ratio between the initial transformation rate of the compound (R o , units of mol·L −1 ·s −1 ) and its absorbed photon flux (P a , units of Einstein L −1 ·s −1 ) [46]. The absorbed photon flux can be calculated by knowing the incident spectral photon flux density p • (λ) of the light source, the optical path length b inside the photoreactor, the molar absorption coefficient ε(λ) of the compound undergoing the direct photolysis, and its concentration c (e.g., 20 µmol·L −1 ) [46]: The numerical integration should be carried out over the wavelength interval [λ 1 ,λ 2 ] where the emission spectrum of the lamp (p • (λ)) and the absorption spectrum of the compound (ε(λ)) overlap. The values of ε(λ) can be determined spectrophotometrically, while the determination of p • (λ) requires the combination of a fiber-optic spectrophotometric measurement with chemical actinometry (I often use the 2-nitrobenzaldehyde method [47], which is described in detail in the Supplementary Material of Marchisio et al. [48], but several alternatives are available. See, for instance, Kuhn et al. [49] for a review on chemical actinometry). An important consideration should be made when measuring absorption spectra in the context of direct photolysis quantum yield experiments; the usual tendency is to take the spectrum of a solution at a substrate concentration value that allows for a UV peak (often, a peak in the UVC region) to nicely stay on scale. In this way, a nice-looking absorption spectrum can be obtained. Unfortunately, however, one very often sees the absorbance decrease almost to zero when approaching the UVB region, where the absorption spectrum may get confounded with the background noise. With such data in hand, it may be difficult to tell exactly whether the substrate is unable to absorb sunlight, or whether its absorbance is just very low. The difference between the two scenarios may not be trivial; for instance, ibuprofen has very low (but non-negligible) absorbance above 290 nm which, combined with a high photolysis quantum yield (Φ = 0.33), ensures that the direct photolysis can account for over 50% of its phototransformation in some environmental conditions [19]. In order to exactly measure absorption above 290 nm, one should take the spectrum of a solution that is as concentrated as possible (in the case of ibuprofen, at least 0.01 mol·L −1 at circumneutral pH). In this case, any UVC absorption peak(s) may be totally saturated, but the environmental UV absorption can be properly highlighted.
Another issue is that the initial degradation rate R o should take into account phototransformation alone. Dark experiments are thus needed to determine the hydrolysis kinetics and possible biotransformation (although unlikely in laboratory solutions), which should be subtracted from the measured phototransformation rate. The calculation of the initial reaction rates requires the knowledge of the time evolution of the substrate (C t = concentration at time t, C o = initial concentration, k = kinetic constant), in a first-order kinetic approximation (C t = C o e −k t ) or in a zero-order one (C t = C o (1 -k t)), followed in either case by R o = k C o . When both R o and P a are known, one can calculate the direct photolysis quantum yield as Φ = R o P −1 a .

Measurement of Second-Order Reaction Rate Constants without Using Reference Compounds
When using this approach, it is first necessary to photochemically produce the different reactive transient species. Recommended sources are The determination of the second-order reaction rate constant of a substrate S with • OH should make use of an • OH scavenger of known reactivity. It is not necessary to monitor the time evolution of the scavenger, which can be an alcohol such as methanol, ethanol, 2-propanol, or t-butanol. The latter two compounds are the most frequently used, presumably because of the low reactivity of the secondary radicals (interfering species) arising from the oxidation of the relevant alcohols by • OH. The kinetic system should take into account the formation of • OH by H 2 O 2 photolysis (if possible under UVB radiation, which is experimentally more convenient than UVC), as well as the reactions of • OH with H 2 O 2 , the added alcohol, and the substrate S [50]: Alcohol where R• OH is the formation rate of • OH upon photolysis of H 2 O 2 . Upon application of the steady-state approximation to • OH, one gets the following trend for the initial transformation rate of S, R S : The most straightforward operation is to study the transformation of S at constant [S] and [H 2 O 2 ], letting the initial concentration of the alcohol vary. Suggested concentration values are 20 µmol·L −1 for S, and H 2 O 2 fixed somewhere between 10 −3 and 10 −2 mol·L −1 , letting the alcohol vary in different irradiation experiments, from 0 to 0.01 or 0.1 mol·L −1 (the higher the k 17 , the more concentrated should be the alcohol to inhibit the degradation of S). Note that the added alcohol at the highest concentration value should cause R S to decrease by at least 50% compared to the case where no alcohol is present. By plotting the experimental data of R S as a function of [Alcohol], one can use Equation (18) as a fit function with R• OH and k 17 as fit parameters (k 15 , k 16 , [S], and [H 2 O 2 ] are known; note that k 16 = 9.7 × 10 8 L·mol −1 ·s −1 for methanol, 1.9 × 10 9 L·mol −1 ·s −1 for both ethanol and 2-propanol, and 6.0 × 10 8 L· mol −1 ·s −1 for t-butanol [50]). The two fit parameters are mutually orthogonal; thus, the fit result is univocal. As an alternative, and especially if one lacks a non-linear fit procedure, Equation (18) can be linearized as follows: In this case, one should plot 1/R S vs.
[Alcohol] and make a linear fit, deriving k 17 from the slope and intercept of the fit line.

•−
In the case of the carbonate radical, it is not possible to determine the second-order reaction rate constant without competition kinetics. However, it is possible to carry out a screening study by which to see whether the CO 3 •− reaction could be important in the photodegradation of the given compound in natural waters. The rationale is that CO 3 •− can be generated upon irradiation of nitrate in the presence of bicarbonate [51]: The photolysis of nitrate yields O •− + • NO 2 , which are initially contained in a solvent cage, i.e., surrounded by water molecules. The two radical species can either undergo in-cage (geminate) recombination to nitrate (Equation (21)), or diffuse into the solvent bulk, where they can react with other species (bulk recombination of • OH + • NO 2 is very unlikely). It has been shown that in the presence of nitrate alone under irradiation, more that 75% of O •− + • NO 2 undergoes geminate recombination, while only 25% diffuses into the solution bulk [52]. The addition of excess scavengers (in this case, HCO 3 − + CO 3 2− ) can trigger the consumption of both the bulk species (especially • OH) and, most notably, the in-cage ones, thereby inhibiting geminate recombination and increasing the overall formation yield of radicals ( • OH + • NO 2 + CO 3 •− ). For instance, excess alcohol addition as an • OH scavenger, coupled with monitoring of the alcohol transformation products as • OH probes, can result in an over-prediction of the nitrate photolysis quantum yield [53]. The addition of bicarbonate salts at sufficiently high concentration values can also inhibit geminate recombination, because of the scavenging of cage O •− (reactions 25,26). This process enhances the production of CO 3 •− and, because of the lower geminate recombination of [O •− + • NO 2 ] cage , the overall yield of • OH + CO 3 •− with nitrate + bicarbonate (usually with a prevalence of CO 3 •− , because most • OH is scavenged in either the cage or the bulk) is higher than the • OH yield with nitrate alone [51].
The above phenomenon can have two consequences, depending on the reactivity of a substrate with • OH vs. CO 3 •− : if the substrate reacts only with • OH, with poor or no CO 3 •− reactivity, its degradation is inhibited by bicarbonate (note that less • OH occurs with nitrate + bicarbonate compared to nitrate alone). If the CO 3 •− reactivity is significant, the addition of bicarbonate enhances degradation because of the increased production of • OH + CO 3 •− compared to the case of nitrate alone [51]. However, the interpretation of the experimental results may be a bit less straightforward because: (i) bicarbonate addition to nitrate increases pH, and some compounds might undergo a reactivity change with pH, e.g., because of deprotonation; moreover, (ii) direct photolysis may be important, which could complicate the analysis of the bicarbonate trend. Indeed, in some cases the CO 3 •− reaction might not show up well enough against the background of direct phototransformation.
To tackle the above possible biases, three series of experiments should be carried out [19]: 1.

2.
Irradiation of the substrate with nitrate at the same concentrations as before, but with a phosphate buffer (H 2 PO 4 − + HPO 4 2− ) instead of bicarbonate. The phosphate buffer should have the same total concentration as the bicarbonate salt, and the same pH within 0.2-0.3 units.

3.
Irradiation of the substrate at the usual concentration without nitrate, but with the same bicarbonate concentrations as in series (1) (direct photolysis check).
If the substrate degradation rates in series (3) are sufficiently lower than those in (1) and (2), then the direct photolysis is not so important and will not mask the other photochemical pathways. In this case, two possible scenarios can be in effect [51]: (a) Transformation with bicarbonate is faster than that with phosphate: in this case, the CO 3 •− reaction could be important and should be investigated, e.g., by measuring the reaction rate constant with competition kinetics (vide infra); (b) Transformation with bicarbonate is slower than that with phosphate: in this case, the CO 3 •− reaction is likely to be negligible in surface-water conditions.

Reaction with 1 O 2
The generation of 1 O 2 can make use of Rose Bengal (RB) under irradiation as a suitable photosensitizer. The recommended RB concentration is somewhere around 10 µmol L −1 . This dye absorbs visible light; thus, selective irradiation can conveniently use a yellow lamp that will minimize the probability of directly photolyzing the substrate S. The resulting kinetic system is quite simple (ISC = inter-system crossing, while superscripts 1 and 3 indicate singlet and triplet excited states, respectively) [54]: Upon application of the steady-state approximation to 1 O 2 , one gets the following equation: where R S is again the initial transformation rate of S. If [S] is low enough, the above equation can be linearized as follows: . From the linear plot of R S vs.
[S] one can derive k 29 because k 28 is known, provided that the value of R1 O 2 is also known. To determine R1 O 2 , it is recommended to use furfuryl alcohol (FFA) as a probe and carry out another irradiation experiment with the same RB concentration and irradiation set-up as before. In this case, the kinetic system is made up of Equations (27) and (28) plus the following [55]: By applying again the steady-state approximation to 1 O 2 , the initial degradation rate of FFA gets the following expression, which allows for R1 O 2 to be determined: The plot R S = m [S], which has a linear form if [S] is low enough, and where m is the line slope, can then be arranged as follows: It is thus possible to derive k 29 based on known parameters.

Reaction with 3 CDOM*
The determination of the second-order reaction rate constant with reactive triplet states is conceptually more complicated, because CDOM is not a definite chemical species, and the same holds for 3 CDOM*. Dissolved compounds interact with triplet states with a mix of physical quenching and chemical reactivity, both of which consume 3 CDOM* (usually yielding CDOM, CDOM •− , or CDOMH • depending on the process). However, these processes do not necessarily modify the compounds themselves. The quenching rate constant describes the sum of physical quenching and actual reactions, and it can be determined by laser flash photolysis using either proxy molecules (the triplet states of which simulate the behavior of 3 CDOM*) or, more recently, actual CDOM [56,57]. Unfortunately, the quenching rate constants are only upper limits for the reaction rate constants that are involved in the actual transformation of the substrates.
An alternative strategy to laser flash photolysis is the use of irradiation experiments with CDOM proxy molecules. Here, the conditions are more stringent compared to the laser flash photolysis experiments, because the photochemistry and photophysics of the proxy molecule have to be very well known (indeed, liquid chromatography tells nothing about the triplet-state kinetics). Anthraquinone-2-sulfonate (AQ2S) was the first proxy molecule to be proposed, due to its well-known photophysics and straightforward triplet-state reactivity without side reactions such as the generation of • OH or 1 O 2 [58]. Unfortunately, the triplet state 3 AQ2S* is considerably more reactive than typical 3 CDOM*; therefore, the use of AQ2S produces overestimations of triplet-sensitized reactions in the environment. More recently, 4-carboxybenzophenone (CBBP) has been proposed as a proxy for irradiation experiments, because the reactivity of 3 CBBP* is more similar to that of 3 CDOM* [20]. The procedure to be used for CBBP experiments is described below [59].
Solutions containing CBBP (suggested concentration around 50-100 µmol L −1 ) and the substrate S (variable concentration values in different experiments, typically below 100 µmol L −1 ) are irradiated under a UVA lamp. The initial degradation rates of S, R S ', are then calculated for different initial values of [S]. The direct photolysis of S is checked by irradiating it alone (i.e., without CBBP) under the same lamp and at the same concentration values as before, obtaining the initial photolysis rates R S ". For each S concentration value, the "genuine" triplet-sensitized transformation rate is determined as R S = R S ' − χ R S ", where χ is the ratio between the photon flux absorbed by S in a CBBP solution, compared to the photon flux absorbed in a solution that contains S alone (χ takes into account the light-screening effect of CBBP on S). Note that if S does not undergo direct photolysis under UVA radiation, one simply has R S = R S '. Otherwise: where p • (λ) is the lamp spectral photon flux density, the concentrations [S] and [CBBP] refer to the initial values, ε is a molar absorption coefficient, b the optical path length in the irradiated photoreactor, and [λ 1 ,λ 2 ] is the wavelength interval where the emission spectrum of the lamp overlaps with the absorption spectrum of S.
In the solution containing CBBP and S, CBBP undergoes excitation to 3 CBBP* that can [60]: (i) undergo thermal deactivation (which includes physical quenching by S and reaction-less encounters with dissolved O 2 ); (ii) react with O 2 to produce 1 O 2 , which could contribute to S degradation (by comparison, AQ2S has the advantage of not producing 1  is low enough, a linear plot is obtained of R S = m [S] (which means that S at low concentration is a negligible 3 CBBP* quencher). The application of the full kinetic model (see [60] for details) yields the following expression for the reaction rate constant between S and 3 CBBP* (k S+ 3 CBBP * , units of L·mol −1 ·s −1 ): where k' = 6 × 10 5 s −1 is the first-order inactivation rate constant of 3 CBBP* in aerated solution, S ∆ = 0.46 is the 1 O 2 yield between 3 CBBP* and O 2 (which means that 46% of the 3 CDOM* + O 2 encounters end up in CDOM + 1 O 2 , and 54% in CDOM + O 2 ), while k 28 , k 29 respectively describe 1 O 2 inactivation and its reaction with S, as per the previous section [60]. P a,CBBP is the photon flux absorbed by CBBP, the calculation of which should take into account the possible competition for lamp irradiance between S and CBBP. The general equation is the following: , the above equation is simplified as follows: Back-reduction processes. The triplet-state reactivity might not end up like this, however. Canonica and co-workers have in fact shown that the antioxidant (mostly phenolic) moieties of DOM can inhibit the triplet-sensitized degradation of contaminants. The mechanism of action concerns the primary intermediates generated by the electron-transfer or H-abstraction oxidation of a substrate S by 3 CDOM*. These intermediates (S •+ or (S-H) • , the latter representing S minus a hydrogen atom) can be reduced back to S by the DOM phenolic moieties (Ph-OH), following the reaction scheme below [61][62][63]: where k' = 6 × 10 5 s −1 is the first-order inactivation rate constant of 3 CBBP* in aerated solution, SΔ = 0.46 is the 1 O2 yield between 3 CBBP* and O2 (which means that 46% of the 3 CDOM* + O2 encounters end up in CDOM + 1 O2, and 54% in CDOM + O2), while k28, k29 respectively describe 1 O2 inactivation and its reaction with S, as per the previous section [60]. Pa,CBBP is the photon flux absorbed by CBBP, the calculation of which should take into account the possible competition for lamp irradiance between S and CBBP. The general equation is the following: If (εS(λ) × [S]) « (εCBBP(λ) × [CBBP]), the above equation is simplified as follows: Back-reduction processes. The triplet-state reactivity might not end up like this, however. Canonica and co-workers have in fact shown that the antioxidant (mostly phenolic) moieties of DOM can inhibit the triplet-sensitized degradation of contaminants. The mechanism of action concerns the primary intermediates generated by the electron-transfer or H-abstraction oxidation of a substrate S by 3 Therefore, [Ph-OH]1/2 can be obtained by numerical fit of the experimental data. As an alternative, the linearized form is Phenol is a suitable model antioxidant that can be used in this kind of experiment, e.g., by irradiating CBBP + S in the presence of different phenol concentration values (a possible suggestion to start with could be [Ph-OH] = 0-10 µmol L −1 ). Note that the reaction rate RS° is made up of the contributions of which becomes pseudo-first order by assuming that 3 CBBP* is in steady state). Therefore, the reaction rate RS in the presence of antioxidants can be expressed as follows: , as per second-order reaction kinetics, which becomes pseudo-first order by assuming that 3 CBBP* is in steady state). Therefore, the reaction rate R S in the presence of antioxidants can be expressed as follows: By defining an apparent reaction rate constant, k a , one can write R S in a shorter form: can be used in APEX to carry out photochemical modeling (vide infra for the details), but natural DOM contains phenolic moieties and not actual phenol. The phenolic equivalent of DOM should thus be considered, and recent studies suggest that: ⇒ If [Ph-OH] is expressed in µmol L −1 and DOC 1/2 in mg C ·L −1 , the following equivalence holds: [64].
With this definition, and using CBBP as CDOM proxy, the apparent reaction rate constant between S and 3 CDOM* (k a S+ 3 CDOM * ) can be expressed as follows: The following step is then to modify the APEX code in order to accommodate DOC 1/2 in the expression for k a S+ 3 CDOM * . In this case, modification should involve the apex.m calculation engine (see   (if set very high at, e.g., 100,000, the back-reduction process becomes negligible) Figure 2. This is the part of the apex.m file where the back-reduction process can be described. The default value of DOC1/2 is so high (100,000) that back-reduction is negligible in the as-provided file. If modeling of back-reduction is needed, a suitable DOC1/2 numerical value (in mgC L −1 units) should replace the default 100,000. For instance, for the acid and basic forms of sulfadiazine it is DOC1/2 = 17 and 0.7 mgC L −1 , respectively [64]. It is advisable to restore the 100,000 value after use, to avoid inadvertent back-reduction modeling when it is not needed. Note that DOC and NPOC are synonyms.

Measurement of Second-Order Reaction Rate Constants by Using Reference Compounds (Competition Kinetics)
The experimental procedures described above have several pros, including robustness; indeed, it is relatively easy in that context to identify unwanted reactions (e.g., the direct photolysis) and carry out due corrections. For instance, to account for direct photolysis or additional processes in the case of • OH, it is sufficient to fit the experimental data of RS vs.
[Alcohol] with a modified form of Equation (18), where a constant additive term is introduced in the right-hand side [65]. Nevertheless, the aforementioned procedures have a considerable disadvantage in being lengthy, because several experiments have to be carried out to derive a single reaction rate constant. This issue limits the number of compounds for which the photochemical reactivity can be assessed, which is a problem when considering the number of new chemicals that reach the market every Figure 2. This is the part of the apex.m file where the back-reduction process can be described. The default value of DOC 1/2 is so high (100,000) that back-reduction is negligible in the as-provided file. If modeling of back-reduction is needed, a suitable DOC 1/2 numerical value (in mg C ·L −1 units) should replace the default 100,000. For instance, for the acid and basic forms of sulfadiazine it is DOC 1/2 = 17 and 0.7 mg C ·L −1 , respectively [64]. It is advisable to restore the 100,000 value after use, to avoid inadvertent back-reduction modeling when it is not needed. Note that DOC and NPOC are synonyms.

Measurement of Second-Order Reaction Rate Constants by Using Reference Compounds (Competition Kinetics)
The experimental procedures described above have several pros, including robustness; indeed, it is relatively easy in that context to identify unwanted reactions (e.g., the direct photolysis) and carry out due corrections. For instance, to account for direct photolysis or additional processes in the case of • OH, it is sufficient to fit the experimental data of R S vs.
[Alcohol] with a modified form of Equation (18), where a constant additive term is introduced in the right-hand side [65]. Nevertheless, the aforementioned procedures have a considerable disadvantage in being lengthy, because several experiments have to be carried out to derive a single reaction rate constant. This issue limits the number of compounds for which the photochemical reactivity can be assessed, which is a problem when considering the number of new chemicals that reach the market every year.
A faster procedure (competition kinetics) implies the use of reference compounds, combined with the monitoring of the time evolution of both the substrate and the reference compound, which should both be present at the same time in the same solution [66]. The advantage is that, in this case the second-order reaction rate constant may be obtained with just one irradiation experiment (although it is highly advisable to carry out replicates). Moreover, competition kinetics has turned out to be a necessary choice when studying the photoinactivation of bacteria and viruses, e.g., to avoid the use of toxic alcohols as • OH scavengers [44,67]. In that case, and always for the issue of toxicity, it was also necessary to choose nitrate as • OH source instead of H 2 O 2 . Unfortunately, the competition kinetics approach works well if there is only one operational reaction pathway. Indeed, it may be relatively difficult to account for additional reactions and exclude their interference, except perhaps for direct photolysis.
For a description of how competition kinetics works [68], assume S as the substrate for which one wants to determine the second-order reaction rate constant with the transient X, k S+X (with X = • OH, the same lamp as before, but in the absence of photosensitizers, to assess the direct photolysis kinetics of the two compounds. With a similar first-order kinetics approach, one gets R S " and R R " as the initial degradation rates of, respectively, S and R by direct photolysis. If S and/or R directly photolyze in this experiment, it means that the runs with the photosensitizer actually provide a combination of direct photolysis and indirect photochemistry. It is thus not correct to just subtract the direct photolysis rate from the degradation rate measured in the presence of the photosensitizer, in order to obtain the rate of the photosensitized process after accounting for the direct photolysis. In fact, the direct photolysis kinetics may be slowed down in the solution containing the photosensitizer, because the latter absorbs radiation and inhibits the direct photolysis of the substrates (i.e., R and S) [46]. Provided that additional processes different from direct photolysis and the X reaction are not operational, the correct approach to subtract the direct photolysis kinetics is the following: the degradation rates of S and R in the photosensitizer solution, accounted for by reaction with the transient X are, respectively, R S = R S ' − χ S × R S ", and R R = R R ' − χ R × R R " (the meaning of R' and R" is the same as before). The fractions χ S and χ R represent how much the direct photolysis kinetics of, respectively, S and R are slowed down in a solution that contains the photosensitizer P. These fractions can be calculated as follows, where p • (λ) is the lamp spectral photon flux density, ε a molar absorption coefficient, and b the optical path length in the photoreactor: The reaction rate constant between S and X can thus be obtained as follows [68]: In the case of • OH, CO 3 •− , and 1 O 2 , this is the end of the story. In the case of 3 CDOM*, the back-reduction process should still be accounted for using the same procedure described in the previous section. The choice of the reference compound R depends on several issues. First of all, a sound measurement of k S+X can be carried out if 0.1 < k S+X (k R+X ) −1 < 10, otherwise the experimental reaction rates become too different. One then needs to know k R+ 3 CBBP * to be able to measure k S+ 3 CBBP * . Unfortunately, the 3 CBBP* reaction rate constant is presently known for only a few compounds, which restricts the number of reference molecules that can be used with CBBP. On this basis, acetaminophen and atrazine can be recommended as reference compounds because of their known k R+ 3 CBBP * [59]. In the case of CO 3 •− , it might be sometimes convenient to choose tyrosine [65], while acesulfame K can be used to study reactivity with • OH and 1 O 2 [68]. The latter compound has the disadvantage of being ionic; thus, its monitoring by reverse-phase liquid chromatography requires the addition of an ionic coupler (e.g., tetrabutylammonium hydrogen sulfate) to the aqueous eluent. On the other hand, acesulfame K has the big advantage of not undergoing direct photolysis.  [59,65,68]. The potential of the given compound to undergo direct photolysis for irradiation at λ > 290 nm (which causes some additional complications in data treatment) is also specified. n/a = not available.

QSAR Approaches to Determining the Second-Order Reaction Rate Constants
Compared to experimental measurements, a faster, although much less accurate method to determine the second-order reaction rate constants between reactive transient species and organic substrates makes use of QSAR calculations. Based on the molecular structure or on molecular characteristics such as the one-electron oxidation potential, it is possible to predict the reactivity with photogenerated transients with an accuracy that is usually within an order of magnitude of the target value. While not exceedingly accurate, such an approach can be used for an assessment of the photoreaction kinetics as a first screening, to identify particularly photostable or photolabile compounds that might be subject to further investigation. In the case of the direct photolysis, some studies have found a correlation between the photolysis quantum yield and parameters such as the energies of the HOMO and LUMO orbitals, as well as their difference. Moreover, other parameters that are strongly structure-dependent are also important [72,73]. For instance, in the case of polychlorodibenzodioxins, the number of chlorine atoms, the chlorine charges, and the dipole moment play a major role [73]. Unfortunately, such parameters are difficult or even impossible to extend to different structures.
A QSAR assessment of the second-order • OH reaction rate constants with gas-phase compounds (k S+ • OH,gas ) can be obtained using the shareware software EPI Suite TM by US-EPA [74]. Interestingly, a correlation has also been observed between the gas-phase reaction rate constants and the aqueous-phase ones (k S+ • OH,water ), which can be expressed as follows depending on the measurement units of k S+ • OH,gas (cm 3 molecule −1 s −1 or L·mol −1 ·s −1 , note that EPI Suite TM uses the former) [8]: (46) Note that N A is Avogadro's number (6.02 × 10 23 ). One possible approach is thus to determine k S+ • OH,gas with EPI Suite TM , and derive k S+ • OH,water with Equation (45). With ibuprofen this procedure yielded k IBU+ • OH,water = 2.6 × 10 9 L·mol −1 ·s −1 , which is within one order of magnitude of the experimental value (1 × 10 10 L·mol −1 ·s −1 ) [19].
The second-order reaction rate constants with CO 3 The ibuprofen radical cation has a reduction potential of 1.6 V vs. NHE [76], which corresponds to an oxidation potential for ibuprofen of E 1 = −1.6 V (note that the reduction process S •+ /S is understandably favored because of the instability of S •+ , and the reverse happens for oxidation). With this datum, one gets k IBU+ 1 O 2 = 9 × 10 5 L·mol −1 ·s −1 , k IBU+CO •− 3 = 1.9 × 10 7 L·mol −1 ·s −1 , and k IBU+ 3 CDOM * = 1 × 10 7 L·mol −1 ·s −1 . It should be remarked that, ibuprofen not being a phenolic compound, the estimates cannot be too accurate; the 1 O 2 reaction rate constant is overestimated by over an order of magnitude (15 times to be precise), there is unfortunately no reference for k IBU+CO •− 3 , while k IBU+ 3 CDOM * is better predicted (within a factor of 5). Experimental data for comparison are reported in the file readme.pdf (Table 1) of the Supplementary Materials. Figure 3 compares the ibuprofen reaction pathways obtained by using the experimental (3a) vs. the predicted rate constants (3b). The former neglect the CO 3 •− process, while the latter do not take into account direct photolysis.
The figure gives some insight into the possible level of agreement between the experimental data and the QSAR approach. The agreement in the overall degradation kinetics looks surprisingly good for both low (<1 mgC L −1 ) and relatively high (>10 mgC L −1 ) DOC values. The main differences can be seen at intermediate DOC, but they are lower than an order of magnitude. Still, the QSAR approach does not consider the direct photolysis and overestimates CO3 •− ; it appears that the relatively good agreement in the overall kinetics stems from a compensation of errors, because the considered photoreaction pathways are definitely not the same, although they yield relatively similar kinetics.

Measurement of Intermediate Formation Yields
Knowledge of the intermediate formation yields, i.e., the ratios between intermediate initial formation rates and substrate initial degradation rates in the different photochemical pathways (direct photolysis and reaction with • OH, CO3 •− , 1 O2, and 3 CDOM*), is essential to predict the intermediate photogeneration kinetics by using APEX [17]. In these experiments, the substrate S should be irradiated alone or in the presence of photosensitizers (H2O2, NO3 − + HCO3 − , RB, CBBP), to monitor the time evolution of both S and the intermediate(s) of interest (hereinafter I) [21]. This approach is usually allowed if the intermediate is available as a commercial standard, or if it is synthesized on purpose. In order to better quantify I, it might be convenient to use somewhat higher [S]o values (e.g., 0.1 mM) compared to the previously described experiments dealing with degradation kinetics. The transformation of S into different intermediates, among which the intermediate I, followed by the transformation of I itself in a first-order kinetic context, can be described by the scheme below:  The agreement in the overall degradation kinetics looks surprisingly good for both low (<1 mg C ·L −1 ) and relatively high (>10 mg C ·L −1 ) DOC values. The main differences can be seen at intermediate DOC, but they are lower than an order of magnitude. Still, the QSAR approach does not consider the direct photolysis and overestimates CO 3 •− ; it appears that the relatively good agreement in the overall kinetics stems from a compensation of errors, because the considered photoreaction pathways are definitely not the same, although they yield relatively similar kinetics.

Measurement of Intermediate Formation Yields
Knowledge of the intermediate formation yields, i.e., the ratios between intermediate initial formation rates and substrate initial degradation rates in the different photochemical pathways (direct photolysis and reaction with • OH, CO 3 •− , 1 O 2 , and 3 CDOM*), is essential to predict the intermediate photogeneration kinetics by using APEX [17].  The agreement in the overall degradation kinetics looks surprisingly good for both low (<1 mgC L −1 ) and relatively high (>10 mgC L −1 ) DOC values. The main differences can be seen at intermediate DOC, but they are lower than an order of magnitude. Still, the QSAR approach does not consider the direct photolysis and overestimates CO3 •− ; it appears that the relatively good agreement in the overall kinetics stems from a compensation of errors, because the considered photoreaction pathways are definitely not the same, although they yield relatively similar kinetics.

Measurement of Intermediate Formation Yields
Knowledge of the intermediate formation yields, i.e., the ratios between intermediate initial formation rates and substrate initial degradation rates in the different photochemical pathways (direct photolysis and reaction with • OH, CO3 •− , 1 O2, and 3 CDOM*), is essential to predict the intermediate photogeneration kinetics by using APEX [17]. In these experiments, the substrate S should be irradiated alone or in the presence of photosensitizers (H2O2, NO3 − + HCO3 − , RB, CBBP), to monitor the time evolution of both S and the intermediate(s) of interest (hereinafter I) [21]. This approach is usually allowed if the intermediate is available as a commercial standard, or if it is synthesized on purpose. In order to better quantify I, it might be convenient to use somewhat higher [S]o values (e.g., 0.1 mM) compared to the previously described experiments dealing with degradation kinetics. The transformation of S into different intermediates, among which the intermediate I, followed by the transformation of I itself in a first-order kinetic context, can be described by the scheme below: where kS and kI are the respective (first-order) degradation rate constants of S and I, and k'I is the formation rate constant of I from S (obviously, k'I ≤ kS).  (50) where k S and k I are the respective (first-order) degradation rate constants of S and I, and k' I is the formation rate constant of I from S (obviously, k' I ≤ k S ). The first-order kinetic model yields the usual time evolution for S ([S] t = [S] o e −k S t , where the initial degradation rate is R S = k S [S] o ). The time evolution of I is described by the following equation [77]: The initial formation rate of I is R' I = k' I [S] o . However, the numerical fit of Equation (51), by making use of several free-floating and non-orthogonal parameters (at least k I and k' I , and maybe also k S and [S] o to get a better fit), ensures that the fit outcome is non-univocal; different combinations of the floating parameters can give the same or very similar fit(s), and k' I may be affected by a large error. Therefore, the calculation of R' I by using a purely numerical approach may not be reliable, and it can be more convenient to determine R' I graphically, as shown in Figure 4. The initial formation rate of I is R'I = k'I [S]o. However, the numerical fit of Equation (51), by making use of several free-floating and non-orthogonal parameters (at least kI and k'I, and maybe also kS and [S]o to get a better fit), ensures that the fit outcome is non-univocal; different combinations of the floating parameters can give the same or very similar fit(s), and k'I may be affected by a large error. Therefore, the calculation of R'I by using a purely numerical approach may not be reliable, and it can be more convenient to determine R'I graphically, as shown in Figure 4.
Briefly, the following procedure should be carried out: (i) irradiate S under the appropriate conditions (one photochemical pathway at a time) and monitor the time evolution of both S and I; (ii) determine RS; (iii) fit the experimental data of [I]t vs. t with Equation (51), trying different initial values until you get a good fit (it might be necessary to use all four free-floating parameters for this purpose, i.e., kI, k'I, kS, and [S]o); (iv) draw the tangent of [I]t vs. t at t = 0; (v) determine R'I as the slope of the tangent line. Points (iv) and (v) are described in Figure 4.
Finally, once R'I and RS are known, the formation yield of I can be obtained as yI = R'I (RS) −1 . The yield thus obtained refers to the single photochemical pathway under study, and yI values should be determined for all the relevant photoreactions (direct photolysis, • OH, CO3 •− , 1 O2, and 3 CDOM*) [77].

How to Quantify the pH Effect
The solution pH can be an important parameter for photochemical reactions, especially if the substrate undergoes acid-base equilibrium within a pH interval that is significant for surface waters. One such example is represented by the solar filter benzophenone-4 (2-hydroxy-4methoxybenzophenone-5-sulfonic acid, hereinafter BP4), which has a pKa = 7.3 and is mainly photodegraded by direct photolysis and • OH reaction [78]. The two forms of BP4 (acidic and basic) are indicated here as HBP4 and BP4 − , respectively. The acid-base equilibrium can be expressed as follows, where cBP4 = [HBP4] + [BP4 − ]:  Briefly, the following procedure should be carried out: (i) irradiate S under the appropriate conditions (one photochemical pathway at a time) and monitor the time evolution of both S and I; (ii) determine R S ; (iii) fit the experimental data of [I] t vs. t with Equation (51), trying different initial values until you get a good fit (it might be necessary to use all four free-floating parameters for this purpose, i.e., k I , k' I , k S , and [S] o ); (iv) draw the tangent of [I] t vs. t at t = 0; (v) determine R' I as the slope of the tangent line. Points (iv) and (v) are described in Figure 4.
Finally, once R' I and R S are known, the formation yield of I can be obtained as y I = R' I (R S ) −1 . The yield thus obtained refers to the single photochemical pathway under study, and y I values should be determined for all the relevant photoreactions (direct photolysis, • OH, CO 3 •− , 1 O 2 , and 3 CDOM*) [77].

How to Quantify the pH Effect
The solution pH can be an important parameter for photochemical reactions, especially if the substrate undergoes acid-base equilibrium within a pH interval that is significant for surface waters. One such example is represented by the solar filter benzophenone-4 (2-hydroxy-4-methoxybenzophenone-5-sulfonic acid, hereinafter BP4), which has a pK a = 7.3 and is mainly photodegraded by direct photolysis and • OH reaction [78]. The two forms of BP4 (acidic and basic) are indicated here as HBP4 and BP4 − , respectively. The acid-base equilibrium can be expressed as follows, where c BP4 = [HBP4] + [BP4 − ]: [HBP4] = α HBP4 c BP4 = [H + ] [H + ] + K a c BP4 = 10 −pH 10 −pH + 10 −pK a c BP4 (54) With the APEX software, it is possible to separately compute the photochemical transformation kinetics of both HBP4 and BP4 − (overall degradation rate constants, as well as rate constants accounted for by the single photoreaction pathways). In the case of the overall degradation rate constants, one gets k HBP4 and k BP4 − from two separate APEX simulations (for the input data, see the file readme.pdf, Table 1, in the Supplementary Materials). The two results can be combined to obtain the overall BP4 transformation rate constant, k overall BP4 , as follows [38,78]: A similar approach can be followed for the degradation rate constants relative to the single photoreaction pathways, so that the pH trend can be derived for both the overall process (Equation (56)) and the separate pathways ( • OH and direct photolysis). The calculations pertaining to the pH trend are not automatically carried out by APEX; thus, they should be performed separately on the APEX output data (clearly, the Savetable function should be used to produce such data, using the output .csv table as basis for the additional calculations). By following this approach, one can obtain the results shown in Figure 5. The pH trend is accounted for by the fact that HBP4 reacts with • OH faster than BP4 − , but the latter species undergoes much faster direct photolysis. With the APEX software, it is possible to separately compute the photochemical transformation kinetics of both HBP4 and BP4 − (overall degradation rate constants, as well as rate constants accounted for by the single photoreaction pathways). In the case of the overall degradation rate constants, one gets  α α (56) A similar approach can be followed for the degradation rate constants relative to the single photoreaction pathways, so that the pH trend can be derived for both the overall process (Equation (56)) and the separate pathways ( • OH and direct photolysis). The calculations pertaining to the pH trend are not automatically carried out by APEX; thus, they should be performed separately on the APEX output data (clearly, the Savetable function should be used to produce such data, using the output .csv table as basis for the additional calculations). By following this approach, one can obtain the results shown in Figure 5. The pH trend is accounted for by the fact that HBP4 reacts with • OH faster than BP4 − , but the latter species undergoes much faster direct photolysis.

Model Treatment of Non-Thoroughly Mixed or Flowing Systems
The default use of APEX concerns stationary but thoroughly mixed systems, such as a lake during overturn, which are conceptually the simplest. However, lakes can become stratified during the summer season [79] while rivers flow by definition; thus, the most straightforward mathematical treatment of the reaction kinetics neglects some very important aquatic environments. Recently, tools and strategies have been developed to adapt the APEX output or input data to the treatment of somewhat more complex systems, such as stratified lakes, lakes undergoing evaporative concentration, and rivers [27]. The ways to do this, including tips on how to modify the code if needed, are reported below.

Stratified Lakes
Lakes in temperate areas can undergo stratification during both summer and winter, but summer stratification is much more important from a photochemical point of view. In a stratified lake, the warmer and sunlit epilimnion floats over the darker and cooler hypolimnion, while the thermocline (i.e., the zone with the highest temperature gradient with depth) acts as a separation layer (see Figure 6a) [80]. In the absence of water mixing, the epilimnion and hypolimnion evolve separately, and so do the photochemical reactions in the two compartments. Photoprocesses are faster in the epilimnion than in the average or mixed lake, while the reverse is true in the hypolimnion [27]. The sunlight irradiance and the sunlight spectrum incident on the epilimnion (i.e., the lake surface) are taken into account by the default p0sun column of the molecule.csv input file. In contrast, because the epilimnion separates the hypolimnion from the surface, the incident irradiance on the hypolimnion is decreased by the absorption of radiation in the overlying water.
Assume p epi (λ) as the sunlight spectral photon flux density incident over the epilimnion/lake surface at a given wavelength λ. Although sunlight meets the water surface at an angle, refraction deviates the light trajectory in water towards the vertical [12]. Therefore, one makes a relatively low error by considering that the light path in water is equal to the water depth. As an alternative, one can introduce a correction factor ψ that is a function of latitude and season. The ψ parameter takes into account the fact that the path traveled by light in water is slightly longer than the water depth (see for this the Readme.pdf file in the Supplementary Materials, where paragraph 6.3 explains how to estimate ψ) [17]. The attenuation of sunlight in the epilimnion can be taken into account as follows: where p th (λ) is the spectral photon flux density of sunlight at the depth of the thermocline, which separates epilimnion and hypolimnion; A 1 (λ) is the water absorbance over a path length of 1 cm (units of cm −1 ); and d th (which may be replaced by ψ × d th ) is the depth of the thermocline in cm. Note that consistent length units have to be used, so that the product A 1 (λ) × d th is unitless. A standard procedure to carry out the calculations of hypolimnion photochemistry could be to assume the default p0sun values as p epi (λ), apply Equation (57) to derive p th (λ), and insert the latter values into the p0sun column for the modeling of the hypolimnion. In practice, to carry out APEX calculations for the epilimnion, hypolimnion, and the overturning (mixed) lake, one simply has to modify the p0sun column of the molecule.csv file, and set the water depth, as follows: Epilimnion: p epi (λ) → p0sun, depth d = d th Hypolimnion: p th (λ) → p0sun, depth d = d tot -d th Mixed lake: p epi (λ) → p0sun, depth d = d tot For more precision, the depth values can be multiplied by the ψ correction factor, as outlined above. Figure 6b reports the modeled time trends of ibuprofen in epilimnion, hypolimnion, and an overall mixed lake. The reported trends reflect the fact that the epilimnion is better illuminated than the overall lake due to its shallower water, while the hypolimnion is more poorly illuminated because of light screening by the overlying water column.

Rivers
The water flow in rivers is definitely a major parameter as far as the importance of photochemical reactions is concerned [27]. The (average) flow velocity ν (units of [m s −1 ]) is a key issue, which is much more important for photochemistry when compared with the flow rate (Q, units of [m 3 s −1 ]), although the latter is more often available [81]. Assume L as the length of a river: the residence time of flowing water is τ = L (ν ) −1 , which defines the timescale within which the photochemical reactions have to operate to be significant (note that water might pass to the underlying aquifer, but in this case it will be protected from light exposure. Photoreactions only occur during the in-stream time spent by both water, and the substrates it carries). Photoprocesses have fewer chances to be important under conditions of high flow, where ν is also high and τ becomes correspondingly low. More interestingly, the reverse happens in periods of low flow. Therefore, photoreactions may help depollute rivers [27] when low values of Q and ν could exacerbate pollution problems because of low dilution [82].
The flow rate Q = ν d w, where d is the average depth and w the average width. It is reasonable to assume that a variation in Q will be evenly distributed amongst the three directions of space: in other words, if the water flow increases, one expects the water to flow faster and the river to be both

Rivers
The water flow in rivers is definitely a major parameter as far as the importance of photochemical reactions is concerned [27]. The (average) flow velocity ν (units of [m s −1 ]) is a key issue, which is much more important for photochemistry when compared with the flow rate (Q, units of [m 3 s −1 ]), although the latter is more often available [81]. Assume L as the length of a river: the residence time of flowing water is τ = L (ν) −1 , which defines the timescale within which the photochemical reactions have to operate to be significant (note that water might pass to the underlying aquifer, but in this case it will be protected from light exposure. Photoreactions only occur during the in-stream time spent by both water, and the substrates it carries). Photoprocesses have fewer chances to be important under conditions of high flow, where ν is also high and τ becomes correspondingly low. More interestingly, the reverse happens in periods of low flow. Therefore, photoreactions may help depollute rivers [27] when low values of Q and ν could exacerbate pollution problems because of low dilution [82].
The flow rate Q = ν d w, where d is the average depth and w the average width. It is reasonable to assume that a variation in Q will be evenly distributed amongst the three directions of space: in other words, if the water flow increases, one expects the water to flow faster and the river to be both deeper and wider (note that the width variation holds for natural water bodies, not for artificial channels where w might be constrained) [27]. In the case of even spatial distribution, and assuming ν o , d o , w o and Q o to be the initial values of, respectively, average flow velocity, depth, width and water flow, Varying width does not affect the photoreaction rates, while the photoinduced processes are faster in shallower water. Moreover, slow water flow provides more time for the degradation reactions to take place. On this basis, given the pseudo-first order degradation rate constant k S for a given substrate S, one can define both the half-life time (t 1/2 ) S = ln 2 (k S ) −1 and the half-life length (l 1/2 ) S = ν (t 1/2 ) S = ln 2 ν (k S ) −1 . The parameter (l 1/2 ) S is the length of the river that is required for photoreactions to halve the concentration of S [27]. Figure 7 shows an example of the application of this procedure to the attenuation of ibuprofen in river water. It was initially assumed that  (58) deeper and wider (note that the width variation holds for natural water bodies, not for artificial channels where w might be constrained) [27]. In the case of even spatial distribution, and assuming o ν , do, wo and Qo to be the initial values of, respectively, average flow velocity, depth, width and water flow, we get ν ( o Varying width does not affect the photoreaction rates, while the photoinduced processes are faster in shallower water. Moreover, slow water flow provides more time for the degradation reactions to take place. On this basis, given the pseudo-first order degradation rate constant kS for a given substrate S, one can define both the half-life time (t1/2)S = ln 2 (kS) −1 and the half-life length (l1/2)S = ν (t1/2)S = ln 2 ν (kS) −1 . The parameter (l1/2)S is the length of the river that is required for photoreactions to halve the concentration of S [27]. Figure 7 shows an example of the application of this procedure to the attenuation of ibuprofen in river water. It was initially assumed that Qo = 100 m 3 As anticipated, it can be seen that photoreactions are both faster and have more time to take place if water flows more slowly. Therefore, photochemistry can be considered an important process in river water during drought.  As anticipated, it can be seen that photoreactions are both faster and have more time to take place if water flows more slowly. Therefore, photochemistry can be considered an important process in river water during drought.

Aquatic Systems under Evaporative Concentration
Lakes, ponds, and other stationary water systems located in subtropical areas can undergo evaporative concentration during the dry/hot season(s), especially if other water loss mechanisms are not or poorly operational [83,84]. The basic idea is that water evaporates but non-volatile solutes do not; thus, the concentration values of NO 3 − , NO 2 − , HCO 3 − , CO 3 2− and the DOC all increase with decreasing water volume and depth [27]. If there are no constraints on the way the water volume decreases upon evaporation, one can make the hypothesis that the volume contraction is operational along the three axes. The most important quantities are volume (V) and depth; thus, Therefore, if depth gradually decreases from, say, d o = 10 m down to 1 m (see Figure 8), the concentration values of photosensitizers and scavengers (hereafter [℘J]) are expected to vary as follows: In order to include these variations in APEX, one should define depth as an X or Y variable (e.g., "d = −1;" "x = 1:0.05:10;"; see Figure 9 for where to type it in Savetable) and then introduce a modification in the apex.m file (see Figure 9 as well). Modifying the apex.m file can be potentially dangerous (in case of a mistake, the whole application might no longer work, or work erroneously). I personally operate in this way: make a new folder (e.g., C:\Apex_Arid), and copy the files from the original C:\Apex folder into it. The modifications are carried out in the duplicated apex.m file, leaving the original one intact. In this case, one has to call APEX from Octave as: "> cd c:\Apex_Arid" instead of "> cd c:\Apex".
After that, APEX can be run in the customary way, and Figure 8 shows as an example the output results in the case of the ibuprofen phototransformation pathways. In the sample case shown here, the Savetable output file and, particularly, the data in the columns k_OH, k_1O2, k_3DOM, and k_Phot were used to plot the rate constants of the single photochemical pathways as a function of the depth (and volume) loss.

Aquatic Systems Under Evaporative Concentration
Lakes, ponds, and other stationary water systems located in subtropical areas can undergo evaporative concentration during the dry/hot season(s), especially if other water loss mechanisms are not or poorly operational [83,84]. The basic idea is that water evaporates but non-volatile solutes do not; thus, the concentration values of NO3 − , NO2 − , HCO3 − , CO3 2− and the DOC all increase with decreasing water volume and depth [27]. If there are no constraints on the way the water volume decreases upon evaporation, one can make the hypothesis that the volume contraction is operational along the three axes. The most important quantities are volume (V) and depth; thus, d (similar equations hold for the horizontal widths, while for the water surface S it is S (So) −1 = [V (Vo) −1 ] 2/3 , but they have no photochemical implications).
Therefore, if depth gradually decreases from, say, do = 10 m down to 1 m, the concentration values of photosensitizers and scavengers (hereafter [℘J]) are expected to vary as follows: In order to include these variations in APEX, one should define depth as an X or Y variable (e.g., "d = −1;" "x = 1:0.05:10;"; see Figure 9 for where to type it in Savetable) and then introduce a modification in the apex.m file (see Figure 9 as well). Modifying the apex.m file can be potentially dangerous (in case of a mistake, the whole application might no longer work, or work erroneously). I personally operate in this way: make a new folder (e.g., C:\Apex_Arid), and copy the files from the original C:\Apex folder into it. The modifications are carried out in the duplicated apex.m file, leaving the original one intact. In this case, one has to call APEX from Octave as: "> cd c:\Apex_Arid" instead of "> cd c:\Apex".
After that, APEX can be run in the customary way, and Figure 8 shows as an example the output results in the case of the ibuprofen phototransformation pathways. In the sample case shown here, the Savetable output file and, particularly, the data in the columns k_OH, k_1O2, k_3DOM, and k_Phot were used to plot the rate constants of the single photochemical pathways as a function of the depth (and volume) loss.  These "%" should NEVER be deleted Modelling of water evaporation is enabled by consistently deleting ALL these "%". Typing them again disables evaporation modelling when it is no longer required.

[…] File top above, file bottom below
This is Apex.m

This is Savetable.m […] […]
In this way, water depth is set to vary from 1 to 10 m. It is important that the upper value (10 m) is reported both here and in apex.m. This is the upper value of water depth, i.e., the value from which evaporation starts. It is important to have the same value both here and in Savetable.m (NOTE: setting the two values equal is NOT automatic).

Ibuprofen as a Case Study
Ibuprofen is a non-steroidal, anti-inflammatory drug that is often found in natural waters due to incomplete elimination during wastewater treatment [85]. Among other processes, it can undergo photodegradation in surface waters, which contributes to its removal. However, in addition to the attenuation of the parent compound, ibuprofen phototransformation can also produce the toxic intermediate 4-isobutylacetophenone (IBAP) [77]. The use of APEX can help in the assessment of both ibuprofen photodegradation and IBAP photogeneration kinetics and pathways. The photoreaction parameters that describe the transformation of ibuprofen and the generation of IBAP, and that should be inserted in Savetable, are reported in Table 2. The absorption spectrum of ibuprofen is provided in the input file Ibuprofen.csv. Table 2. Photoreactivity parameters of ibuprofen degradation and 4-isobutylacetophenone (IBAP) formation, relevant to the different photoreaction pathways. Φ = direct photolysis quantum yield, k = second-order reaction rate constant, and y = formation yield of the intermediate from the parent compound. Based on the above data, it is possible to assess ibuprofen photodegradation and IBAP photogeneration kinetics for different environmental conditions. For instance, Figure 10 reports the calculation results as a function of the DOC, highlighting the contributions of the different photoreaction pathways. In the case of the IBAP formation yields, the different contributions to the overall yield were calculated as the ratios between the IBAP initial formation rate constant (kf ) in each pathway and the overall ibuprofen degradation rate constant (kd; dp = direct photolysis):

Ibuprofen as a Case Study
Ibuprofen is a non-steroidal, anti-inflammatory drug that is often found in natural waters due to incomplete elimination during wastewater treatment [85]. Among other processes, it can undergo photodegradation in surface waters, which contributes to its removal. However, in addition to the attenuation of the parent compound, ibuprofen phototransformation can also produce the toxic intermediate 4-isobutylacetophenone (IBAP) [77]. The use of APEX can help in the assessment of both ibuprofen photodegradation and IBAP photogeneration kinetics and pathways. The photoreaction parameters that describe the transformation of ibuprofen and the generation of IBAP, and that should be inserted in Savetable, are reported in Table 2. The absorption spectrum of ibuprofen is provided in the input file Ibuprofen.csv. Table 2. Photoreactivity parameters of ibuprofen degradation and 4-isobutylacetophenone (IBAP) formation, relevant to the different photoreaction pathways. Φ = direct photolysis quantum yield, k = second-order reaction rate constant, and y = formation yield of the intermediate from the parent compound.

Direct photolysis
• OH 1 O2 3 CDOM* Ibuprofen [19] Φ = 0. Based on the above data, it is possible to assess ibuprofen photodegradation and IBAP photogeneration kinetics for different environmental conditions. For instance, Figure 10 reports the calculation results as a function of the DOC, highlighting the contributions of the different photoreaction pathways. In the case of the IBAP formation yields, the different contributions to the overall yield were calculated as the ratios between the IBAP initial formation rate constant (kf) in each pathway and the overall ibuprofen degradation rate constant (kd; dp = direct photolysis): The decrease of kIbuprofen with increasing DOC is a typical finding, and is also observed with many other contaminants [27]. In the case of a river, an ibuprofen lifetime of 10 days would correspond to a half-life length of over 860 km if ν = 1 m s −1 , which in several instances means normal flow conditions [81]. Therefore, a considerable river length would be required to Savetable and further processed.
The decrease of k Ibuprofen with increasing DOC is a typical finding, and is also observed with many other contaminants [27]. In the case of a river, an ibuprofen lifetime of 10 days would correspond to a half-life length of over 860 km if ν = 1 m s −1 , which in several instances means normal flow conditions [81]. Therefore, a considerable river length would be required to photochemically attenuate ibuprofen. In contrast, severe water scarcity could produce ν = 0.1 m s −1 [81], in which case the scenario varies considerably because the half-life length reduces to around 86 km (moreover, river water would be shallower and photoreactions even faster, as explained in Section 6.2).

Conclusions
This paper shows how to use the APEX software in order to predict the phototransformation kinetics of pollutants, as a function of the environmental conditions. Moreover, because environment-specific adaptations of the original code have been successfully carried out since its first release, hints are here given into how to modify parts of the code to treat back-reduction processes as well as water evaporation. Compared to the original version, the APEX 1.1 code provided here was updated so that it might be easier to make such changes. Additional hints are also given into how to prepare the input data, or how to modify the output data, in order to describe varying pH values, stratification conditions, and river flow. It should be remarked that APEX strongly relies on the input data, and in particular on the photoreactivity parameters of the compounds to be studied. Such parameters include direct photolysis quantum yields and second-order reaction rate constants with photogenerated transient species. These may be known from the literature, or the compound(s) of interest may already be included in the list of 44 molecules for which there are complete data available (they are provided here together with the software, see Supplementary Materials). Otherwise, photoreaction parameters have to be measured in the laboratory or assessed by a QSAR approach. To aid APEX users, experimental protocols to measure photoreaction parameters (e.g., with or without using the competition kinetics methods) have been described in some detail. It has also been described how to approximately assess second-order reaction rate constants on the basis of • OH gas-phase rate constants, and from the one-electron oxidation potential of the given compounds. This work has the ambition of being a key reference for APEX users, and it might hopefully inspire environmental photochemists to make wide use of a potentially powerful tool to predict the photochemical fate of pollutants in surface water bodies.