Skip to content

Commit

Permalink
Fluxes tests were not active + various bugfixes (#258)
Browse files Browse the repository at this point in the history
* add fluxes tests

* fix syntax

* some fixes

* remove the show methods

* fix tests

* correct height

* change version

* this works for the moment

* fix tests

* remove comment

* correct arch
  • Loading branch information
simone-silvestri authored Nov 17, 2024
1 parent a0736cd commit 7619d40
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 181 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ JLD2 = "0.4, 0.5"
KernelAbstractions = "0.9"
MPI = "0.20"
NCDatasets = "0.12, 0.13, 0.14"
Oceananigans = "0.94"
Oceananigans = "0.94.2 - 0.99"
OffsetArrays = "1.14"
OrthogonalSphericalShellGrids = "0.1.2, 0.2"
OrthogonalSphericalShellGrids = "0.1.8"
Scratch = "1"
SeawaterPolynomials = "0.3.4"
StaticArrays = "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function compute_atmosphere_ocean_fluxes!(coupled_model)
coupled_model.fluxes.ocean_reference_density,
coupled_model.fluxes.ocean_heat_capacity,
coupled_model.fluxes.freshwater_density)

limit_fluxes_over_sea_ice!(grid, kernel_parameters, sea_ice,
centered_velocity_fluxes,
net_tracer_fluxes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ using ClimaSeaIce: SeaIceModel
sea_ice_thickness(sea_ice::Simulation{<:SeaIceModel}) = sea_ice.model.ice_thickness
sea_ice_thickness(::Nothing) = nothing

# Nothing yet...
# Nothing yet...
12 changes: 7 additions & 5 deletions src/OceanSeaIceModels/OceanSeaIceModels.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module OceanSeaIceModels

export OceanSeaIceModel, SimilarityTheoryTurbulentFluxes, Radiation, LatitudeDependentAlbedo
export OceanSeaIceModel, SimilarityTheoryTurbulentFluxes, FreezingLimitedOceanTemperature
export Radiation, LatitudeDependentAlbedo

using Oceananigans
using SeawaterPolynomials
Expand Down Expand Up @@ -47,14 +48,15 @@ include("CrossRealmFluxes/CrossRealmFluxes.jl")

using .CrossRealmFluxes

import .CrossRealmFluxes:
compute_atmosphere_ocean_fluxes!,
compute_sea_ice_ocean_fluxes!,
limit_fluxes_over_sea_ice!

include("ocean_sea_ice_model.jl")
include("freezing_limited_ocean_temperature.jl")
include("time_step_ocean_sea_ice_model.jl")

import .CrossRealmFluxes:
compute_atmosphere_ocean_fluxes!,
compute_sea_ice_ocean_fluxes!

# "No atmosphere" implementation
const NoAtmosphereModel = OceanSeaIceModel{<:Any, Nothing}

Expand Down
2 changes: 1 addition & 1 deletion src/OceanSeaIceModels/PrescribedAtmospheres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function Base.show(io::IO, pa::PrescribedAtmosphere)
print(io, summary(pa), " on ", grid_name(pa.grid), ":", '\n')
print(io, "├── times: ", prettysummary(pa.times), '\n')
print(io, "├── reference_height: ", prettysummary(pa.reference_height), '\n')
print(io, "└── boundary_layer_height: ", prettysummary(pa.reference_height))
print(io, "└── boundary_layer_height: ", prettysummary(pa.boundary_layer_height))
end

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function limit_fluxes_over_sea_ice!(grid, kernel_parameters,
net_tracer_fluxes,
ocean_temperature,
ocean_salinity)

launch!(architecture(grid), grid, kernel_parameters, _limit_fluxes_over_sea_ice!,
centered_velocity_fluxes,
net_tracer_fluxes,
Expand Down
4 changes: 2 additions & 2 deletions src/OceanSeaIceModels/time_step_ocean_sea_ice_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function update_state!(coupled_model::OceanSeaIceModel, callbacks=[]; compute_te
time = Time(coupled_model.clock.time)
update_model_field_time_series!(coupled_model.atmosphere, time)
compute_atmosphere_ocean_fluxes!(coupled_model)
#compute_sea_ice_ocean_fluxes!(coupled_model)
#compute_atmosphere_sea_ice_fluxes!(coupled_model)
compute_sea_ice_ocean_fluxes!(coupled_model)
# compute_atmosphere_sea_ice_fluxes!(coupled_model)
return nothing
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if test_group == :downloading || test_group == :all
include("test_downloading.jl")
end

if test_group == :turbulent_fluxes || test_group == :all
if test_group == :fluxes || test_group == :all
include("test_surface_fluxes.jl")
end

Expand Down
Loading

0 comments on commit 7619d40

Please sign in to comment.