Skip to content

Commit

Permalink
tf 4 years and figures intermediate
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Dec 14, 2024
1 parent 89437d9 commit c094ace
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
9 changes: 7 additions & 2 deletions experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ end
function setup_and_solve_problem(; greet = false)

t0 = 0.0
tf = 60 * 60.0 * 24 * 365 * 2
tf = 60 * 60.0 * 24 * 365 * 4
Δt = 450.0
nelements = (101, 15)
if greet
Expand Down Expand Up @@ -412,7 +412,12 @@ short_names = ["gpp", "swc", "et", "ct"]
mktempdir(root_path) do tmpdir
for short_name in short_names
var = get(simdir; short_name)
times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]]
N = length(ClimaAnalysis.times(var))
times = [
ClimaAnalysis.times(var)[1],
ClimaAnalysis.times(var)[div(N, 2, RoundNearest)],
ClimaAnalysis.times(var)[N],
]
for t in times
fig = CairoMakie.Figure(size = (600, 400))
kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict()
Expand Down
17 changes: 8 additions & 9 deletions experiments/long_runs/snowy_land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ end
function setup_and_solve_problem(; greet = false)

t0 = 0.0
tf = 60 * 60.0 * 24 * 365 * 2
tf = 60 * 60.0 * 24 * 365 * 4
Δt = 450.0
nelements = (101, 15)
if greet
Expand Down Expand Up @@ -481,7 +481,12 @@ short_names = ["gpp", "swc", "et", "ct", "swe", "si"]
mktempdir(root_path) do tmpdir
for short_name in short_names
var = get(simdir; short_name)
times = [ClimaAnalysis.times(var)[end]]
N = length(ClimaAnalysis.times(var))
times = [
ClimaAnalysis.times(var)[1],
ClimaAnalysis.times(var)[div(N, 2, RoundNearest)],
ClimaAnalysis.times(var)[N],
]
for t in times
fig = CairoMakie.Figure(size = (600, 400))
kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict()
Expand All @@ -499,13 +504,7 @@ mktempdir(root_path) do tmpdir
end
figures = readdir(tmpdir, join = true)
pdfunite() do unite
run(
Cmd([
unite,
figures...,
joinpath(root_path, "last_year_figures.pdf"),
]),
)
run(Cmd([unite, figures..., joinpath(root_path, "figures.pdf")]))
end
end

Expand Down
9 changes: 7 additions & 2 deletions experiments/long_runs/soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ end
function setup_and_solve_problem(; greet = false)

t0 = 0.0
tf = 60 * 60.0 * 24 * 365 * 2
tf = 60 * 60.0 * 24 * 365 * 4
Δt = 450.0
nelements = (101, 15)
if greet
Expand Down Expand Up @@ -253,7 +253,12 @@ short_names = ["swc", "si", "sie"]
mktempdir(root_path) do tmpdir
for short_name in short_names
var = get(simdir; short_name)
times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]]
N = length(ClimaAnalysis.times(var))
times = [
ClimaAnalysis.times(var)[1],
ClimaAnalysis.times(var)[div(N, 2, RoundNearest)],
ClimaAnalysis.times(var)[N],
]
for t in times
var = get(simdir; short_name)
fig = CairoMakie.Figure(size = (600, 400))
Expand Down

0 comments on commit c094ace

Please sign in to comment.