Closed juliasloan25 closed 1 year ago
@LenkaNovak @kmdeck tagging for visibility
@simonbyrne Does this potential explanation of the bug make sense to you? Are we meant to apply DSS to both the prognostic variables and aux/cache state?
The requirement is that any tendencies are continuous: that is, at any two colocated points, you get the same result.
For horizontal tendencies, we do this by calling DSS, for vertical tendencies and sources we do this by ensuring all inputs are continuous (so the result will also be).
If you're filling a field with random values, there is no guarantee of continuity, so any tendency computed from this may not be. So I would suggest DSS-ing the field after calling rand
to ensure it is continuous.
Closing because we don't actually need to implement this
We're seeing problems with water conservation in the coupler when snow is included in a simulation. We see that water is conserved when input evaporation is a uniform field, but large errors arise when evaporation varies randomly across space. In the land model, DSS is currently applied to the prognostic variables, but not to the auxiliary state
p
. We think that the incorrect water content calculations may be due to this lack of DSS.Part of #404
Update: As of 9/19/23, we think the water conservation errors arose because
dss
is being applied to the state vector via thestep!
call, but it is never applied to the change in water content on the RHS (diff_PE
below). If we modify the MWE to calldss!(diff_PE)
just before the test comparison, we see similarly small errors to those in the uniform case:(-2.842170943040401e-14, 5.684341886080802e-14)
. Note that these extrema values are identical whether we calldss!(diff_PE)
before or afterstep!
.MWE
Script:
Alternative solutions