Skip to content

Commit a9548a4

Browse files
committed
add option to read land ICs from a file
1 parent 6abe502 commit a9548a4

File tree

8 files changed

+74
-15
lines changed

8 files changed

+74
-15
lines changed

.buildkite/pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ steps:
219219
slurm_ntasks: 1
220220
slurm_mem: 20GB
221221

222+
- label: "AMIP: integrated land non-spun up initial condition test"
223+
command: "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_amip.jl --config_file $CONFIG_PATH/amip_land_ic.yml --job_id amip_land_ic"
224+
artifact_paths: "experiments/ClimaEarth/output/amip_land_ic/artifacts/*"
225+
agents:
226+
slurm_ntasks: 1
227+
slurm_mem: 20GB
228+
222229
- label: "AMIP - Float64 + hourly checkpoint"
223230
key: "amip"
224231
command: "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_amip.jl --config_file $CONFIG_PATH/amip_coarse_ft64_hourly_checkpoints.yml --job_id amip_coarse_ft64_hourly_checkpoints"

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ ClimaCoupler.jl Release Notes
66

77
### ClimaCoupler features
88

9+
#### Add option for integrated land spun up IC. PR[#1318](https://github.com/CliMA/ClimaCoupler.jl/pull/1318)
10+
11+
Adds a boolean flag `land_spun_up_ic` that allows the user to request reading integrated land
12+
initial conditions from a saved simulation, rather than setting them with default values.
13+
If this option is true, the land/sea mask must be used, since the spun-up ICs are only defined
14+
over land (i.e. this cannot be used in the `slabplanet_terra` mode). The default is true.
15+
916
#### Use EN4 dataset for ocean initial conditions and forcing PR[#1425](https://github.com/CliMA/ClimaCoupler.jl/pull/1425)
1017

1118
Use EN4 instead of ECCO for ocean initial conditions and forcing, to avoid

config/ci_configs/amip_land_ic.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apply_limiter: false
2+
co2_model: "maunaloa"
3+
dt: "150secs"
4+
dt_cpl: "150secs"
5+
dt_rad: "1hours"
6+
dz_bottom: 30
7+
dz_top: 3000
8+
h_elem: 4
9+
land_model: "integrated"
10+
land_spun_up_ic: false
11+
mode_name: "amip"
12+
moist: "equil"
13+
precip_model: "0M"
14+
rad: "allskywithclear"
15+
rayleigh_sponge: true
16+
t_end: "300secs"
17+
vert_diff: "true"
18+
z_elem: 50
19+
z_stretch: false

experiments/ClimaEarth/cli_options.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ function argparse_settings()
156156
help = "Boolean flag indicating whether to compute and output land model diagnostics [`true` (default), `false`]"
157157
arg_type = Bool
158158
default = true
159+
"--land_spun_up_ic"
160+
help = "Boolean flag to indicate whether to use integrated land initial conditions from spun up state [`true` (default), `false`]"
161+
arg_type = Bool
162+
default = true
159163
# BucketModel specific
160164
"--bucket_albedo_type"
161165
help = "Access bucket surface albedo information from data file. [`map_static` (default), `function`, `map_temporal`]"

