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

check energy timestep_init and run phases needs to set error variables. #159

Closed
nusbaume opened this issue Nov 20, 2024 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@nusbaume
Copy link
Collaborator

nusbaume commented Nov 20, 2024

Currently the check_energy_chng subroutines in the check_energy schemes here:

https://github.com/ESCOMP/atmospheric_physics/blob/main/schemes/check_energy/check_energy_chng.F90#L30

and here:

https://github.com/ESCOMP/atmospheric_physics/blob/main/schemes/check_energy/check_energy_chng.F90#L177

have errmsg and errflg variables that are intent(out), but which are not actually set to anything. This could potentially cause model crashes depending on the compiler configuration and error-checking method, so to be safe it would be good to at least set them to their default values, e.g.:

errflg = 0
errmsg = ''

I believe this change won't currently impact anything (it is more of a precaution), and thus could be brought in with any upcoming atmospheric_physics PR.

@nusbaume nusbaume added the bug Something isn't working label Nov 20, 2024
@nusbaume nusbaume changed the title check energy timestep_init phase needs to set error variables. check energy timestep_init and run phases needs to set error variables. Nov 20, 2024
@jimmielin
Copy link
Member

Thanks @nusbaume! I will fill the errflg and errmsg in the check_energy related subroutines. I missed some of these in the other schemes as well so I will fill throughout with the error message/flag arguments for the check_energy related schemes.

@jimmielin
Copy link
Member

I've made #160 and this could be brought in together with another PR to main. Thanks again for noticing this.

jimmielin added a commit that referenced this issue Nov 25, 2024
Originator(s): @jimmielin 

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):

Fixes #159. b4b changes to include errmsg, errflg in the check_energy
schemes

Describe any changes made to the namelist: N/A

List all files eliminated and why: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the
changes:
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)
```
Add errmsg, errflg (or set when not previously set) in check_energy schemes.

M       schemes/check_energy/check_energy_chng.F90
M       schemes/check_energy/check_energy_fix.F90
M       schemes/check_energy/check_energy_fix.meta
M       schemes/check_energy/check_energy_gmean/check_energy_gmean.F90
M       schemes/check_energy/check_energy_gmean/check_energy_gmean.meta
M       schemes/check_energy/check_energy_save_teout.F90
M       schemes/check_energy/check_energy_save_teout.meta
M       schemes/check_energy/check_energy_zero_fluxes.F90
M       schemes/check_energy/check_energy_zero_fluxes.meta
M       schemes/check_energy/dycore_energy_consistency_adjust.F90
M       schemes/check_energy/dycore_energy_consistency_adjust.meta
```

List any test failures: N/A

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? No
@jimmielin
Copy link
Member

Fixed in #160!

@github-project-automation github-project-automation bot moved this from To Do to Done in CAM Development Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants