Skip to content

Commit

Permalink
Merge pull request #26 from PALEOtoolkit/river_fluxes
Browse files Browse the repository at this point in the history
Add option to control treatment of DIC in riverine fluxes
  • Loading branch information
sjdaines authored Aug 23, 2023
2 parents cff2c50 + d4be7ab commit ff4a721
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
19 changes: 16 additions & 3 deletions src/landsurface/LandBergman2004.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ Base.@kwdef mutable struct ReactionLandBergman2004{P} <: PB.AbstractReaction
# Organic carbon burial
PB.ParString("f_locb", "original", allowed_values=["original", "Prescribed"]),

# Treatment of DIC in riverine / atmosphere fluxes
PB.ParBool("dic_runoff", true,
description="true to add additional DIC runoff terms to riverine (and atmosphere) fluxes so riverine DIC ~ TAlk, "*
"false to just use riverine DIC = 'carbw'"),

PB.ParType(PB.AbstractData, "CIsotope", PB.ScalarData,
external=true,
allowed_values=PB.IsotopeTypes,
Expand Down Expand Up @@ -303,18 +308,26 @@ function do_land_bergman2004(

carbw_isotope = @PB.isotope_totaldelta(Cisotopetype, D.carbw[], D.C_delta[])

DICrunoff = @PB.isotope_totaldelta(Cisotopetype, D.carbw[] + 2*D.silw[], D.CO2_delta[] + D.eps_eqbw[])


# fluxes
#########################################################################

# Atmospheric fluxes
fluxAtoLand.CO2[] += DICrunoff - oxidw_isotope + locb_isotope
fluxAtoLand.CO2[] += - oxidw_isotope + locb_isotope

fluxAtoLand.O2[] += D.oxidw[] + 2*D.pyrw[] - D.locb[]

# Riverine fluxes
fluxRtoOcean.DIC[] += DICrunoff + carbw_isotope
fluxRtoOcean.DIC[] += carbw_isotope

if pars.dic_runoff[]
# DIC isotopes - need to take account of atmosphere-water fractionation
# (not critical to get this right, as there is a 'short circuit' atm <-> river -> ocean <-> atm)
DICrunoff = @PB.isotope_totaldelta(Cisotopetype, D.carbw[] + 2*D.silw[], D.CO2_delta[] + D.eps_eqbw[])
fluxAtoLand.CO2[] += DICrunoff
fluxRtoOcean.DIC[] += DICrunoff
end

fluxRtoOcean.TAlk[] += 2*D.silw[] + 2*D.carbw[]

Expand Down
21 changes: 16 additions & 5 deletions src/landsurface/LandCOPSEReloaded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ Base.@kwdef mutable struct ReactionLandWeatheringFluxes{P} <: PB.AbstractReactio
PB.ParDouble("CPland0", 1000.0, units="",
description="present-day C/P land burial"),

# Treatment of DIC in riverine fluxes
PB.ParBool("dic_runoff", true,
description="true to add additional DIC runoff terms to riverine (and atmosphere) fluxes so riverine DIC ~ TAlk, "*
"false to just use riverine DIC = 'carbw'"),

# Isotopes
PB.ParType(PB.AbstractData, "CIsotope", PB.ScalarData,
external=true,
Expand Down Expand Up @@ -810,20 +815,26 @@ function do_land_weathering_fluxes(

carbw_isotope = @PB.isotope_totaldelta(CIsotopeType, D.carbw[], D.C_delta[])

# DIC isotopes - need to take account of atmosphere-water fractionation
# (not critical to get this right, as there is a 'short circuit' atm <-> river -> ocean <-> atm)
DICrunoff = @PB.isotope_totaldelta(CIsotopeType, D.carbw[] + 2*D.silw[], D.CO2_delta[] + D.D_eqbw_CO2[])


# fluxes
#########################################################################

# Atmospheric fluxes
fluxAtoLand.CO2[] += DICrunoff - oxidw_isotope + locb_isotope
fluxAtoLand.CO2[] += - oxidw_isotope + locb_isotope

fluxAtoLand.O2[] += D.oxidw[] + 2*D.pyrw[] - D.locb[]

# Riverine fluxes
fluxRtoOcean.DIC[] += DICrunoff + carbw_isotope
fluxRtoOcean.DIC[] += carbw_isotope

if pars.dic_runoff[]
# DIC isotopes - need to take account of atmosphere-water fractionation
# (not critical to get this right, as there is a 'short circuit' atm <-> river -> ocean <-> atm)
DICrunoff = @PB.isotope_totaldelta(CIsotopeType, D.carbw[] + 2*D.silw[], D.CO2_delta[] + D.D_eqbw_CO2[])
fluxAtoLand.CO2[] += DICrunoff
fluxRtoOcean.DIC[] += DICrunoff
end

fluxRtoOcean.TAlk[] += 2*D.silw[] + 2*D.carbw[]
if pars.SRedoxAlk[]
Expand Down

0 comments on commit ff4a721

Please sign in to comment.