-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from PALEOtoolkit/add_romaniello2010
Add ICBM global ocean and Black Sea examples from Romeniello & Derry (2010)
- Loading branch information
Showing
25 changed files
with
3,622 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using Logging | ||
using DiffEqBase | ||
using Sundials | ||
|
||
using Plots | ||
|
||
import PALEOboxes as PB | ||
import PALEOmodel | ||
import PALEOocean | ||
|
||
|
||
global_logger(ConsoleLogger(stderr,Logging.Info)) | ||
|
||
include("config_ocean_blacksea_expts.jl") | ||
include("plot_ocean_blacksea.jl") | ||
|
||
# abiotic atmosphere-ocean, O2 only | ||
model = PB.create_model_from_config( | ||
joinpath(@__DIR__, "PALEO_examples_blacksea_cfg.yaml"), "blacksea_abiotic_O2", | ||
modelpars=Dict( | ||
"matdir"=>joinpath(@__DIR__, "../romglb/romaniello2010_transport") # assume zip file has been downloaded and unpacked in this subfolder | ||
) | ||
) | ||
|
||
config_ocean_blacksea_expts(model, ["baseline"]); tspan=(0, 1e4) | ||
|
||
initial_state, modeldata = PALEOmodel.initialize!(model) | ||
|
||
paleorun = PALEOmodel.Run(model=model, output = PALEOmodel.OutputWriters.OutputMemory()) | ||
|
||
# No carbonate system, so can integrate as an ODE | ||
PALEOmodel.ODE.integrateForwardDiff( | ||
paleorun, initial_state, modeldata, tspan, | ||
solvekwargs=(reltol=1e-5,), | ||
) | ||
|
||
|
||
######################################## | ||
# Plot output | ||
######################################## | ||
|
||
# individual plots | ||
# plotlyjs(size=(750, 565)) | ||
# pager = PALEOmodel.DefaultPlotPager() | ||
|
||
# assemble plots onto screens with 6 subplots | ||
gr(size=(1200, 900)) | ||
pager=PALEOmodel.PlotPager((2, 3), (legend_background_color=nothing, margin=(5, :mm))) | ||
|
||
plot_totals(paleorun.output; species=["T", "O2"], pager=pager) | ||
plot_airsea(paleorun.output; species=["O2"], pager=pager) | ||
plot_ocean_tracers( | ||
paleorun.output; | ||
tracers=["insol", "T_conc", "O2_conc"], | ||
tcol=[-Inf, 10.0, 100.0, 1000.0, 1e4, 1e5], | ||
pager=pager | ||
) | ||
pager(:newpage) # flush output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Logging | ||
using DiffEqBase | ||
using Sundials | ||
|
||
using Plots | ||
|
||
import PALEOboxes as PB | ||
import PALEOmodel | ||
import PALEOocean | ||
|
||
|
||
global_logger(ConsoleLogger(stderr,Logging.Info)) | ||
|
||
include("config_ocean_blacksea_expts.jl") | ||
include("plot_ocean_blacksea.jl") | ||
|
||
# abiotic atmosphere-ocean, O2 only | ||
model = PB.create_model_from_config( | ||
joinpath(@__DIR__, "PALEO_examples_blacksea_cfg.yaml"), "blacksea_P_O2", | ||
modelpars=Dict( | ||
"matdir"=>joinpath(@__DIR__, "../romglb/romaniello2010_transport") # assume zip file has been downloaded and unpacked in this subfolder | ||
) | ||
) | ||
|
||
config_ocean_blacksea_expts(model, ["baseline"]); tspan=(0, 1e5) | ||
|
||
initial_state, modeldata = PALEOmodel.initialize!(model) | ||
|
||
paleorun = PALEOmodel.Run(model=model, output = PALEOmodel.OutputWriters.OutputMemory()) | ||
|
||
# No carbonate system, so can integrate as an ODE | ||
PALEOmodel.ODE.integrateForwardDiff( | ||
paleorun, initial_state, modeldata, tspan, | ||
solvekwargs=(reltol=1e-5,), | ||
) | ||
|
||
|
||
######################################## | ||
# Plot output | ||
######################################## | ||
|
||
# individual plots | ||
# plotlyjs(size=(750, 565)) | ||
# pager = PALEOmodel.DefaultPlotPager() | ||
|
||
# assemble plots onto screens with 6 subplots | ||
gr(size=(1200, 900)) | ||
pager=PALEOmodel.PlotPager((2, 3), (legend_background_color=nothing, margin=(5, :mm))) | ||
|
||
plot_totals(paleorun.output; species=["T", "O2", "P"], pager=pager) | ||
plot_airsea(paleorun.output; species=["O2"], pager=pager) | ||
pager(:newpage) | ||
plot_ocean_tracers( | ||
paleorun.output; | ||
tracers=["insol", "T_conc", "O2_conc", "P_conc"], | ||
tcol=[-Inf, 10.0, 100.0, 1000.0, 1e4, 1e5], | ||
pager=pager | ||
) | ||
pager(:newpage) # flush output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using Logging | ||
using DiffEqBase | ||
using Sundials | ||
|
||
using Plots | ||
|
||
import PALEOboxes as PB | ||
import PALEOmodel | ||
import PALEOocean | ||
|
||
|
||
global_logger(ConsoleLogger(stderr,Logging.Info)) | ||
|
||
include("config_ocean_blacksea_expts.jl") | ||
include("plot_ocean_blacksea.jl") | ||
|
||
model = PB.create_model_from_config( | ||
joinpath(@__DIR__, "PALEO_examples_blacksea_cfg.yaml"), "blacksea_P_O2_SO4", | ||
modelpars=Dict( | ||
"matdir"=>joinpath(@__DIR__, "../romglb/romaniello2010_transport") # assume zip file has been downloaded and unpacked in this subfolder | ||
) | ||
) | ||
|
||
config_ocean_blacksea_expts(model, ["baseline"]); tspan=(0, 1e5) | ||
|
||
initial_state, modeldata = PALEOmodel.initialize!(model) | ||
|
||
paleorun = PALEOmodel.Run(model=model, output = PALEOmodel.OutputWriters.OutputMemory()) | ||
|
||
# No carbonate system, so can integrate as an ODE | ||
PALEOmodel.ODE.integrateForwardDiff( | ||
paleorun, initial_state, modeldata, tspan, | ||
solvekwargs=(reltol=1e-5,), | ||
) | ||
|
||
|
||
######################################## | ||
# Plot output | ||
######################################## | ||
|
||
# individual plots | ||
# plotlyjs(size=(750, 565)) | ||
# pager = PALEOmodel.DefaultPlotPager() | ||
|
||
# assemble plots onto screens with 6 subplots | ||
gr(size=(1200, 900)) | ||
pager=PALEOmodel.PlotPager((2, 3), (legend_background_color=nothing, margin=(5, :mm))) | ||
|
||
plot_totals(paleorun.output; species=["T", "O2", "P", "S"], pager=pager) | ||
plot_airsea(paleorun.output; species=["O2"], pager=pager) | ||
pager(:newpage) | ||
plot_ocean_tracers( | ||
paleorun.output; | ||
tracers=["insol", "T_conc", "O2_conc", "P_conc", "SO4_conc", "H2S_conc"], | ||
tcol=[-Inf, 10.0, 100.0, 1000.0, 1e4, 1e5], | ||
pager=pager | ||
) | ||
pager(:newpage) # flush output |
Oops, something went wrong.