aircraft & downwelling RT support, surface-reflectance derivation, and clear-sky bookkeeping fixes #276
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends CRTM forward, tangent-linear, adjoint, and K-matrix functionality to support radiative transfer at aircraft pressure levels and user-defined downwelling-radiance pressure levels. It also hardens cloud-fraction handling, improves clear-sky output consistency, integrates optional surface-reflectance derivation across all solution paths, and fixes several scattering and surface-optics edge cases for improved physical and numerical robustness. :contentReference[oaicite:0]{index=0}
Key changes
1. Aircraft-pressure and downwelling-radiance support
AIRCRAFT_PRESSURE_THRESHOLDand consistent handling of:Opt%Aircraft_Pressure(aircraft RT)Opt%Obs_4_downward_P(downwelling radiance at a pressure level; surface if zero)CRTM_Get_PressureLevelIdxto select the closest profile level.2. Clear-sky and fractional-cloud bookkeeping
RTV_Clear%n_StokesfollowsOpt%n_Stokesoverrides.Solar_Flag_truetoRTV_Clearfor fractionally cloudy atmospheres.Tb_clearandR_clearequal toBrightness_TemperatureandRadiancewhen:Atm%n_Clouds == 0, or< MIN_COVERAGE_THRESHOLD(note: this is not aerosol-cleared output).
3. Small cloud-fraction hardening
Cloud_Fraction < MIN_COVERAGE_THRESHOLD:4. Surface reflectance derivation hook
ADA_Module::CRTM_SurfRefinto FWD/TL/AD/K-matrix solutions.Options_Presentopt%Derive_Surface_Refl == .TRUE.mth_Azi == 0COS_SUN > 05. Scattering and surface-optics correctness fixes
Is_Active_SensorandInclude_Scattering.SfcOptics_KandSfcOptics_Clear_KtrackUse_New_MWSSEMconsistently with the forward path.SfcOptics/SfcOptics_Kn_Stokesconsistency after option overrides.Rationale
These changes enable aircraft- and profile-level downwelling RT use cases, eliminate ambiguous behavior for near-zero cloud fractions, and make clear-sky outputs explicit and reliable. The surface-reflectance and scattering fixes address long-standing edge cases that affected TL/AD/K-matrix consistency.
Notes