NASA-LIS/LISF

Bug in soil moisture DA code

LIS-navari opened this issue · 0 comments

Bug Description

I found multiple bugs in this section of code.


Lines 361-461

1- ens_flag should be a 2-D vector; otherwise, we overwrite the value in each j loop (keeping only the values of the last layer, j=4).

2- First, we loop over the ensemble members to adjust for bound violation. If a bound violation occurs, we set ens_flag(m) = false. Next, we compute the total delta and divide it by 11 to obtain the delta for each ensemble, including those that have already been adjusted to the unperturbed value. However, when applying the delta, we check ens_flag(m) and subtract the delta only from the ensemble members with a true flag.
To ensure consistency, we should either:
a. Divide the delta by the number of ensembles that we did not set to the unperturbed values in the bound violation check.
b. Subtract that delta from all ensemble members.

Steps to Replicate

--assignee @LIS-navari