Skip to content

Commit

Permalink
Merge pull request #41 from CliMA/he/isdac
Browse files Browse the repository at this point in the history
ISDAC forcing
  • Loading branch information
akshaysridhar authored Jun 21, 2024
2 parents 42c11fc + fa09d2c commit 38ba5fa
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 8 deletions.
20 changes: 16 additions & 4 deletions docs/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -106,6 +106,18 @@ @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,
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},
}
3 changes: 1 addition & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ format = Documenter.HTML(
#! format: on

makedocs(
bib,
plugins = [bib],
sitename = "AtmosphericProfilesLibrary.jl",
strict = true,
format = format,
checkdocs = :exports,
clean = true,
Expand Down
4 changes: 3 additions & 1 deletion docs/src/define_save_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 8 additions & 1 deletion docs/src/plot_profiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]")),
]

#####
Expand Down
1 change: 1 addition & 0 deletions src/AtmosphericProfilesLibrary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
67 changes: 67 additions & 0 deletions src/profiles/ISDAC.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 38ba5fa

Please sign in to comment.