9
Application of the complex step method to chemistry-transport modeling Bogdan V. Constantin, Steven R.H. Barrett * Laboratory for Aviation and the Environment, Department of Aeronautics and Astronautics, Massachusetts Institute of Technology, Cambridge, MA 02139, USA highlights Sensitivity analysis is widely used in chemistry-transport modeling. The common nite difference approach incurs numerical errors. We implement the complex step in a chemistry-transport for the rst time. The method results in near-exact sensitivities and is straightforward to implement. We also propose a combined complex step/adjoint approach. article info Article history: Received 17 May 2014 Received in revised form 9 October 2014 Accepted 11 October 2014 Available online 12 October 2014 Keywords: Sensitivity analysis Adjoint Finite difference Chemistry-transport modeling abstract Sensitivity analysis in atmospheric chemistry-transport modeling is used to develop understanding of the mechanisms by which emissions affect atmospheric chemistry and composition, to quantify the marginal impact of emissions on air quality, and for other applications including improving estimates of emissions, developing fast rst order air quality models, and validating adjoint models. Forward modeling sensitivities have predominantly been calculated using the nite difference approach, i.e. where the results of two separate simulations are subtracted. The nite difference approach incurs truncation and cancellation errors, which mean that exact sensitivities cannot be calculated and even approximate sensitivities cannot always be calculated for a sufciently small perturbation (e.g. for emissions at a single location or time). Other sensitivity methods can provide exact sensitivities, but require the reformulation of non-linear steps (e.g. the decoupled direct method) or the development of adjoints of entire codes (partly automatically and partly manually). While the adjoint approach is widely applied and has signicant utility in providing receptor-oriented information, in some applications the source-oriented information of forward approaches is needed. Here we apply an alternative method of calculating sensitivities that results in source-oriented information as with the nite difference approach, requires minimal reformulation of models, but enables near-exact computation of sensitivities. This approach e the complex step method e is applied for the rst time to a complete atmospheric chemistry-transport model (GEOS-Chem). (The complex step method has been previously used in vali- dating the adjoint of an aerosol thermodynamic equilibrium model.) We also introduce the idea of combining complex-step and adjoint sensitivity analysis (for the rst time in any context to our knowledge) to enable the direct calculation of near-exact second order sensitivities. © 2014 Elsevier Ltd. All rights reserved. 1. Introduction Sensitivity analysis is the study of how the outputs of a model are affected by changes in the values of the inputs (Morgan and Henrion, 1990). In the context of atmospheric chemistry- transport models (CTMs), this typically entails computing the change in a species concentration with respect to a change in a species emission. The EPA recommends that sensitivity analysis be used early and often in the development and validation of computational models of the environment (EPA, 2009). Sensitivity analysis is also applied in the development of rapid surrogate models of more complex CTMs and in the analysis of potential air * Corresponding author. E-mail address: [email protected] (S.R.H. Barrett). Contents lists available at ScienceDirect Atmospheric Environment journal homepage: www.elsevier.com/locate/atmosenv http://dx.doi.org/10.1016/j.atmosenv.2014.10.017 1352-2310/© 2014 Elsevier Ltd. All rights reserved. Atmospheric Environment 99 (2014) 457e465

MyArticle

Embed Size (px)

Citation preview

lable at ScienceDirect

Atmospheric Environment 99 (2014) 457e465

Contents lists avai

Atmospheric Environment

journal homepage: www.elsevier .com/locate/atmosenv

Application of the complex step method to chemistry-transportmodeling

Bogdan V. Constantin, Steven R.H. Barrett*

Laboratory for Aviation and the Environment, Department of Aeronautics and Astronautics, Massachusetts Institute of Technology, Cambridge,MA 02139, USA

h i g h l i g h t s

� Sensitivity analysis is widely used in chemistry-transport modeling.� The common finite difference approach incurs numerical errors.� We implement the complex step in a chemistry-transport for the first time.� The method results in near-exact sensitivities and is straightforward to implement.� We also propose a combined complex step/adjoint approach.

a r t i c l e i n f o

Article history:Received 17 May 2014Received in revised form9 October 2014Accepted 11 October 2014Available online 12 October 2014

Keywords:Sensitivity analysisAdjointFinite differenceChemistry-transport modeling

* Corresponding author.E-mail address: [email protected] (S.R.H. Barrett).

http://dx.doi.org/10.1016/j.atmosenv.2014.10.0171352-2310/© 2014 Elsevier Ltd. All rights reserved.

a b s t r a c t

Sensitivity analysis in atmospheric chemistry-transport modeling is used to develop understanding ofthe mechanisms by which emissions affect atmospheric chemistry and composition, to quantify themarginal impact of emissions on air quality, and for other applications including improving estimates ofemissions, developing fast first order air quality models, and validating adjoint models. Forwardmodeling sensitivities have predominantly been calculated using the finite difference approach, i.e.where the results of two separate simulations are subtracted. The finite difference approach incurstruncation and cancellation errors, which mean that exact sensitivities cannot be calculated and evenapproximate sensitivities cannot always be calculated for a sufficiently small perturbation (e.g. foremissions at a single location or time). Other sensitivity methods can provide exact sensitivities, butrequire the reformulation of non-linear steps (e.g. the decoupled direct method) or the development ofadjoints of entire codes (partly automatically and partly manually). While the adjoint approach is widelyapplied and has significant utility in providing receptor-oriented information, in some applications thesource-oriented information of forward approaches is needed. Here we apply an alternative method ofcalculating sensitivities that results in source-oriented information as with the finite difference approach,requires minimal reformulation of models, but enables near-exact computation of sensitivities. Thisapproach e the complex step method e is applied for the first time to a complete atmosphericchemistry-transport model (GEOS-Chem). (The complex step method has been previously used in vali-dating the adjoint of an aerosol thermodynamic equilibrium model.) We also introduce the idea ofcombining complex-step and adjoint sensitivity analysis (for the first time in any context to ourknowledge) to enable the direct calculation of near-exact second order sensitivities.

