Reinitialisation
- LevelSetReinitWRFFire
model
wildland_fire
fire_behavior
The level-set REINITIALISATION equation of NCAR fire_behavior (physics/level_set_mod.F90 Reinit_level_set / Advance_ls_reinit; Sussman, Smereka and Osher 1994 as adapted by Munoz-Esparza et al. 2018), written as the PDE d psi / d tau = S(psi_0) (1 - |grad psi|) on cartesian_uniform_2d and lowered by the EarthSciDiscretizations rule each test imports. WHAT THIS IS AND IS NOT. It is NOT part of d psi/dt: the fire model propagates the level set, then re-signs it in a pseudo-time loop between the propagation and the ignition-time update, so the instantaneous tendency that couplings/wildlandfire_behavior.esm exposes is untouched by anything here. What it is, is the operator that keeps psi close to a signed distance function, which matters for two reasons: the WENO5/ENO1 band test of the PROPAGATION scheme is written on |psi| itself, so a psi that drifts away from a distance function silently changes which discretisation each cell gets; and a long .esm integration that omits it will diverge from WRF's for that reason even though every instantaneous tendency agrees. ACCEPTANCE: this component's own pseudo-time tendency is verified against the Fortran; it makes no claim about d psi/dt. THE SIGN IS FROZEN. S(psi_0) = psi_0 / sqrt(psi_0^2 + dx^2) is formed ONCE per reinitialisation from the field the propagation left (fire_behavior's lfn_s0, from lfn_out) and reused by all three Runge-Kutta stages, so psi_ref is a separate input from psi and is NOT psi at stages 2 and 3. The stage-2 test is what proves the component keeps it frozen. It is also the upwind selector: the hybrid WENO5/ENO1 derivative picks its side from S(psi_0) (d4 psi/dx), not from the wind-relative sign the propagation uses, which is why this component imports the rule weno5_eno1_signed_norm_D2_extrapolate_bc and supplies the free name upwind_sign rather than wind_u/wind_v. UNITS, stated because they are odd and the oddity is the reference code's: the reinitialisation's pseudo-time step is dt_s = reinit_pseudot_coef * dx, which is a LENGTH, and the tendency S (1 - |grad psi|) is DIMENSIONLESS, so the update lfn_fin = lfn_ini + dt_s * rk_coeff * tend_r is metres + metres and is consistent -- but the quantity fire_behavior calls a time step is a length and what it calls a tendency has no units. tau_step and dpsi_dtau are declared accordingly rather than being given a fictitious second. HOW MUCH IT MOVES psi, measured rather than assumed: at the coefficient both shipped namelists set (reinit_pseudot_coef = 0.0001, against the namelist_mod default of 0.01) one reinitialisation of one WRF step changes psi by at most 5.7 mm and on average 0.14 mm, i.e. 2.3e-4 of the 25 m cell, while rms(|grad psi| - 1) over the domain is 0.177. So on test7 the reinitialisation is very nearly inert, and the 100x larger namelist default -- what a user who does not copy test7's namelist gets -- would make it 0.57 m per step, 2.3 % of a cell. Not transcribed: Reinit_level_set's outer loop (fire_lsm_reinit_iter Runge-Kutta iterations, default 1), its final `lfn_out = min(lfn_s3, lfn_in)` clamp ("fire area can only increase"), and Reinit_level_set_fast_dist (the fast-sweeping option, fast_dist_reinit_opt). Reference: fire_behavior develop @ eb77580, instrumented fork ctessum-claude/fire_behavior@66a800e, real32, rel 1e-5. TOLERANCE ON dpsi_dtau, measured not guessed: the tendency is S (1 - |grad psi|), and near the front |grad psi| is within a few 1e-3 of 1, so the subtraction loses about 2.5 decimal digits to cancellation out of real32's 7. The floor is therefore an ABSOLUTE 2e-7 alongside the relative 2e-5, which is roughly three ulps of the dumped grad_mag: at (18,64), 1 - grad = 3.879e-3 with eps32(grad) = 5.96e-8, giving |S| eps32 = 1.9e-8 against an observed residual of 3.2e-8, and at (20,66) 4.2e-8 against 7.0e-8 -- a couple of ulps in both cases, i.e. the reference's own precision and not a transcription difference. Where there is no cancellation the relative tolerance still governs: at (17,57) the tendency is -1.71 and 2e-7 is 1.2e-7 relative, far tighter than 2e-5, so the floor never makes an assertion vacuous.