From 7d898c490861074eeff6b3c44baaa9ef81b8d44d Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Thu, 16 May 2024 17:39:59 -0700 Subject: [PATCH 1/2] ISDAC forcing --- docs/bibliography.bib | 12 ++++++ src/AtmosphericProfilesLibrary.jl | 1 + src/profiles/ISDAC.jl | 67 +++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 src/profiles/ISDAC.jl diff --git a/docs/bibliography.bib b/docs/bibliography.bib index ecbdc78..0c7771d 100644 --- a/docs/bibliography.bib +++ b/docs/bibliography.bib @@ -109,3 +109,15 @@ @article{vanZanten2011 doi = {https://doi.org/10.1029/2011MS000056}, year = {2011} } +@article{ovchinnikov_intercomparison_2014, + author = {Ovchinnikov, Mikhail and Ackerman, Andrew S. and Avramov, Alexander and Cheng, Anning and Fan, Jiwen and Fridlind, Ann M. and Ghan, Steven and Harrington, Jerry and Hoose, Corinna and Korolev, Alexei and McFarquhar, Greg M. and Morrison, Hugh and Paukert, Marco and Savre, Julien and Shipway, Ben J. and Shupe, Matthew D. and Solomon, Amy and Sulia, Kara}, + title = {Intercomparison of large-eddy simulations of {Arctic} mixed-phase clouds: {Importance} of ice size distribution assumptions}, + copyright = {{\copyright} 2014. American Geophysical Union. All Rights Reserved.}, + doi = {10.1002/2013MS000282}, + issn = {1942-2466}, + journal = {Journal of Advances in Modeling Earth Systems}, + number = {1}, + pages = {223--248}, + volume = {6}, + year = {2014}, +} diff --git a/src/AtmosphericProfilesLibrary.jl b/src/AtmosphericProfilesLibrary.jl index e8d558a..1a8427a 100644 --- a/src/AtmosphericProfilesLibrary.jl +++ b/src/AtmosphericProfilesLibrary.jl @@ -16,5 +16,6 @@ include("profiles/Dycoms_RF02.jl") include("profiles/GABLS.jl") include("profiles/SP.jl") include("profiles/DryBubble.jl") +include("profiles/ISDAC.jl") end # module diff --git a/src/profiles/ISDAC.jl b/src/profiles/ISDAC.jl new file mode 100644 index 0000000..47c0290 --- /dev/null +++ b/src/profiles/ISDAC.jl @@ -0,0 +1,67 @@ + +# 825m: base of initial inversion +# 2045m: nominal domain top + +""" [ovchinnikov_intercomparison_2014](@cite) """ +function ISDAC_q_tot(::Type{FT}) where {FT} + z -> FT(if z < 400 + 1.5 - 0.00075 * (z - 400) + elseif 400 ≤ z < 825 + 1.5 + elseif 825 ≤ z < 2045 + 1.2 + else #2045 ≤ z + 0.5 - 0.000075 * (z - 2045) + end / 1000) # kg/kg +end + +""" [ovchinnikov_intercomparison_2014](@cite) """ +function ISDAC_θ_liq_ice(::Type{FT}) where {FT} + z -> FT(if z < 400 + 265 + 0.004 * (z - 400) + elseif 400 ≤ z < 825 + 265 + elseif 825 ≤ z < 2045 + 266 + (z - 825)^0.3 + else #2045 ≤ z + 271 + (z - 2000)^0.33 + end) # K +end + +""" [ovchinnikov_intercomparison_2014](@cite) """ +ISDAC_u(::Type{FT}) where {FT} = z -> FT(-7) # m/s + +""" [ovchinnikov_intercomparison_2014](@cite) """ +ISDAC_v(::Type{FT}) where {FT} = z -> FT(-2 + 0.003z) # m/s + +""" [ovchinnikov_intercomparison_2014](@cite) """ +ISDAC_subsidence(::Type{FT}) where {FT} = + z -> FT(z < 825 ? -5e-6z : -0.4125e-2) # m/s + +""" [ovchinnikov_intercomparison_2014](@cite) """ +ISDAC_tke(::Type{FT}) where {FT} = z -> FT(0.1) # m²/s² + +""" [ovchinnikov_intercomparison_2014](@cite) """ +function ISDAC_inv_τ_scalar(::Type{FT}) where {FT} + z₁ = 1200 # m + z₂ = 1500 # m + hr = 3600 # s + z -> FT(if z < z₁ + 0 + elseif z₁ ≤ z ≤ z₂ + 1 / hr * (1 - cos(π * (z - z₁) / (z₂ - z₁))) / 2 + else #z > z₂ + 1 / hr + end) # s⁻¹ +end + +""" [ovchinnikov_intercomparison_2014](@cite) """ +function ISDAC_inv_τ_wind(::Type{FT}) where {FT} + zᵤᵥ = 825 # m + hr = 3600 # s + z -> FT(if z ≤ zᵤᵥ + 1 / 2hr * (1 - cos(π * z / zᵤᵥ)) / 2 + else #z > zᵤᵥ + 1 / 2hr + end) # s⁻¹ +end From fa09d2c0900bf5e6fdd31a7c695e678d3649a2e9 Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Fri, 21 Jun 2024 09:14:34 -0700 Subject: [PATCH 2/2] fix docs errors --- docs/bibliography.bib | 8 ++++---- docs/make.jl | 3 +-- docs/src/define_save_plots.jl | 4 +++- docs/src/plot_profiles.jl | 9 ++++++++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/bibliography.bib b/docs/bibliography.bib index 0c7771d..c8ffe6c 100644 --- a/docs/bibliography.bib +++ b/docs/bibliography.bib @@ -74,7 +74,7 @@ @article{Soares2004 pages = {3365--3383}, year = {2004}, publisher = {Wiley Online Library}, - doi = {https://doi.org/10.1256/qj.03.223} + doi = {10.1256/qj.03.223} } @article{Stevens2005, @@ -85,7 +85,7 @@ @article{Stevens2005 number = {6}, pages = {1443--1462}, year = {2005}, - doi = {http://dx.doi.org/10.1175/MWR2930.1} + doi = {10.1175/MWR2930.1} } @article{Tan2018, @@ -97,7 +97,7 @@ @article{Tan2018 pages = {770--800}, year = {2018}, publisher = {Wiley Online Library}, - doi = {https://doi.org/10.1002/2017MS001162} + doi = {10.1002/2017MS001162} } @article{vanZanten2011, @@ -106,7 +106,7 @@ @article{vanZanten2011 journal = {Journal of Advances in Modeling Earth Systems}, volume = {3}, number = {2}, - doi = {https://doi.org/10.1029/2011MS000056}, + doi = {10.1029/2011MS000056}, year = {2011} } @article{ovchinnikov_intercomparison_2014, diff --git a/docs/make.jl b/docs/make.jl index 369ca94..3da5677 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -31,9 +31,8 @@ format = Documenter.HTML( #! format: on makedocs( - bib, + plugins = [bib], sitename = "AtmosphericProfilesLibrary.jl", - strict = true, format = format, checkdocs = :exports, clean = true, diff --git a/docs/src/define_save_plots.jl b/docs/src/define_save_plots.jl index 8e8c212..733060e 100644 --- a/docs/src/define_save_plots.jl +++ b/docs/src/define_save_plots.jl @@ -42,12 +42,14 @@ function save_z_profile( xlabel, scale_z = scale_z_to_kilometers, z_range, + unit = nothing, ) prof = profile(Float64) # data = (z) -> prof(z) data = prof.(z_range) Plots.plot(data, scale_z.(z_range)) - Plots.xlabel!("$xlabel $(units(xlabel))") + unit = @something unit units(xlabel) + Plots.xlabel!("$xlabel $unit") Plots.ylabel!(ylabel(scale_z)) Plots.title!("$(nameof(profile))") Plots.savefig("z_$(nameof(profile)).png") diff --git a/docs/src/plot_profiles.jl b/docs/src/plot_profiles.jl index d16db4d..feab7be 100644 --- a/docs/src/plot_profiles.jl +++ b/docs/src/plot_profiles.jl @@ -143,7 +143,14 @@ z_profiles = [ (; func = APL.DryBubble_updrafts_w , kwargs = (;z_range = zr_lo, xlabel = "w")), (; func = APL.DryBubble_updrafts_T , kwargs = (;z_range = zr_lo, xlabel = "T")), - + (; func = APL.ISDAC_θ_liq_ice , kwargs = (;z_range = zr_lo, xlabel = "θ_liq_ice")), + (; func = APL.ISDAC_q_tot , kwargs = (;z_range = zr_lo, xlabel = "q_tot")), + (; func = APL.ISDAC_u , kwargs = (;z_range = zr_lo, xlabel = "u")), + (; func = APL.ISDAC_v , kwargs = (;z_range = zr_lo, xlabel = "v")), + (; func = APL.ISDAC_tke , kwargs = (;z_range = zr_lo, xlabel = "tke")), + (; func = APL.ISDAC_subsidence , kwargs = (;z_range = zr_lo, xlabel = "subsidence", unit = "[m/s]")), + (; func = APL.ISDAC_inv_τ_scalar , kwargs = (;z_range = zr_lo, xlabel = "inv_τ_scalar", unit = "[1/s]")), + (; func = APL.ISDAC_inv_τ_wind , kwargs = (;z_range = zr_lo, xlabel = "inv_τ_wind", unit = "[1/s]")), ] #####