© 2014 Elsevier Ltd. All rights reserved.

1. Introduction

Sensitivity analysis is the study of how the outputs of a modelare affected by changes in the values of the inputs (Morgan and

Henrion, 1990). In the context of atmospheric chemistry-transport models (CTMs), this typically entails computing thechange in a species concentration with respect to a change in aspecies emission. The EPA recommends that sensitivity analysis beused early and often in the development and validation ofcomputational models of the environment (EPA, 2009). Sensitivityanalysis is also applied in the development of rapid surrogatemodels of more complex CTMs and in the analysis of potential air

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465458

quality policies (e.g. Ashok et al., 2013). It is used both in deter-mining which model parameters can be excluded from a particularclass of problem (due to relatively low sensitivity), and for devel-oping the parameters used by surrogatemodels. Sensitivity analysisis used in combination with uncertainty analysis to attribute un-certainty in outputs of models to uncertainty in their inputs (Becket al., 1994). This informs users on the confidence that can beplaced in models.

1.1. Sensitivity methods implemented in CTMs

The major classes of sensitivity methods implemented in CTMsare 1) the finite difference (FD) method, 2) the adjoint method, 3)the decoupled direct method (DDM), and 4) the Green's functionmethod (GFM).

The FD method is the most common sensitivity method usedwith CTMs because it is relatively straightforward to implement(van Keulen et al., 2005). The FD method in CTMs has beenextensively used in climate and air quality sensitivity problems (Fryet al., 2012; Kohler et al., 2008; Naik et al., 2005; Stevenson et al.,2004) as well as in validating the implementation of the adjoints,e.g. GEOS-Chem (Henze et al., 2007).

The FDmethod is based on running a CTM twice: one simulationto obtain the reference results and another simulation with a per-turbed input variable. The two results are then post processed toobtain sensitivities. The FD approximation is given by.

f 0ðx0Þyf ðx0 þ DÞ � f ðx0Þ

D; (1)

where x0 is the reference value of the input variable and D is theperturbation. Relating to CTMs, f is the result of the CTM (e.g. theconcentration of a chemical species at a location), x0 is an input tothe CTM (e.g. an emission) and f

0(x0) is the sensitivity of the result

with respect to the input.A drawback of the FD method is that there is a tradeoff between

truncation and cancelation errors (Martins et al., 2003; Squire andTrapp, 1998; van Keulen et al., 2005). The truncation error isassociated with non-linearity (i.e. ignoring the higher order terms)and is reduced by decreasing D. However, at some decrease in D thecancelation error increases because, in finite precision, the refer-ence and perturbed results become indistinguishable (resulting in“noisy” results). In practice this limits the calculation of sensitivitiesin CTMs to sufficiently large perturbations, which may be of amagnitude to incur truncation errors depending on the non-linearity of the specific problem.

The DDM has been used in computing first order sensitivities inair quality models (Dunker et al., 2002) and higher order sensitiv-ities (HDDM, Hakami et al., 2003, 2004). The DDMmethod and theadjoint method are similar because they are both derived bydifferentiating the original code (i.e. algorithm differentiation) ofthe model and both produce near-exact sensitivities. The differenceis that the DDM is a forward sensitivity method and the adjoint isa reverse method. The DDM method entails reformulating andrecoding the extensive parts of the model in which non-linear re-sponses can occur (e.g. chemistry and advection), because equa-tions for sensitivities have different forms to those forconcentrations in these cases.

The GFM has been used by Vuilleumier et al. (1997) to study thetemporal dependence of O3 concentrations on the NOx concentra-tions. The GFM was designed to be a fast sensitivity analysismethod (Rabitz et al., 1983), although it incurs numerical errors anderrors that are introduced by the choice in step size (Vuilleumieret al., 1997), similar to the FD method. The GFM is not in wide-spread use.

The adjoint method is based on differentiation of the forwardcode and then integration of the sensitivities backwards. This re-sults in computing the sensitivity of one output of the CTM withrespect to all the inputs by performing one run of the adjointmodel. This has significant utility in applications where many in-puts are assessed relative to their impact on one output, such asdetermining the spatiotemporal locations where emissions re-ductions result in the greatest total population exposure to apollutant. Adjoint approaches are not useful where the distributionof impacts from an emissions change is required.

The adjoint method in GEOS-Chem has been implemented byHenze et al. (2007) and has been extensively used in air quality andclimate studies (Henze et al., 2012; Bowmann and Henze, 2012;Gilmore et al., 2013; Koo et al., 2013). As a particular example,Turner et al. (2012) used the adjoint sensitivity method in GEOS-Chem to estimate the impact on concentrations due to contribu-tions of local versus distant emissions. The adjoint of GEOS-Chem isa combination of continuous and discrete adjoint code created byboth manually implementing the code and by use of automaticadjoint generating tools such as Tangent and Adjoint ModelCompiler (TAMC, Giering and Kaminski, 1998), the Kinetic PrePro-cessor (KPP, Sandu et al., 2003; Damian et al., 2002; Daescu et al.,2003).

