Skip to content

Commit

Permalink
Add TODOs, clean up config, add new TOML
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Mar 6, 2025
1 parent 52d3559 commit 0c21cf5
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 53 deletions.
65 changes: 15 additions & 50 deletions experiments/calibration/coarse_amip/model_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FLOAT_TYPE: "Float32"
albedo_model: "CouplerAlbedo"
atmos_config_file: "config/longrun_configs/amip_target_edonly.yml"
checkpoint_dt: "99999days"
coupler_toml: ["toml/amip.toml"]
coupler_toml: ["toml/amip_no_precipitation_timescale.toml"]
print_config_dict: true
coupler_output_dir: "experiments/calibration/output"
dt: "800secs"
Expand Down Expand Up @@ -31,54 +31,19 @@ z_elem: 39
z_max: 60000.0
extra_atmos_diagnostics:
- reduction_time: average
short_name: rsut
period: 1months
writer: nc
- reduction_time: average
short_name: rlut
period: 1months
writer: nc
- reduction_time: average
short_name: rsdt
period: 1months
writer: nc
- reduction_time: average
short_name: rsutcs
period: 1months
writer: nc
- reduction_time: average
short_name: rlutcs
period: 1months
writer: nc
- reduction_time: average
short_name: pr
period: 1months
writer: nc
- reduction_time: average
short_name: ts
period: 1months
writer: nc
- reduction_time: average
short_name: ta
period: 1months
writer: nc
- reduction_time: average
short_name: hur
period: 1months
writer: nc
- reduction_time: average
short_name: hus
period: 1months
writer: nc
- reduction_time: average
short_name: clw
period: 1months
writer: nc
- reduction_time: average
short_name: cli
period: 1months
writer: nc
- reduction_time: average
short_name: pfull
short_name:
- rsut
- rlut
- rsdt
- rsutcs
- rlutcs
- pr
- ts
- ta
- hur
- hus
- clw
- cli
- pfull
period: 1months
writer: nc
1 change: 1 addition & 0 deletions experiments/calibration/coarse_amip/observation_map.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function process_outputvar(simdir, name)
monthly_avgs = ClimaAnalysis.Atmos.to_pressure_coordinates(monthly_avgs, pressure)
monthly_avgs = limit_pressure_dim_to_era5_range(monthly_avgs)
end
# TODO: Ask ollie how to replace nans in a way that makes sense
monthly_avgs = ClimaAnalysis.replace(monthly_avgs, missing => 0.0, NaN => 0.0)
monthly_avgs = ClimaAnalysis.shift_to_start_of_previous_month(monthly_avgs)

Expand Down
7 changes: 4 additions & 3 deletions experiments/calibration/coarse_amip/observation_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function get_all_output_vars(obs_dir, diagnostic_var2d, diagnostic_var3d)
# TOA net radiative flux
net_rad = rlut + rsut - rsdt
# For some reason we need to add the start date back in
# TODO: Make PR in climaanalysis to do this
net_rad.attributes["start_date"] = string(start_date)

# cloud radiative effect
Expand Down Expand Up @@ -77,13 +78,13 @@ function get_all_output_vars(obs_dir, diagnostic_var2d, diagnostic_var3d)
ql = era5_outputvar(joinpath(obs_dir, "era5_specific_cloud_liquid_water_content_1deg.nc"))
# Cloud specific ice water content
qi = era5_outputvar(joinpath(obs_dir, "era5_specific_cloud_ice_water_content_1deg.nc"))
foreach((qi, )) do var
foreach((ql, qi, )) do var
# Convert from hPa to Pa in-place so we don't create more huge OutputVars
@assert var.dim_attributes[pressure_name(var)]["units"] == "hPa"
var.dims[pressure_name(var)] .*= 100.0
set_dim_units!(var, pressure_name(var), "Pa")
end

# TODO: determine where time is spent here
ql = resample(reverse_dim(reverse_dim(ql, latitude_name(ql)), pressure_name(ql)))
qi = resample(reverse_dim(reverse_dim(qi, latitude_name(qi)), pressure_name(qi)))

Expand Down Expand Up @@ -231,7 +232,7 @@ function create_observation_vector(nt, yrs = 19)

return all_observations # NOT an EKP.ObservationSeries
end

# TODO: Ask kevin to implement in
downsample(var::ClimaAnalysis.OutputVar, n) = downsample(var.data, n)

function downsample(arr::AbstractArray, n)
Expand Down
29 changes: 29 additions & 0 deletions toml/amip_no_precipitation_timescale.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[alpha_rayleigh_w]
value = 10.0

[zd_rayleigh]
value = 40000.0

[zd_viscous]
value = 40000.0

[entr_inv_tau]
value = 0.002

[entr_coeff]
value = 0

[detr_inv_tau]
value = 0

[detr_buoy_coeff]
value = 0.12

[detr_vertdiv_coeff]
value = 0.6

[min_area_limiter_scale]
value = 0

[max_area_limiter_scale]
value = 0

0 comments on commit 0c21cf5

Please sign in to comment.