Skip to content

Commit

Permalink
Fix 3355
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Oct 3, 2024
1 parent b17acc1 commit 6bd423c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ function set_insolation_variables!(Y, p, t, ::TimeVaryingInsolation)
@. weighted_irradiance = irradiance * (au / last(insolation_tuple))^2
else
# assume that the latitude and longitude are both 0 for flat space
insolation_tuple = instantaneous_zenith_angle(d, δ, η_UTC, FT(0), FT(0))
rrtmgp_model.cos_zenith .=
cos(min(first(insolation_tuple), max_zenith_angle))
rrtmgp_model.weighted_irradiance .=
irradiance * (au / last(insolation_tuple))^2
@. insolation_tuple =
instantaneous_zenith_angle(d, δ, η_UTC, FT(0), FT(0))
zenith_angle = insolation_tuple.:1
earth_sun_distance = insolation_tuple.:3
@. rrtmgp_model.cos_zenith = cos(min(zenith_angle, max_zenith_angle))
@. rrtmgp_model.weighted_irradiance =
irradiance * (au / earth_sun_distance)^2
end
end

Expand Down

0 comments on commit 6bd423c

Please sign in to comment.