Skip to content

Commit 6343795

Browse files
committed
chore: add show method for ColumnInterpolatableField
1 parent 79028dd commit 6343795

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/initial_conditions/initial_conditions.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ struct ColumnInterpolatableField{F, D}
4848
end
4949
(f::ColumnInterpolatableField)(z) = Spaces.undertype(axes(f.f))(f.data(z))
5050

51+
function Base.show(io::IO, x::ColumnInterpolatableField)
52+
# Extract z grid from the wrapped column field
53+
z = Fields.coordinate_field(x.f).z
54+
nz = length(vec(z))
55+
zmin, zmax = extrema(z)
56+
val_eltype = eltype(x.f)
57+
# These are fixed by the constructor
58+
interp_str = "Linear"
59+
extrap_str = "Flat"
60+
print(io,
61+
"ColumnInterpolatableField(Nz=$nz, z∈[$zmin, $zmax], value_eltype=$val_eltype, ",
62+
"interpolation=$interp_str, extrapolation=$extrap_str)",
63+
)
64+
end
65+
5166
import ClimaComms
5267
import ClimaCore.Domains as Domains
5368
import ClimaCore.Meshes as Meshes

0 commit comments

Comments
 (0)