Skip to content

Commit 304590b

Browse files
authored
Merge pull request #1510 from CliMA/js/landv1
use ClimaLand v1
2 parents 98b85cf + ec4f1df commit 304590b

File tree

4 files changed

+18
-44
lines changed

4 files changed

+18
-44
lines changed

experiments/ClimaEarth/Manifest-v1.11.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.11.6"
44
manifest_format = "2.0"
5-
project_hash = "6fcb2201b869e956566288ef56ee64f45bdfe089"
5+
project_hash = "11e98d4a15a07feb154bc6454a90cb27a5f25a1b"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "27cecae79e5cc9935255f90c53bb831cc3c870d7"
@@ -465,9 +465,9 @@ weakdeps = ["CUDA"]
465465

466466
[[deps.ClimaLand]]
467467
deps = ["ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "Dates", "DocStringExtensions", "Insolation", "Interpolations", "LazyArtifacts", "LazyBroadcast", "LinearAlgebra", "NCDatasets", "SciMLBase", "StaticArrays", "SurfaceFluxes", "Thermodynamics"]
468-
git-tree-sha1 = "254150996acda0928622b946b6ef6c11c7d0c00c"
468+
git-tree-sha1 = "ee5a46c0181e86cec2a45f65967f8af48620ba05"
469469
uuid = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532"
470-
version = "0.20.1"
470+
version = "1.0.0"
471471

472472
[deps.ClimaLand.extensions]
473473
FluxnetSimulationsExt = ["DelimitedFiles"]
@@ -3424,7 +3424,7 @@ uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
34243424
version = "1.59.0+0"
34253425

34263426
[[deps.oneTBB_jll]]
3427-
deps = ["Artifacts", "JLLWrappers", "Libdl"]
3427+
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl"]
34283428
git-tree-sha1 = "d5a767a3bb77135a99e433afe0eb14cd7f6914c3"
34293429
uuid = "1317d2d5-d96f-522e-a858-c73665f53c3e"
34303430
version = "2022.0.0+0"

experiments/ClimaEarth/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ ClimaAnalysis = "0.5.10"
3939
ClimaAtmos = "0.27, 0.28, 0.29, 0.30, 0.31"
4040
ClimaCalibrate = "0.1"
4141
ClimaDiagnostics = "0.2.6"
42-
ClimaLand = "0.20"
42+
ClimaLand = "1.0"
4343
ClimaOcean = "0.8"
44-
ClimaParams = "1"
44+
ClimaParams = "1.0"
4545
ClimaTimeSteppers = "0.7, 0.8"
4646
ClimaUtilities = "0.1"
4747
CUDA = "5"
@@ -50,4 +50,4 @@ Insolation = "0.10.2"
5050
Interpolations = "0.14, 0.15"
5151
Oceananigans = "0.97.1, 0.98"
5252
StaticArrays = "1"
53-
YAML = "0.4"
53+
YAML = "0.4"

experiments/ClimaEarth/components/land/climaland_bucket.jl

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ function BucketSimulation(
6767
energy_check::Bool = false,
6868
parameter_files = [],
6969
) where {FT, TT <: Union{Float64, ITime}}
70+
# Construct the parameter dictionary based on the float type and any parameter files
71+
toml_dict = LP.create_toml_dict(FT; override_files = parameter_files)
72+
7073
# Note that this does not take into account topography of the surface, which is OK for this land model.
7174
# But it must be taken into account when computing surface fluxes, for Δz.
7275
if isnothing(shared_surface_space)
@@ -89,10 +92,9 @@ function BucketSimulation(
8992
surface_elevation = Interfacer.remap(surface_elevation, surface_space)
9093
end
9194

92-
α_snow = FT(0.8) # snow albedo
9395
if albedo_type == "map_static" # Read in albedo from static data file (default type)
9496
# By default, this uses a file containing bareground albedo without a time component. Snow albedo is specified separately.
95-
albedo = CL.Bucket.PrescribedBaregroundAlbedo{FT}(α_snow, surface_space)
97+
albedo = CL.Bucket.PrescribedBaregroundAlbedo(toml_dict, surface_space)
9698
elseif albedo_type == "map_temporal" # Read in albedo from data file containing data over time
9799
# By default, this uses a file containing linearly-interpolated monthly data of clear-sky albedo, generated from CERES.
98100
albedo = CL.Bucket.PrescribedSurfaceAlbedo{FT}(
@@ -106,36 +108,18 @@ function BucketSimulation(
106108
(; lat, long) = coordinate_point
107109
return typeof(lat)(0.38)
108110
end
111+
α_snow = toml_dict["alpha_snow"] # snow albedo
109112
albedo =
110113
CL.Bucket.PrescribedBaregroundAlbedo{FT}(α_snow, α_bareground, surface_space)
111114
else
112115
error("invalid albedo type $albedo_type")
113116
end
114117

115-
z_0m = FT(1e-3) # roughness length for momentum over smooth bare soil
116-
z_0b = FT(1e-3) # roughness length for tracers over smooth bare soil
117-
τc = FT(float(dt)) # This is the timescale on which snow exponentially damps to zero, in the case where all
118+
# This is the timescale on which snow exponentially damps to zero, in the case where all
118119
# the snow would melt in time `τc`. It prevents us from having to specially time step in cases where
119120
# all the snow melts in a single timestep.
120-
σS_c = FT(0.2) # critical snow water equivalent
121-
W_f = FT(0.2) # bucket capacity
122-
κ_soil = FT(1.5) # soil conductivity
123-
ρc_soil = FT(2e6) # soil volumetric heat capacity
124-
125-
params = if isempty(parameter_files)
126-
CL.Bucket.BucketModelParameters(FT; albedo, z_0m, z_0b, τc, σS_c, W_f, κ_soil, ρc_soil)
127-
else
128-
# this is a temporary hack and should be updated properly
129-
toml_dict = CP.create_toml_dict(
130-
FT;
131-
override_file = CP.merge_toml_files(
132-
[CL.Parameters.DEFAULT_PARAMS_FILEPATH, parameter_files...];
133-
override = true,
134-
),
135-
)
136-
# τc should be the only exception, it depends on `dt`
137-
CL.Bucket.BucketModelParameters(toml_dict; z_0m, z_0b, albedo, τc)
138-
end
121+
τc = FT(float(dt))
122+
params = CL.Bucket.BucketModelParameters(toml_dict; albedo, τc)
139123

140124
args = (params, CL.CoupledAtmosphere{FT}(), CL.CoupledRadiativeFluxes{FT}(), domain)
141125
model = CL.Bucket.BucketModel{FT, typeof.(args)...}(args...)

experiments/ClimaEarth/components/land/climaland_integrated.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ function ClimaLandSimulation(
9191
) where {FT, TT <: Union{Float64, ITime}}
9292
# Note that this does not take into account topography of the surface, which is OK for this land model.
9393
# But it must be taken into account when computing surface fluxes, for Δz.
94-
95-
9694
if isnothing(shared_surface_space)
9795
domain = make_land_domain(depth; nelements, dz_tuple)
9896
else
@@ -117,24 +115,17 @@ function ClimaLandSimulation(
117115
atmos_h = Interfacer.remap(atmos_h, surface_space)
118116

119117
# Set up spatially-varying parameters
120-
default_parameter_file = joinpath(pkgdir(CL), "toml", "default_parameters.toml")
121-
toml_dict = CP.create_toml_dict(
122-
FT;
123-
override_file = CP.merge_toml_files(
124-
[default_parameter_file, parameter_files...];
125-
override = true,
126-
),
127-
)
118+
toml_dict = LP.create_toml_dict(FT; override_files = parameter_files)
128119
earth_param_set = CL.Parameters.LandParameters(toml_dict)
129120

130121
# Set up atmosphere and radiation forcing
131122
forcing = (;
132123
atmos = CL.CoupledAtmosphere{FT}(surface_space, atmos_h),
133124
radiation = CL.CoupledRadiativeFluxes{FT}(
134125
start_date;
135-
insol_params = LP.insolation_parameters(earth_param_set),
136126
latitude = ClimaCore.Fields.coordinate_field(domain.space.surface).lat,
137127
longitude = ClimaCore.Fields.coordinate_field(domain.space.surface).long,
128+
toml_dict,
138129
),
139130
)
140131

@@ -301,9 +292,8 @@ function ClimaLandSimulation(
301292

302293
# Update cos(zenith angle) within land model every hour
303294
update_dt = dt isa ITime ? ITime(3600) : 3600
304-
updateat = [promote(tspan[1]:update_dt:(tspan[2] + dt)...)...] # add an extra time at end in case sim steps over end
305295
updatefunc = CL.make_update_drivers(CL.get_drivers(model))
306-
driver_cb = CL.DriverUpdateCallback(updateat, updatefunc)
296+
driver_cb = CL.DriverUpdateCallback(updatefunc, update_dt, tspan[1])
307297

308298
exp_tendency! = CL.make_exp_tendency(model)
309299
imp_tendency! = CL.make_imp_tendency(model)

0 commit comments

Comments
 (0)