Skip to content

Commit

Permalink
Merge #394
Browse files Browse the repository at this point in the history
394: Use time-varying albedo in bucket r=juliasloan25 a=juliasloan25



Co-authored-by: Julia Sloan <[email protected]>
  • Loading branch information
bors[bot] and juliasloan25 authored Sep 1, 2023
2 parents b3650ff + 9fd1d5b commit c435636
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 102 deletions.
15 changes: 10 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ steps:
agents:
slurm_mem: 20GB

- label: "Slabplanet: albedo from temporal map"
key: "slabplanet_albedo_maptemporal"
command: "julia --color=yes --project=experiments/AMIP/modular/ experiments/AMIP/modular/coupler_driver_modular.jl --run_name slabplanet_albedo_maptemporal --FLOAT_TYPE Float64 --coupled true --surface_setup PrescribedSurface --moist equil --vert_diff true --rad gray --energy_check true --mode_name slabplanet --t_end 10days --dt_save_to_sol 9days --dt_cpl 200 --dt 200secs --mono_surface true --h_elem 4 --precip_model 0M --anim true --albedo_type map_temporal --job_id slabplanet_albedo_maptemporal"
artifact_paths: "experiments/AMIP/modular/output/slabplanet/slabplanet_albedo_maptemporal_artifacts/*"
agents:
slurm_mem: 20GB


# AMIP

Expand Down Expand Up @@ -199,8 +206,8 @@ steps:
slurm_mem: 20GB

- label: "Moist earth with slab surface - default: monin gray no_sponge idealinsol freq_dt_cpl - bucket using BulkAlbedoFunction"
command: "julia --color=yes --project=experiments/AMIP/modular/ experiments/AMIP/modular/coupler_driver_modular.jl --FLOAT_TYPE Float64 --coupled true --surface_setup PrescribedSurface --moist equil --vert_diff true --rad gray --energy_check true --mode_name slabplanet --t_end 10days --dt_save_to_sol 3600secs --dt_cpl 200 --dt 200secs --mono_surface true --h_elem 4 --precip_model 0M --albedo_from_file false --run_name default_albedo_prescribed --job_id default_albedo_from_file"
artifact_paths: "experiments/AMIP/modular/output/slabplanet/default_albedo_from_file_artifacts/total_energy*.png"
command: "julia --color=yes --project=experiments/AMIP/modular/ experiments/AMIP/modular/coupler_driver_modular.jl --FLOAT_TYPE Float64 --coupled true --surface_setup PrescribedSurface --moist equil --vert_diff true --rad gray --energy_check true --mode_name slabplanet --t_end 10days --dt_save_to_sol 3600secs --dt_cpl 200 --dt 200secs --mono_surface true --h_elem 4 --precip_model 0M --albedo_type function --run_name default_albedo_prescribed --job_id default_albedo_function"
artifact_paths: "experiments/AMIP/modular/output/slabplanet/default_albedo_function_artifacts/total_energy*.png"
agents:
slurm_mem: 20GB

Expand All @@ -212,7 +219,7 @@ steps:

# Note: this test fails when run with the more realistic albedo from file
- label: "Moist earth with slab surface - target: monin allsky sponge realinsol infreq_dt_cpl - bucket using BulkAlbedoFunction"
command: "julia --color=yes --project=experiments/AMIP/modular/ experiments/AMIP/modular/coupler_driver_modular.jl --FLOAT_TYPE Float64 --run_name target_params_in_slab --coupled true --surface_setup PrescribedSurface --moist equil --vert_diff true --rad allskywithclear --rayleigh_sponge true --alpha_rayleigh_uh 0 --alpha_rayleigh_w 10 --energy_check true --mode_name slabplanet --t_end 10days --dt_save_to_sol 3600secs --dt_cpl 3600 --dt 200secs --dt_rad 6hours --idealized_insolation false --mono_surface true --h_elem 6 --precip_model 0M --albedo_from_file false --job_id target_params_in_slab" # idealized albedo breaks
command: "julia --color=yes --project=experiments/AMIP/modular/ experiments/AMIP/modular/coupler_driver_modular.jl --FLOAT_TYPE Float64 --run_name target_params_in_slab --coupled true --surface_setup PrescribedSurface --moist equil --vert_diff true --rad allskywithclear --rayleigh_sponge true --alpha_rayleigh_uh 0 --alpha_rayleigh_w 10 --energy_check true --mode_name slabplanet --t_end 10days --dt_save_to_sol 3600secs --dt_cpl 3600 --dt 200secs --dt_rad 6hours --idealized_insolation false --mono_surface true --h_elem 6 --precip_model 0M --albedo_type function --job_id target_params_in_slab" # idealized albedo breaks
artifact_paths: "experiments/AMIP/modular/output/slabplanet/target_params_in_slab_artifacts/total_energy*.png"
agents:
slurm_mem: 20GB
Expand Down Expand Up @@ -306,5 +313,3 @@ steps:
- build_history staging # name of branch to plot
artifact_paths:
- "build_history.html"


2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ClimaAtmos = "0.15"
ClimaComms = "0.5"
ClimaCore = "0.10"
ClimaCoreTempestRemap = "0.3"
ClimaLSM = "0.2"
ClimaLSM = "0.3.2"
DocStringExtensions = "0.8, 0.9"
Insolation = "0.6"
JLD2 = "0.4"
Expand Down
84 changes: 42 additions & 42 deletions experiments/AMIP/modular/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ version = "0.1.29"

[[deps.ArrayLayouts]]
deps = ["FillArrays", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "6189f7819e6345bcc097331c7db571f2f211364f"
git-tree-sha1 = "dcda7e0ac618210eabf43751d5cafde100dd539b"
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
version = "1.1.1"
version = "1.3.0"

[[deps.ArtifactWrappers]]
deps = ["Downloads", "Pkg"]
Expand Down Expand Up @@ -101,9 +101,9 @@ version = "0.4.2"

[[deps.BandedMatrices]]
deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "PrecompileTools", "SparseArrays"]
git-tree-sha1 = "6e9b384d5e21452bc81cae3552c74f430e320985"
git-tree-sha1 = "0b816941273b5b162be122a6c94d706e3b3125ca"
uuid = "aae01518-5342-5314-be14-df237901396f"
version = "0.17.35"
version = "0.17.38"

