Skip to content

Commit cf49041

Browse files
committed
Make number of NetCDF points YAML controllable
1 parent 8760f6e commit cf49041

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

config/default_configs/default_config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ netcdf_interpolate_z_over_msl:
256256
netcdf_output_at_levels:
257257
help: "Do not perform any vertical interpolation in the output NetCDF files. Instead, interpolate horizontally and output the level. This is incompatible with netcdf_interpolate_z_over_msl when topography is present."
258258
value: false
259+
netcdf_interpolation_num_points:
260+
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]."
261+
value: ~
259262
warn_allocations_diagnostics:
260263
help: "When true, a dry-run for all the diagnostics is performed to check whether the functions allocate additional memory (which reduces performances)"
261264
value: false

config/model_configs/single_column_radiative_equilibrium_gray.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ z_max: 70000.0
1111
dt_save_to_sol: "30hours"
1212
job_id: "single_column_radiative_equilibrium_gray"
1313
rad: "gray"
14+
netcdf_interpolation_num_points: [1, 1, 80]

src/solver/type_getters.jl

+11
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,19 @@ function get_diagnostics(parsed_args, atmos_model, spaces)
574574
)
575575

576576
hdf5_writer = CAD.HDF5Writer()
577+
578+
if !isnothing(parsed_args["netcdf_interpolation_num_points"])
579+
num_netcdf_points =
580+
tuple(parsed_args["netcdf_interpolation_num_points"]...)
581+
else
582+
# TODO: Once https://github.com/CliMA/ClimaCore.jl/pull/1567 is merged,
583+
# dispatch over the Grid type
584+
num_netcdf_points = (180, 90, 50)
585+
end
586+
577587
netcdf_writer = CAD.NetCDFWriter(;
578588
spaces,
589+
num_points = num_netcdf_points,
579590
interpolate_z_over_msl = parsed_args["netcdf_interpolate_z_over_msl"],
580591
disable_vertical_interpolation = parsed_args["netcdf_output_at_levels"],
581592
)

0 commit comments

Comments
 (0)