From 287060d0529120717cfc5077138ad262df2a5c84 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 19 Jul 2019 15:05:33 -0600 Subject: [PATCH] Fix negative values generated during BGC DynamicAreaConservation When running a transient case with C isotopes, people occasionally ran into a problem whereby C13_HR, C13_NBP, FPI values result in numeric conversion not representable error. At least part of the problem can be explained as: 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. For more details, see https://github.com/ESCOMP/ctsm/issues/741 Resolves ESCOMP/ctsm#741 --- src/biogeochem/CNVegetationFacade.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index fed7889819..c3b42209f9 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -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, &