Commit a688afc
feat: Extend attribution module with q2 humidity support
Add multi-variable attribution capability following the same Shapley
decomposition framework used for T2. The q2 (2m specific humidity)
attribution uses latent heat flux (QE) and the scale factor gamma =
1/(rho*Lv) to decompose humidity differences into physical mechanisms.
New functions:
- attribute_q2(): Decompose q2 differences between two scenarios
- diagnose_q2(): Automatic anomaly detection for humidity
- attribute(): Generic dispatcher for T2/q2
- diagnose(): Generic dispatcher for T2/q2
- _cal_gamma_humidity(): Scale factor for latent heat
- _cal_r_eff_humidity(): Back-calculate moisture resistance
The design maximises code reuse - both T2 and q2 follow the same
flux-gradient physics pattern (X = X_ref + r * F * gamma).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 37a5ea7 commit a688afc
2 files changed
+485
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
0 commit comments