You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The i.evapo.mh module incorrectly converts net radiation from W/m²/day to MJ/m²/day using the formula:
ra = ra * (24.0 * 60.0 * 60.0 / 1000.0); /* convert W -> MJ/d */ (Line 16 in mh_original.c)
This multiplies by 86.4, which actually converts W/m²/day to kJ/m²/day, not MJ/m²/day.
However, the module then applies the constant 0.408, which assumes radiation is in MJ/m²/day (Line 17 in mh_original.c). This inconsistency results in a ~1000× overestimation of evapotranspiration (ET), violating the physical energy balance. The comment in the code is also misleading, stating it converts to MJ/d when it does not.
To reproduce
Run the following commands: r.mapcalc "netrad = 100" r.mapcalc "avg_temp = 20" r.mapcalc "min_temp = 10" r.mapcalc "max_temp = 30"
With:
Ra = 100 W/m²/day
Ra in MJ = 100 × 0.0864 = 8.64 MJ/m²/day
ET = 1.370593 (0.0023 * 0.408 * 8.64 * ((10+30/2)+ 17.8) * pow((30-10), 0.5)))
Screenshots
System description
Operating System: Windows Subsystem for Linux (WSL)
GRASS GIS version: 8.4
details about further software components
version=8.5.0dev
python version=3.10.12
Additional context
I wrote a test to compare output ET from i.evapo.mh to a theoretical radiation-limited maximum using the formula in the cited paper. The module regularly exceeds this threshold by thousands of mm/day. Upon reviewing the C code, the unit mismatch became evident. I found the same error in the modified formula of Hargreaves approach in mh_samani.c file.
I would be happy to help prepare a patch.
The text was updated successfully, but these errors were encountered:
The
i.evapo.mh module
incorrectly converts net radiation from W/m²/day to MJ/m²/day using the formula:This multiplies by 86.4, which actually converts W/m²/day to kJ/m²/day, not MJ/m²/day.
However, the module then applies the constant 0.408, which assumes radiation is in MJ/m²/day (Line 17 in mh_original.c). This inconsistency results in a ~1000× overestimation of evapotranspiration (ET), violating the physical energy balance. The comment in the code is also misleading, stating it converts to MJ/d when it does not.
To reproduce
Run the following commands:
r.mapcalc "netrad = 100"
r.mapcalc "avg_temp = 20"
r.mapcalc "min_temp = 10"
r.mapcalc "max_temp = 30"
i.evapo.mh -h \ netradiation_diurnal=netrad \ average_temperature=avg_temp \ minimum_temperature=min_temp \ maximum_temperature=max_temp \ output=i_evapo_mh_output
r.univar -g map=i_evapo_mh_output
Observed Output:
mean=1370.593094
Expected behavior
With:
Ra = 100 W/m²/day
Ra in MJ = 100 × 0.0864 = 8.64 MJ/m²/day
ET = 1.370593 (0.0023 * 0.408 * 8.64 * ((10+30/2)+ 17.8) * pow((30-10), 0.5)))
Screenshots
System description
Operating System: Windows Subsystem for Linux (WSL)
GRASS GIS version: 8.4
details about further software components
Additional context
I wrote a test to compare output ET from i.evapo.mh to a theoretical radiation-limited maximum using the formula in the cited paper. The module regularly exceeds this threshold by thousands of mm/day. Upon reviewing the C code, the unit mismatch became evident. I found the same error in the modified formula of Hargreaves approach in mh_samani.c file.
I would be happy to help prepare a patch.
The text was updated successfully, but these errors were encountered: