Skip to content

Commit

Permalink
Print sigma coordinates nicely
Browse files Browse the repository at this point in the history
  • Loading branch information
milankl committed Aug 17, 2023
1 parent 1b18057 commit 2f81479
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/dynamics/vertical_coordinates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ end
# obtain nlev from length of predefined σ_half levels
SigmaCoordinates(σ_half::AbstractVector) = SigmaCoordinates(nlev=length(σ_half)-1;σ_half)

function Base.show(io::IO::SigmaCoordinates)
println("$(σ.nlev)-level SigmaCoordinates:")
nchars = length(string.nlev))
format = Printf.Format("%$(nchars)d")
for k=1:σ.nlev
println(" k=",Printf.format(format,k-1),".5 -- $(Float16.σ_half[k]))")
σk =.σ_half[k] + σ.σ_half[k+1])/2
println(" k=",Printf.format(format,k)," × $(Float16(σk))")
end
print(" k=",Printf.format(format,σ.nlev),".5 -- $(Float16.σ_half[end]))")
end

"""Coefficients of the generalised logistic function to describe the vertical coordinate.
Default coefficients A,K,C,Q,B,M,ν are fitted to the old L31 configuration at ECMWF.
Expand Down

0 comments on commit 2f81479

Please sign in to comment.