diff --git a/sorc/ncep_post.fd/UPP_PHYSICS.f b/sorc/ncep_post.fd/UPP_PHYSICS.f index cc609aabf..cc6bd7c5e 100644 --- a/sorc/ncep_post.fd/UPP_PHYSICS.f +++ b/sorc/ncep_post.fd/UPP_PHYSICS.f @@ -998,6 +998,7 @@ END SUBROUTINE CALCAPE !> 2015-??-?? | S Moorthi | Optimization and threading !> 2021-09-03 | J Meng | Modified to add 0-3km CAPE/CINS, LFC, effective helicity, downdraft CAPE, dendritic growth layer depth, ESP !> 2021-09-01 | E Colon | Equivalent level height index for RTMA +!> 2022-08-27 | S Trahan | Fixed bug in CALCAPE2 where extreme atmospheric conditions cause an out-of-bounds access !> !> @author Russ Treadon W/NP2 @date 1993-02-10 SUBROUTINE CALCAPE2(ITYPE,DPBND,P1D,T1D,Q1D,L1D, & @@ -1399,6 +1400,10 @@ SUBROUTINE CALCAPE2(ITYPE,DPBND,P1D,T1D,Q1D,L1D, & ENDDO ENDDO ! +!Ensure later calculations do not access LM+1 +! + LEND=MIN(LEND,LM-1) +! !reverse L order from bottom up for ESRH calculation ! ESRHH = LCL