[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -121,9 +121,9 @@ version = "0.1.5"

[[deps.BlockArrays]]
deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra"]
git-tree-sha1 = "174b4970af15a500a29e76151f5c53195784b9d4"
git-tree-sha1 = "54cd829dd26330c42e1cf9df68470dd4df602c61"
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
version = "0.16.36"
version = "0.16.38"

[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -156,9 +156,9 @@ version = "0.2.3"

[[deps.CUDA]]
deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CUDA_Driver_jll", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "ExprTools", "GPUArrays", "GPUCompiler", "KernelAbstractions", "LLVM", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Preferences", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "SpecialFunctions", "UnsafeAtomicsLLVM"]
git-tree-sha1 = "35160ef0f03b14768abfd68b830f8e3940e8e0dc"
git-tree-sha1 = "968c1365e2992824c3e7a794e30907483f8469a9"
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
version = "4.4.0"
version = "4.4.1"

[[deps.CUDA_Driver_jll]]
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"]
Expand Down Expand Up @@ -246,9 +246,9 @@ version = "0.1.0"

[[deps.ClimaLSM]]
deps = ["ArtifactWrappers", "CFTime", "ClimaComms", "ClimaCore", "ClimaCoreTempestRemap", "Dates", "DiffEqCallbacks", "DocStringExtensions", "IntervalSets", "JLD2", "LinearAlgebra", "NCDatasets", "StaticArrays", "SurfaceFluxes", "Thermodynamics", "UnPack"]
git-tree-sha1 = "b0de7c152ae13c96635bcd8b1a79e7ec60011d5b"
git-tree-sha1 = "370d0b4511be7e9f6126f5c6c91f07db1a25e142"
uuid = "7884a58f-fab6-4fd0-82bb-ecfedb2d8430"
version = "0.2.7"
version = "0.3.2"

[[deps.ClimaTimeSteppers]]
deps = ["CUDA", "ClimaComms", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "KernelAbstractions", "Krylov", "LinearAlgebra", "LinearOperators", "SciMLBase", "StaticArrays"]
Expand Down Expand Up @@ -560,9 +560,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
git-tree-sha1 = "f372472e8672b1d993e93dada09e23139b509f9e"
git-tree-sha1 = "a20eaa3ad64254c61eeb5f230d9306e937405434"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.5.0"
version = "1.6.1"

[[deps.FiniteDiff]]
deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays", "StaticArrays"]
Expand Down Expand Up @@ -709,10 +709,10 @@ uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe"
version = "1.0.2"

[[deps.HDF5]]
deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires", "UUIDs"]
git-tree-sha1 = "c73fdc3d9da7700691848b78c61841274076932a"
deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Printf", "Random", "Requires", "UUIDs"]
git-tree-sha1 = "114e20044677badbc631ee6fdc80a67920561a29"
uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
version = "0.16.15"
version = "0.16.16"

[[deps.HDF5_jll]]
deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"]
Expand Down Expand Up @@ -829,10 +829,10 @@ uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c"
version = "0.1.5"

[[deps.JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
deps = ["Artifacts", "Preferences"]
git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.4.1"
version = "1.5.0"

[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
Expand Down Expand Up @@ -1038,24 +1038,24 @@ version = "2.5.2"

[[deps.LinearSolve]]
deps = ["ArrayInterface", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "Libdl", "LinearAlgebra", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "Requires", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "SuiteSparse", "UnPack"]
git-tree-sha1 = "f746a5b9522815bf098049f9cbfbfcae53f29450"
git-tree-sha1 = "69cbd612e6e67ba2f8121bc8725bc9d04d803599"
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
version = "2.5.0"
version = "2.5.1"

[[deps.LogExpFunctions]]
deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f"
git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa"
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
version = "0.3.24"
version = "0.3.26"

[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.LoggingExtras]]
deps = ["Dates", "Logging"]
git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e"
git-tree-sha1 = "0d097476b6c381ab7906460ef1ef1638fbce1d91"
uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36"
version = "1.0.0"
version = "1.0.2"

[[deps.LoopVectorization]]
deps = ["ArrayInterface", "ArrayInterfaceCore", "CPUSummary", "ChainRulesCore", "CloseOpenIntervals", "DocStringExtensions", "ForwardDiff", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "SpecialFunctions", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"]
Expand Down Expand Up @@ -1095,9 +1095,9 @@ version = "5.3.1+0"

[[deps.MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2"
git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.10"
version = "0.5.11"

[[deps.ManualMemory]]
git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd"
Expand Down Expand Up @@ -1207,9 +1207,9 @@ version = "1.2.0"

[[deps.NonlinearSolve]]
deps = ["ArrayInterface", "DiffEqBase", "EnumX", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "PrecompileTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "UnPack"]
git-tree-sha1 = "23dabe80f8ebec9a68b0db4cd02f2d2cdbc4f653"
git-tree-sha1 = "ee53089df81a6bdf3c06c17cf674e90931b10a73"
uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
version = "1.9.0"
version = "1.10.0"

[[deps.OffsetArrays]]
deps = ["Adapt"]
Expand Down Expand Up @@ -1375,9 +1375,9 @@ version = "0.4.12"

[[deps.PrecompileTools]]
deps = ["Preferences"]
git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81"
git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f"
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
version = "1.1.2"
version = "1.2.0"

[[deps.Preferences]]
deps = ["TOML"]
Expand All @@ -1397,9 +1397,9 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.ProgressBars]]
deps = ["Printf"]
git-tree-sha1 = "9d84c8646109eb8bc7a006d59b157c64d5155c81"
git-tree-sha1 = "b437cdb0385ed38312d91d9c00c20f3798b30256"
uuid = "49802e3a-d2f1-5c88-81d8-b72133a6f568"
version = "1.5.0"
version = "1.5.1"

[[deps.ProgressLogging]]
deps = ["Logging", "SHA", "UUIDs"]
Expand Down Expand Up @@ -1629,9 +1629,9 @@ version = "0.3.9"

[[deps.SpecialFunctions]]
deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3"
git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "2.3.0"
version = "2.3.1"

[[deps.StackViews]]
deps = ["OffsetArrays"]
Expand All @@ -1646,10 +1646,10 @@ uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
version = "0.8.8"

[[deps.StaticArrayInterface]]
deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "Requires", "SnoopPrecompile", "SparseArrays", "Static", "SuiteSparse"]
git-tree-sha1 = "33040351d2403b84afce74dae2e22d3f5b18edcb"
deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"]
git-tree-sha1 = "03fec6800a986d191f64f5c0996b59ed526eda25"
uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718"
version = "1.4.0"
version = "1.4.1"

[[deps.StaticArrays]]
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
Expand Down Expand Up @@ -1854,9 +1854,9 @@ version = "0.4.1"

[[deps.Unitful]]
deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"]
git-tree-sha1 = "64eb17acef1d9734cf09967539818f38093d9b35"
git-tree-sha1 = "a72d22c7e13fe2de562feda8645aa134712a87ee"
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
version = "1.16.2"
version = "1.17.0"

[[deps.UnitfulLatexify]]
deps = ["LaTeXStrings", "Latexify", "Unitful"]
Expand Down Expand Up @@ -1911,10 +1911,10 @@ uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6"
version = "0.5.5"

[[deps.XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "93c41695bc1c08c46c5899f4fe06d6ead504bb73"
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"]
git-tree-sha1 = "04a51d15436a572301b5abbb9d099713327e9fc4"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.10.3+0"
version = "2.10.4+0"

[[deps.XSLT_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"]
Expand Down
8 changes: 4 additions & 4 deletions experiments/AMIP/modular/cli_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function argparse_settings()
help = "Method to partition turbulent fluxes. [`PartitionedStateFluxes`, `CombinedStateFluxes`]"
arg_type = String
default = "CombinedStateFluxes"
"--albedo_from_file"
help = "Access land surface albedo information from data file"
arg_type = Bool
default = true
"--albedo_type"
help = "Access land surface albedo information from data file. [`function`, `map_static`, `map_temporal`]"
arg_type = String
default = "map_static"
"--coupled" # TODO - remove from Atmos
help = "Coupled simulation [`false` (default), `true`]"
arg_type = Bool
Expand Down
19 changes: 14 additions & 5 deletions experiments/AMIP/modular/components/land/bucket_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import ClimaLSM.Bucket:
net_radiation,
surface_air_density,
liquid_precipitation,
BulkAlbedoMap,
BulkAlbedoTemporal,
BulkAlbedoStatic,
BulkAlbedoFunction,
surface_albedo,
snow_precipitation
Expand Down Expand Up @@ -162,14 +163,16 @@ function bucket_init(
::Type{FT},
tspan::Tuple{FT, FT},
config::String,
albedo_from_file::Bool,
albedo_type::String,
comms_ctx::AbstractCommsContext,
regrid_dirpath::String;
space,
dt::FT,
saveat::FT,
area_fraction,
stepper = CTS.RK4(),
date_ref::DateTime,
t_start::FT,
) where {FT}
if config != "sphere"
println(
Expand All @@ -181,14 +184,20 @@ function bucket_init(
earth_param_set = create_lsm_parameters(FT)

α_snow = FT(0.8) # snow albedo
if albedo_from_file # Read in albedo from data file (default)
albedo = BulkAlbedoMap{FT}(regrid_dirpath, α_snow = α_snow, comms = comms_ctx)
else # Use spatially-varying function for surface albedo
if albedo_type == "map_static" # Read in albedo from static data file (default type)
# By default, this uses a file containing bareground albedo without a time component. Snow albedo is specified separately.
albedo = BulkAlbedoStatic{FT}(regrid_dirpath, α_snow = α_snow, comms = comms_ctx)
elseif albedo_type == "map_temporal" # Read in albedo from data file containing data over time
# By default, this uses a file containing linearly-interpolated monthly data of total albedo, generated by CESM2's land model (CLM).
albedo = BulkAlbedoTemporal{FT}(regrid_dirpath, date_ref, t_start, space)
elseif albedo_type == "function" # Use prescribed function of lat/lon for surface albedo
function α_sfc(coordinate_point)
(; lat, long) = coordinate_point
return typeof(lat)(0.4)
end
albedo = BulkAlbedoFunction{FT}(α_snow, α_sfc)
else
error("invalid albedo type $albedo_type")
end

σS_c = FT(0.2)
Expand Down
4 changes: 3 additions & 1 deletion experiments/AMIP/modular/coupler_driver_modular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,15 @@ land_sim = bucket_init(
FT,
FT.(tspan),
parsed_args["config"],
parsed_args["albedo_from_file"],
parsed_args["albedo_type"],
comms_ctx,
REGRID_DIR;
dt = FT(Δt_cpl),
space = boundary_space,
saveat = FT(saveat),
area_fraction = land_fraction,
date_ref = date0,
t_start = FT(0),
)

#=
Expand Down
Loading

0 comments on commit c435636

Please sign in to comment.