The time_step_size_s parameter is used to set the BMI model time step, which is used in Update_until to determine how many Update steps to call. If this parameter isn't provided in the configuration, it is left uninitialized and leads to undefined behavior. For example, if the compiler assigns 0 for the uninitialized variable, then in Update_until there is a divide by 0, which can cause a crash, or worse, can make n_steps become inf (again, this is undefined behavior...) which causes an infinite loop.
This either needs to be a required parameter and validated to not be 0, or an optional value (also validated to not be 0) and a non-zero default assigned during initialization.
https://github.com/NOAA-OWP/evapotranspiration/blob/80c1ab9189e6a9c131cea72b4e22b41bb9a5f177/src/bmi_pet.c#L768
The
time_step_size_s
parameter is used to set the BMI model time step, which is used inUpdate_until
to determine how manyUpdate
steps to call. If this parameter isn't provided in the configuration, it is left uninitialized and leads to undefined behavior. For example, if the compiler assigns 0 for the uninitialized variable, then inUpdate_until
there is a divide by 0, which can cause a crash, or worse, can maken_steps
becomeinf
(again, this is undefined behavior...) which causes an infinite loop.This either needs to be a required parameter and validated to not be 0, or an optional value (also validated to not be 0) and a non-zero default assigned during initialization.