Skip to content

Bug fix, if with .and. in argument#75

Merged
alex-huth merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
nikizadehgfdl:bugfix_if_with_and
Apr 20, 2026
Merged

Bug fix, if with .and. in argument#75
alex-huth merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
nikizadehgfdl:bugfix_if_with_and

Conversation

@nikizadehgfdl

Copy link
Copy Markdown
Contributor
  • bug found with debug mode run crash
  • if(A.and.B) A and B are evaluated in any order, so B cannot be dependent on A.

In " if (Sb_max_set .and. (Sbdry > Sb_max)) " Sb_max is not yet initialized when this is called for the first time,

- bug found with debug mode run crash
- if(A.and.B) A and B are evaluated in any order, so B cannot be dependent on A
  in this case B refers to a variable that is undefined unless A is true
  cause crash in debug mode
@nikizadehgfdl nikizadehgfdl requested a review from alex-huth April 15, 2026 19:16

@alex-huth alex-huth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for finding this bug. The fix looks correct (and mirrors what is done in the ice-shelf code).

@alex-huth alex-huth merged commit 3eabc01 into NOAA-GFDL:dev/gfdl Apr 20, 2026
1 check failed
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