-
Notifications
You must be signed in to change notification settings - Fork 6
Clean up some diagnostics and ensure that diagnostics return AbstractOperations #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f5e9464
a9d7255
e2d86ff
c934dc9
bc2ecbc
fe8bb33
e08da88
e9b0a46
ec708fd
43ecf6f
2850600
e1b5fd3
786456b
977c2ec
ccedd01
9dc7ac9
f6c1fd2
42220a3
0fddfcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,8 @@ end | |
| ########################### | ||
|
|
||
| """ | ||
| <<<<<<< HEAD | ||
| ======= | ||
| frazil_heat_flux(esm::EarthSystemModel) | ||
|
|
||
| Return the two-dimensional frazil heat flux (W m⁻²) in a coupled `esm`. | ||
|
|
@@ -82,15 +84,17 @@ end | |
| frazil_heat_flux(esm::NoSeaIceOceanInterfaceModel) = ZeroField() | ||
|
|
||
| """ | ||
| >>>>>>> main | ||
| net_ocean_heat_flux(esm::EarthSystemModel) | ||
|
|
||
| Return the net heat flux (W m⁻²) at the ocean's surface in a coupled `esm`. | ||
| """ | ||
| function net_ocean_heat_flux(esm::EarthSystemModel) | ||
| Jᵀ = esm.ocean.model.tracers.T.boundary_conditions.top.condition # temperature flux | ||
| ρᵒᶜ = esm.interfaces.ocean_properties.reference_density | ||
| cᵒᶜ = esm.interfaces.ocean_properties.heat_capacity | ||
| net_ocean_heat_flux = ρᵒᶜ * cᵒᶜ * net_ocean_temperature_flux(esm) | ||
| return Field(net_ocean_heat_flux) | ||
| frazil_heat_flux = esm.interfaces.sea_ice_ocean_interface.fluxes.frazil_heat | ||
| return ρᵒᶜ * cᵒᶜ * Jᵀ + frazil_heat_flux | ||
| end | ||
|
|
||
| """ | ||
|
|
@@ -100,9 +104,14 @@ Return the sea ice-ocean heat flux (W m⁻²) at the sea ice-ocean interface | |
| in a coupled `esm`. | ||
| """ | ||
| function sea_ice_ocean_heat_flux(esm::EarthSystemModel) | ||
| <<<<<<< HEAD | ||
| frazil_heat_flux = esm.interfaces.sea_ice_ocean_interface.fluxes.frazil_heat | ||
| return esm.interfaces.sea_ice_ocean_interface.fluxes.interface_heat + frazil_heat_flux | ||
| ======= | ||
| sea_ice_ocean_fluxes = esm.interfaces.sea_ice_ocean_interface.fluxes | ||
| sea_ice_ocean_heat_flux = sea_ice_ocean_fluxes.interface_heat + frazil_heat_flux(esm) | ||
| return Field(sea_ice_ocean_heat_flux) | ||
| >>>>>>> main | ||
| end | ||
|
|
||
| sea_ice_ocean_heat_flux(esm::NoSeaIceOceanInterfaceModel) = ZeroField() | ||
|
|
@@ -113,6 +122,10 @@ sea_ice_ocean_heat_flux(esm::NoSeaIceOceanInterfaceModel) = ZeroField() | |
| Return the atmosphere-ocean heat flux (W m⁻²) at the atmosphere-ocean | ||
| interface in a coupled `esm`. | ||
| """ | ||
| <<<<<<< HEAD | ||
| atmosphere_ocean_heat_flux(esm::EarthSystemModel) = | ||
| net_ocean_heat_flux(esm) - sea_ice_ocean_heat_flux(esm) | ||
| ======= | ||
| function atmosphere_ocean_heat_flux(esm::EarthSystemModel) | ||
| ρᵒᶜ = esm.interfaces.ocean_properties.reference_density | ||
| cᵒᶜ = esm.interfaces.ocean_properties.heat_capacity | ||
|
|
@@ -160,6 +173,7 @@ function atmosphere_ocean_salinity_flux(esm::EarthSystemModel) | |
| net_ocean_salinity_flux(esm) - sea_ice_ocean_salinity_flux(esm) | ||
| return Field(atmosphere_ocean_salinity_flux) | ||
| end | ||
| >>>>>>> main | ||
|
|
||
|
|
||
| ########################### | ||
|
|
@@ -171,25 +185,17 @@ end | |
|
|
||
| Return the net freshwater mass flux (kg m⁻² s⁻¹) at the ocean's surface in a coupled `esm`. | ||
| """ | ||
| function net_ocean_freshwater_flux(esm::EarthSystemModel; reference_salinity = 35) | ||
| ρᵒᶜ = esm.interfaces.ocean_properties.reference_density | ||
| S₀ = convert(typeof(ρᵒᶜ), reference_salinity) | ||
| net_ocean_frashwater_flux = - ρᵒᶜ / S₀ * net_ocean_salinity_flux(esm) | ||
| return Field(net_ocean_frashwater_flux) | ||
| end | ||
| net_ocean_freshwater_flux(esm::EarthSystemModel) = | ||
| sea_ice_ocean_freshwater_flux(esm) + atmosphere_ocean_freshwater_flux(esm) | ||
|
|
||
| """ | ||
| sea_ice_ocean_freshwater_flux(esm::EarthSystemModel) | ||
|
|
||
| Return the sea ice-ocean freshwater mass flux (kg m⁻² s⁻¹) at the sea ice-ocean interface | ||
| in a coupled `esm`. | ||
| """ | ||
| function sea_ice_ocean_freshwater_flux(esm::EarthSystemModel; reference_salinity = 35) | ||
| ρᵒᶜ = esm.interfaces.ocean_properties.reference_density | ||
| S₀ = convert(typeof(ρᵒᶜ), reference_salinity) | ||
| sea_ice_ocean_freshwater_flux = - ρᵒᶜ / S₀ * sea_ice_ocean_salinity_flux(esm) | ||
| return Field(sea_ice_ocean_freshwater_flux) | ||
| end | ||
| sea_ice_ocean_freshwater_flux(esm::EarthSystemModel) = | ||
| esm.interfaces.sea_ice_ocean_interface.fluxes.freshwater_flux | ||
|
|
||
| sea_ice_ocean_freshwater_flux(esm::NoSeaIceOceanInterfaceModel; kwargs...) = ZeroField() | ||
|
|
||
|
|
@@ -199,9 +205,7 @@ sea_ice_ocean_freshwater_flux(esm::NoSeaIceOceanInterfaceModel; kwargs...) = Zer | |
| Return the atmosphere-ocean freshwater mass flux (kg m⁻² s⁻¹) at the atmosphere-ocean | ||
| interface in a coupled `esm`. | ||
| """ | ||
| function atmosphere_ocean_freshwater_flux(esm::EarthSystemModel; reference_salinity = 35) | ||
| function atmosphere_ocean_freshwater_flux(esm::EarthSystemModel) | ||
| ρᵒᶜ = esm.interfaces.ocean_properties.reference_density | ||
| S₀ = convert(typeof(ρᵒᶜ), reference_salinity) | ||
| atmosphere_ocean_freshwater_flux = - ρᵒᶜ / S₀ * atmosphere_ocean_salinity_flux(esm) | ||
| return Field(atmosphere_ocean_freshwater_flux) | ||
| return ρᵒᶜ * esm.interfaces.atmosphere_ocean_interface.fluxes.freshwater_flux | ||
| end | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess there is a conflict here in terminology. probably the property should be changed to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we can rename all freshwater flux diagnostics to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and you propose defining
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. esm.interfaces.atmosphere_ocean_interface.fluxes.freshwater_fluxis a volume flux, right? We leave that as is, and the freshwater_flux diagnostics (which are mass fluxes) we add the esm.interfaces.atmosphere_ocean_interface.fluxes.freshwater_flux?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is one option. I am proposing a different path: define The reason to do this is that we really want to work with mass fluxes and a volume flux is not something user facing.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha! Deal
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a big change, right? I mean, there are a lot of places where in the internals of the coupler there is The same should happen in the ocean-sea ice coupler?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't it just a search and replace?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, the workload is not my concern.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you do it, perhaps? |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this exists. It's a salt flux, so we need to convert it to freshwater.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah scratch it. I didn't see it is part of this PR to add it