Skip to content

Commit

Permalink
change back to argmax
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Jul 9, 2024
1 parent 66dd0e9 commit 1382c6f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,22 @@ function set_insolation_variables!(Y, p, t, ::TimeVaryingInsolation)
end
end

function set_aerosol_type(::Type{FT};
DST01 = FT(0),
SSLT01 = FT(0),
SO4 = FT(0),
CB1 = FT(0),
CB2 = FT(0),
OC1 = FT(0),
OC2 = FT(0),
function set_aerosol_type(;
DST01 = 0,
SSLT01 = 0,
SO4 = 0,
CB1 = 0,
CB2 = 0,
OC1 = 0,
OC2 = 0,
_...,
) where{FT}
_, index = findmax((DST01, SSLT01, SO4, CB1, CB2, OC1, OC2))::Tuple{FT, Int}
#index = argmax(Base.Fix1(getindex, (DST01, SSLT01, SO4, CB1, CB2, OC1, OC2)), 1:7)
return index
)
return argmax(
Base.Fix1(getindex, (DST01, SSLT01, SO4, CB1, CB2, OC1, OC2)),
1:7,
)
end
set_aerosol_type(nt) = set_aerosol_type(eltype(nt); nt...)
set_aerosol_type(nt) = set_aerosol_type(; nt...)

NVTX.@annotate function save_state_to_disk_func(integrator, output_dir)
(; t, u, p) = integrator
Expand Down

0 comments on commit 1382c6f

Please sign in to comment.