Skip to content

Commit

Permalink
Merge pull request #12 from PALEOtoolkit/split_ocean
Browse files Browse the repository at this point in the history
Split up ReactionOceanCOPSE
  • Loading branch information
sjdaines authored Jul 9, 2022
2 parents 7bb2413 + 12dd12a commit 0b58a3c
Show file tree
Hide file tree
Showing 9 changed files with 377 additions and 185 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PALEOcopse"
uuid = "4a6ed817-0e58-48c6-8452-9e9afc8cb508"
authors = ["sd336 "]
version = "0.3.1"
version = "0.4.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -19,7 +19,7 @@ Documenter = "0.27"
Infiltrator = "1.0"
Interpolations = "0.13"
MAT = "0.10"
PALEOboxes = "0.19.1"
PALEOboxes = "0.19.1, 0.20.0"
PALEOmodel = "0.15.1"
Plots = "1.0"
Roots = "1.0, 2.0"
Expand Down
5 changes: 3 additions & 2 deletions docs/src/PALEOcopse.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ CurrentModule = PALEOcopse.Ocean
```

```@docs
OceanCOPSE.ReactionOceanCOPSE
OceanCOPSE.ReactionMarineBiotaCOPSE
OceanCOPSE.ReactionOceanBurialCOPSE
```

## Ocean floor
```@meta
CurrentModule = PALEOcopse.Oceanfloor
```

### Seafloor weathering
```@docs
CarbBurial.ReactionCarbBurialAlk
Weathering.ReactionSeafloorWeathering
```

Expand Down
16 changes: 12 additions & 4 deletions examples/COPSE/COPSE_reloaded_bergman2004_cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,11 @@ model1:
R:initial_value: 4e19
R:initial_delta: 20.0 # per mil

ocean_copse:
class: ReactionOceanCOPSE
marinebiota_copse:
class: ReactionMarineBiotaCOPSE

oceanburial_copse:
class: ReactionOceanBurialCOPSE
parameters:
# Marine organic carbon burial
f_mocb : 'original' # COPSE Bergman (2004) functional form
Expand Down Expand Up @@ -478,10 +481,15 @@ model1:
DIC_delta: DIC_delta # provided by CIsotopes
# DIC*: atmocean.A # dont do this !!! (overwrites DIC_delta with atmocean.A_delta)
# Route O -> atmocean.O
O*: atmocean.O*
O: atmocean.O # O, O_*, but NOT OX*
O_*: atmocean.O_*

oceanfloor:

reactions:
carbburial:
class: ReactionCarbBurialAlk
variable_links:
DIC_sms: atmocean.A_sms


oceansurface:
Expand Down
32 changes: 21 additions & 11 deletions examples/COPSE/COPSE_reloaded_reloaded_cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -568,19 +568,11 @@ model1:
R:initial_value: 1.2e17
R:initial_delta: 0.708 # reasonable average value for Phanerozoic

ocean_copse:
class: ReactionOceanCOPSE
variable_links:
DIC_sms: atmocean.A_sms
DIC_delta: DIC_delta # provided by CIsotopes
# DIC*: atmocean.A # dont do this !!! (overwrites DIC_delta with atmocean.A_delta)
O*: atmocean.O*
CAL_norm: global.CAL_NORM # [Ca] from forcing
marinebiota_copse:
class: ReactionMarineBiotaCOPSE
parameters:
newp0: 225.956
CNsea0: 37.5
CPsea0: 250.0


f_anoxia: newanoxia
k_logistic: 12.0
k_uptake: 0.5
Expand All @@ -591,6 +583,19 @@ model1:
k3_nfix: 8.667e12
k4_denit: 4.3e12

oceanburial_copse:
class: ReactionOceanBurialCOPSE
variable_links:
DIC_sms: atmocean.A_sms
DIC_delta: DIC_delta # provided by CIsotopes
# DIC*: atmocean.A # dont do this !!! (overwrites DIC_delta with atmocean.A_delta)
O: atmocean.O # relink O, O_*, NOT OX*
O_*: atmocean.O_*
CAL_norm: global.CAL_NORM # [Ca] from forcing
parameters:
CNsea0: 37.5
CPsea0: 250.0

f_mocb: original
f_mocb_b: 2.0
k2_mocb: 2.5e12
Expand All @@ -616,6 +621,11 @@ model1:


reactions:
carbburial:
class: ReactionCarbBurialAlk
variable_links:
DIC_sms: atmocean.A_sms

sfw:
class: ReactionSeafloorWeathering
parameters:
Expand Down
9 changes: 5 additions & 4 deletions examples/COPSE/copse_reloaded_bergman2004_expts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ function copse_reloaded_bergman2004_expts(

elseif expt == "VCI"
# Fig.12 magenta
PB.setvalue!(PB.get_reaction(model, "ocean", "ocean_copse").pars.f_CPsea, "VCI")
PB.setvalue!(PB.get_reaction(model, "ocean", "oceanburial_copse").pars.f_CPsea, "VCI")

elseif expt == "mocbProdLinear"
# not shown in paper - mocb linearly proportional to new production
PB.setvalue!(PB.get_reaction(model, "ocean", "ocean_copse").pars.f_mocb_b, 1.0)
PB.setvalue!(PB.get_reaction(model, "ocean", "oceanburial_copse").pars.f_mocb_b, 1.0)

elseif expt == "noNcycle"
# not shown in paper
PB.setvalue!(PB.get_reaction(model, "ocean", "ocean_copse").pars.f_ncycle, false)
PB.setvalue!(PB.get_reaction(model, "ocean", "marinebiota_copse").pars.f_ncycle, false)
PB.setvalue!(PB.get_reaction(model, "ocean", "oceanburial_copse").pars.f_ncycle, false)

elseif length(expt) == 5 && expt[1] == "setpar"
# generic parameter set (setpar, <domain>, <reaction>, <parname>, <parvalue)
Expand Down Expand Up @@ -90,7 +91,7 @@ function copse_reloaded_bergman2004_expts(
end

# set parameters for steady-state
rct_ocean = PB.get_reaction(model, "ocean", "ocean_copse")
rct_ocean = PB.get_reaction(model, "ocean", "oceanburial_copse")
mtotpb = rct_ocean.pars.k2_mocb.v/rct_ocean.pars.CPsea0.v +rct_ocean.pars.k7_capb.v +rct_ocean.pars.k6_fepb.v
rct_degass = PB.get_reaction(model, "sedcrust", "sedcrust_copse")

Expand Down
9 changes: 5 additions & 4 deletions examples/COPSE/copse_reloaded_reloaded_expts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ function copse_reloaded_reloaded_expts(

elseif expt == "VCI"
# Fig.12 magenta
PB.set_parameter_value!(model, "ocean", "ocean_copse", "f_CPsea", "VCI")
PB.set_parameter_value!(model, "ocean", "oceanburial_copse", "f_CPsea", "VCI")

elseif expt == "mocbProdLinear"
# not shown in paper - mocb linearly proportional to new production
PB.set_parameter_value!(model, "ocean", "ocean_copse", "f_mocb_b", 1.0)
PB.set_parameter_value!(model, "ocean", "oceanburial_copse", "f_mocb_b", 1.0)

elseif expt == "noNcycle"
# not shown in paper
PB.set_parameter_value!(model, "ocean", "ocean_copse", "f_ncycle", false)
PB.set_parameter_value!(model, "ocean", "marinebiota_copse", "f_ncycle", false)
PB.set_parameter_value!(model, "ocean", "oceanburial_copse", "f_ncycle", false)

elseif length(expt) == 5 && expt[1] == "setpar"
# generic parameter set (setpar, <domain>, <reaction>, <parname>, <parvalue)
Expand Down Expand Up @@ -92,7 +93,7 @@ function copse_reloaded_reloaded_expts(
end

# set parameters for carbonate-silicate weathering steady-state
rct_ocean = PB.get_reaction(model, "ocean", "ocean_copse")
rct_ocean = PB.get_reaction(model, "ocean", "oceanburial_copse")
mtotpb = rct_ocean.pars.k2_mocb.v/rct_ocean.pars.CPsea0.v +rct_ocean.pars.k7_capb.v +rct_ocean.pars.k6_fepb.v
rct_degass = PB.get_reaction(model, "sedcrust", "sedcrust_copse")
rct_sfw = PB.get_reaction(model, "oceanfloor", "sfw")
Expand Down
Loading

2 comments on commit 0b58a3c

@sjdaines
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/63912

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.0 -m "<description of version>" 0b58a3c9658e29b49a935a7ad2e11680a5df89cc
git push origin v0.4.0

Please sign in to comment.