Skip to content

Fix floating-point exception error in ShinHong PBL#18

Open
weiwangncar wants to merge 3 commits intoNCAR:mainfrom
weiwangncar:bug-fix-shpbl
Open

Fix floating-point exception error in ShinHong PBL#18
weiwangncar wants to merge 3 commits intoNCAR:mainfrom
weiwangncar:bug-fix-shpbl

Conversation

@weiwangncar
Copy link
Copy Markdown
Collaborator

Compilation with -D option on Derecho identified possible floating-point exception error in the ShinHong PBL module. This PR sets some limit to prevent this from happening.

@weiwangncar
Copy link
Copy Markdown
Collaborator Author

@dudhia @Songyou184 Can you review this PR?

Comment thread bl_shinhong.F90
Comment thread bl_shinhong.F90 Outdated
deltaz=0.5*(z(k+1)-z(k-1))
s2l=s2(k)
q2l=q2(k)
q2l=max(q2(k),0.01)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How was the lower bound of 0.01 chosen?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is just a small value typically used for tke which is what this is. There is a parameter called epsq2l=0.01 that probably should have been used instead.

@mgduda mgduda requested review from mgduda and removed request for mgduda May 5, 2026 16:11
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.

3 participants