SURF-Torch v1.0: a differentiable PyTorch implementation of the OpenIFS land-surface physics
Abstract. Land-surface schemes are mature in process content but are written in Fortran, confining parameter and sensitivity studies to ensembles of independent integrations. We present a differentiable PyTorch implementation of the complete OpenIFS land-surface physics that preserves the tiled process ordering of the Fortran reference and keeps every conditional regime switch unsmoothed, so the differentiated operator is the verified one. It matches the reference at every duration tested: a 30-day controlled integration of the 97,709-column ends at surface-temperature and snow-water-equivalent RMSE of 6.90×10−6 K and 1.05×10−6 kg m−2, a one-year autonomous integration holds terminal relative errors below 5.1×10−3 %, and ten successively restarted years (2009–2018) show no error growth; CUDA-graph execution on an NVIDIA A100 sustains a 3.8-fold speed-up over the 32-thread Fortran reference. Against independent Terra MODIS observations, the configuration reproduces nighttime land surface temperature (bias 0.66 K) but carries a −6.4 K daytime cold bias. Decomposing this bias with reverse-mode derivatives verified against finite differences to 4×10−4, we find that eight global parameter scales explain at most 0.5 K of it, that the remainder is a structural 8.1 K peak-to-peak deficit of near-surface diurnal amplitude, and that a two-timescale surface-layer closure designed from this diagnosis and verified in state space removes 67–84 % of the bias (calibration to held-out) in every month of the year and ports back to the Fortran driver without re-tuning. These results show how a differentiable land surface moves evaluation beyond numerical fidelity to observation-constrained process improvement.