Skip to content

Commit

Permalink
Fix negative values generated during BGC DynamicAreaConservation
Browse files Browse the repository at this point in the history
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 ESCOMP#741

Resolves ESCOMP#741
  • Loading branch information
olyson authored and billsacks committed Jul 19, 2019
1 parent 20b69a3 commit 77a2298
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 77a2298

Please sign in to comment.