# Question on Implementing ECH4 in CMAQ v5.0 Adjoint Model (CB05CL\_AERO5)

**URL:** <https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853>\
**Category:** CMAQ-Adjoint\
**Created:** [June 13, 2025, 6:57am UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853 "2025-06-13T06:57:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![power9x9x9](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@power9x9x9](https://forum.cmascenter.org/u/power9x9x9)\
**Post date:** [June 13, 2025, 6:57am UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853/1 "2025-06-13T06:57:55Z")

</div>

Dear CMAQ users,

I am currently working on implementing methane ( **ECH4** ) as an additional variable in the CMAQ v5.0 adjoint model to evaluate sensitivities. The chemical mechanism used is **CB05CL\_AERO5**. I have successfully modified the chemical mechanism files (i.e., `GC_cb05cl_ae5_aq.csv`, `GC_cb05cl_ae5_aq.nml`, and `GC_SPC.EXT`) to include ECH4 and can now output its concentration without any issues.

In particular, I added the following two chemical reactions:

**OH + ECH4 = MEO2 # 2.45E-12 @ 1775K**  
 **CL + ECH4 = HCL + MEO2 # 6.6E-12 @ 1240K**

Initially, a background CH4 concentration was used, but I have modified the model to utilize CH4 emissions as input, and this successfully drives the ECH4 concentration field.

However, when incorporating these reactions into the Tangent Linear and Adjoint models by modifying KPP-related subroutines ( **KPP\_Function, KPP\_Jacobian, KPP\_JacobianSP, KPP\_LinearAlgebra** ), I encountered an issue where **NaN values** appear in the computed concentrations. I suspect the problem may lie in the hard-coded Jacobian structure in `KPP_Jacobian.f90`, which might be incompatible with the changes I’ve made.

Would anyone be willing to provide insight or guidance on resolving this issue? Any help would be greatly appreciated.

Thank you in advance.

Sincerely,  
**Jeong hyeok**

---

<div class="post-metadata">

**Author:** ![Sun](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sun](https://forum.cmascenter.org/u/Sun)\
**Post date:** [November 12, 2025, 7:39am UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853/2 "2025-11-12T07:39:50Z")

</div>

Dear Jeong hyeok

I would like to know how you added the chemical reactions involved in ECH4. The CB05CL\_AERO5 of CMAQ4.7.1 called by the CMAQv5.0adjoint model does not have files such as GC\_cb05cl\_ae5\_aq.csv and GC\_cb05cl\_ae5\_aq.nml. I modified GC\_SPC.EXT、GC\_EMIS.EXT、GC\_DIFF.EXT、GC\_CONC.EXT et, al.

Sincerely,  
Wang

---

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forum.cmascenter.org/u/sergey)\
**Post date:** [November 21, 2025, 3:58pm UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853/3 "2025-11-21T15:58:14Z")

</div>

Simply modifying the text include files is not sufficient to modify the chemical mechanism. Adding reactions is possible, but requires a more complete understanding and use of the CMAQ CHEMMECH tool.

Similarly for the original poster, you are correct in that the Jacobian needs to be redefined by taking into account the newly added reactions.

Sergey

---

<div class="post-metadata">

**Author:** ![Sun](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sun](https://forum.cmascenter.org/u/Sun)\
**Post date:** [December 16, 2025, 2:43am UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853/5 "2025-12-16T02:43:53Z")

</div>

Thank you for your guidance. CMAQ v4.7.1 does not include the CHEMMECH tool, so I have only modified the text include files. I would like to ask how the chemical mechanism should be modified correctly under this constraint, and whether it is possible to obtain the CHEMMECH tool from other sources.  
Any help would be greatly appreciated.  
Wang

---

<div class="post-metadata">

**Author:** ![bhutzell](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bhutzell](https://forum.cmascenter.org/u/bhutzell)\
**Post date:** [December 22, 2025, 8:03pm UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853/6 "2025-12-22T20:03:03Z")

</div>

A 4.7.1 version of the CHEMMECH tool can be found at [GitHub - bhutzell/CMAQ.mech\_processor: FORTRAN code that creates the RXNS modules for the CMAQ model version 5.1](https://github.com/bhutzell/CMAQ.mech_processor) . You may need to create KPP solver files for the updated chemical mechanism. If you do not have these files, try contacting one of the authors of [the 2020 paper](https://gmd.copernicus.org/articles/13/2925/2020/).

---

<div class="post-metadata">

**Author:** ![power9x9x9](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@power9x9x9](https://forum.cmascenter.org/u/power9x9x9)\
**Post date:** [December 23, 2025, 4:36am UTC](https://forum.cmascenter.org/t/question-on-implementing-ech4-in-cmaq-v5-0-adjoint-model-cb05cl-aero5/5853/7 "2025-12-23T04:36:43Z")

</div>

Sorry for the delayed response. As Sergey mentioned, simply modifying the text include files is not sufficient to properly update the chemical mechanism. However, as you know, CMAQ v4.7.1 does not provide the CHEMMECH tool. Because of this limitation, I proceeded without using CHEMMECH and instead modified the Fortran source code directly to add the ECH4-related reactions.

I was able to implement the new reactions successfully by editing the following KPP-generated Fortran modules:

- KPP\_Function.f90

- KPP\_Hessian.f90

- KPP\_HessianSP.f90

- KPP\_Jacobian.f90

- KPP\_JacobianSP.f90

- KPP\_LinearAlgebra.f90

- KPP\_Parameters.f90

- KPP\_Util.f90

Although this approach is “hard-coded,” the structure follows a consistent set of rules, which made it possible to extend the mechanism as long as the existing conventions were carefully maintained.

I hope this information is helpful to you.