A benefit of an adjoint approach is that the sensitivities can beexact. As it is currently implemented, the adjoint of GEOS-Chemcan compute sensitivities with respect to scaling factors of emis-sions, absolute values of emissions, initial concentrations and(more recently) reaction rate constants (GEOS-Chem AdjointUser's Guide (gcadj.v35)). The main drawback of the adjoint is that“the practical implementation of this approach can be chal-lenging” (Giles and Pierce, 2000). Also, because it is based on theforward code it means that for each update and further develop-ment of the forward model, the adjoint code must be updatedaccordingly to reflect the changes in the forward model. Both ofthese drawbacks are similar to the DDM approach. The adjointapproach also provides receptor-oriented information, which isadvantageous in some applications while there are others wheresource-oriented information (as provided with the FD method) isneeded.

1.2. Motivation for the complex step method

As has been described above, forward methods provide infor-mation on the spatiotemporal distribution of the impact and notinformation on the spatiotemporal distribution of the sources. Incontrast, adjoint methods provide information on the spatiotem-poral distribution of the sources and not information on thespatiotemporal distribution of the impact. Depending on whetherthe required result of the sensitivity analysis is a spatiotemporaldistribution of impacts or a spatiotemporal distribution of sources,one may need to perform a forward sensitivity analysis, a reversesensitivity analysis or both. Because of this, in CTMs such as GEOS-Chem, adjoint sensitivity methods and forward sensitivity methodscan be considered complements of each other and therefore thereis need for both. However, while the adjointmethod results in exactcomputation of receptor-oriented sensitivities, there is no accurateway of calculating source-oriented sensitivities in GEOS-Chem, andthe exact DDM (applied to CMAQ, for example) incurs the draw-backs of reformulating and rewriting significant portions of thecode.

There have also been studies that highlight the importance ofcomputing second order sensitivities. Hakami et al. (2004) statesthat “addition of higher-order information to the analysis allowsmore reliable prediction of the response beyond its linear range,particularly when nonlinear behavior is expected”. For example,

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465 459

Woody et al. (2011) and Koo et al. (2013) suggest that backgroundemissions could change the air quality impacts attributable toaviation. The only method currently implemented for computingsecond order sensitivities in GEOS-Chem is by performing FDsensitivities on the adjoint model, which means that second ordersensitivities are subject to the tradeoff between cancelation andtruncation errors.

We propose application of the complex step (CS) sensitivitymethod to chemistry-transport modeling as an alternative forwardsensitivity method that will mitigate the cancelation errors of theFD method, yielding near-exact first order sensitivities without theimplementation drawbacks of the DDM or GFM. We also proposethe idea of mixing CS and adjoint analysis to enable calculation ofmixed sourceereceptor-oriented near-exact second order sensi-tivities. These can also answer applied questions such as “how willchanges in ammonia emissions affect the impact of aviation on airquality?” e which has utility in policy analysis contexts (Koo et al.,2013).

2. The complex step method

The CS sensitivity method is a numerical differentiation tech-nique based on the properties of complex numbers. The idea ofusing complex numbers to compute derivatives was first intro-duced by Lyness and Moler (1967) and Lyness (1967). The initialdescription of how to use complex variables to obtain first andhigher order derivatives was based on Cauchy's Theorem but themethod was complicated and computationally intensive and wasonly put into practice after Squire and Trapp (1998) “developed anelegant, simple expression based on complex-step differentiationto compute first-order derivatives of an analytic function” (Lantoineet al., 2012).

The CS method has been implemented in multidisciplinarysensitivity analysis (Newman et al., 1998) and for computationalfluid dynamics problems (Anderson et al., 1999). It has also beenused in validating the adjoint of the aerosol thermodynamic modelISSOROPIA (ANISORROPIA, Capps et al., 2012) and other adjointimplementations because of its accuracy in results (Martins et al.,2002; Giles and Pierce, 2000). We note that the CS approach doeshave limitations including the treatment of certain functions andconvergence of iterative calculations, which are relevant to CTMsand have been worked around in our implementation, as well aslimitations of less relevance here such as for models that alreadycontain complex numbers (Martins et al., 2002).

This is to the best of our knowledge the first time the CSsensitivity method has been implemented in a chemistry-transport model and also the first time that second order sensi-tivities are computed by using the complex step method incombination with an adjoint model in any application. Weimplement the CS sensitivity method in GEOS-Chem, which is atropospheric chemistry-transport model (Bey et al., 2001). Itperforms transport, gas- and aerosol-phase chemistry, as well aswet and dry deposition calculations. It takes as inputs emissionsas well as GEOS-5 meteorological data from the NASA GMAO. Theresolution of the horizontal grid is 4� � 5� (latitude � longitude),with 47 vertical layers up to 80 km. As mentioned, GEOS-Chemhas a widely applied adjoint implemented by Henze et al.(2007), which enables us to apply the CS method in combina-tion with an adjoint.

2.1. Mathematical description

The CS method is derived by considering the Taylor seriesexpansion of a real function f around a reference point x0,

f ðxÞ ¼ f ðx0Þ þ f 0ðx0Þ�x� x0

�þ 12!

f00 ðx0Þðx� x0Þ2

þ 13!

f ð3Þðx0Þðx� x0Þ3 þ…; (2)

By substituting the real variable x with a complex variable,x ¼ x0 þ ih, where x0 is a reference, i ¼

ffiffiffiffiffiffiffi�1

pand h is an arbitrary

real number, we obtain.

f ðx0 þ ihÞ ¼ f ðx0Þ þ f 0ðx0Þðx0 þ ih� x0Þ

þ 12!

f00 ðx0Þðx0 þ ih� x0Þ2

þ 13!

f ð3Þðx0Þðx0 þ ih� x0Þ3 þ…: (3)

This can be further simplified to.

f ðx0 þ ihÞ ¼ f ðx0Þ þ if 0ðx0Þh� 12!

f00 ðx0Þh2 �

13!

if ð3Þðx0Þh3 þ…:

(4)

Taking the imaginary part of the left-hand side and right-handside, rearranging and dividing through by h we obtain.

f 0ðx0Þ ¼Imff ðx0 þ ihÞg

hþ O

�h2�; (5)

where O(h2) terms are of order h2 or higher. This indicates that inthe limit of h / 0 the first derivative of the function is

f 0ðx0ÞzImff ðx0 þ ihÞg

h: (6)

Equation (6) reveals the most important benefit of using the CSmethod. Although at relatively large complex steps, h, the deriva-tive suffers from truncation error there is no subtraction as in thecase of the finite difference method. This means that afterdecreasing the complex step size to a certain threshold, the sensi-tivities are computed within machine precision as there is nocancelation error. In theory the CS method can compute forwardsensitivities as accurately as the adjoint method and the DDM. Inpractice somemarginwould be allowed for, sowe term this a “near-exact” method as the step size (as will be shown) can be orders ofmagnitude smaller than is possible with the FD method.

2.2. Implementation of the GEOS-Chem XPLEX

The CS method applied to GEOS-Chem, which we name GEOS-Chem XPLEX, is useful for computing: 1) sensitivities includingvalidation of adjoints, 2) changes due to perturbations (i.e. absolutechanges due to small emissions), and 3) second order sensitivities.

