Skip to content

GEOS-Chem photolysis completion: 62 new channels — 13 dedicated Cloud-J σ tables + 49 surrogate mappings (63 → 125 coupled) - #226

Open
xk-y wants to merge 3 commits into
EarthSciML:mainfrom
xk-y:pr/photolysis-completion
Open

GEOS-Chem photolysis completion: 62 new channels — 13 dedicated Cloud-J σ tables + 49 surrogate mappings (63 → 125 coupled)#226
xk-y wants to merge 3 commits into
EarthSciML:mainfrom
xk-y:pr/photolysis-completion

Conversation

@xk-y

@xk-y xk-y commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

completion/bugfix · numerical drift for GEOS-Chem users (previously-zero channels activate)

Motivation

GEOSChemGasPhase declares ~154 photolysis reactions, but only 63 were wired to FastJX j-values — every remaining organic channel (carbonyls, organic nitrates, peroxides, epoxides, ...) ran with an effective rate of zero, systematically underestimating photolytic loss and radical production. This PR wires 62 of the remaining channels and leaves 29 deferred (63 + 62 + 29 = 154).

Change (hybrid)

  • 13 dedicated cross-section tables generated from the Cloud-J v7.3e spectral data (FJX_spec.dat) and inserted into Fast-JX.jl for the species whose spectra have no adequate surrogate. The generator (gen_sigma.py) had an f0 quantum-yield bug — fixed before table generation.
  • 62 organic channels coupled via couple2 — 13 bind the new dedicated tables above, 49 bind spectrally similar surrogate σ (hybrid lookup); the 3 inorganic two-channel species are excluded from the surrogate path (they need per-channel quantum yields and stay on their dedicated treatment). Surrogate assignments and j-scaling factors follow GEOS-Chem's FJX_j2j.dat (Cloud-J v7.3e, index-aligned in the organic block and species-verified), including the branch factors — e.g. ETP photolyzes at 0.5 × j(CH3OOH), GEOS-Chem's own FJX_j2j.dat factor, not an ad-hoc choice.
  • GEOS-Chem ↔ FastJX coupled channels: 63 → 125.
  • FastJX interpolation table extended 64 → 77 channels so the fast interpolated path (FastJX_interpolation) covers the new couplings.

Photolysis coupling 63→125; all ~154 declared reactions accounted for (63 wired + 62 new + 29 deferred)

Figure — left: coupled channels 63 → 125; right: full accounting of the ~154 declared photolysis reactions (63 already wired + 62 newly wired + 29 deferred). 13 of the 62 use new dedicated Cloud-J v7.3e σ tables; the rest reuse existing surrogate σ.

Compatibility impact

This is a bugfix: channels that previously contributed zero now photolyze, so GEOS-Chem coupled baselines shift — this aligns the port with the GEOS-Chem / Cloud-J v7.3e reference, where all these channels are active. No API change; SuperFast users unaffected. Note the baseline drift in release notes.

Validation

  • 143 tests pass: the new σ tables (magnitude/shape against the Cloud-J source data), every surrogate channel mapping, and the extended interpolation table.
  • The new channels read live j-values, not placeholders (asserted by the in-repo surrogate-mapping tests). Author-side integration evidence (not reproducible from this repo): exercised end-to-end by the coupled GEOS-Chem CTM stack (build + solve).
  • Full Pkg.test green (rc=0) in the upstream environment on this branch.

Dependencies

None (cut from main; independent of the aerosol stack). Suggested merge order: after #223 (rate_ALK), per the tracking issue.

Limitations

  • 29 channels deliberately deferred (documented list in the source): no usable Cloud-J cross-section or negligible tropospheric contribution (e.g. halogen-side channels outside the current mechanism scope). They remain zero-rate, as before this PR.
  • The 62 surrogate mappings are a spectral approximation; only the 13 species with clearly distinct spectra get dedicated tables in this pass.

Part of the coordinated cross-repo update tracked in #225.

xk-y and others added 2 commits July 7, 2026 11:59
Connect the organic surrogate photolysis channels that GEOS-Chem 14.1.1
photolyzes via surrogate cross-sections but the EarthSciML port left at j=0,
and port the dedicated Cloud-J v7.3e cross-sections for the species that have
them. The GEOSChemGasPhase<->FastJX coupling goes from 63 to 125 connected
photolysis reactions (+62 organic channels).

