Skip to content

Commit

Permalink
Merge branch 'extra_precision_control' into release-clm5.0
Browse files Browse the repository at this point in the history
Add CN prec. control call to fix problems related to small neg. values

Small negative values (roughly roundoff-level different from zero) in
frootc (and possibly other quantities) were occasionally creating
problems with carbon isotope fluxes and FPI in the first time step of
the year, at the time of transient landcover change. This tag fixes the
problem by introducing an extra call to SoilBiogeochemPrecisionControl
in between computing the patch-level transient landcover fluxes and
moving these to column-level. In particular, this truncates small
negative values of decomp_cpools_vr_col to zero, which prevents the
previous blow-ups.

For most of the problematic fields, the explanation seems to be: frootc
can sometimes be negative; this is intentional. Negative frootc causes
negative dwt_frootc_to_litter if the patch in question is shrinking. The
resulting negative fluxes cause problems in the ciso calculation. This
can be worked around by inserting an extra precision control call
between the calculation of the dwt fluxes and the ciso fluxes, so that
small negative dwt fluxes are set to 0.

This does not necessarily fully explain the issue with FPI, but the
insertion of the extra precision control call fixes that issue, too.

For more details, see the discussion in
ESCOMP#741

Resolves ESCOMP#741
  • Loading branch information
billsacks committed Jul 30, 2019
2 parents 9b43e0d + 65963d7 commit b14a293
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/biogeochem/CNVegetationFacade.F90
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,13 @@ subroutine DynamicAreaConservation(this, bounds, clump_index, &
soilbiogeochem_nitrogenstate_inst)
call t_stopf('CNUpdateDynPatch')

! This call fixes issue #741 by performing precision control on decomp_cpools_vr_col
call t_startf('SoilBiogeochemPrecisionControl')
call SoilBiogeochemPrecisionControl(num_soilc_with_inactive, filter_soilc_with_inactive, &
soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, &
c14_soilbiogeochem_carbonstate_inst,soilbiogeochem_nitrogenstate_inst)
call t_stopf('SoilBiogeochemPrecisionControl')

call t_startf('dyn_cnbal_col')
call dyn_cnbal_col(bounds, clump_index, column_state_updater, &
soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, &
Expand Down

0 comments on commit b14a293

Please sign in to comment.