2.2.1. CS sensitivities in GEOS-Chem XPLEXBecause it is not practical to compute the sensitivities of all of

the outputs with respect to all the inputs by applying an imaginarycomplex step to one variable at a time, we apply imaginary complexsteps to multiple input variables simultaneously. To explain themeaning of doing this, we perform a Taylor series analysis on afunction that depends on multiple variables. If we substitute inEquation (2) the variable x and x0 by vectors x¼ [x1,x2,…, xn] andx0 ¼ [x0,1,x0,2,…, x0,n] respectively, the Taylor series expansion of amultiple variable function is.

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465460

f ðxÞ ¼f ðx0Þ þ11!

Xnj¼1

vf ðxÞvxj

�xj � x0;j

�þ 12!

Xnj¼1

Xnk¼1

v2f ðxÞvxjvxk

� �xj � x0;j��xk � x0;k

�þ 13!

Xnj¼1

Xnk¼1

Xnl¼1

v3f ðxÞvxjvxkvxl

� �xj � x0;j��xk � x0;k

��xl � x0;l

�þ…

(7)

By substituting in Equation (7) the variable x with the complexvariable vector x ¼ [x0,1 þ ih, x0,2 þ ih,…, x0,n þ ih] we obtain.

f ðxÞ ¼f ðx0Þ þ11!

Xnj¼1

vf ðxÞvx0;j

ih� 12!

Xnj¼1

Xnk¼1

v2f ðxÞvx0;jvx0;k

ðihÞ2

þ 13!

Xnj¼1

Xnk¼1

Xnl¼1

v3f ðxÞvx0;jvx0;kvx0;l

ðihÞ3 þ…

(8)

Dividing through by h, taking the imaginary part and rear-ranging Equation (8) we find that.

Imff ðxÞgh

¼Xnj¼1

vf ðxÞvx0;j

þ O�h2�: (9)

As the complex-step size h decreases, the imaginary part of thefunction divided by the complex step h represents the summationof the partial derivatives of the function with respect to the inputswhich were given a complex step. In other words, it is interpretedas the marginal cumulative impact of x on f. For example, let x bethe emissions of NOx at all times (t) and all grid locations (s),x≡ENOx

��s;t þ ih, and f the concentration of PM2.5 at a particular grid

point location. By using the CS method we compute the marginalimpact of the global NOx emissions on the concentration of PM2.5 atthat particular grid cell. This is the interpretation of inputting auniform complex step to a set of input variables. Note that, if h issufficiently small, the CS method does not affect the backgroundsince the information on sensitivity is kept in the imaginary part ofthe variables.

2.2.2. Change due to input perturbationsThe CS method can also be used to compute the change of the

output function due to a perturbation in a variable or a set of var-iables without altering the background reference case. The onlymodification that needs to be done is to multiply the imaginarycomplex step by the respective perturbation of the variables.

Multiplying the imaginary complex steps of x in Equation (9) bythe respective real perturbations we obtain X¼ [x0,1 þ ihdx0,1,x0,2 þ ihdx0,2,…, x0,n þ ihdx0,n] where dx0,j represents the pertur-bation in x0,j. After manipulating the resulting equation, taking theimaginary part and dividing through by h we obtain.

Imff ðXÞgh

¼Xnj¼1

vf ðXÞvx0; j

dx0; j þ O�h2�zdf ðXÞ: (10)

In Equation (10) each sensitivity, vf(X)/vx0,j, is multiplied by eachperturbation of the inputs, dx0,j, which effectively results incomputing a change in f due to all perturbations (e.g. emissions atall locations), under the assumption that dx0,j ≪ x0,j. Note that dx0,jmay be different for each index, j. For example we can compute thechange in the concentration of PM2.5 due to global aviation NOx

emissions under the assumption that aviation NOx emissions are asmall perturbation to the background NOx (Barrett et al., 2010). Thisexample is shown in more detail in Section 3.2 of this paper.Another example is that temperature can be perturbed such thatthe impact of a marginal temperature change on atmospheric

chemistry will be retained in the imaginary part of the complexconcentrations, which is given in the Supporting information (SI).

2.2.3. CS-adjoint: second order sensitivitiesWe propose a new numerical method of computing second or-

der sensitivities in GEOS-Chem XPLEX by applying the complexstep sensitivities in combination with the adjoint sensitivities. Thisis appealing because both the adjoint and the CS sensitivities can becomputed within machine precision and the implementation onthe CS sensitivity requires minimal changes to the original code.

The idea is that the CS method computes sensitivities of outputswith respect to an input or a set of inputs and the adjoint computessensitivities of a cost function with respect to all the individualinputs. Therefore, the imaginary component of the CS-Adjointresult will be.

Im

(vJ

vx0;k

)

h¼Xnj¼1

v

vx0;j

vJ

vx0;k

!þ O

�h2�¼limh/0

Xnj¼1

v2Jvx0;jvx0;k

¼ v

vx0;k

Xnj¼1

vJvx0;j

: (11)

where J is the cost function of the adjoint, vJ/vx0,k is the result of theadjoint, x0,k is an individual input, x0,j represent the inputs whichhad imaginary complex steps and O(h2) are the higher order terms.In the limit of h going to zero, Equation (11) can be interpreted ashow does x0,k impact the sensitivity of the cost function withrespect to the vector x¼ [x0,1 þ ih, x0,2 þ ih,…, x0,j þ ih,…, x0,n þ ih].An example application of Equation (11) is given in section 3.3 ofthis paper.

2.2.4. CodingWe implemented the CS method in GEOS-Chem. In principle

