Skip to content

Commit 3859ffe

Browse files
authored
Merge pull request #1447 from CliMA/js/salinity-flux
fix salinity flux signs
2 parents e56a167 + c4c5f2d commit 3859ffe

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

experiments/ClimaEarth/components/ocean/oceananigans.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,19 @@ Interfacer.get_field(sim::OceananigansSimulation, ::Val{:surface_diffuse_albedo}
233233
# NOTE: This is 3D, but it will be remapped to 2D
234234
Interfacer.get_field(sim::OceananigansSimulation, ::Val{:surface_temperature}) = 273.15 + sim.ocean.model.tracers.T
235235

236+
"""
237+
FluxCalculator.update_turbulent_fluxes!(sim::OceananigansSimulation, fields)
238+
239+
Update the turbulent fluxes in the simulation using the values stored in the coupler fields.
240+
These include latent heat flux, sensible heat flux, momentum fluxes, and moisture flux.
241+
242+
A note on sign conventions:
243+
SurfaceFluxes and Oceananigans both use the convention that a positive flux is an upward flux.
244+
No sign change is needed during the exchange, except for moisture/salinity fluxes:
245+
SurfaceFluxes provides moisture moving from atmosphere to ocean as a negative flux at the surface,
246+
and Oceananigans represents moisture moving from atmosphere to ocean as a positive salinity flux,
247+
so a sign change is needed when we convert from moisture to salinity flux.
248+
"""
236249
function FluxCalculator.update_turbulent_fluxes!(sim::OceananigansSimulation, fields)
237250
# Only LatitudeLongitudeGrid are supported because otherwise we have to rotate the vectors
238251

@@ -349,6 +362,13 @@ by the coupler.
349362
350363
Update the portion of the surface_fluxes for T and S that is due to radiation and
351364
precipitation. The rest will be updated in `update_turbulent_fluxes!`.
365+
366+
A note on sign conventions:
367+
ClimaAtmos and Oceananigans both use the convention that a positive flux is an upward flux.
368+
No sign change is needed during the exchange, except for precipitation/salinity fluxes.
369+
ClimaAtmos provides precipitation as a negative flux at the surface, and
370+
Oceananigans represents precipitation as a positive salinity flux,
371+
so a sign change is needed when we convert from precipitation to salinity flux.
352372
"""
353373
function FieldExchanger.update_sim!(sim::OceananigansSimulation, csf, area_fraction)
354374
(; ocean_reference_density, ocean_heat_capacity, ocean_fresh_water_density) = sim.ocean_properties

0 commit comments

Comments
 (0)