src/Fast-JX.jl:
- Add 13 dedicated v7.3e cross-sections (ONIT1, ETNO3, IPRNO3, NPRNO3, MVKN,
  MACRN, MACRNP, ICN, ETHLN, NITP, HMHP, HP2, ENOL; ETNO3/IPRNO3 are
  two-temperature via create_fjx_interp([240, 298])), each with a j_X(t)
  output variable and a j_X ~ j_mean_X(T/T_unit, flux_vars) equation. The
  18-bin layout was verified against the port's sigma_CH3OOH (17/18 bins).

src/fastjx_couplings.jl:
- couple2(GEOSChemGasPhase, FastJX): wire 62 organic channels. Hydroperoxides
  map to /CH3OOH/, organic & alkyl nitrates to /CH3NO3/, plus the 19 channels
  that use the 13 dedicated cross-sections, plus /MGlyxl//PrAld//H2O2/ for a
  few carbonyls/peroxides. Assignments and j-factors follow GEOS-Chem's
  FJX_j2j.dat (v7.3e). ETP keeps its 0.5 j-factor.

Scope / correctness notes:
- 62 (not 55) organic channels: several are multi-line reactions in
  geoschem_fullchem.jl that the original single-line survey missed.
- j2j indices align with the port only in the organic block (j_79+); the
  inorganic block does not, so surrogate assignment matches by species and uses
  the index only to disambiguate a/b channels (e.g. INPDa -> /CH3OOH/ vs
  INPDb -> /ONIT1/).
- Three inorganic same-species second channels are intentionally NOT added
  (j_17 HNO4->OH+NO3, j_29 BrNO3 2nd, j_36 N2O): the sibling channel is already
  wired at factor 1.0, so adding at 1.0 would double-count, and v7.3e collapses
  HNO4/CH3CHO to a single channel (no branching factor). These need the real
  14.1.1 FJX_j2j.dat branching and are left as follow-up.
- Halogen/iodine/SO4/aerosol-nitrate channels (~29) remain deferred (the port
  lacks those cross-sections; low tropospheric-O3 impact).

Tests:
- Extend "Compose GEOSChem FastJX" to assert all 62 new channel connections and
  the ETP 0.5 factor.
- Add "GEOSChem dedicated photolysis cross-sections": 13 j-value regressions,
  two-temperature interpolation for ETNO3/IPRNO3, and diurnal zeroing at night.
- 143/143 assertions pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…_INTERP_J_FULL 64→77)

After merging photolysis-completion (13 dedicated-σ species + their j_mean_* funcs in Fast-JX.jl)
into the interp branch, append those 13 species to _FJX_INTERP_J_FULL so FastJX_interpolation_
troposphere(mech=:all) exposes them. The .bson flux grid (P×cosSZA×18 WL bins) is channel-
independent, so no regeneration is needed — only the list entries (the σ/ϕ are code in Fast-JX.jl).
The interp test asserts all 13 dedicated channels are exposed and that GEOSChemGasPhase couples to them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xk-y xk-y changed the title GEOS-Chem photolysis completion: 13 dedicated Cloud-J σ tables + 62 surrogate channels (63 → 125 coupled) GEOS-Chem photolysis completion: 62 new channels — 13 dedicated Cloud-J σ tables + 49 surrogate mappings (63 → 125 coupled) Jul 10, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.65%. Comparing base (a38e337) to head (13fb335).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   87.45%   87.65%   +0.20%     
==========================================
  Files          20       20              
  Lines        1467     1491      +24     
==========================================
+ Hits         1283     1307      +24     
  Misses        184      184              
Flag Coverage Δ
docs 71.71% <100.00%> (+0.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ctessum

ctessum commented Sep 10, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	test/fastjx_test.jl
@ctessum

ctessum commented Sep 10, 2026

Copy link
Copy Markdown
Member

@xk-y It seems that in bins 1-16:

  • σ_HP2 = 2 × σ_CH3OOH
  • σ_HMHP = 0.7 × σ_CH3OOH
  • σ_NITP = σ_CH3OOH + σ_ONIT1
  • σ_MACRNP = 0.25 × (σ_CH3OOH + σ_MACRN)

But, in bin 17 all four are different from the formulas by a factor of 3. If this the case, please confirm that it's intentional and not a transcription mistake. And if all the values are supposed to match those formulas, we can just use the formulas rather than writing out all the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants