Skip to content

Commit b663752

Browse files
committed
Merge branch 'wlin/lnd/nml_nbalance_err_tol' (PR #6651)
This enables namelist control for the balance_check_tolerance. The hardwired default of balance_check_tolerance is increased from 1e-8 to 1e-7 for C, N and P based on testing results from investigating a runtime failure due to grid and column nbalance errors exceeding specified threshold. [BFB] for tests never having nbalance issue [NML] no NML diff for tests as default is not set via nml.
2 parents 76d797e + 632faeb commit b663752

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

components/elm/bld/namelist_files/namelist_definition.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ If TRUE consider priority of plant to get a fraction of
139139
symbiotic N fixation and P phosphatase
140140
</entry>
141141

142+
<entry id="bgc_balance_check_tolerance" type="real" category="elm_physics"
143+
group="elm_inparm" valid_values="" >
144+
BGC balance check tolerance
145+
Default 1.0e-7 hardwired
146+
</entry>
147+
142148
<entry id="startdate_add_temperature" type="char*8" category="elm_physics"
143149
group="elm_inparm" valid_values="" >
144150
Set date for beginning of adding temperature to atmospheric forcing

components/elm/src/biogeochem/EcosystemBalanceCheckMod.F90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ module EcosystemBalanceCheckMod
4848
implicit none
4949
save
5050
private
51-
real(r8), parameter :: balance_check_tolerance = 1e-8_r8
51+
52+
! This corersponds to namelist variable bgc_balance_check_tolerance
53+
real(r8), public :: balance_check_tolerance = 1e-7_r8
54+
5255
!
5356
! !PUBLIC MEMBER FUNCTIONS:
5457
public :: BeginColCBalance
@@ -278,7 +281,7 @@ subroutine ColCBalanceCheck(bounds, &
278281
end if
279282

280283
! check for significant errors
281-
if (abs(col_errcb(c)) > 1e-8_r8) then
284+
if (abs(col_errcb(c)) > balance_check_tolerance) then
282285
err_found = .true.
283286
err_index = c
284287
end if
@@ -498,7 +501,7 @@ subroutine ColNBalanceCheck(bounds, &
498501
! here is '-' adjustment. It says that the adding to PF decomp n pools was less.
499502
end if
500503

501-
if (abs(col_errnb(c)) > 1e-8_r8) then
504+
if (abs(col_errnb(c)) > balance_check_tolerance) then
502505
err_found = .true.
503506
err_index = c
504507
end if
@@ -731,7 +734,7 @@ subroutine ColPBalanceCheck(bounds, &
731734
col_errpb(c) = (col_pinputs(c) - col_poutputs(c))*dt - &
732735
(col_endpb(c) - col_begpb(c))
733736

734-
if (abs(col_errpb(c)) > 1e-8_r8) then
737+
if (abs(col_errpb(c)) > balance_check_tolerance) then
735738
err_found = .true.
736739
err_index = c
737740
end if

components/elm/src/main/controlMod.F90

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module controlMod
5555
use elm_varctl , only: const_climate_hist
5656
use elm_varctl , only: use_top_solar_rad
5757
use elm_varctl , only: snow_shape, snicar_atm_type, use_dust_snow_internal_mixing
58+
use EcosystemBalanceCheckMod, only: bgc_balance_check_tolerance => balance_check_tolerance
5859

5960
!
6061
! !PUBLIC TYPES:
@@ -181,6 +182,10 @@ subroutine control_init( )
181182
namelist /elm_inparm/ &
182183
NFIX_PTASE_plant
183184

185+
! BGC balance check
186+
namelist /elm_inparm/ &
187+
bgc_balance_check_tolerance
188+
184189
! For experimental manipulations
185190
namelist /elm_inparm/ &
186191
startdate_add_temperature
@@ -325,7 +330,7 @@ subroutine control_init( )
325330

326331
namelist /elm_mosart/ &
327332
lnd_rof_coupling_nstep
328-
333+
329334
namelist /elm_inparm/ &
330335
snow_shape, snicar_atm_type, use_dust_snow_internal_mixing
331336

@@ -796,6 +801,7 @@ subroutine control_spmd()
796801
call mpi_bcast (forest_fert_exp, 1, MPI_LOGICAL, 0, mpicom, ier)
797802
call mpi_bcast (ECA_Pconst_RGspin, 1, MPI_LOGICAL, 0, mpicom, ier)
798803
call mpi_bcast (NFIX_PTASE_plant, 1, MPI_LOGICAL, 0, mpicom, ier)
804+
call mpi_bcast (bgc_balance_check_tolerance, 1, MPI_REAL8, 0, mpicom, ier)
799805
call mpi_bcast (use_pheno_flux_limiter, 1, MPI_LOGICAL, 0, mpicom, ier)
800806
call mpi_bcast (startdate_add_temperature, 1, MPI_CHARACTER, 0, mpicom, ier)
801807
call mpi_bcast (startdate_add_co2, 1, MPI_CHARACTER, 0, mpicom, ier)

0 commit comments

Comments
 (0)