Skip to content

Commit

Permalink
unify output dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Dec 13, 2024
1 parent 5318c3b commit 85fa3f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
7 changes: 2 additions & 5 deletions experiments/ClimaEarth/components/land/climaland_bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function bucket_init(
config::String,
albedo_type::String,
land_temperature_anomaly::String,
dir_paths::NamedTuple;
output_dir::String;
space,
dt::Float64,
saveat::Float64,
Expand All @@ -72,9 +72,6 @@ function bucket_init(
@assert config == "sphere"
end

regrid_dirpath = dir_paths.regrid
artifacts_dir = dir_paths.artifacts

α_snow = FT(0.8) # snow 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.
Expand Down Expand Up @@ -152,7 +149,7 @@ function bucket_init(

# Add diagnostics
if use_land_diagnostics
netcdf_writer = CD.Writers.NetCDFWriter(domain.space.subsurface, artifacts_dir)
netcdf_writer = CD.Writers.NetCDFWriter(domain.space.subsurface, output_dir)
scheduled_diagnostics =
CL.default_diagnostics(model, date_ref, output_writer = netcdf_writer, average_period = :monthly)

Expand Down
14 changes: 9 additions & 5 deletions experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ dir_paths = Utilities.setup_output_dirs(output_dir = COUPLER_OUTPUT_DIR, comms_c
@info "Coupler artifacts directory $(dir_paths.artifacts)"
@info "Coupler checkpoint directory $(dir_paths.checkpoints)"

atmos_output_dir = joinpath(dir_paths.output, "clima_atmos")
land_output_dir = joinpath(dir_paths.output, "clima_land")

## get component model dictionaries (if applicable)
## Note this step must come after parsing the coupler config dictionary, since
## some parameters are passed from the coupler config to the component model configs
atmos_output_dir = joinpath(dir_paths.output, "clima_atmos")
atmos_config_dict = get_atmos_config_dict(config_dict, job_id, atmos_output_dir)
(; dt_rad, output_default_diagnostics) = get_atmos_args(atmos_config_dict)

Expand Down Expand Up @@ -249,7 +251,7 @@ if mode_name == "amip"
land_domain_type,
land_albedo_type,
land_temperature_anomaly,
dir_paths;
land_output_dir;
dt = component_dt_dict["dt_land"],
space = boundary_space,
saveat = saveat,
Expand Down Expand Up @@ -347,7 +349,7 @@ elseif mode_name in ("slabplanet", "slabplanet_aqua", "slabplanet_terra")
land_domain_type,
land_albedo_type,
land_temperature_anomaly,
dir_paths;
land_output_dir;
dt = component_dt_dict["dt_land"],
space = boundary_space,
saveat = saveat,
Expand Down Expand Up @@ -397,7 +399,7 @@ elseif mode_name == "slabplanet_eisenman"
land_domain_type,
land_albedo_type,
land_temperature_anomaly,
dir_paths;
land_output_dir;
dt = component_dt_dict["dt_land"],
space = boundary_space,
saveat = saveat,
Expand Down Expand Up @@ -552,7 +554,9 @@ Use ClimaDiagnostics for default AMIP diagnostics, which currently include turbu
=#
if mode_name == "amip" && use_coupler_diagnostics
include("user_io/amip_diagnostics.jl")
amip_diags_handler = amip_diagnostics_setup(coupler_fields, dir_paths.output, dates.date0[1], tspan[1], calendar_dt)
coupler_diags_path = joinpath(dir_paths.output, "coupler")
amip_diags_handler =
amip_diagnostics_setup(coupler_fields, coupler_diags_path, dates.date0[1], tspan[1], calendar_dt)
else
amip_diags_handler = nothing
end
Expand Down

0 comments on commit 85fa3f9

Please sign in to comment.