Skip to content

Commit 29101ce

Browse files
Store valid thermodynamic tendency (#79)
* Update thermodynamic_time_step.jl * bump * Update src/SeaIceThermodynamics/thermodynamic_time_step.jl
1 parent f2cd54f commit 29101ce

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClimaSeaIce"
22
uuid = "6ba0ff68-24e6-4315-936c-2e99227c95a4"
33
authors = ["Climate Modeling Alliance and contributors"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/SeaIceThermodynamics/thermodynamic_time_step.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,22 @@ end
7474
ℵ⁺ = concentration_thermodynamic_step(ice_thermodynamics.concentration_evolution, ∂t_V, ℵⁿ, hⁿ, hᶜ, Δt)
7575
h⁺ = Vⁿ⁺¹ / ℵ⁺
7676

77-
# Save thermodynamic tendency for possible later use
78-
@inbounds Gⁿ[i, j, 1] = ∂t_V
79-
8077
# Treat pathological cases
8178
h⁺ = ifelse(ℵ⁺ 0, zero(h⁺), h⁺)
8279
ℵ⁺ = ifelse(∂t_V == 0, ℵⁿ, ℵ⁺) # No volume change
8380
h⁺ = ifelse(∂t_V == 0, hⁿ, h⁺) # No volume change
8481
ℵ⁺ = ifelse(h⁺ == 0, zero(ℵ⁺), ℵ⁺) # reset the concentration if there is no sea-ice
85-
82+
8683
# Ridging caused by the thermodynamic step
87-
@inbounds ice_concentration[i, j, 1] = ifelse(ℵ⁺ > 1, one(ℵ⁺), ℵ⁺)
88-
@inbounds ice_thickness[i, j, 1] = ifelse(ℵ⁺ > 1, h⁺ * ℵ⁺, h⁺)
84+
ℵⁿ⁺¹ = ifelse(ℵ⁺ > 1, one(ℵ⁺), ℵ⁺)
85+
hⁿ⁺¹ = ifelse(ℵ⁺ > 1, h⁺ * ℵ⁺, h⁺)
86+
87+
# Update thermodynamic variables
88+
@inbounds ice_concentration[i, j, 1] = ℵⁿ⁺¹
89+
@inbounds ice_thickness[i, j, 1] = hⁿ⁺¹
90+
91+
# Recompute new thermodynamic tendency, excluding pathological cases and save for possible later use
92+
@inbounds Gⁿ[i, j, 1] = (hⁿ⁺¹ * ℵⁿ⁺¹ - hⁿ * ℵⁿ) / Δt
8993
end
9094

9195
# We parameterize the evolution of ice thickness and concentration
@@ -102,4 +106,4 @@ end
102106
ℵ⁺ = max(zero(ℵ⁺), ℵ⁺)
103107

104108
return ℵ⁺
105-
end
109+
end

0 commit comments

Comments
 (0)