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

Out-of-bounds access in CALCAPE2 during extreme atmospheric conditions #556

Closed
SamuelTrahanNOAA opened this issue Aug 26, 2022 · 0 comments · Fixed by #555
Closed

Out-of-bounds access in CALCAPE2 during extreme atmospheric conditions #556

SamuelTrahanNOAA opened this issue Aug 26, 2022 · 0 comments · Fixed by #555
Assignees
Labels
bug Something isn't working RRFS

Comments

@SamuelTrahanNOAA
Copy link
Contributor

When the LCL is above the model top, CALCAPE2 will access beyond the bounds of the TPAR array. This happened in an RRFS run by @EricJames-NOAA and it might be the cause of sporadic failures seen in other RRFS workflows.

1411:   DO L=LEND,LBEG,-1
   ...
1457:      ESATP2  = min(FPVSNEW(TPAR(I,J,L+1)),PRESK2)
   ...
1481:   ENDDO

The fix (#555) is to apply bounds to the LEND index:

!                                                                                                                                                                                                                                            
!Ensure later calculations do not access LM+1                                                                                                                                                                                                
!                                                                                                                                                                                                                                            
      LEND=MIN(LEND,LM-1)
@WenMeng-NOAA WenMeng-NOAA added bug Something isn't working RRFS labels Aug 26, 2022
EricJames-NOAA pushed a commit to EricJames-NOAA/UPP that referenced this issue Oct 18, 2023
This fixed a bug in RRFS_A for using FVCOM.

Co-authored-by: ming hu <ming.hu@dlogin05.dogwood.wcoss2.ncep.noaa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working RRFS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants