Added optional Richardson-number screening for Bulk-Residual via stability_method = "ri_guard".
The Richardson guard attaches bulk_Ri_g and bulk_stability attributes and returns NA for invalid, weak-shear or very stable profile cases.
The default Bulk-Residual behaviour remains the neutral, unguarded estimate with stability_method = "none".
Energy-balance closure diagnostics
Added energy_balance_closure() to inspect how existing heat-flux output fields relate to available energy, rad_bal - soil_flux.
For paired sensible/latent heat methods, the diagnostic reports closure_residual = rad_bal - soil_flux - sensible - latent and closure_ratio = (sensible + latent) / (rad_bal - soil_flux).
For Penman, the diagnostic reports unresolved_complement = rad_bal - soil_flux - latent_penman; this complement is not a paired sensible heat flux.
Monin-Obukhov/Profile residuals are reported as diagnostic differences and are not treated as automatic errors or forced to close the balance.
Added plot_energy_balance_closure() to plot diagnostic residuals, Penman unresolved complements and closure ratios. Formal closure is not presented as physical validation.
Clarified Bulk-Residual documentation: the sensible-heat estimate may use mean-wind, profile-derived friction velocity, or roughness-derived friction velocity, while latent heat remains a residual closure term.
Penman latent heat
Corrected the Penman vapour-pressure-deficit term by converting saturation and actual vapour pressure from hPa to kPa before use.
This fixes a unit mismatch in latent_penman() and can substantially change Penman latent-heat estimates.
Aerodynamic-resistance handling in latent_penman() is now elementwise; invalid log arguments, invalid wind and non-finite aerodynamic states return NA with a warning.
latent_penman.weather_station() now uses hum1 when available and falls back to rh; missing humidity input produces an explicit failure instead of an unclear downstream error.
Bowen ratio
Sensible and latent Bowen paths now use the same guarded denominator logic for 1 + beta.
Finite, uncapped Bowen cases still close the available energy rad_bal - soil_flux.
Non-finite Bowen ratios or non-finite denominators now return NA elementwise with warnings.
Near-singular capped cases are treated as guarded outputs and are not interpreted as exact energy-balance closure.
The exported Bowen implementation remains the documented fieldClim beta path based on gamma_code * dpot / dah.
Monin-Obukhov / Profile
Corrected sensible_monin() to use the documented vertical gradient denominator z2 - z1 instead of log(z2 - z1).
sensible_monin() and latent_monin() now return controlled values for critical profile cases: zero temperature gradient gives zero sensible heat flux, and zero moisture gradient gives zero latent heat flux.
Invalid heights, invalid wind input, weak shear and non-finite profile states return NA with warnings.
Monin-Obukhov/Profile outputs remain profile-based estimates. They are not forced to close rad_bal - soil_flux.
Priestley-Taylor
Priestley-Taylor sensible and latent heat formulas remain unchanged.
Warning checks were made more robust for vectors containing NA.
Documentation now clarifies the package implementation and sign convention for Priestley-Taylor outputs.
Removed/disabled weather-station missing-data completion behavior from the package API. fieldClim no longer creates replacement time-series columns or performs internal gap treatment.
inspect_weather_station_inputs() remains as a read-only inspection and quality-control helper. It reports missingness, gap runs, variable classes, selected QC flags and heat-flux method input availability.
Missing-data treatment must be performed outside fieldClim with documented provenance; package heat-flux methods continue to require their actual measured/input fields.
Documentation
Roxygen documentation was updated for formulas, units, sign conventions, examples, source references and guard behaviour.
The documentation now separates energy-balance-closing methods from profile-based estimates and latent-heat-only paths.
Help pages and vignettes document the method-family context and package implementation choices. Remaining scientific validation should be added through benchmark datasets, published numerical examples and explicit table-value audits where needed.
Tests
Added method equation-contract tests for radiation balance, soil heat flux, Priestley-Taylor, Bulk-Residual, Bowen, Penman and Monin-Obukhov/Profile equations.
Added helper equation-contract tests for documented humidity, pressure, temperature, boundary-layer and turbulent-flux helper equations.
Added weather_station API parity tests for direct calls versus weather_station methods.
Added workflow tests for turb_flux_calc() including pt_only, full workflow output, Penman fallback and Bulk-Residual Richardson-guard pass-through.