CLIMED Run 3 Multi-GCM regional-domain hotfix v3
Date: 2026-10-24

REPORTED FAILURE
 Step 1, after loading the first historical GCM:
 core.climate_median._crop_region: InputValidationError:
 'CMIP source does not cover the full CLIMED study area with an interpolation halo'.

ROOT CAUSE
 Previous hotfix v2 required source latitude/longitude centers one EXTRA full GCM cell
 beyond the CLIMED study bounding box, even after selecting the source cells that
 bracket the bbox. That wrongly rejects data subsets which do include all of India.
 Example from supplied MPI historical temperature NetCDF:
  lat centers 4.663150 to 38.237736; lon centers 65.625 to 99.375
 Existing CLIMED common-grid bbox:
  lat 6.754368 to 37.077611; lon 68.093477 to 97.411498
 The source covers the full study bbox, but cannot satisfy an additional
 full native-cell halo beyond the northern study boundary.

WHAT CHANGED (SINGLE FILE ONLY)
 app/core/climate_median.py
 1. Source cropping now retains the immediately bracketing native GCM points.
 2. The full study bbox must still be covered in both axes; missing coverage is
    rejected with an explicit source/bbox coordinate diagnostic.
 3. The combined reference grid retains interior native coordinates of the
    finest-resolution GCM and adds EXACT study bbox endpoints as interpolation
    nodes. This enables the existing 20-km saved CLIMED grid to be covered
    without adding a synthetic extrapolation halo.
 4. Version/cache fingerprint changed so the previous median cache is rebuilt.
 5. All original no-gap/no-extrapolation/no-member-dropping checks remain.

INSTALLATION
 Close CLIMED. Back up your current:
   D:\CliMed_Methods_Audit_Candidate_CodeOnly_2026-10-21\app\core\climate_median.py
 Replace ONLY that file with app/core/climate_median.py from the ZIP.
 No changes to the GUI, solver, SEI equations, gates, or common-grid file.
 Relaunch GUI with the same 3 historical folders. Run Step 1, then Step 2.
 Ensure the log says 'saved one combined input' before Step 2.

EXPECTED DIAGNOSTICS
 MULTI-GCM: source bracketing coverage lat=[...], lon=[...] ...
 MULTI-GCM: loaded ...
 MULTI-GCM: reference grid = ... (finest native climate grid)
 MULTI-GCM: saved one combined input ...combined_median_climate.nc

VALIDATION
 - Synthetic three-model regional India climate inputs with different native
   spatial grids (17 days) passed preprocessor, reload through original
   CLIMED loader, Step-2-style standardize_daily() and date-gap checks.
 - The previous cache was safely reusable if verified.
 - Truncating a model so it genuinely missed southern India was rejected.
 - Source MPI native-grid geographical extents were verified directly using
   the uploaded 2005-2014 NetCDF HDF5 coordinate arrays.
 - Full Windows GUI run and actual 3-model historical input folders could
   not be run here; no claim of operational production validation is made.

IF AN ERROR REMAINS
 Paste the new message with source coordinate ranges, or upload the model
 NetCDF files concerned. Do not change the CLIMED common-grid extent or
 replace missing values with zeros/nearest values.
