@@ -25,6 +25,9 @@ $(FIELDS)
2525 " Rime density"
2626 ρ_rim:: FT
2727end
28+ Base. show (io:: IO , mime:: MIME"text/plain" , x:: P3State ) =
29+ ShowMethods. verbose_show_type_and_fields (io, mime, x)
30+ ShowMethods. field_units (:: P3State ) = (; L_ice = " kg/m³" , N_ice = " 1/m³" , ρ_rim = " kg/m³" )
2831
2932"""
3033 get_state(params; L_ice, N_ice, F_rim, ρ_rim)
@@ -51,10 +54,21 @@ Create a [`P3State`](@ref) from [`CMP.ParametersP3`](@ref) and rime state parame
5154 julia> params = CMP.ParametersP3(FT);
5255
5356 julia> state = P3.get_state(params; F_rim = FT(0.5), ρ_rim = FT(916.7))
54- P3State{Float32}
55- ├── params = {MassPowerLaw, AreaPowerLaw, SlopePowerLaw, VentilationFactor}
56- ├── F_rim = 0.5 [-]
57- └── ρ_rim = 916.7 [kg/m^3]
57+ P3State
58+ ├─ params: ParametersP3
59+ │ ├─ mass: MassPowerLaw(α_va = 0.018537706f0 [kg m^(-β_va)], β_va = 1.9f0 [-])
60+ │ ├─ area: AreaPowerLaw(γ = 0.2285f0 [μm^(2-σ)], σ = 1.88f0 [-])
61+ │ ├─ slope: SlopePowerLaw(a = 0.00191f0 [m^b], b = 0.8f0 [-], c = 2.0f0 [-], μ_max = 6.0f0 [-])
62+ │ ├─ vent: VentilationFactor(aᵥ = 0.78f0 [-], bᵥ = 0.308f0 [-])
63+ │ ├─ ρ_rim_local: LocalRimeDensity(a = 51.0f0 [-], b = 114.0f0 [-], c = -5.5f0 [-], ρ_ice = 916.7f0 [kg m⁻³])
64+ │ ├─ τ_wet = 100.0 [s]
65+ │ ├─ ρ_i = 916.7 [kg m⁻³]
66+ │ ├─ ρ_l = 1000.0 [kg m⁻³]
67+ │ └─ T_freeze = 273.15 [K]
68+ ├─ L_ice = 0.3
69+ ├─ N_ice = 1.0e6
70+ ├─ F_rim = 0.5
71+ └─ ρ_rim = 916.7
5872 ```
5973"""
6074function get_state (params:: CMP.ParametersP3 ; L_ice, N_ice, F_rim, ρ_rim)
@@ -408,19 +422,3 @@ function ϕᵢ(params::CMP.ParametersP3, F_rim, ρ_rim, D)
408422
409423 return ifelse (D == 0 , FT (0 ), ϕ_ob)
410424end
411-
412- # ## ----------------- ###
413- # ## ----- UTILS ----- ###
414- # ## ----------------- ###
415-
416- function Base. show (io:: IO , state:: P3State )
417- FT = eltype (state)
418- _name (state, field) = typeof (getfield (state. params, field)). name. name
419- param_types = join (_name .(state, (:mass , :area , :slope , :vent )), " , " )
420- println (io, " P3State{$FT }" )
421- println (io, " ├── params = {$param_types }" )
422- println (io, " ├── L_ice = $(state. L_ice) [kg/m³]" )
423- println (io, " ├── N_ice = $(state. N_ice) [1/m³]" )
424- println (io, " ├── F_rim = $(state. F_rim) [-]" )
425- println (io, " └── ρ_rim = $(state. ρ_rim) [kg/m³]" )
426- end
0 commit comments