experiments/ClimaEarth/components/land/climaland_integrated.jl

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ function ClimaLandSimulation(
6363
start_date::Dates.DateTime,
6464
output_dir::String,
6565
area_fraction,
66-
nelements::Tuple{Int, Int} = (101, 10),
66+
nelements::Tuple{Int, Int} = (101, 15),
6767
depth::FT = FT(50),
6868
dz_tuple::Tuple{FT, FT} = FT.((10.0, 0.05)),
6969
shared_surface_space = nothing,
70+
land_spun_up_ic::Bool = true,
7071
saveat::Vector{TT} = [tspan[1], tspan[2]],
7172
surface_elevation = nothing,
7273
land_temperature_anomaly::String = "amip",
@@ -171,19 +172,34 @@ function ClimaLandSimulation(
171172
orog_adjusted_T = CC.Fields.Field(orog_adjusted_T_data, subsurface_space)
172173
orog_adjusted_T_surface = CC.Fields.Field(CC.Fields.level(orog_adjusted_T_data, 1), surface_space)
173174

174-
# Set initial conditions for the state
175-
θ_r, ν, ρc_ds = soil_params.θ_r, soil_params.ν, soil_params.ρc_ds
176-
@. Y.soil.ϑ_l = θ_r +- θ_r) / 2
177-
Y.soil.θ_i .= FT(0.0)
178-
ρc_s = CL.Soil.volumetric_heat_capacity.(Y.soil.ϑ_l, Y.soil.θ_i, ρc_ds, earth_param_set)
179-
Y.soil.ρe_int .= CL.Soil.volumetric_internal_energy.(Y.soil.θ_i, ρc_s, orog_adjusted_T, earth_param_set)
175+
# Set initial conditions that aren't read in from file
180176
Y.soilco2.C .= FT(0.000412) # set to atmospheric co2, mol co2 per mol air
181177
Y.canopy.hydraulics.ϑ_l.:1 .= canopy_component_args.hydraulics.parameters.ν
182178
@. Y.canopy.energy.T = orog_adjusted_T_surface
183179

184-
Y.snow.S .= FT(0)
185-
Y.snow.S_l .= FT(0)
186-
Y.snow.U .= FT(0)
180+
# Read in initial conditions for snow and soil from file, if requested
181+
θ_r, ν, ρc_ds = soil_params.θ_r, soil_params.ν, soil_params.ρc_ds
182+
if land_spun_up_ic
183+
# Set snow T first to use in computing snow internal energy
184+
@. p.snow.T = orog_adjusted_T_surface
185+
186+
# Read in initial conditions for snow and soil
187+
ic_path = CL.Artifacts.soil_ic_2008_50m_path()
188+
CL.Simulations.set_snow_initial_conditions!(Y, p, surface_space, ic_path, model.snow.parameters)
189+
190+
T_bounds = extrema(Y.canopy.energy.T)
191+
CL.Simulations.set_soil_initial_conditions!(Y, ν, θ_r, subsurface_space, ic_path, model.soil, T_bounds)
192+
else
193+
# Set initial conditions for the state
194+
@. Y.soil.ϑ_l = θ_r +- θ_r) / 2
195+
Y.soil.θ_i .= FT(0.0)
196+
ρc_s = CL.Soil.volumetric_heat_capacity.(Y.soil.ϑ_l, Y.soil.θ_i, ρc_ds, earth_param_set)
197+
Y.soil.ρe_int .= CL.Soil.volumetric_internal_energy.(Y.soil.θ_i, ρc_s, orog_adjusted_T, earth_param_set)
198+
199+
Y.snow.S .= FT(0)
200+
Y.snow.S_l .= FT(0)
201+
Y.snow.U .= FT(0)
202+
end
187203

188204
# Initialize the surface temperature so the atmosphere can compute radiation.
189205
# This cache variable is normally computed using `p.drivers.LW_d`, which is

experiments/ClimaEarth/setup_run.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ function CoupledSimulation(config_dict::AbstractDict)
121121
diagnostics_dt,
122122
evolving_ocean,
123123
land_model,
124+
land_temperature_anomaly,
125+
land_spun_up_ic,
124126
bucket_albedo_type,
125127
bucket_initial_condition,
126-
land_temperature_anomaly,
127128
energy_check,
128129
use_coupler_diagnostics,
129130
output_dir_root,
@@ -298,6 +299,8 @@ function CoupledSimulation(config_dict::AbstractDict)
298299
output_dir = land_output_dir,
299300
area_fraction = land_fraction,
300301
shared_surface_space,
302+
land_spun_up_ic,
303+
saveat,
301304
surface_elevation,
302305
land_temperature_anomaly,
303306
use_land_diagnostics,

experiments/ClimaEarth/test/amip_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ h_elem: 8
1010
checkpoint_dt: "720hours"
1111
bucket_albedo_type: "map_temporal"
1212
land_model: "integrated"
13+
land_spun_up_ic: false
1314
mode_name: "amip"
1415
netcdf_interpolation_num_points: [90, 45, 31]
1516
netcdf_output_at_levels: true

experiments/ClimaEarth/user_io/arg_parsing.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ function get_coupler_args(config_dict::Dict)
119119

120120
# ClimaLand-specific information
121121
land_model = config_dict["land_model"]
122-
bucket_albedo_type = config_dict["bucket_albedo_type"]
123-
bucket_initial_condition = config_dict["bucket_initial_condition"]
124122
land_temperature_anomaly = config_dict["land_temperature_anomaly"]
125123
use_land_diagnostics = config_dict["use_land_diagnostics"]
124+
land_spun_up_ic = config_dict["land_spun_up_ic"]
125+
bucket_albedo_type = config_dict["bucket_albedo_type"]
126+
bucket_initial_condition = config_dict["bucket_initial_condition"]
126127

127128
return (;
128129
job_id,
@@ -147,10 +148,11 @@ function get_coupler_args(config_dict::Dict)
147148
rmse_check,
148149
output_dir_root,
149150
land_model,
150-
bucket_albedo_type,
151-
bucket_initial_condition,
152151
land_temperature_anomaly,
152+
land_spun_up_ic,
153153
use_land_diagnostics,
154+
bucket_albedo_type,
155+
bucket_initial_condition,
154156
parameter_files,
155157
)
156158
end

0 commit comments

Comments
 (0)