Skip to content

Conversation

@alperaltuntas
Copy link
Member

Otherwise, associated(Lam2) may be checked before present(Lam2), which may lead to sigsegv.

This behavior was discovered while testing ESCOMP/MOM_interface#298

Testing: aux_mom.b4b

…t_Bodner

Otherwise, associated(Lam2) may be checked before present(Lam2), which may lead to sigsegv.
@alperaltuntas alperaltuntas self-assigned this Oct 21, 2025
@alperaltuntas alperaltuntas changed the title Prevent short-circuiting in Lam2 available check in mixedlayer_restart_Bodner Ensure short-circuiting in Lam2 available check in mixedlayer_restart_Bodner Oct 21, 2025
Copy link
Collaborator

@mnlevy1981 mnlevy1981 left a comment

Choose a reason for hiding this comment

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

One minor recommendation, but this looks great.

logical :: line_is_empty, keep_going
integer, dimension(2) :: EOSdom ! The i-computational domain for the equation of state
integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
logical :: lam2_available = .false.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see anything about this in the style guide, but if you are going to initialize lam2_available I think you want to do it below rather than in the variable declaration to avoid implicitly save-ing it. Maybe just set it to .false. in the else block for the if (CS%wave_enhanced_ustar) then you modify below?

Copy link
Collaborator

@mnlevy1981 mnlevy1981 left a comment

Choose a reason for hiding this comment

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

Looks great!

@alperaltuntas alperaltuntas merged commit b7bd692 into NCAR:dev/ncar Oct 24, 2025
52 checks passed
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