The excess water from infiltration is added to the direct_runoff (https://github.com/NOAA-OWP/cfe/blob/master/src/cfe.c#L181), however, excess water from percolation is added to the mass balance but not to the direct runoff (https://github.com/NOAA-OWP/cfe/blob/master/src/cfe.c#L208), which closes the mass balance locally but excess water does not contribute to GIUH runoff.
So my understanding is that if the mass balance is done outside the code as a post-processing, it may not close. Unless I am missing something...
Expected code change
In the block at https://github.com/NOAA-OWP/cfe/blob/master/src/cfe.c#L204, put the following line to add excess water to the direct runoff.
direct_output_runoff_m+=diff;
The excess water from infiltration is added to the direct_runoff (https://github.com/NOAA-OWP/cfe/blob/master/src/cfe.c#L181), however, excess water from percolation is added to the mass balance but not to the direct runoff (https://github.com/NOAA-OWP/cfe/blob/master/src/cfe.c#L208), which closes the mass balance locally but excess water does not contribute to GIUH runoff.
So my understanding is that if the mass balance is done outside the code as a post-processing, it may not close. Unless I am missing something...
Expected code change
In the block at https://github.com/NOAA-OWP/cfe/blob/master/src/cfe.c#L204, put the following line to add excess water to the direct runoff.
direct_output_runoff_m+=diff;