@@ -13,7 +13,7 @@ struct ScalarRoughnessLength{FT, V, R}
13
13
end
14
14
15
15
"""
16
- ScalarRoughnessLength([FT= Float64] ;
16
+ ScalarRoughnessLength(FT = Float64;
17
17
air_kinematic_viscosity = temperature_dependent_viscosity,
18
18
reynolds_number_scaling_function = empirical_scaling_function,
19
19
maximum_roughness_length = 1.6e-4)
@@ -28,7 +28,7 @@ Keyword Arguments
28
28
- `reynolds_number_scaling_function::Function`: The function to compute the Reynolds number scaling factor.
29
29
- `maximum_roughness_length::Float`: The maximum roughness length value. Defaults to `1.6e-4`.
30
30
"""
31
- function ScalarRoughnessLength (FT= Float64 ;
31
+ function ScalarRoughnessLength (FT= Oceananigans . defaults . FloatType ;
32
32
air_kinematic_viscosity = TemperatureDependentAirViscosity (FT),
33
33
reynolds_number_scaling_function = ReynoldsScalingFunction (FT),
34
34
maximum_roughness_length = 1.6e-4 ) # Values from COARE3.6
@@ -39,7 +39,7 @@ function ScalarRoughnessLength(FT=Float64;
39
39
end
40
40
41
41
"""
42
- MomentumRoughnessLength([FT= Float64] ;
42
+ MomentumRoughnessLength(FT = Float64;
43
43
gravitational_acceleration = default_gravitational_acceleration,
44
44
maximum_roughness_length = 1.0,
45
45
air_kinematic_viscosity = TemperatureDependentAirViscosity(FT),
@@ -58,7 +58,7 @@ Keyword Arguments
58
58
- `gravity_wave_parameter`: The wave parameter. Default: 0.011.
59
59
- `laminar_parameter`: The laminar parameter. Default: 0.11.
60
60
"""
61
- function MomentumRoughnessLength (FT= Float64 ;
61
+ function MomentumRoughnessLength (FT= Oceananigans . defaults . FloatType ;
62
62
gravitational_acceleration = default_gravitational_acceleration,
63
63
maximum_roughness_length = 1.0 , # An estimate?
64
64
air_kinematic_viscosity = TemperatureDependentAirViscosity (FT),
@@ -72,7 +72,7 @@ function MomentumRoughnessLength(FT=Float64;
72
72
convert (FT, maximum_roughness_length))
73
73
end
74
74
75
- function default_roughness_lengths (FT= Float64 )
75
+ function default_roughness_lengths (FT= Oceananigans . defaults . FloatType )
76
76
momentum = MomentumRoughnessLength (FT)
77
77
temperature = ScalarRoughnessLength (FT)
78
78
water_vapor = ScalarRoughnessLength (FT)
@@ -88,7 +88,7 @@ struct TemperatureDependentAirViscosity{FT}
88
88
end
89
89
90
90
"""
91
- TemperatureDependentAirViscosity([FT = Float64 ;
91
+ TemperatureDependentAirViscosity([FT = Oceananigans.defaults.FloatType ;
92
92
C₀ = 1.326e-5,
93
93
C₁ = C₀ * 6.542e-3,
94
94
C₂ = C₀ * 8.301e-6,
@@ -100,7 +100,7 @@ viscosity of air as
100
100
C₀ + C₁ T + C₂ T^2 + C₃ T^3.
101
101
```
102
102
"""
103
- function TemperatureDependentAirViscosity (FT = Float64 ;
103
+ function TemperatureDependentAirViscosity (FT = Oceananigans . defaults . FloatType ;
104
104
C₀ = 1.326e-5 ,
105
105
C₁ = C₀ * 6.542e-3 ,
106
106
C₂ = C₀ * 8.301e-6 ,
@@ -148,15 +148,15 @@ struct ReynoldsScalingFunction{FT}
148
148
end
149
149
150
150
"""
151
- ReynoldsScalingFunction(FT = Float64; A = 5.85e-5, b = 0.72)
151
+ ReynoldsScalingFunction(FT= Float64; A= 5.85e-5, b= 0.72)
152
152
153
153
Empirical fit of the scalar roughness length with roughness Reynolds number `R★ = u★ ℓu / ν`.
154
154
Edson et al. (2013), equation (28).
155
155
```math
156
156
ℓs = A / R★ ^ b
157
157
```
158
158
"""
159
- ReynoldsScalingFunction (FT = Float64 ; A = 5.85e-5 , b = 0.72 ) =
159
+ ReynoldsScalingFunction (FT = Oceananigans . defaults . FloatType ; A = 5.85e-5 , b = 0.72 ) =
160
160
ReynoldsScalingFunction (convert (FT, A), convert (FT, b))
161
161
162
162
@inline (s:: ReynoldsScalingFunction )(R★, args... ) = ifelse (R★ == 0 , convert (eltype (R★), 0 ), s. A / R★ ^ s. b)
0 commit comments