diff --git a/docs/Project.toml b/docs/Project.toml index 1d78af27a1..bbcd9e1dc1 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,9 @@ [deps] +ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" +Glob = "c27321d9-0574-5035-807b-f59d2c89b15c" +JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" TurbulenceConvection = "8e072fc4-01f8-44fb-b9dc-f9336c367e6b" diff --git a/docs/make.jl b/docs/make.jl index 9cc87ac7d0..93167476bd 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,11 +1,17 @@ using TurbulenceConvection, Documenter using DocumenterCitations +import Glob + +# https://github.com/jheinen/GR.jl/issues/278#issuecomment-587090846 +ENV["GKSwstype"] = "nul" bib = CitationBibliography(joinpath(@__DIR__, "bibliography.bib")) #! format: off pages = Any[ "Home" => "index.md", + "Reference states" => "ReferenceStates.md", + "References" => "References.md", ] mathengine = MathJax(Dict( @@ -41,3 +47,16 @@ deploydocs( devbranch = "main", forcepush = true, ) + +# Clean up +build_dir = joinpath(@__DIR__, "build") +if isdir(build_dir) + cd(build_dir) do + for filename in Glob.glob("Output.*") + rm(filename; force = true, recursive = true) + end + for filename in Glob.glob("*.in") + rm(filename; force = true) + end + end +end diff --git a/docs/src/ReferenceStates.md b/docs/src/ReferenceStates.md new file mode 100644 index 0000000000..aeda329cdb --- /dev/null +++ b/docs/src/ReferenceStates.md @@ -0,0 +1,109 @@ +# Reference States + +```@example +import TurbulenceConvection +using Plots +using NCDatasets +tc_dir = dirname(dirname(pathof(TurbulenceConvection))) +include(joinpath(tc_dir, "integration_tests", "utils", "generate_namelist.jl")) +include(joinpath(tc_dir, "integration_tests", "utils", "generate_paramlist.jl")) +include(joinpath(tc_dir, "integration_tests", "utils", "Cases.jl")) +using .NameList +using .ParamList +import .Cases +function export_ref_profile(case_name::String) + namelist = default_namelist(case_name) + paramlist = default_paramlist(case_name) + grid = TurbulenceConvection.Grid(namelist) + ref_state = TurbulenceConvection.ReferenceState(grid) + Stats = TurbulenceConvection.NetCDFIO_Stats(namelist, paramlist, grid) + case = Cases.CasesFactory(namelist, paramlist, grid, ref_state) + Cases.initialize_reference(case, grid, ref_state, Stats) + Dataset(joinpath(Stats.path_plus_file), "r") do ds + zc = ds.group["profiles"]["z_half"][:] + zf = ds.group["profiles"]["z"][:] + ρc_0 = ds.group["reference"]["rho0_half"][:] + pc_0 = ds.group["reference"]["p0_half"][:] + αc_0 = ds.group["reference"]["alpha0_half"][:] + ρf_0 = ds.group["reference"]["rho0"][:] + pf_0 = ds.group["reference"]["p0"][:] + αf_0 = ds.group["reference"]["alpha0"][:] + p1 = plot(ρc_0, zc ./ 1000;label="centers") + plot!(ρf_0, zf ./ 1000;label="faces") + plot!(size=(1000,400)) + plot!(margin=5Plots.mm) + xlabel!("ρ_0") + ylabel!("z (km)") + title!("ρ_0") + + p2 = plot(pc_0 ./ 1000, zc ./ 1000;label="centers") + plot!(pf_0 ./ 1000, zf ./ 1000;label="faces") + plot!(size=(1000,400)) + plot!(margin=5Plots.mm) + xlabel!("p_0 (kPa)") + ylabel!("z (km)") + title!("p_0 (kPa)") + + p3 = plot(αc_0, zc ./ 1000;label="centers") + plot!(αf_0, zf ./ 1000;label="faces") + plot!(size=(1000,400)) + plot!(margin=5Plots.mm) + xlabel!("α_0") + ylabel!("z (km)") + title!("α_0") + + plot(p1,p2,p3; layout=(1,3)) + savefig("$case_name.svg") + end +end +for case_name in ( + "Bomex", + "life_cycle_Tan2018", + "Soares", + "Rico", + "TRMM_LBA", + "ARM_SGP", + "GATE_III", + "DYCOMS_RF01", + "GABLS", + "SP", + "DryBubble", +) + export_ref_profile(case_name) +end; +``` + +## Bomex +![](Bomex.svg) + +## life\_cycle\_Tan2018 +![](life_cycle_Tan2018.svg) + +## Soares +![](Soares.svg) + +## Rico +![](Rico.svg) + +## TRMM\_LBA +![](TRMM_LBA.svg) + +## ARM\_SGP +![](ARM_SGP.svg) + +## GATE\_III +![](GATE_III.svg) + +## DYCOMS\_RF01 +![](DYCOMS_RF01.svg) + +## GABLS +![](GABLS.svg) + +## SP +![](SP.svg) + +## DryBubble +![](DryBubble.svg) + + diff --git a/docs/src/References.md b/docs/src/References.md new file mode 100644 index 0000000000..b88be230e5 --- /dev/null +++ b/docs/src/References.md @@ -0,0 +1,5 @@ +# References + +```@bibliography +``` +