Skip to content

Commit

Permalink
Merge #2292
Browse files Browse the repository at this point in the history
2292: Update config and initialization code for DYAMOND configuration r=sriharshakandala a=sriharshakandala



Co-authored-by: sriharshakandala <sriharsha.kvs@gmail.com>
  • Loading branch information
bors[bot] and sriharshakandala authored Oct 25, 2023
2 parents 18c84ac + 10bba68 commit ae44e03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
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

0 comments on commit ae44e03

Please sign in to comment.