Skip to content

Commit

Permalink
make aerosol radiation work on GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Jul 9, 2024
1 parent 98bac83 commit 2b5c5c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/model_configs/gpu_aquaplanet_dyamond.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ surface_setup: "DefaultMoninObukhov"
rayleigh_sponge: true
dt: "100secs"
t_end: "8hours"
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "DST02", "DST03", "DST04", "OC1", "OC2", "SO4", "SOA", "SSLT01", "SSLT02", "SSLT03", "SSLT04"]
toml: [toml/longrun_aquaplanet_dyamond.toml]
6 changes: 5 additions & 1 deletion src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ function set_aerosol_type(;
OC2 = 0,
_...,
)
_, index = findmax((DST01, SSLT01, SO4, CB1, CB2, OC1, OC2))
maxval = max(DST01, SSLT01, SO4, CB1, CB2, OC1, OC2)
index = findfirst(
c -> c == maxval,
(DST01, SSLT01, SO4, CB1, CB2, OC1, OC2),
)::Int
return index
end
set_aerosol_type(NT) = set_aerosol_type(; NT...)
Expand Down

0 comments on commit 2b5c5c0

Please sign in to comment.