Skip to content

Commit 2191c75

Browse files
committed
bugfix: nested if-condition
Otherwise, debug-execution yielded ``` Caught signal 8 (Floating point exception: floating-point invalid operation) ```
1 parent c143e2c commit 2191c75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/clm5/biogeochem/ch4Mod.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,12 +2473,14 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, &
24732473
end if
24742474

24752475
! If switched on, use pH factor for production based on spatial pH data defined in surface data.
2476-
if (.not. lake .and. usephfact .and. pH(c) > pHmin .and.pH(c) < pHmax) then
2476+
if (.not. lake .and. usephfact) then
2477+
if (pH(c) > pHmin .and.pH(c) < pHmax) then
24772478
pH_fact_ch4 = 10._r8**(-0.2235_r8*pH(c)*pH(c) + 2.7727_r8*pH(c) - 8.6_r8)
24782479
! fitted function using data from Dunfield et al. 1993
24792480
! Strictly less than one, with optimum at 6.5
24802481
! From Lei Meng
24812482
f_ch4_adj = f_ch4_adj * pH_fact_ch4
2483+
end if
24822484
else
24832485
! if no data, then no pH effects
24842486
end if

0 commit comments

Comments
 (0)