implementation of the CS method is as simple as converting all thereal variables in the code to complex variables. In practice thisnecessitated our defining a new variable type “XPLEX” with theoperator and function properties required for the CS method, asdiscussed further in the SI. Nonetheless the implementation of theCS method with the XPLEX variable type is significantly simplerthan the development of an adjoint or a DDM implementation(Giles and Pierce, 2000). We named our modified version of thecode GEOS-Chem XPLEX. Implementation of the CS method indifferent programming languages is presented by Martins et al.(2003).

For the proposed CS and CS-Adjoint method, we replaced all realvariables in GEOS-Chem and the adjoint of GEOS-Chem with theXPLEX variable type. The resultant code takes double the memoryand double the computational code of the base model as thenumber of variables and calculations has been doubled. This meansthat it is computationally equivalent to running the base modeltwice, as would be needed for a FD computation. Note that in thiscase our “base” is a version of the GEOS-Chem with consistentdouble precision variables, rather than mixed precision, which re-sults in a further factor of 1.6 increase in execution time over theregular version of the GEOS-Chem. However, overall the compu-tational time required for the XPLEX version of GEOS-Chem inpractice is a factor of 4.5 higher than regular (mixed prevision)GEOS-Chem. This additional 40% of computation time (over thefactors of 2 � 1.6) is in part due to the additional arithmeticcomplexity and numerical checks implemented in the XPLEX var-iable type. Running GEOS-Chem XPLEX is in practice the same as aconventional GEOS-Chem run, except that an imaginary step isapplied to the variable of interest and the sensitivities are found by

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465 461

taking the imaginary component of the output of interest anddividing by the imaginary step size.

3. Results

In this section of the paper we show 1) comparisons betweenthe CS, FD and adjoint sensitivities 2) application of the CS methodin GEOS-Chem XPLEX and 3) our proposed CS-Adjoint approach tocomputing second order sensitivities.

3.1. First order sensitivities

We performed a comparison between the CS sensitivities andthe FD and adjoint sensitivities. The purpose of this is to validatethe CS approach relative to the already validated and exact GEOS-Chem Adjoint, We computed the sensitivities of 24-h averageconcentrations of nitrogen oxides (NOx), ozone (O3), fine particulatematter (PM2.5) and three of the species of PM2.5 [ammonium (NHþ

4 ),nitrates (NO�

3 ) and sulfates (SO2�4 )] with respect to NOx emissions

at 11 grid locations in the global GEOS-Chem domain. The chosenpoints are dispersed in order to capture a variety of backgroundconditions as well as a variety of meteorological conditions. Weshow more detail on the sensitivities computed at one of the 11points. See the SI for the location of the points and comparison plotsfor the rest of the points.

In Fig. 1 the sensitivities are plotted on a logarithmic scale onboth axes to show the behavior of the CS sensitivities and FD sen-sitivities over the ranges of step sizes and perturbations tested. Theadjoint is plotted as a reference line as it is not dependent on anyperturbation or complex-step size as the adjoint results in a singlenumber. Fig. 1 shows the CS sensitivities correspond to the adjointsensitivities over the range of complex steps tested. The FDapproach results in cancelation errors over a range where the CSmethod is near-exact. We note that this behavior occurs at largerperturbation in the case of NHþ

4 sensitivities than it does in the caseof NOx sensitivities. This is because the optimal perturbation is notthe same for all inputeoutput pairs. See the SI for the comparisonbetween the three sensitivity methods at the remaining tenlocations.

Fig. 1. Sensitivity comparisons of the CS (circles), FD (diamonds) and adjoint (ADJ, dashed linthe GEOS-Chem convention for raw model outputs); units of h and D are kg s�1.

We correlated the sensitivities obtained by the CS method andthe adjoint as shown in Fig. 2. It was found that the R2 was in therange of 0.972 and 0.994 for all the sensitivities computed. Also, thegradients of the linear regression lines that were fitted to the datawere in the range of 0.96 and 1.04.

To demonstrate how the CS method overcomes cancelation er-rors in the FD approach for analyzing cases of small emissionsperturbations, we computed the monthly average sensitivity of O3concentrations with respect to a single kilogram of surface NOx

emitted at the beginning of the simulation with both the FDmethod and the CS method. The source of the NOx was at groundlevel on the East coast of the United States. The sensitivities ofground level O3 are plotted in Fig. 3. The FD sensitivities in Fig. 3 (a)show a pattern of positive and negative sensitivities dispersedirregularly over the whole ground level domain, i.e. “noise”. Incontrast, the CS sensitivities show a consistent pattern of negativesensitivities with highest magnitudes in the region where the NOx

was initially emitted and decreasing magnitudes over the NorthernAtlantic Ocean.

Also, we notice that the peak values of the FD sensitivities areroughly four orders of magnitude higher than the values of the CSsensitivities. We conclude that the irregular pattern and the highermagnitudes are a result of numerical noise and cancelation errors.This suggests that the CSmethod has improved the capability of themodel to compute sensitivities with respect to small perturbationswhich was not possible before our implementation of GEOS-ChemXPLEX. Taking this together with Fig. 2, we now have the comple-ment of the adjoint e the ability to compute near-exact source-oriented sensitivities.

3.2. Second order sensitivities

We used the CS method in GEOS-Chem XPLEX in combinationwith the adjoint method in order to compute the annual averagesecond order sensitivities of air quality. Specifically, we computedthe average impact of ground level background emissions on thesensitivity of total PM2.5 concentrations to the global aviation NOx

emissions.To compute these second order sensitivities with GEOS-Chem

XPLEX we specified a uniform imaginary complex step to all the

