From edee04f6d86f8541aad784b218b12826772e1c40 Mon Sep 17 00:00:00 2001 From: AlexisRenchon Date: Fri, 15 Nov 2024 10:22:32 -0800 Subject: [PATCH 1/5] longruns global seasonal cycle We currently plot global maps for initial and final time steps (months) of the long runs. In this commit, we add a global seasonal plot. This plot takes the monthly global average of each output variables and plot them as a line, the simulation is one year long so there is 12 data points. --- experiments/long_runs/land.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index 8fb0daf610..16a4800b56 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -376,7 +376,12 @@ end function setup_and_solve_problem(; greet = false) t0 = 0.0 - tf = 60 * 60.0 * 24 * 365 + seconds = 1.0 + minutes = 60seconds + hours = 60minutes + days = 24hours + years = 365days + tf = 1years Δt = 450.0 nelements = (101, 15) if greet @@ -410,6 +415,10 @@ 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]] + var_global_average = ClimaAnalysis.average_lon(ClimaAnalysis.average_lat(var)) + fig_seasonal_cycle = CairoMakie.Figure(size = (600, 400)) + CairoMakie.lines!(fig_seasonal_cycle, var_global_average) + CairoMakie.save(joinpath(tmpdir, "$(short_name)_global_monthly.pdf"), fig_seasonal_cycle) for t in times fig = CairoMakie.Figure(size = (600, 400)) kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() From cb076d72a810f2aa4cad93e87261a8194dab7676 Mon Sep 17 00:00:00 2001 From: Alexandre Alexis Renchon Date: Fri, 15 Nov 2024 12:08:19 -0800 Subject: [PATCH 2/5] Update land.jl --- experiments/long_runs/land.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index 16a4800b56..12fe3bc99d 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -417,7 +417,7 @@ mktempdir(root_path) do tmpdir times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] var_global_average = ClimaAnalysis.average_lon(ClimaAnalysis.average_lat(var)) fig_seasonal_cycle = CairoMakie.Figure(size = (600, 400)) - CairoMakie.lines!(fig_seasonal_cycle, var_global_average) + CairoMakie.lines!(fig_seasonal_cycle, var_global_average.data) CairoMakie.save(joinpath(tmpdir, "$(short_name)_global_monthly.pdf"), fig_seasonal_cycle) for t in times fig = CairoMakie.Figure(size = (600, 400)) From 33d0e6aa6ffb345a322a350f1bebbc262e2d8e18 Mon Sep 17 00:00:00 2001 From: Alexandre Alexis Renchon Date: Sat, 16 Nov 2024 12:26:27 -0800 Subject: [PATCH 3/5] Update land.jl --- experiments/long_runs/land.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index 12fe3bc99d..ab8d93ad47 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -417,7 +417,8 @@ mktempdir(root_path) do tmpdir times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] var_global_average = ClimaAnalysis.average_lon(ClimaAnalysis.average_lat(var)) fig_seasonal_cycle = CairoMakie.Figure(size = (600, 400)) - CairoMakie.lines!(fig_seasonal_cycle, var_global_average.data) + ax = Axis(fig[1,1]) + CairoMakie.lines!(ax, var_global_average.data) CairoMakie.save(joinpath(tmpdir, "$(short_name)_global_monthly.pdf"), fig_seasonal_cycle) for t in times fig = CairoMakie.Figure(size = (600, 400)) From 357d2bdc49d6a8e02d5f8da0931e756c14dc4c87 Mon Sep 17 00:00:00 2001 From: Alexandre Alexis Renchon Date: Sat, 16 Nov 2024 16:28:13 -0800 Subject: [PATCH 4/5] Update land.jl --- experiments/long_runs/land.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index ab8d93ad47..e2917239e0 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -417,7 +417,7 @@ mktempdir(root_path) do tmpdir times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] var_global_average = ClimaAnalysis.average_lon(ClimaAnalysis.average_lat(var)) fig_seasonal_cycle = CairoMakie.Figure(size = (600, 400)) - ax = Axis(fig[1,1]) + ax = Axis(fig_seasonal_cycle[1,1]) CairoMakie.lines!(ax, var_global_average.data) CairoMakie.save(joinpath(tmpdir, "$(short_name)_global_monthly.pdf"), fig_seasonal_cycle) for t in times From e645a72463dc5796bdcab64008589075e1d9ef73 Mon Sep 17 00:00:00 2001 From: Alexandre Alexis Renchon Date: Sun, 17 Nov 2024 11:31:12 -0800 Subject: [PATCH 5/5] Update land.jl --- experiments/long_runs/land.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index e2917239e0..89d739db54 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -418,7 +418,7 @@ mktempdir(root_path) do tmpdir var_global_average = ClimaAnalysis.average_lon(ClimaAnalysis.average_lat(var)) fig_seasonal_cycle = CairoMakie.Figure(size = (600, 400)) ax = Axis(fig_seasonal_cycle[1,1]) - CairoMakie.lines!(ax, var_global_average.data) + CairoMakie.lines!(ax, 1:1:12, var_global_average.data) CairoMakie.save(joinpath(tmpdir, "$(short_name)_global_monthly.pdf"), fig_seasonal_cycle) for t in times fig = CairoMakie.Figure(size = (600, 400))