Skip to content

Commit 652f730

Browse files
juliasloan25glwagnernavidcy
authored
Bump patch release v0.8.3 (#606)
* tag v0.8.3 * Update similarity_theory_turbulent_fluxes.jl * Update PrescribedAtmospheres.jl * Update PrescribedAtmospheres.jl * drop compat for Thermodynamics 0.12, 0.13 * update to use Thermodynamics-defined consts * no universal, just constant * alignment * Update src/OceanSeaIceModels/PrescribedAtmospheres.jl Co-authored-by: Gregory L. Wagner <[email protected]> * revert constitutive parameters * missing ) * fix docstrings + alignment --------- Co-authored-by: Gregory L. Wagner <[email protected]> Co-authored-by: Navid C. Constantinou <[email protected]>
1 parent 453d796 commit 652f730

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "ClimaOcean"
22
uuid = "0376089a-ecfe-4b0e-a64f-9c555d74d754"
33
license = "MIT"
44
authors = ["Climate Modeling Alliance and contributors"]
5-
version = "0.8.2"
5+
version = "0.8.3"
66

77
[deps]
88
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -65,7 +65,7 @@ SeawaterPolynomials = "0.3.5"
6565
StaticArrays = "1"
6666
Statistics = "1.9"
6767
SurfaceFluxes = "0.11, 0.12"
68-
Thermodynamics = "0.12, 0.13, 0.14"
68+
Thermodynamics = "0.14"
6969
ZipFile = "0.10"
7070
julia = "1.10"
7171

src/OceanSeaIceModels/InterfaceComputations/similarity_theory_turbulent_fluxes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using KernelAbstractions.Extras.LoopInfo: @unroll
1414
using Statistics: norm
1515

1616
import Thermodynamics as AtmosphericThermodynamics
17-
import Thermodynamics.Parameters: molmass_ratio
17+
import Thermodynamics.Parameters: Rv_over_Rd
1818

1919
#####
2020
##### Bulk turbulent fluxes based on similarity theory
@@ -259,7 +259,7 @@ L_★ = u_★² / ϰ b_★ .
259259
@inline function buoyancy_scale(θ★, q★, ℂ, 𝒬, g)
260260
𝒯ₐ = AtmosphericThermodynamics.virtual_temperature(ℂ, 𝒬)
261261
qₐ = AtmosphericThermodynamics.vapor_specific_humidity(ℂ, 𝒬)
262-
ε = AtmosphericThermodynamics.Parameters.molmass_ratio(ℂ)
262+
ε = AtmosphericThermodynamics.Parameters.Rv_over_Rd(ℂ)
263263
δ = ε - 1 # typically equal to 0.608
264264

265265
b★ = g / 𝒯ₐ * (θ★ * (1 + δ * qₐ) + δ * 𝒯ₐ * q★)

src/OceanSeaIceModels/PrescribedAtmospheres.jl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module PrescribedAtmospheres
22

33
using Oceananigans
4-
using Oceananigans.Grids: grid_name
5-
using Oceananigans.Utils: prettysummary, Time
64
using Oceananigans.Fields: Center
5+
using Oceananigans.Grids: grid_name
76
using Oceananigans.OutputReaders: FieldTimeSeries, update_field_time_series!, extract_field_time_series
87
using Oceananigans.TimeSteppers: Clock, tick!
8+
using Oceananigans.Utils: prettysummary, Time
99

1010
using Adapt
1111
using Thermodynamics.Parameters: AbstractThermodynamicsParameters
@@ -16,22 +16,22 @@ import Thermodynamics.Parameters:
1616
gas_constant, #
1717
molmass_dryair, # Molar mass of dry air (without moisture)
1818
molmass_water, # Molar mass of gaseous water vapor
19-
molmass_ratio, # Ratio of the molar masses of dry air to water vapor
19+
Rv_over_Rd, # Ratio of the specific gas constants of water vapor over dry air
2020
R_v, # Specific gas constant for water vapor
2121
R_d, # Specific gas constant for dry air
2222
kappa_d, # Ideal gas adiabatic exponent for dry air
2323
T_0, # Enthalpy reference temperature
2424
LH_v0, # Vaporization enthalpy at the reference temperature
2525
LH_s0, # Sublimation enthalpy at the reference temperature
26-
LH_f0, # Fusionn enthalpy at the reference temperature
26+
LH_f0, # Fusion enthalpy at the reference temperature
2727
cp_d, # Heat capacity of dry air at constant pressure
2828
cp_v, # Isobaric specific heat capacity of gaseous water vapor
2929
cp_l, # Isobaric specific heat capacity of liquid water
3030
cp_i, # Isobaric specific heat capacity of water ice
3131
cv_v, # Heat capacity of dry air at constant volume
3232
cv_l, # Isobaric specific heat capacity of liquid water
3333
cv_i, # Isobaric specific heat capacity of liquid water
34-
e_int_v0, # what? someting about reference internal energy of water vapor
34+
e_int_v0, # what? something about reference internal energy of water vapor
3535
T_freeze, # Freezing temperature of _pure_ water
3636
T_triple, # Triple point temperature of _pure_ water
3737
press_triple, # Triple point pressure of pure water
@@ -64,7 +64,7 @@ end
6464
Base.show(io::IO, p::ConstitutiveParameters) = print(io, summary(p))
6565

