Skip to content

Commit 33a7d7f

Browse files
Merge remote-tracking branch 'origin/ss/add-radiative-flux-diagnostic' into ss-nc/fix-climatoloy-experiment
2 parents 0159623 + 0ec0bd4 commit 33a7d7f

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

src/OceanSeaIceModels/InterfaceComputations/assemble_net_fluxes.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,15 @@ end
103103
α = stateindex(atmos_ocean_properties.radiation.α, i, j, kᴺ, grid, time)
104104
ϵ = stateindex(atmos_ocean_properties.radiation.ϵ, i, j, kᴺ, grid, time)
105105
Qu = upwelling_radiation(Tₛ, σ, ϵ)
106-
Qr = (; Qs, Qℓ)
107-
Qd = net_downwelling_radiation(Qr, α, ϵ)
108-
ΣQao = Qd + Qu + Qc + Qv
106+
Qdℓ = downwelling_longwave_radiation(Qℓ, ϵ)
107+
Qds = downwelling_shortwave_radiation(Qs, α)
108+
ΣQao = Qu + Qc + Qv + Qdℓ + Qds
109+
110+
@inbounds begin
111+
atmos_ocean_fluxes.upwelling_longwave[i, j, 1] = Qu
112+
atmos_ocean_fluxes.downwelling_longwave[i, j, 1] = Qdℓ
113+
atmos_ocean_fluxes.downwelling_shortwave[i, j, 1] = Qds
114+
end
109115

110116
# Convert from a mass flux to a volume flux (aka velocity)
111117
# by dividing with the density of freshwater.

src/OceanSeaIceModels/InterfaceComputations/component_interfaces.jl

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,23 @@ function atmosphere_ocean_interface(atmos,
178178
velocity_formulation,
179179
specific_humidity_formulation)
180180

181-
water_vapor = Field{Center, Center, Nothing}(ocean.model.grid)
182-
latent_heat = Field{Center, Center, Nothing}(ocean.model.grid)
183-
sensible_heat = Field{Center, Center, Nothing}(ocean.model.grid)
184-
x_momentum = Field{Center, Center, Nothing}(ocean.model.grid)
185-
y_momentum = Field{Center, Center, Nothing}(ocean.model.grid)
186-
ao_fluxes = (; latent_heat, sensible_heat, water_vapor, x_momentum, y_momentum)
181+
water_vapor = Field{Center, Center, Nothing}(ocean.model.grid)
182+
latent_heat = Field{Center, Center, Nothing}(ocean.model.grid)
183+
sensible_heat = Field{Center, Center, Nothing}(ocean.model.grid)
184+
x_momentum = Field{Center, Center, Nothing}(ocean.model.grid)
185+
y_momentum = Field{Center, Center, Nothing}(ocean.model.grid)
186+
upwelling_longwave = Field{Center, Center, Nothing}(ocean.model.grid)
187+
downwelling_longwave = Field{Center, Center, Nothing}(ocean.model.grid)
188+
downwelling_shortwave = Field{Center, Center, Nothing}(ocean.model.grid)
189+
190+
ao_fluxes = (; latent_heat,
191+
sensible_heat,
192+
water_vapor,
193+
x_momentum,
194+
y_momentum,
195+
upwelling_longwave,
196+
downwelling_longwave,
197+
downwelling_shortwave)
187198

188199
σ = radiation.stefan_boltzmann_constant
189200
αₐₒ = radiation.reflection.ocean

src/OceanSeaIceModels/InterfaceComputations/radiation.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ end
9494
@inline net_downwelling_radiation(i, j, grid, time, α, ϵ, Qs, Qℓ) = - (1 - α) * Qs - ϵ * Qℓ
9595
@inline net_downwelling_radiation(r, α, ϵ) = - (1 - α) * r.Qs - ϵ * r.Qℓ
9696

97+
# Split the individual bands
98+
@inline downwelling_longwave_radiation(Qℓ, ϵ) = - ϵ * Qℓ
99+
@inline downwelling_shortwave_radiation(Qℓ, ϵ) = - (1 - α) * Qs

0 commit comments

Comments
 (0)