Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set netcdf_output_at_levels default to true #2908

Merged
merged 3 commits into from
Apr 17, 2024
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
2 changes: 1 addition & 1 deletion config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ output_default_diagnostics:
value: true
netcdf_output_at_levels:
help: "Do not perform any vertical interpolation in the output NetCDF files. Instead, interpolate horizontally and output the level. "
value: false
value: true
netcdf_interpolation_num_points:
help: "Override the number of interpolation point for the NetCDF output. This configuration has to be a list of integers, e.g. [180, 90, 10]."
value: ~
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/diagnostic_edmfx_bomex_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dt: "100secs"
t_end: "6hours"
dt_save_state_to_disk: "10mins"
toml: [toml/diagnostic_edmfx_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 60]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dt: "200secs"
t_end: "6hours"
dt_save_state_to_disk: "10mins"
toml: [toml/diagnostic_edmfx_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/diagnostic_edmfx_dycoms_rf01_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dt: 100secs
t_end: 4hours
dt_save_state_to_disk: 10mins
toml: [toml/diagnostic_edmfx_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ dt: 20secs
t_end: 4hours
dt_save_state_to_disk: 10mins
toml: [toml/diagnostic_edmfx_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/diagnostic_edmfx_gabls_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ dt: 200secs
t_end: 9hours
dt_save_state_to_disk: 10mins
toml: [toml/diagnostic_edmfx_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 8]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/diagnostic_edmfx_rico_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dt: 100secs
t_end: 8hours
dt_save_state_to_disk: 10mins
toml: [toml/diagnostic_edmfx_trmm_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 100]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/diagnostic_edmfx_test_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ config: "box"
job_id: "diagnostic_edmfx_test_box"
moist: "equil"
toml: [toml/diagnostic_edmfx_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 45]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/diagnostic_edmfx_trmm_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ t_end: 6hours
dt_save_state_to_disk: 10mins
FLOAT_TYPE: "Float64"
toml: [toml/diagnostic_edmfx_trmm_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 82]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ t_end: 6hours
dt_save_state_to_disk: 10mins
FLOAT_TYPE: "Float64"
toml: [toml/diagnostic_edmfx_trmm_box.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_adv_test_column.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ t_end: "3600secs"
dt_save_state_to_disk: "100secs"
FLOAT_TYPE: "Float64"
toml: [toml/prognostic_edmfx_advection.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 63]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_bomex_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dt: "50secs"
t_end: "6hours"
dt_save_state_to_disk: "30mins"
toml: [toml/prognostic_edmfx_bomex.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 60]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_bomex_column.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dt: "50secs"
t_end: "6hours"
dt_save_to_disk: "10mins"
toml: [toml/prognostic_edmfx_bomex.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 60]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dt: "1secs"
t_end: "6hours"
dt_save_to_disk: "10mins"
toml: [toml/prognostic_edmfx_bomex_explicit.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 60]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dt: "5secs"
t_end: "6hours"
dt_save_state_to_disk: "10mins"
toml: [toml/prognostic_edmfx_bomex.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 60]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dt: "50secs"
t_end: "6hours"
dt_save_state_to_disk: "10mins"
toml: [toml/prognostic_edmfx_bomex.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dt: 40secs
t_end: 4hours
dt_save_state_to_disk: 10mins
toml: [toml/prognostic_edmfx_dycoms_rf01.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_gabls_column.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ t_end: "9hours"
dt_save_state_to_disk: "30mins"
perturb_initstate: false
toml: [toml/prognostic_edmfx.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 8]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_rico_column.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dt: "5secs"
t_end: "6hours"
dt_save_state_to_disk: "10mins"
toml: [toml/prognostic_edmfx.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 100]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dt: 20secs"
t_end: "12hours"
dt_save_to_disk: "10mins"
toml: [toml/prognostic_edmfx_simpleplume.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 80]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_trmm_column.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ t_end: 6hours
dt_save_state_to_disk: 10mins
FLOAT_TYPE: "Float64"
toml: [toml/prognostic_edmfx.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 82]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
1 change: 0 additions & 1 deletion config/model_configs/prognostic_edmfx_trmm_column_0M.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ t_end: 6hours
dt_save_state_to_disk: 10mins
FLOAT_TYPE: "Float64"
toml: [toml/prognostic_edmfx.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [8, 8, 82]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ t_end: "6days"
use_reference_state: false
dt: "200secs"
job_id: "sphere_baroclinic_wave_rhoe_topography_dcmip_rs"
netcdf_output_at_levels: false
diagnostics:
- short_name: [pfull, wa, va, rv]
period: 1days
1 change: 1 addition & 0 deletions perf/benchmark_netcdf_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ for device in keys(timings)
[Dict("short_name" => "rhoa", "period" => config.parsed_args["dt"])]
config.parsed_args["netcdf_interpolation_num_points"] = [NUM, NUM, NUM]
config.parsed_args["job_id"] = "flame_perf_io"
config.parsed_args["netcdf_output_at_levels"] = false

simulation = CA.get_simulation(config)

Expand Down
46 changes: 35 additions & 11 deletions src/diagnostics/netcdf_writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ function add_space_coordinates_maybe!(
space::Spaces.ExtrudedFiniteDifferenceSpace,
num_points;
interpolated_physical_z = nothing,
disable_vertical_interpolation = false,
)

hdims_names = vdims_names = []
Expand All @@ -319,18 +320,40 @@ function add_space_coordinates_maybe!(
Spaces.staggering(space),
)

if Spaces.grid(space).hypsography isa Grids.Flat
vdims_names =
add_space_coordinates_maybe!(nc, vertical_space, num_points_vertic)
else
vdims_names = add_space_coordinates_maybe!(
nc,
vertical_space,
num_points_vertic,
interpolated_physical_z;
names = ("z_reference",),
depending_on_dimensions = hdims_names,
no_topography = Spaces.grid(space).hypsography isa Grids.Flat

if disable_vertical_interpolation
zpts = Array(
parent(space.grid.vertical_grid.center_local_geometry.coordinates),
)
name = no_topography ? "z" : "z_reference"
if !dimension_exists(nc, name, (num_points_vertic,))
zpts = Array(
parent(
space.grid.vertical_grid.center_local_geometry.coordinates,
),
)
add_dimension!(nc, name, zpts[:, 1], units = "m", axis = "Z")
end
vdims_names = [name]
else
if no_topography
vdims_names = add_space_coordinates_maybe!(
nc,
vertical_space,
num_points_vertic,
)
else
disable_vertical_interpolation && error("Not implemented")
vdims_names = add_space_coordinates_maybe!(
nc,
vertical_space,
num_points_vertic,
interpolated_physical_z;
names = ("z_reference",),
depending_on_dimensions = hdims_names,
)
end
end

return (hdims_names..., vdims_names...)
Expand Down Expand Up @@ -704,6 +727,7 @@ function save_diagnostic_to_disk!(
space,
writer.num_points;
writer.interpolated_physical_z,
writer.disable_vertical_interpolation,
)

if haskey(nc, "$(var.short_name)")
Expand Down
Loading