New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fix deltacc bug #776
Conversation
…n from blowing up
…t_brent not converging
Looks good to me : @jhamman - another pair of eyes may be useful. Feel free to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small comment to move the hard coded literal out of vic_run.
@@ -105,6 +109,7 @@ SnowPackEnergyBalance(double TSurf, | |||
intercepted snow (kg/m2s) */ | |||
double BlowingMassFlux; /* Mass flux of water vapor from blowing snow. (kg/m2s) */ | |||
double SurfaceMassFlux; /* Mass flux of water vapor from pack snow. (kg/m2s) */ | |||
double epsilon_snow = 1.e-8; /* Snow depth below which we ignore the ground flux from the snowpack */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a parameter in the parameters structure.
@jhamman - I've updated this to add the snow depth threshold as a parameter rather than a hard coded literal. Ready for another review |
This PR fixes the issue described in #775. In addition to what is described there, the unreasonable
deltaCC
values were a result of incorrect values for the ground flux out of the snowpack, which is subtracted from thedeltaCC
term. Calculating the ground flux out of the snowpack depends on snow density (squared) and snow depth, and extremely large values for snow density were occurring for certain grid cells at certain time steps in the RASM domain. This was fixed by a) implementing a cap on the new snow density calculated by the Hedstrom and Pomeroy 1998 equation, and b) disregarding the ground flux out of the snowpack if snow depth is below a certain threshold (1.e-8
). A new parameter,SNOW_NEW_SNOW_DENS_MAX
, was added to the parameters struct to cap snow density.