Atmospheric chemistry mechanism files are usually written in the KPP language. They can generate Fortran or C code, but cannot be used with the differentiable frameworks commonly used in machine learning. KPPax fills this gap: it directly generates chemical code from KPP mechanisms that is differentiable, just-in-time compiled, and vectorizable in JAX. Rate calculations use sparse operations in log space, while integration is handled by diffrax’s implicit solvers and forward and backward adjoints. Sensitivities are computed exactly, without having to write adjoint code by hand.

The paper demonstrates two applications using the POLLU benchmark. The first uses an automatically differentiated Jacobian to calculate the Fisher information matrix, determining which of 25 rate constants can be identified from flow-tube-type experiments before fitting. Noisy synthetic estimates confirm that the predicted uncertainties for the nine identifiable coefficients are within about 30%, while also revealing that some fast reactions can only be constrained through ratios. The second application trains a neural-network correction to an emissions inventory offline, using each scenario’s 4D-Var inversion results, then fine-tunes it online through the chemical model. This reduces errors in the biogenic correction by a factor of 2.4 to 5.

This is an arXiv preprint and has not undergone peer review; the conclusions should be understood within the scope of the experiments described in the abstract.

$BTC