e) method at a point. Units of sensitivities are ppb kg�1 (including in the case of PM per

Fig. 2. Correlations of CS and adjoint sensitivity results. The solid black line represents the unity line and the dashed blue line represents the regression line fitted through the data.Units of ppb kg�1. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Fig. 3. Average monthly sensitivities of ground level O3 to 1 kg of NOx computed by (a) the FD method and (b) the CS method. Units of ppb kg�1.

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465462

aviation NOx emissions, EAVNOx

���s;t

¼ EAVNOx

���s;t

þ ih. This is equivalent tosaying that in all locations where aviation emits, all locations areperturbed by the same amount. (The next section provides anexample of geospatially weighting the complex perturbations.)Thenwe defined the cost function of the adjoint as the total groundlevel PM2.5 concentration over a region in North America (definedin the SI) and consider its sensitivity to SO2 emissions (from anysource).

The space-time matrix of results from the CS-Adjoint is there-fore.

v

vðaviation NOx emissionsÞ�

vðtotal ground level PM in NAÞvðSO2 emissions in any time or locationÞ

:

The quantity in square brackets is the adjoint sensitivity, whichis a four-dimensional (space and time) matrix. A particular locationin this matrix quantifies the sensitivity of total ground level PM2.5 in

North America to SO2 emissions at the particular location and timethat the matrix location refers to. The CS-Adjoint method computesthe sensitivity of the aforementioned sensitivity to, in this case, allaviation NOx emissions being perturbed by the same infinitesimalamount. This tells us how changes in aviation emissions will impactupon the effectiveness of other sector's SO2 emissions at creatingground level PM. The mechanism for this in the case of aviationwasdescribed in Barrett et al. (2012) [and in other contexts byLeibensperger et al. (2011)], i.e. aviation NOx emissions increase theoxidative capacity of the atmosphere, thereby increasing the con-version of SO2 emitted from other sectors to sulfate PM.

We also computed the second order sensitivities by performingthe FD of two adjoint runs of the original GEOS-Chem model forcomparison as in Koo et al. (2013). Computations were also

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465 463

performed for the equivalent cases with ground NH3 emissionsinstead of SO2 (with results in the SI).

As presented in Figs. 4 and 5, the CS-Adjoint results are com-parable in spatial distribution and order of magnitude to the FD-Adjoint results. The difference between the CS-Adjoint in GEOS-Chem XPLEX and the FD-Adjoint in the original GEOS-Chemadjoint is that the CS-Adjoint shows more pronounced featuresthan the FD-Adjoint. The percent differences between the secondorder sensitivities computed by the CS-Adjoint and the FD-Adjoint

Fig. 4. Time-averaged ground-level second order sensitivity described in Section 3.3 computhat a global increase in aviation NOx emissions will reduce the impact of SO2 emissions in tthat the impact of SO2 emissions in that location on total ground level PM2.5 would be am

Fig. 5. Ground-level second order sensitivity described in Section 3.3 for a) January CS-Ad(kg h�1)�2.

ranged between 0% and 123% with an average difference ofapproximately 7%. This is consistent with the FD method in theadjoint introducing cancelation or truncation errors.

We also note that, as implied by Equation (11), the following twointerpretations of Fig. 4 are equivalent:

1. A blue location means that a uniform increase in aviation NOx

emissions will reduce the impact of SO2 emissions in thatlocation on total ground level PM2.5 in the domain.

ted by a) CS-Adjoint; b) FD-Adjoint. Units of mg m�3 (kg h�1)�2. A blue location meanshat location on total ground level PM2.5 in the domain. Similarly, a red location meansplified by an increase in global aviation NOx emissions.

joint; b) January FD-Adjoint; c) June CS-Adjoint; d) June FD-Adjoint. Units of mg m�3

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465464

2. A blue location means that an increase in ground level SO2emissions at that location will reduce the impact of a uniformincrease in aviation NOx emissions on aviation-attributableground level PM2.5 in the domain.

This is because the order of the partials in Equation (11) can beswapped.

In addition to a spatial variation of the second order sensitivitiesthere is also a temporal variation. Fig. 5 shows that in the winteraviation NOx emissions can either amplify or suppress the sensi-tivity of ground level PM2.5 to ground level SO2 emissionsdepending on location (of the SO2 emissions), while in the summeraviation NOx emissions only amplify the sensitivity. The results alsoshow the loss of information in the FD approach.

It was found that the second order sensitivities of ammonia(NH3) aremostly positive both spatially and temporally. This meansthat by increasing the emissions of NH3 the PM2.5 sensitivity toglobal aviation NOx would increase. Koo et al. (2013) performeddifferences of adjoint simulations with and without aviationemissions and also found that ammonia increases the PM sensi-tivity to aviation emissions. We found the percent difference be-tween the second order sensitivities of NH3 ground level emissionson the annual average sensitivity of total PM2.5 with respect toglobal aviation NOx emissions over the NA region computed by theCS-Adjoint and the FD-Adjoint ranged between 0% and 94% with amean percent difference of 8%. The annual second order sensitiv-ities and monthly sensitivities are plotted in the SI.

3.3. D PM2.5 due to global aviation NOx emissions

As well as for computing sensitivities, the CS method can beused to calculate the impact of a specific emissions scenario onconcentrations, and has utility where that the emissions are smallrelative to the background or the time horizon over which impactsare of interest is long. Also the CS method (and CS-Adjoint) can beapplied with weighted perturbations. In this applicationwe give anexample use of the CS sensitivity method to compute the change intotal annual average PM2.5 due to global aviation NOx emissions(EAVNOx

) over a domain in North America as defined in the SI. Theresults are shown in Fig. 6.

We can use the sensitivities to compute concentrations in thisexample because we are making the assumption that the aviationNOx emissions are a slight perturbation to the overall NOx emissionsand the response is in the linear regime (Barrett et al., 2010). The CSand the adjoint results are then compared to the result obtained bythe difference between two simulation of the forward model with

Fig. 6. Ground level annual average concentration distribution of PM2.5 due to global avidifference method by subtracting two forward simulations. Units of mg m�3.

and without EAVNOx. We ran one year simulation of the GEOS-Chem

XPLEX by implementing a weighted imaginary complex step toall the aviation NOx emissions at all times (t) and all locations (s),EAVNOx

���s;t

¼ EAVNOx

���s;t

þ ihEAVNOx

���s;t.

We found the CS method domain average perturbation was0.0105 mg m�3. By performing the difference between the forwardsimulations was 0.0111 mg m�3. The values represent less than 0.5%of the total average PM2.5 computed over the domain. The absolutepercent difference between the CSmethod result and the differenceresult is approximately 5%. These results suggest that aviation'simpacts on surface level PM2.5 is approximately linear, but that themarginal impact of emissions beyond their current level is lowerthan the average impact.

