From b92616ec027272ddd2b619809c25f42f9de226f7 Mon Sep 17 00:00:00 2001 From: Julia Sloan Date: Thu, 24 Apr 2025 14:36:32 -0700 Subject: [PATCH 1/3] use Bucket p.e_per_area --- .../components/land/climaland_bucket.jl | 36 +------------------ experiments/ClimaEarth/setup_run.jl | 2 -- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/experiments/ClimaEarth/components/land/climaland_bucket.jl b/experiments/ClimaEarth/components/land/climaland_bucket.jl index 05080142b3..aa50c16d0d 100644 --- a/experiments/ClimaEarth/components/land/climaland_bucket.jl +++ b/experiments/ClimaEarth/components/land/climaland_bucket.jl @@ -42,20 +42,6 @@ struct BucketSimulation{ end Interfacer.name(::BucketSimulation) = "BucketSimulation" -""" - get_new_cache(p, Y, energy_check) -Returns a new `p` with an updated field to store e_per_area if energy conservation - checks are turned on. -""" -function get_new_cache(p, Y, energy_check) - if energy_check - e_per_area_field = CC.Fields.zeros(axes(Y.bucket.W)) - return merge(p, (; e_per_area = e_per_area_field)) - else - return p - end -end - """ bucket_init @@ -76,7 +62,6 @@ function BucketSimulation( stepper = CTS.RK4(), albedo_type::String = "map_static", land_initial_condition::String = "", - energy_check::Bool = false, parameter_files = [], ) where {FT, TT <: Union{Float64, ITime}} α_snow = FT(0.8) # snow albedo @@ -134,9 +119,6 @@ function BucketSimulation( # Initial conditions with no moisture Y, p, coords = CL.initialize(model) - # Add space in the cache for the energy if energy checks are enabled - p = get_new_cache(p, Y, energy_check) - # Get temperature anomaly function T_functions = Dict("aquaplanet" => temp_anomaly_aquaplanet, "amip" => temp_anomaly_amip) haskey(T_functions, land_temperature_anomaly) || @@ -254,23 +236,7 @@ Interfacer.get_field(sim::BucketSimulation, ::Val{:surface_humidity}) = CL.surface_specific_humidity(nothing, sim.model, sim.integrator.u, sim.integrator.p, sim.integrator.t) Interfacer.get_field(sim::BucketSimulation, ::Val{:surface_temperature}) = CL.surface_temperature(sim.model, sim.integrator.u, sim.integrator.p, sim.integrator.t) - -""" - Interfacer.get_field(sim::BucketSimulation, ::Val{:energy}) - -Extension of Interfacer.get_field that provides the total energy contained in the bucket, including the latent heat due to snow melt. -""" -function Interfacer.get_field(sim::BucketSimulation, ::Val{:energy}) - # required by ConservationChecker - e_per_area = sim.integrator.p.e_per_area .= 0 - CC.Operators.column_integral_definite!(e_per_area, sim.model.parameters.ρc_soil .* sim.integrator.u.bucket.T) - - e_per_area .+= - -LP.LH_f0(sim.model.parameters.earth_param_set) .* LP.ρ_cloud_liq(sim.model.parameters.earth_param_set) .* - sim.integrator.u.bucket.σS - - return e_per_area -end +Interfacer.get_field(sim::BucketSimulation, ::Val{:energy}) = sim.integrator.p.e_per_area """ Interfacer.get_field(sim::BucketSimulation, ::Val{:water}) diff --git a/experiments/ClimaEarth/setup_run.jl b/experiments/ClimaEarth/setup_run.jl index 8ba96e71f2..92e9bd9f36 100644 --- a/experiments/ClimaEarth/setup_run.jl +++ b/experiments/ClimaEarth/setup_run.jl @@ -278,7 +278,6 @@ function CoupledSimulation(config_dict::AbstractDict) use_land_diagnostics, albedo_type = land_albedo_type, land_initial_condition, - energy_check, parameter_files, ) elseif land_model == "integrated" @@ -341,7 +340,6 @@ function CoupledSimulation(config_dict::AbstractDict) use_land_diagnostics, albedo_type = land_albedo_type, land_initial_condition, - energy_check, parameter_files, ) From dffec7a3c96a76ff279d02ef07ff16ae2474851f Mon Sep 17 00:00:00 2001 From: Julia Sloan Date: Thu, 24 Apr 2025 14:36:52 -0700 Subject: [PATCH 2/3] use branch ClimaLand#tr/add-energy_per_area-bucket --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9d696a4517..13513631df 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -43,6 +43,7 @@ steps: - "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.develop(path=\".\")'" - "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'" - "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.add(\"MPI\"); Pkg.add(\"CUDA\");'" + - "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.add(Pkg.PackageSpec(;name=\"ClimaLand\", rev=\"tr/add-energy_per_area-bucket\"))'" - "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'" - "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'" From 6d7480d6b204b3e9b9d55d9c4643211f02bea0fe Mon Sep 17 00:00:00 2001 From: Julia Sloan Date: Thu, 24 Apr 2025 16:16:39 -0700 Subject: [PATCH 3/3] use land branch --- experiments/ClimaEarth/Manifest-v1.11.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/experiments/ClimaEarth/Manifest-v1.11.toml b/experiments/ClimaEarth/Manifest-v1.11.toml index c206ca1fbf..47b102731b 100644 --- a/experiments/ClimaEarth/Manifest-v1.11.toml +++ b/experiments/ClimaEarth/Manifest-v1.11.toml @@ -2,7 +2,7 @@ julia_version = "1.11.4" manifest_format = "2.0" -project_hash = "b128b4b3c921eda6ebd10795a43db24e86ebb375" +project_hash = "a6b727ee8a2506c47fabb82909c682490f07c2f7" [[deps.ADTypes]] git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32" @@ -348,7 +348,9 @@ version = "0.2.13" [[deps.ClimaLand]] deps = ["ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaUtilities", "Dates", "DocStringExtensions", "Insolation", "Interpolations", "LazyArtifacts", "LinearAlgebra", "NCDatasets", "SciMLBase", "StaticArrays", "SurfaceFluxes", "Thermodynamics"] -git-tree-sha1 = "08d08423e0a955180d3eea39c340b81603a00585" +git-tree-sha1 = "d5ba1073aa5c015f6d25ee9ace265d63ac421197" +repo-rev = "tr/add-energy_per_area-bucket" +repo-url = "https://github.com/CliMA/ClimaLand.jl.git" uuid = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532" version = "0.15.14"