Skip to content

Commit

Permalink
Fix Code Bug on CAPE Triggering Condition (#1904)
Browse files Browse the repository at this point in the history
TYPE: bug fix

KEYWORDS: CAPE, PLFC

SOURCE: Zhixiao Zhang (University of Oxford)

DESCRIPTION OF CHANGES:
Problem:
CAPE can't be updated

Solution:
Assign PLFC value before calculating CAPE because PLFC is the triggering condition for CAPE calculation.

ISSUE: Fixes #1903

LIST OF MODIFIED FILES: 
M     phys/module_diag_functions.F

TESTS:
The Jenkins tests are all passing.

RELEASE NOTE: Fixed triggering condition code bug for CAPE calculation.
  • Loading branch information
zhixiaozhang committed Dec 8, 2023
1 parent eaaa8bd commit 4c1b732
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions phys/module_diag_functions.F
Expand Up @@ -760,9 +760,10 @@ FUNCTION Buoyancy ( nz, tk, rh, p, hgt, sfc, cape, cin, zlfc, plfc, lidx, &
flag = .false.
END IF
END DO
IF (ellev >= 0) THEN !Modified by Zhixiao
pel = p(ellev) !Modified by Zhixiao
CIN=REAL ( 0 ) !Modified by Zhixiao
IF ((ellev >= 0) .and. (lfclev >= 0)) THEN !Modified by Zhixiao
plfc = p (lfclev)
pel = p (ellev)
CIN = REAL ( 0 )
DO k = sfc+1, nz
! Make CAPE and CIN consistent with AMS definition
! https://glossary.ametsoc.org/wiki/Convective_available_potential_energy
Expand Down

0 comments on commit 4c1b732

Please sign in to comment.