6666
"""
67-
ConstitutiveParameters(FT = Float64;
67+
ConstitutiveParameters(FT = Oceananigans.defaults.FloatType;
6868
gas_constant = 8.3144598,
6969
dry_air_molar_mass = 0.02897,
7070
water_molar_mass = 0.018015)
@@ -76,7 +76,7 @@ Construct a set of parameters that define the density of moist air,
7676
```
7777
7878
where ``p`` is pressure, ``T`` is temperature, ``q`` defines the partition
79-
of total mass into vapor, liqiud, and ice mass fractions, and
79+
of total mass into vapor, liquid, and ice mass fractions, and
8080
``Rᵐ`` is the effective specific gas constant for the mixture,
8181
8282
```math
@@ -102,7 +102,7 @@ const CP{FT} = ConstitutiveParameters{FT} where FT
102102
@inline gas_constant(p::CP) = p.gas_constant
103103
@inline molmass_dryair(p::CP) = p.dry_air_molar_mass
104104
@inline molmass_water(p::CP) = p.water_molar_mass
105-
@inline molmass_ratio(p::CP) = molmass_dryair(p) / molmass_water(p)
105+
@inline Rv_over_Rd(p::CP) = molmass_dryair(p) / molmass_water(p)
106106
@inline R_v(p::CP) = gas_constant(p) / molmass_water(p)
107107
@inline R_d(p::CP) = gas_constant(p) / molmass_dryair(p)
108108

@@ -124,7 +124,7 @@ end
124124
Base.show(io::IO, p::HeatCapacityParameters) = print(io, summary(p))
125125

126126
"""
127-
HeatCapacityParameters(FT = Float64,
127+
HeatCapacityParameters(FT = Oceananigans.defaults.FloatType;
128128
dry_air_adiabatic_exponent = 2/7,
129129
water_vapor_heat_capacity = 1859,
130130
liquid_water_heat_capacity = 4181,
@@ -213,9 +213,9 @@ end
213213
const ATP{FT} = AtmosphereThermodynamicsParameters{FT} where FT
214214

215215
Base.eltype(::ATP{FT}) where FT = FT
216-
Base.eltype(::CP{FT}) where FT = FT
217-
Base.eltype(::HCP{FT}) where FT = FT
218-
Base.eltype(::PTP{FT}) where FT = FT
216+
Base.eltype(::CP{FT}) where FT = FT
217+
Base.eltype(::HCP{FT}) where FT = FT
218+
Base.eltype(::PTP{FT}) where FT = FT
219219

220220
Base.summary(::ATP{FT}) where FT = "AtmosphereThermodynamicsParameters{$FT}"
221221

@@ -247,9 +247,9 @@ function Base.show(io::IO, p::AtmosphereThermodynamicsParameters)
247247
end
248248

249249
function AtmosphereThermodynamicsParameters(FT = Oceananigans.defaults.FloatType;
250-
constitutive = ConstitutiveParameters(FT),
251-
phase_transitions = PhaseTransitionParameters(FT),
252-
heat_capacity = HeatCapacityParameters(FT))
250+
constitutive = ConstitutiveParameters(FT),
251+
phase_transitions = PhaseTransitionParameters(FT),
252+
heat_capacity = HeatCapacityParameters(FT))
253253

254254
return AtmosphereThermodynamicsParameters(constitutive, heat_capacity, phase_transitions)
255255
end
@@ -261,7 +261,7 @@ const ATP = AtmosphereThermodynamicsParameters
261261
@inline gas_constant(p::ATP) = gas_constant(p.constitutive)
262262
@inline molmass_dryair(p::ATP) = molmass_dryair(p.constitutive)
263263
@inline molmass_water(p::ATP) = molmass_water(p.constitutive)
264-
@inline molmass_ratio(p::ATP) = molmass_ratio(p.constitutive)
264+
@inline Rv_over_Rd(p::ATP) = Rv_over_Rd(p.constitutive)
265265
@inline LH_v0(p::ATP) = LH_v0(p.phase_transitions)
266266
@inline LH_s0(p::ATP) = LH_s0(p.phase_transitions)
267267
@inline LH_f0(p::ATP) = LH_f0(p.phase_transitions)
@@ -344,8 +344,8 @@ function default_freshwater_flux(grid, times)
344344
return (; rain, snow)
345345
end
346346

347-
""" The standard unit of atmospheric pressure; 1 standard atmosphere (atm) = 101,325 Pascals (Pa) in SI units.
348-
This is approximately equal to the mean sea-level atmospheric pressure on Earth. """
347+
""" The standard unit of atmospheric pressure; 1 standard atmosphere (atm) = 101,325 Pascals (Pa)
348+
in SI units. This is approximately equal to the mean sea-level atmospheric pressure on Earth. """
349349
function default_atmosphere_pressure(grid, times)
350350
pa = FieldTimeSeries{Center, Center, Nothing}(grid, times)
351351
parent(pa) .= 101325
@@ -377,11 +377,11 @@ end
377377
@inline boundary_layer_height(atmos::PrescribedAtmosphere) = atmos.boundary_layer_height
378378

379379
"""
380-
PrescribedAtmosphere(grid, times;
380+
PrescribedAtmosphere(grid, times=[zero(grid)];
381381
clock = Clock{Float64}(time = 0),
382382
surface_layer_height = 10, # meters
383383
boundary_layer_height = 512 # meters,
384-
thermodynamics_parameters = AtmosphereThermodynamicsParameters(FT),
384+
thermodynamics_parameters = nothing,
385385
auxiliary_freshwater_flux = nothing,
386386
velocities = default_atmosphere_velocities(grid, times),
387387
tracers = default_atmosphere_tracers(grid, times),

0 commit comments

Comments
 (0)