-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an empty 1-moment precipitation tendency
- Loading branch information
1 parent
e5dcb33
commit 257bc19
Showing
19 changed files
with
522 additions
and
31 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
config: "column" | ||
initial_condition: "PrecipitatingColumn" | ||
surface_setup: "DefaultExchangeCoefficients" | ||
z_elem: 200 | ||
z_max: 10000.0 | ||
z_stretch: false | ||
dt: "10secs" | ||
t_end: "1500secs" | ||
dt_save_to_disk: "500secs" | ||
moist: "nonequil" | ||
precip_model: "1M" | ||
precip_upwinding: "first_order" | ||
hyperdiff: "false" | ||
regression_test: false | ||
check_precipitation: true | ||
job_id: "single_column_precipitation_test" | ||
toml: [toml/single_column_precipitation_test.toml] | ||
diagnostics: | ||
- short_name: hus | ||
period: 500secs | ||
- short_name: clw | ||
period: 500secs | ||
- short_name: cli | ||
period: 500secs | ||
- short_name: husra | ||
period: 500secs | ||
- short_name: hussn | ||
period: 500secs | ||
- short_name: ta | ||
period: 500secs | ||
- short_name: wa | ||
period: 500secs |
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,110 @@ | ||
import ClimaAtmos as CA | ||
import ClimaCore as CO | ||
import CairoMakie as MK | ||
|
||
function plot_single_column_precip(output_dir, job_id) | ||
|
||
fig = MK.Figure(resolution = (1200, 600)) | ||
ax1 = MK.Axis(fig[1, 1], ylabel = "z [km]", xlabel = "q_tot [g/kg]") | ||
ax4 = MK.Axis(fig[2, 1], ylabel = "z [km]", xlabel = "T [K]") | ||
ax2 = MK.Axis(fig[1, 2], xlabel = "q_liq [g/kg]") | ||
ax3 = MK.Axis(fig[1, 3], xlabel = "q_ice [g/kg]") | ||
ax5 = MK.Axis(fig[2, 2], xlabel = "q_rai [g/kg]") | ||
ax6 = MK.Axis(fig[2, 3], xlabel = "q_sno [g/kg]") | ||
|
||
path = joinpath(pkgdir(CA), output_dir) | ||
|
||
col = Dict( | ||
"0" => :navy, | ||
"500" => :blue2, | ||
"1000" => :royalblue, | ||
"1500" => :skyblue1, | ||
) | ||
|
||
for time in ["0", "500", "1000", "1500"] | ||
|
||
fqₜ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "hus_inst_" * time * ".0.h5"), | ||
) | ||
fqₗ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "clw_inst_" * time * ".0.h5"), | ||
) | ||
fqᵢ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "cli_inst_" * time * ".0.h5"), | ||
) | ||
fqᵣ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "husra_inst_" * time * ".0.h5"), | ||
) | ||
fqₛ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "hussn_inst_" * time * ".0.h5"), | ||
) | ||
fTₐ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "ta_inst_" * time * ".0.h5"), | ||
) | ||
fwₐ = CO.InputOutput.HDF5Reader( | ||
joinpath(path, "wa_inst_" * time * ".0.h5"), | ||
) | ||
|
||
qₜ = CO.InputOutput.read_field(fqₜ, "hus_inst") | ||
qₗ = CO.InputOutput.read_field(fqₗ, "clw_inst") | ||
qᵢ = CO.InputOutput.read_field(fqᵢ, "cli_inst") | ||
qᵣ = CO.InputOutput.read_field(fqᵣ, "husra_inst") | ||
qₛ = CO.InputOutput.read_field(fqₛ, "hussn_inst") | ||
Tₐ = CO.InputOutput.read_field(fTₐ, "ta_inst") | ||
wₐ = CO.InputOutput.read_field(fwₐ, "wa_inst") | ||
|
||
qₜ_col = CO.Fields.column(qₜ, 1, 1, 1) | ||
qₗ_col = CO.Fields.column(qₗ, 1, 1, 1) | ||
qᵢ_col = CO.Fields.column(qᵢ, 1, 1, 1) | ||
qᵣ_col = CO.Fields.column(qᵣ, 1, 1, 1) | ||
qₛ_col = CO.Fields.column(qₛ, 1, 1, 1) | ||
Tₐ_col = CO.Fields.column(Tₐ, 1, 1, 1) | ||
wₐ_col = CO.Fields.column(wₐ, 1, 1, 1) | ||
z = CO.Fields.coordinate_field(qₜ_col).z | ||
|
||
MK.lines!( | ||
ax1, | ||
vec(parent(qₜ_col)) .* 1e3, | ||
vec(parent(z)) ./ 1e3, | ||
color = col[time], | ||
) | ||
MK.lines!( | ||
ax2, | ||
vec(parent(qₗ_col)) .* 1e3, | ||
vec(parent(z)) ./ 1e3, | ||
color = col[time], | ||
) | ||
MK.lines!( | ||
ax3, | ||
vec(parent(qᵢ_col)) .* 1e3, | ||
vec(parent(z)) ./ 1e3, | ||
color = col[time], | ||
) | ||
MK.lines!( | ||
ax4, | ||
vec(parent(Tₐ_col)), | ||
vec(parent(z)) ./ 1e3, | ||
color = col[time], | ||
) | ||
MK.lines!( | ||
ax5, | ||
vec(parent(qᵣ_col)) .* 1e3, | ||
vec(parent(z)) ./ 1e3, | ||
color = col[time], | ||
) | ||
MK.lines!( | ||
ax6, | ||
vec(parent(qₛ_col)) .* 1e3, | ||
vec(parent(z)) ./ 1e3, | ||
color = col[time], | ||
) | ||
|
||
for fid in [fqₜ, fqₗ, fqᵢ, fqᵣ, fqₛ, fTₐ, fwₐ] | ||
close(fid) | ||
end | ||
end | ||
|
||
@info("Saving precipitation plots to " * path) | ||
|
||
MK.save(joinpath(path, "single_column_precipitation.png"), fig) | ||
end |
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
Oops, something went wrong.