Skip to content
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

Fix for segfault on reference to mw_exp when using JRDN snow layering #445

Merged
merged 2 commits into from
Jan 12, 2021

Conversation

arbennett
Copy link
Member

@arbennett arbennett commented Jan 11, 2021

Occasionally, when using JRDN snow layering I have run into segfaults on reference to mw_exp (only when doing scalar solutions) in the line:

iLayerLiqFluxSnow(iLayer)      = k_snow*relSaturn**mw_exp

after some debugging it turns out this loss of access to mw_exp occurs directly following the pack statement:

ixLayerDesired = pack(ixLayerState, ixSnowOnlyHyd/=integerMissing)

I have not been able to determine the exact reason for this error, but have developed a workaround, which is provided in this PR.

Solves #446

! This implementation can result in a segfault when using JRDN layering.
! The segfault occurs when trying to access `mw_exp` in:
! iLayerLiqFluxSnow(iLayer) = k_snow*relSaturn**mw_exp
! Debugging found that the `pack` statement cased `mw_exp` to no longer be accessible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix type 'cased' --> 'caused'

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants