Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ ClimaCoupler.jl Release Notes
`main`
-------

#### Configurable land and coupler diagnostics output frequency and reduction
Adds new config options to control the period and reduction type of land and
coupler diagnostics, matching the existing options for ocean and sea-ice:
- `land_diagnostics_period` (default `"monthly"`) and
`land_diagnostics_reduction` (default `"average"`)
- `coupler_diagnostics_period` (default `nothing`, falls back to the
auto-derived `get_diag_period`) and `coupler_diagnostics_reduction`
(default `"average"`)

Also fixes the calls to `ClimaLand.default_diagnostics` in the ClimaLand
extension to pass `outdir` positionally, so the dispatched method actually
produces land diagnostics instead of falling through to the no-op fallback.

#### Update SST, SIC at monthly frequency PR[#1926](https://github.com/CliMA/ClimaCoupler.jl/pull/1926)
For prescribed ocean and sea ice models, read in SST and SIC
data monthly instead of at the model timestep. These data have
Expand Down
10 changes: 9 additions & 1 deletion config/ci_configs/cmip_oceananigans_climaseaice.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FLOAT_TYPE: "Float32"
albedo_model: "CouplerAlbedo"
atmos_config_file: "config/atmos_configs/climaatmos_edonly.yml"
coupler_diagnostics_period: "1hours"
coupler_diagnostics_reduction: "instantaneous"
coupler_toml: ["toml/amip_edonly.toml"]
dt_atmos: "120secs" # 2 minutes
dt_cpl: "360secs" # 6 minutes
Expand All @@ -11,18 +13,24 @@ dz_bottom: 100.0
energy_check: false
h_elem: 8
ice_model: "clima_seaice"
land_diagnostics_period: "1hours"
land_diagnostics_reduction: "instantaneous"
land_model: "integrated"
land_spun_up_ic: false
mode_name: "cmip"
netcdf_output_at_levels: true
ocean_diagnostic_interval: "1hours"
ocean_diagnostic_mode: "instantaneous"
ocean_model: "oceananigans"
output_default_diagnostics: true
radiation_reset_rng_seed: true
rayleigh_sponge: true
seaice_diagnostic_interval: "1hours"
seaice_diagnostic_mode: "instantaneous"
simple_ocean: true
start_date: "20100101"
surface_setup: "PrescribedSurface"
t_end: "12hours"
t_end: "3hours"
topo_smoothing: true
topography: "Earth"
viscous_sponge: true
Expand Down
10 changes: 9 additions & 1 deletion config/ci_configs/cmip_oceananigans_climaseaice_bucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FLOAT_TYPE: "Float32"
albedo_model: "CouplerAlbedo"
atmos_config_file: "config/atmos_configs/climaatmos_edonly.yml"
bucket_albedo_type: "map_temporal"
coupler_diagnostics_period: "1hours"
coupler_diagnostics_reduction: "instantaneous"
coupler_toml: ["toml/amip_edonly.toml"]
dt_atmos: "120secs" # 2 minutes
dt_cpl: "360secs" # 6 minutes
Expand All @@ -12,16 +14,22 @@ dz_bottom: 100.0
energy_check: false
h_elem: 8
ice_model: "clima_seaice"
land_diagnostics_period: "1hours"
land_diagnostics_reduction: "instantaneous"
mode_name: "cmip"
netcdf_output_at_levels: true
ocean_diagnostic_interval: "1hours"
ocean_diagnostic_mode: "instantaneous"
ocean_model: "oceananigans"
output_default_diagnostics: true
radiation_reset_rng_seed: true
rayleigh_sponge: true
seaice_diagnostic_interval: "1hours"
seaice_diagnostic_mode: "instantaneous"
simple_ocean: true
start_date: "20100101"
surface_setup: "PrescribedSurface"
t_end: "12hours"
t_end: "3hours"
topo_smoothing: true
topography: "Earth"
viscous_sponge: true
Expand Down
16 changes: 12 additions & 4 deletions config/longrun_configs/cmip_diagedmf_land.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FLOAT_TYPE: "Float64"
albedo_model: "CouplerAlbedo"
atmos_config_file: "config/atmos_configs/climaatmos_diagedmf.yml"
checkpoint_dt: "1months"
coupler_diagnostics_period: "1days"
coupler_diagnostics_reduction: "instantaneous"
coupler_toml: ["toml/amip_diagedmf.toml"]
dt_atmos: "120secs" # 2 minutes
dt_cloud_fraction: "1hours"
Expand All @@ -13,18 +15,24 @@ dt_seaice: "360secs" # 6 minutes
energy_check: false
extra_atmos_diagnostics:
- short_name: [hur, hus, ta]
period: 1months
reduction_time: average
period: 1days
reduction_time: inst
pressure_coordinates: true
compute_every: 6hours
compute_every: 1days
ice_model: "clima_seaice"
insolation: "timevarying"
land_diagnostics_period: "1days"
land_diagnostics_reduction: "instantaneous"
land_model: "integrated"
land_spun_up_ic: false
mode_name: "cmip"
ocean_model: "oceananigans"
output_default_diagnostics: true
ocean_diagnostic_interval: "1days"
ocean_diagnostic_mode: "instantaneous"
output_default_diagnostics: false
rmse_check: true
seaice_diagnostic_interval: "1days"
seaice_diagnostic_mode: "instantaneous"
start_date: "20100101"
surface_setup: "PrescribedSurface"
t_end: "186days"
Expand Down
15 changes: 10 additions & 5 deletions config/longrun_configs/cmip_edonly_bucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FLOAT_TYPE: "Float64"
atmos_config_file: "config/atmos_configs/climaatmos_edonly.yml"
bucket_albedo_type: "map_temporal"
checkpoint_dt: "1months"
coupler_diagnostics_period: "1days"
coupler_diagnostics_reduction: "instantaneous"
dt_atmos: "120secs" # 2 minutes
dt_cloud_fraction: "1hours"
dt_cpl: "360secs" # 6 minutes
Expand All @@ -12,12 +14,15 @@ dt_seaice: "360secs" # 6 minutes
energy_check: false
ice_model: "clima_seaice"
insolation: "timevarying"
land_diagnostics_period: "1days"
land_diagnostics_reduction: "instantaneous"
mode_name: "cmip"
ocean_model: "oceananigans"
ocean_diagnostic_interval: "1days"
ocean_diagnostic_mode: "averaged"
ocean_diagnostic_mode: "instantaneous"
output_default_diagnostics: false
seaice_diagnostic_interval: "1days"
seaice_diagnostic_mode: "averaged"
seaice_diagnostic_mode: "instantaneous"
rmse_check: true
start_date: "20100101"
surface_setup: "PrescribedSurface"
Expand All @@ -26,7 +31,7 @@ topo_smoothing: true
topography: "Earth"
extra_atmos_diagnostics:
- short_name: [hur, hus, ta]
period: 1months
reduction_time: average
period: 1days
reduction_time: inst
pressure_coordinates: true
compute_every: 6hours
compute_every: 1days
15 changes: 12 additions & 3 deletions config/longrun_configs/cmip_edonly_land.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FLOAT_TYPE: "Float64"
atmos_config_file: "config/atmos_configs/climaatmos_edonly.yml"
checkpoint_dt: "1months"
coupler_diagnostics_period: "1days"
coupler_diagnostics_reduction: "instantaneous"
dt_atmos: "120secs" # 2 minutes
dt_cloud_fraction: "1hours"
dt_cpl: "360secs" # 6 minutes
Expand All @@ -11,17 +13,24 @@ dt_seaice: "360secs" # 6 minutes
energy_check: false
extra_atmos_diagnostics:
- short_name: [hur, hus, ta]
period: 1months
reduction_time: average
period: 1days
reduction_time: inst
pressure_coordinates: true
compute_every: 6hours
compute_every: 1days
ice_model: "clima_seaice"
insolation: "timevarying"
land_diagnostics_period: "1days"
land_diagnostics_reduction: "instantaneous"
land_model: "integrated"
land_spun_up_ic: false
mode_name: "cmip"
ocean_model: "oceananigans"
ocean_diagnostic_interval: "1days"
ocean_diagnostic_mode: "instantaneous"
output_default_diagnostics: false
rmse_check: true
seaice_diagnostic_interval: "1days"
seaice_diagnostic_mode: "instantaneous"
start_date: "20100101"
surface_setup: "PrescribedSurface"
t_end: "366days"
Expand Down
16 changes: 12 additions & 4 deletions config/longrun_configs/cmip_progedmf_land.yml
Comment thread
akshaysridhar marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FLOAT_TYPE: "Float64"
albedo_model: "CouplerAlbedo"
atmos_config_file: "config/atmos_configs/climaatmos_progedmf.yml"
checkpoint_dt: "1months"
coupler_diagnostics_period: "1days"
coupler_diagnostics_reduction: "instantaneous"
coupler_toml: ["toml/amip_progedmf.toml"]
dt_atmos: "120secs" # 2 minutes
dt_cloud_fraction: "1hours"
Expand All @@ -13,18 +15,24 @@ dt_seaice: "360secs" # 6 minutes
energy_check: false
extra_atmos_diagnostics:
- short_name: [hur, hus, ta]
period: 1months
reduction_time: average
period: 1days
reduction_time: inst
pressure_coordinates: true
compute_every: 6hours
compute_every: 1days
ice_model: "clima_seaice"
insolation: "timevarying"
land_diagnostics_period: "1days"
land_diagnostics_reduction: "instantaneous"
land_model: "integrated"
land_spun_up_ic: false
mode_name: "cmip"
ocean_model: "oceananigans"
output_default_diagnostics: true
ocean_diagnostic_interval: "1days"
ocean_diagnostic_mode: "instantaneous"
output_default_diagnostics: false
Comment thread
akshaysridhar marked this conversation as resolved.
rmse_check: true
seaice_diagnostic_interval: "1days"
seaice_diagnostic_mode: "instantaneous"
start_date: "20100101"
surface_setup: "PrescribedSurface"
t_end: "186days"
Expand Down
9 changes: 9 additions & 0 deletions docs/src/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ multiple configuration files can be used together:
- **Atmos config file** (`--atmos_config_file`): Optional ClimaAtmos-specific configuration
- **TOML parameter files** (`--coupler_toml`): One or more TOML files containing model parameters

Sometimes, the coupler config file includes options that are not defined in ClimaCoupler.jl,
but affect only the atmosphere model. For example `output_default_diagnostics` controls
only the atmosphere diagnostics, despite its generic name. The full set of options used by
the atmosphere model can be found in the [ClimaAtmos.jl docs](https://clima.github.io/ClimaAtmos.jl/stable/config/).

When multiple config files are specified, values in the coupler config file will take
precedence over those in the atmosphere config file. This is explained in more detail
in the [Precendence of Config Files and CLI Arguments](#precendence-of-config-files-and-cli-arguments)
Expand Down Expand Up @@ -135,6 +140,8 @@ specific timesteps should be specified, rather than only `dt`.
| Argument | Type | Default | Valid Options | Description |
|----------|------|---------|---------------|-------------|
| `--use_coupler_diagnostics` | Bool | `true` | `true`, `false` | Whether to compute and output coupler diagnostics |
| `--coupler_diagnostics_period` | String | `nothing` | `"Nsecs"`, `"Nmins"`, `"Nhours"`, `"Ndays"`, `"Nmonths"` | Time interval between coupler diagnostic outputs. If unset, the period is auto-derived from the simulation duration. |
| `--coupler_diagnostics_reduction` | String | `"average"` | `average`, `instantaneous`, `max`, `min` | Reduction mode for coupler diagnostic outputs |
| `--coupler_output_dir` | String | `"output"` | Any valid directory path | Directory to save output files |


Expand Down Expand Up @@ -164,6 +171,8 @@ specific timesteps should be specified, rather than only `dt`.
| `--land_model` | String | `"bucket"` | `bucket`, `integrated` | Land model to use |
| `--land_temperature_anomaly` | String | `"aquaplanet"` | `amip`, `aquaplanet`, `nothing` | Type of temperature anomaly for land model |
| `--use_land_diagnostics` | Bool | `true` | `true`, `false` | Whether to compute and output land model diagnostics |
| `--land_diagnostics_period` | String | `"1months"` | `"30mins"`, `"1hours"`, `"1days"`, `"10days"`, `"1months"` | Time interval between land diagnostic outputs. ClimaLand's diagnostics API only accepts a fixed set of periods, so the values listed here are the only supported options. |
| `--land_diagnostics_reduction` | String | `"average"` | `average`, `instantaneous`, `max`, `min` | Reduction type for land diagnostic outputs |
| `--land_spun_up_ic` | Bool | `false` | `true`, `false` | Whether to use integrated land initial conditions from spun up state |
| `--lai_source` | String | `"modis_monthly"` | `modis_monthly`, `modis_monthly_climatology` | Source for leaf area index data. `modis_monthly` uses full MODIS monthly data, `modis_monthly_climatology` uses MODIS monthly climatology with periodic calendar |
| `--bucket_albedo_type` | String | `"map_static"` | `map_static`, `function`, `map_temporal`, `era5` | Access bucket surface albedo information from data file. Use `era5` for ERA5-derived processed albedo files (requires `era5_initial_condition_dir`) |
Expand Down
7 changes: 6 additions & 1 deletion ext/ClimaCouplerClimaLandExt/climaland_bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function BucketSimulation(
atmos_h,
land_temperature_anomaly::String = "amip",
use_land_diagnostics::Bool = true,
land_diagnostics_period::Symbol = :monthly,
land_diagnostics_reduction::Symbol = :average,
albedo_type::String = "map_static",
bucket_initial_condition::String = "",
era5_albedo_file_path::Union{Nothing, String} = nothing,
Expand Down Expand Up @@ -185,8 +187,11 @@ function BucketSimulation(
diagnostics = CL.default_diagnostics(
model,
start_date,
output_dir;
output_writer = output_writer,
reduction_period = :monthly,
reduction_period = land_diagnostics_period,
reduction_type = land_diagnostics_reduction,
dt = float(dt),
)
else
diagnostics = nothing
Expand Down
7 changes: 6 additions & 1 deletion ext/ClimaCouplerClimaLandExt/climaland_integrated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function ClimaLandSimulation(
atmos_h,
land_temperature_anomaly::String = "amip",
use_land_diagnostics::Bool = true,
land_diagnostics_period::Symbol = :monthly,
land_diagnostics_reduction::Symbol = :average,
coupled_param_dict = CP.create_toml_dict(FT),
land_ic_path::Union{Nothing, String} = nothing,
lai_source::String = "modis_monthly",
Expand Down Expand Up @@ -186,9 +188,12 @@ function ClimaLandSimulation(
diagnostics = CL.default_diagnostics(
model,
start_date,
output_dir;
output_writer = output_writer,
output_vars = :short,
reduction_period = :monthly,
reduction_period = land_diagnostics_period,
reduction_type = land_diagnostics_reduction,
dt = float(dt),
)
else
output_writer = nothing
Expand Down
Loading
Loading