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

Update config and initialization code for DYAMOND configuration #2292

Merged
merged 1 commit into from
Oct 26, 2023
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
4 changes: 2 additions & 2 deletions config/gpu_configs/gpu_aquaplanet_dyamond.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h_elem: 60
h_elem: 30
z_max: 55000.0
z_elem: 63
dz_bottom: 30.0
Expand All @@ -15,6 +15,6 @@ rayleigh_sponge: true
dt_save_to_disk: "3hours"
dt: "50secs"
t_end: "1days"
FLOAT_TYPE: "Float64"
FLOAT_TYPE: "Float32"
job_id: "gpu_aquaplanet_dyamond"
toml: [toml/longrun_aquaplanet_dyamond.toml]
14 changes: 12 additions & 2 deletions src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ function radiation_model_cache(
data_loader,
)
context = ClimaComms.context(axes(Y.c))
device = context.device
(; idealized_h2o, idealized_insolation, idealized_clouds) = radiation_mode
FT = Spaces.undertype(axes(Y.c))
DA = ClimaComms.array_type(device){FT}
rrtmgp_params = CAP.rrtmgp_params(params)
if idealized_h2o && radiation_mode isa RRTMGPI.GrayRadiation
error("idealized_h2o can't be used with $radiation_mode")
Expand Down Expand Up @@ -82,8 +84,16 @@ function radiation_model_cache(
input_center_pressure,
input_center_volume_mixing_ratio_o3,
)
ᶜvolume_mixing_ratio_o3_field =
@. FT(pressure2ozone(default_cache.ᶜp))
if device isa ClimaComms.CUDADevice
fv = Fields.field_values(default_cache.ᶜp)
fld_array = DA(pressure2ozone.(Array(parent(fv))))
data = DataLayouts.rebuild(fv, fld_array)
ᶜvolume_mixing_ratio_o3_field =
Fields.Field(data, axes(default_cache.ᶜp))
else
ᶜvolume_mixing_ratio_o3_field =
@. FT(pressure2ozone(default_cache.ᶜp))
end
center_volume_mixing_ratio_o3 =
RRTMGPI.field2array(ᶜvolume_mixing_ratio_o3_field)

Expand Down
Loading