Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/bmi_lgar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ Update()
AET_subtimestep_cm = 0.0;
volstart_subtimestep_cm = 0.0;
volin_subtimestep_cm = 0.0;
volon_subtimestep_cm = 0.0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking if the mass balance issue due to the garbage surface water, is not directly caused by volon_subtimestep_cm initialization. As it gets updated at the following lines:

volon_subtimestep_cm = ponded_depth_subtimestep_cm;

volon_subtimestep_cm = ponded_depth_subtimestep_cm;

volon_subtimestep_cm = ponded_depth_max_cm;

Austin confirmed that ponded_depth_max is set to 0.0 in the config file. So let's look at the first two.
The ponded_depth_subtimestep_cm is calculated at line using precip_subtimestep_cm_per_h and then at line using volon_timestep_cm.

My point is maybe the volon_timestep_cm is the culprit and not volon_subtimestep_cm. If not then, probably the problem is in the function lgar_create_surficial_front which updates ponded_depth_subtimstep

If I am not clear, let's chat about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct that it gets initialized on those lines, but ALL of those are nested under this conditional

if (!state->lgar_mass_balance.cache_fluxes)

When flux caching is enabled, this block of code executes instead and the variable in question is truly uninitialized when used in the local_mb calculation.

volrunoff_subtimestep_cm = 0.0;
volrech_subtimestep_cm = 0.0;
surface_runoff_subtimestep_cm = 0.0;
Expand Down
Loading