Skip to content

netCDF SpcCoeff: load NLTECoeff/ACCoeff sibling files, add guard test, bump to v3.1.5 - #364

Merged
BenjaminTJohnson merged 3 commits into
developfrom
bugfix/netcdf-spccoeff-sibling-load
Aug 23, 2026
Merged

netCDF SpcCoeff: load NLTECoeff/ACCoeff sibling files, add guard test, bump to v3.1.5#364
BenjaminTJohnson merged 3 commits into
developfrom
bugfix/netcdf-spccoeff-sibling-load

Conversation

@BenjaminTJohnson

Copy link
Copy Markdown
Contributor

Problem

All 3.1.x releases silently skip the <sensor>.NLTECoeff.nc / <sensor>.ACCoeff.nc sibling files when reading netCDF SpcCoeff, so the non-LTE correction and the MW antenna correction are disabled with no warning on the netCDF-coefficient path (the binary reader streams both inline and is unaffected). The observable signature is a ~2 K daytime OmF spike in the 4.3 um CO2 band for hyperspectral IR sounders — confirmed end-to-end for IASI (GSI OmF stats, standalone forward runs, and a JEDI/UFO H(x) A/B on real obs: night dH(x) = 0 exactly, day up to 4.5 K, NLTE channels only).

Changes

  • Cherry-pick of 98c6815 from feature/btj_REL-3.2.0: after reading the netCDF SpcCoeff, look for the siblings in the canonical fix/ACCoeff/netCDF/ / fix/NLTECoeff/netCDF/ directories first, then co-located next to the SpcCoeff file; sensor-consistency checks on load; absence is not an error (graceful degradation). The conflict resolution also brings the two ACCoeff_netCDF_IO/NLTECoeff_netCDF_IO imports the module needs (added by an earlier commit on the feature branch).
  • New ctest test_NLTE_Verification: read-level assertions (iasi616_metop-b NLTECoeff, 27 channels; amsua_n19 ACCoeff; both with-sibling and without-sibling) plus a forward-model A/B — daytime BTs must shift >0.5 K on NLTE channels only (measured 4.17 K at SZA 45) and night-time BTs must be identical. Stages testinput_no_siblings/ next to testinput/. The test fails against the pre-fix reader, so the sibling load is guarded against regression.
  • Version bump 3.1.4 -> 3.1.5 (VERSION.cmake, CMakeLists.txt, test/CMakeLists.txt, README.md).

Verification

Fresh Release build of this branch: new test passes 12/12 assertions in ~2 s; full ctest suite 196/196. Negative control (siblings hidden from testinput/) fails exactly the sibling-load assertions with exit 1.

Note for forward-porting

The fix_REL-3.2.0.0 tarball used by the REL branches has no co-located siblings and no TauCoeff/ODPS/Little_Endian/iasi616_metop-b.TauCoeff.bin; when merging this test forward, the staging lists should switch to the canonical NLTECoeff/netCDF/ / ACCoeff/netCDF/ paths and a netCDF TauCoeff.

BenjaminTJohnson and others added 3 commits August 23, 2026 15:38
… prefer canonical coeff dirs

The substructure-file lookup at the end of SpcCoeff_netCDF_ReadFile was
declared CHARACTER(LEN(Filename)) :: sub_filename. The .SpcCoeff. -> .NLTECoeff.
substitution is one character longer, so the trailing 'c' of '.nc' was
silently truncated and File_Exists returned false. The NLTE sibling load
quietly no-oped for every absolute-path caller, leaving SpcCoeff%NC
default-initialized and producing several-K brightness-temperature drift
on NLTE-active channels for all CrIS/AIRS/IASI sensors. ACCoeff was
unaffected because 'ACCoeff' is shorter than 'SpcCoeff'.

Buffer is now LEN(Filename)+16, with comments explaining why.

Also teach the loader to honor the canonical fix-tree layout: when the
SpcCoeff path contains /SpcCoeff/netCDF/, substitute that segment with
/NLTECoeff/netCDF/ or /ACCoeff/netCDF/ to find the sibling. Falls back
to same-directory sibling lookup for non-canonical (flat) layouts.

Verified end-to-end: cris-fsr_n21, cris-fsr_n20, mhs_n19, and a flat
temp-dir layout all load with the expected substructure associations.

(cherry picked from commit 98c6815)
Unit + forward-model ctest for the NLTECoeff/ACCoeff sibling load in the
netCDF SpcCoeff reader. Read-level: iasi616_metop-b must pick up its
co-located NLTECoeff.nc (27 channels) and amsua_n19 its ACCoeff.nc, and
both loads must still succeed, with the substructures left empty, when
the siblings are absent. Forward-level: with vs without the NLTECoeff
sibling, daytime BTs must differ by >0.5 K on NLTE channels only
(measured 4.17 K at solar zenith 45) and night-time BTs must be
identical, confirming the correction is applied and solar-driven.

Stages testinput_no_siblings/ alongside testinput/ with the same
coefficient set minus the sibling files. The forward assertions fail
against a reader that skips the siblings, so this test guards the
sibling-load fix against regression.
v3.1.5: the netCDF SpcCoeff reader now loads the NLTECoeff/ACCoeff
sibling files, previously skipped silently, which disabled the non-LTE
and antenna corrections for netCDF-coefficient users.
@BenjaminTJohnson
BenjaminTJohnson merged commit 2c7d426 into develop Aug 23, 2026
1 of 2 checks passed
BenjaminTJohnson added a commit that referenced this pull request Aug 25, 2026
Brings in v3.1.5 (PR #364: netCDF SpcCoeff sibling-load fix + test_NLTE_Verification)
and the CMake download/untar refactors (PR #354, #356).

Conflict resolution:
- CMakeLists.txt, VERSION.cmake, README.md: keep the 3.2.0 version strings;
  add the v3.1.5 line to the README release history.
- SpcCoeff_netCDF_IO.f90: keep this branch's version. develop's fix is a
  subset of it (same sibling load, minus the "no sibling found" INFORMATION
  messages).
- test/CMakeLists.txt: keep the fix_REL-3.2.0.0 tarball/checksum on top of
  develop's combined download+untar block; keep the netCDF-only coefficient
  staging list and add the iasi616_metop-b SpcCoeff/NLTECoeff/TauCoeff set
  the new test needs; port the testinput_no_siblings staging block to the
  netCDF filenames since the 3.2.0 tarball ships no .bin coefficients.
BenjaminTJohnson added a commit that referenced this pull request Aug 25, 2026
…ure/btj_REL-3.3.0

Brings in the develop merge (c618afa: PR #364 netCDF SpcCoeff sibling-load
fix and test_NLTE_Verification). Conflicts were the coefficient-tree pin
only: kept the local fix_REL-3.2.0.1 checksum and README path, added the
v3.1.5 release line from develop.
@BenjaminTJohnson BenjaminTJohnson mentioned this pull request Aug 26, 2026
25 tasks
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.

1 participant