4. Conclusions

We introduce the complex step method to chemistry-transportmodeling and implement it in GEOS-Chem as the GEOS-ChemXPLEX. This is the first application of the CS method tochemistry-transport modeling to our knowledge. We also intro-duce the idea of combining complex-step and adjoint sensitivityanalysis (for the first time in any context to our knowledge) toenable the direct calculation of near-exact second ordersensitivities.

We validate the complex step method against the (in principal)exact adjoint, demonstrating that the CS method yields near-exactsensitivities. The correlation coefficients between the CS andadjoint sensitivities were between 0.975 and 0.994. While GEOS-Chem previously had an exact adjoint sensitivity method, the FDmethod incurs cancelation and truncation errors. The GEOS-ChemXPLEX can be considered the source-oriented complement of thereceptor-oriented adjoint for near-exact sensitivity computation.The CS method is significantly more straightforward to implementandmaintain than the DDM, which has been applied to other CTMssuch as CAMx and CMAQ.

We also demonstrate that the CS method can be applied withweighted complex perturbations and can be used to compute theperturbation response of specific (relatively small) emissions forthat would otherwise not be possible to compute due to cancella-tion errors.

Finally, we applied the CS-Adjoint method to compute secondorder sensitivities of global aircraft NOx emissions on ground levelPM2.5 in a region of North America to ground level emissions of SO2and NH3. It was found that there is a spatial and temporal variationin the second order sensitivities in the case of SO2 emissions.

ation NOx emissions computed by a) the CS method in GEOS-Chem XPLEX and b) a

B.V. Constantin, S.R.H. Barrett / Atmospheric Environment 99 (2014) 457e465 465

Increases in ground level SO2 emissions at some locations inJanuary reduce the impact of aviation NOx on ground level PM2.5 inNorth America. The CS-Adjoint approach provides near-exactmixed sourceereceptor-oriented second order sensitivities.

We have released the GEOS-Chem XPLEX source code, which isavailable at http://lae.mit.edu.

Acknowledgments

The authors would like to thank Akshay Ashok, Steve Yim, QiqiWang, Irene Dedoussi and Jamin Koo for valuable discussionsrelated to this work.

Appendix A. Supplementary data

Supplementary data related to this article can be found at http://dx.doi.org/10.1016/j.atmosenv.2014.10.017.

References

Anderson, W.K., Newman, J.C., Whitfield, D.L., Nielsen, E.J., 1999. Sensitivity Analysisfor Navier-stokes Equations on Unstructured Meshes Using Complex Variables.American Institute of Aeronautics and Astronautics. Paper 99e3294.

Ashok, A., Lee, I.H., Arunachalam, S., Waitz, I.A., Yim, S.H.L., Barrett, S.R.H., 2013.Development of a response surface model of aviation's air quality impacts in theUnited States. Atmos. Environ. 77, 445e452.

Barrett, S.R.H., Britter, R.E., Waitz, I.A., 2010. Global mortality attributable to aircraftcruise emissions. Environ. Sci. Technol. 44, 7736e7742.

Barrett, S.R.H., Yim, S.H.L., Gilmore, C.K., Murray, L.T., Kuhn, S.R., Tai, A.P.K.,Yantosca, R.M., Byun, D.W., Ngan, F., Li, X., Levy, J.I., Ashok, A., Koo, J.,Wong, H.M., Dessens, O., Balasubramanian, S., Fleming, G.G., Pearlson, M.N.,Wollersheim, C., Malina, R., Arunachalam, S., Binkowski, F.S.,Leibensperger, E.M., Jacob, D.J., Hileman, J.I., Waitz, I.A., 2012. Public health,climate, and economic impacts of desulfurizing jet fuel. Environ. Sci. Technol. 46(8), 4275e4282. http://dx.doi.org/10.1021/es203325a.

Beck, M., Mulkey, L.A., Barnwell, T.O., 1994. Model Validation for Exposure Assess-ments. United States Environmental Protection Agency, Athens, Georgia.

Bey, I., Jacob, D.J., Yantosca, R.M., Logan, J.A., Field, B.D., Fiore, A.M., Li, Q., Liu, H.Y.,Mickley, L.J., Schultz, M.G., 2001. Global modeling of tropospheric chemistrywith assimilated meteorology: model description and evaluation. J. Geophys.Res. 106, 23073e23095. http://dx.doi.org/10.1029/2001JD000807.

Bowmann, K., Henze, D.K., 2012. Attribution of direct ozone radiative forcing tospatially resolved emissions. Geophys. Res. Lett. 39, L22704.

Capps, S.L., Henze, D.K., Hakami, A., Russell, A.G., Nenes, A., 2012. ANISORROPIA: theadjoint of the aerosol thermodynamic model ISORROPIA. Atmos. Chem. Phys.12, 527e543.

Daescu, D., Sandu, A., Carmichael, G.R., 2003. Direct and adjoint sensitivity analysisof chemical kinetic systems with KPP: II e validation and numerical experi-ments. Atmos. Environ. 37, 5097e5114.

Damian, V., Sandu, A., Damian, M., Potra, F., Carmichael, G.R., 2002. The kineticpreprocessor KPP-a software environment for solving chemical kinetics. Com-put. Chem. Eng. 26 (11), 1567e1579.

Dunker, A.M., Yarwood, G., Ortmann, P.J., Wilson, G.M., 2002. The decoupled directmethod for sensitivity analysis in a three-dimensional air quality model eimplementation, accuracy and efficiency. Environ. Sci. Technol. 36, 2965e2976.

Fry, M.M., Naik, V., West, J.J., Schwarzkopf, M.D., Fiore, A.M., Collins, W.J.,Dentener, F.J., Shindell, D.T., Atherton, C., Bergmann, D., Duncan, B.N., Hess, P.,MacKenzie, I.A., Marmer, E., Schultz, M.G., Szopa, S., Wild, O., Zeng, G., 2012. Theinfluence of ozone precursor emissions from four world regions on tropo-spheric composition and radiative climate forcing. J. Geophys. Res. 117, D07306.

Giering, R., Kaminski, T., 1998. Recipes for adjoint code construction. Assoc. Comput.Mach. Trans. Math. Softw. 24, 437e474.

Giles, M.B., Pierce, N.A., 2000. An introduction to the adjoint approach to design.Flow Turbul. Combust. 65, 393e415.

Gilmore, C.K., Barrett, S.R.H., Koo, J., Wang, Q., 2013. Temporal and spatial variabilityin the aviation NOx-related O3 impact. Environ. Res. Lett. 8, 034027.

Hakami, A., Odman, M.T., Russell, A.G., 2003. High-order direct sensitivity analysisof multidimensional air quality models. Environ. Sci. Technol. 37, 2442e2452.

Hakami, A., Odman, M.T., Russell, A.G., 2004. Nonlinearity in atmospheric response:a direct sensitivity analysis approach. J. Geophys. Res. 109, D15303.

Henze, D.K., Hakami, A., Seinfeld, J.H., 2007. Development of the adjoint of GEOS-Chem. Atmos. Chem. Phys. 7, 2413e2433.

Henze, D.K., Shindell, D.T., Akhtar, F., Spurr, R.J.D., Pinder, R.W., Loughlin, D.,Kopacz, M., Singh, K., Shim, C., 2012. Spatially refined aerosol direct radiativeforcing efficiencies. Environ. Sci. Technol. 46, 9511e9518.

Kohler, M.O., Radel, G., Dessens, O., Shine, K.P., Rogers, H.L., Wild, O., Pyle, J.A., 2008.Impact of perturbations to nitrogen oxide emissions from global aviation.J. Geophys. Res. 113, D11305.

Koo, J., Wang, Q., Henze, D.K., Waitz, I.A., Barrett, S.R.H., 2013. Spatial sensitivities ofhuman health risk to intercontinental and high-altitude pollution. Atmos. En-viron. 71, 140e147.

Lantoine, G., Russell, R., Dargent, T., 2012. Using multicomplex variables for auto-matic computation of high-order derivatives. Assoc. Comput. Mach. Trans.Math. Softw. 38 (3). Article 16.

Leibensperger, E.M., Mickley, L.J., Jacob, D.J., Barrett, S.R.H., 2011. Intercontinentalinfluence of NOx and CO emissions on particulate matter air quality. Atmos.Environ. 19, 3318e3324.

Lyness, J.N., 1967. Numerical algorithms based on the theory of complex variables.In: Proceedings of the Association for Computing Machinery National Meeting(Washington, D.C.), pp. 125e133.

Lyness, J.N., Moler, C.B., 1967. Numerical differentiation of analytic functions. Soc.Ind. Appl. Math. J. Numer. Anal. 4 (2), 202e210.

Martins, J.R.R.A., Alonso, J.J., Reuther, J.J., 2002. Complete Configuration Aero-structural Optimization Using a Coupled Sensitivity Analysis Method. Amer-ican Institute of Aeronautics and Astronautics. Paper 2002e5402.

Martins, J.R.R.A., Sturdza, P., Alonso, J.J., 2003. The complex-step derivativeapproximation. Assoc. Comput. Mach. Math. Softw. 29, 245e262.

Morgan, M.G., Henrion, M., 1990. Uncertainty: a Guide to Dealing with Uncertaintyin Quantitative Risk and Policy Analysis. Cambridge University Press, New York,pp. 47e72.

Naik, V., Mauzerall, D., Horowitz, L., Schwarzkopf, M.D., Ramaswamy, V.,Oppenheimer, M., 2005. Net radiative forcing due to changes in regionalemissions of tropospheric ozone precursors. J. Geophys. Res. 110, D24306.

Newman, J.C., Anderson, W.K., Whitfield, L.D., 1998. Multidisciplinary SensitivityDerivatives Using Complex Variables. Technical Report MSSU-COE-ERC-98e08(July). Computational Fluid Dynamics Laboratory.

Rabitz, H., Kramer, M., Dacol, D., 1983. Sensitivity analysis in chemical kinetics.Annu. Rev. Phys. Chem. 34, 419e461.

Sandu, A., Daescu, D.N., Carmichael, G.R., Chai, T., 2003. Direct and adjoint sensi-tivity analysis of chemical kinetic systems with KPP: part I e theory and soft-ware tools. Atmos. Environ. 37, 5083e5096.

Squire, W., Trapp, G., 1998. Using complex variables to estimate derivatives of realfunctions. Soc. Ind. Appl. Math. Rev. 40, 110e112.

Stevenson, D.S., Doherty, R.M., Sanderson, M.G., Collins, W.J., Johnson, C.E.,Derwent, R.G., 2004. Radiative forcing of NOx emissions: mechanisms andseasonal dependence. J. Geophys. Res. 109, D17307.

Turner, A.J., Henze, D.K., Martin, R.V., Hakami, A., 2012. The spatial extent of sourceinfluences on modeled column concentrations of short-lived species. Geophys.Res. Lett. 39, L12806.

U.S. EPA, 2009. Guidance on the Development, Evaluation and Application ofEnvironmental Models (Washington, D.C.), EPA/100/K-09/003, pp. 8e14, 70.

van Keulen, F., Haftka, R.T., Kim, N.H., 2005. Review of options for structural designsensitivity analysis. Part I: linear systems. Comput. Methods Appl. Mech. Eng.194, 3213e3243.

Vuilleumier, L., Harley, R.A., Brown, N.J., 1997. First- and second-order sensitivityanalysis of a photochemically reactive system (a Green's function approach).Environ. Sci. Technol. 31, 1206e1217.

Woody, M., Baek, B.H., Adelman, Z., Omary, M., Lam, Y.F., West, J.J., Arunachalam, S.,2011. An assessment of aviation's contribution to current and future fine par-ticulate matter in the United States. Atmos. Environ. 45 (20), 3424e3433.