Skip to content

Commit 9b5e2c6

Browse files
Merge branch 'peterdschwartz/lnd/fix-vertp-precision' into next(PR #6649)
Variables that are r8 were initialized as single-precision, potentially causing inconsistent failures with the sums not adding to 1.0_r8. Also, fixed a syntax error in CH4Mod for spval. Fixes #6650 [BFB]
2 parents 74d9018 + dd108ac commit 9b5e2c6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

components/elm/src/biogeochem/CH4Mod.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ subroutine InitAllocate(this, bounds)
223223
! Allocate module variables and data structures
224224
!
225225
! !USES:
226-
use shr_infnan_mod, only: spval => shr_infnan_nan, assignment(=)
226+
use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=)
227227
use elm_varpar , only: nlevgrnd
228228
!
229229
! !ARGUMENTS:

components/elm/src/biogeochem/VerticalProfileMod.F90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ module VerticalProfileMod
2525
logical , public :: exponential_rooting_profile = .true.
2626
logical , public :: pftspecific_rootingprofile = .true.
2727
! how steep profile is for root C inputs (1/ e-folding depth) (1/m)
28-
real(r8), public :: rootprof_exp = 3.
28+
real(r8), public :: rootprof_exp = 3._r8
2929
! how steep profile is for surface components (1/ e_folding depth) (1/m)
30-
real(r8), public :: surfprof_exp = 10.
30+
real(r8), public :: surfprof_exp = 10._r8
3131
!-----------------------------------------------------------------------
3232

3333
contains
@@ -83,7 +83,7 @@ subroutine decomp_vertprofiles(bounds, &
8383
real(r8) :: ndep_prof_sum
8484
real(r8) :: nfixation_prof_sum
8585
real(r8) :: pdep_prof_sum
86-
real(r8) :: delta = 1.e-10
86+
real(r8) :: delta = 1.e-10_r8
8787
character(len=32) :: subname = 'decomp_vertprofiles'
8888
!-----------------------------------------------------------------------
8989

@@ -294,9 +294,9 @@ subroutine decomp_vertprofiles(bounds, &
294294
! check to make sure integral of all profiles = 1.
295295
do fc = 1,num_soilc
296296
c = filter_soilc(fc)
297-
ndep_prof_sum = 0.
298-
nfixation_prof_sum = 0.
299-
pdep_prof_sum = 0.
297+
ndep_prof_sum = 0._r8
298+
nfixation_prof_sum = 0._r8
299+
pdep_prof_sum = 0._r8
300300
do j = 1, nlevdecomp
301301
ndep_prof_sum = ndep_prof_sum + ndep_prof(c,j) * dzsoi_decomp(j)
302302
nfixation_prof_sum = nfixation_prof_sum + nfixation_prof(c,j) * dzsoi_decomp(j)
@@ -324,10 +324,10 @@ subroutine decomp_vertprofiles(bounds, &
324324

325325
do fp = 1,num_soilp
326326
p = filter_soilp(fp)
327-
froot_prof_sum = 0.
328-
croot_prof_sum = 0.
329-
leaf_prof_sum = 0.
330-
stem_prof_sum = 0.
327+
froot_prof_sum = 0._r8
328+
croot_prof_sum = 0._r8
329+
leaf_prof_sum = 0._r8
330+
stem_prof_sum = 0._r8
331331
do j = 1, nlevdecomp
332332
froot_prof_sum = froot_prof_sum + froot_prof(p,j) * dzsoi_decomp(j)
333333
croot_prof_sum = croot_prof_sum + croot_prof(p,j) * dzsoi_decomp(j)

0 commit comments

Comments
 (0)