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

MOSART: Use of uninitialized variable #5332

Closed
ambrad opened this issue Nov 29, 2022 · 2 comments · Fixed by #5343
Closed

MOSART: Use of uninitialized variable #5332

ambrad opened this issue Nov 29, 2022 · 2 comments · Fixed by #5343
Assignees

Comments

@ambrad
Copy link
Member

ambrad commented Nov 29, 2022

Here:

THeat%deltaM_t(iunit) = theDeltaT * (THeat%Ha_h2t(iunit)-cr_advectheat(Qsur + Qsub, THeat%Tt(iunit)))

Qsur and Qsub are used without being initialized. I'm guessing this routine isn't used in standard configurations.

@liho745
Copy link
Contributor

liho745 commented Dec 1, 2022

That line does a calculation that will not be used later, so it does not affect the physics even when MOSART-heat is turned on.

I've fixed this bug in a new branch created off the latest E3SM master branch: https://github.com/E3SM-Project/E3SM/tree/hongyili/mosart/mosart_heat_v3. I did a test global run and the simulated stream temperature seems reasonable.

@rljacob Is there any other test to be done before I issue a PR on this bug fix?

@rljacob
Copy link
Member

rljacob commented Dec 1, 2022

No go ahead.

bishtgautam added a commit that referenced this issue Dec 13, 2022
The use of uninitialized variables (i.e., `Qsur` and `Qsub`) in the computation of the change of energy
due to heat exchange with the environment and advection is fixed. Currently, it is assumed that those
changes in energy are zero.

Fixes #5332
[BFB]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants