diff --git a/src/dynamics/models.jl b/src/dynamics/models.jl index d0d86c998..b673ad4d6 100644 --- a/src/dynamics/models.jl +++ b/src/dynamics/models.jl @@ -56,6 +56,10 @@ except for `model.output` and `model.feedback` which are always called at in `time_stepping!`.""" function initialize!(model::Barotropic) (;spectral_grid,forcing,horizontal_diffusion) = model + + spectral_grid.nlev > 1 && @warn "Only nlev=1 supported for BarotropicModel, \ + SpectralGrid with nlev=$(spectral_grid.nlev) provided." + initialize!(forcing,model) initialize!(horizontal_diffusion,model) @@ -109,6 +113,9 @@ function initialize!(model::ShallowWater) (;spectral_grid,forcing,horizontal_diffusion, orography,planet,spectral_transform,geometry) = model + spectral_grid.nlev > 1 && @warn "Only nlev=1 supported for ShallowWaterModel, \ + SpectralGrid with nlev=$(spectral_grid.nlev) provided." + initialize!(forcing,model) initialize!(horizontal_diffusion,model) initialize!(orography,planet,spectral_transform,geometry) diff --git a/src/output/feedback.jl b/src/output/feedback.jl index a6ba8fb6e..c4ee82214 100644 --- a/src/output/feedback.jl +++ b/src/output/feedback.jl @@ -197,9 +197,11 @@ end # constant from the ProgressMeter module const DT_IN_SEC = Ref(1800) -# overwrite the speedstring function from ProgressMeter -function ProgressMeter.speedstring(sec_per_iter,dt_in_sec=SpeedyWeather.DT_IN_SEC) - speedstring(sec_per_iter,dt_in_sec[]) +# "extend" the speedstring function from ProgressMeter by defining it for ::AbstractFloat +# not just ::Any to effectively overwrite it +function ProgressMeter.speedstring(sec_per_iter::AbstractFloat) + dt_in_sec = SpeedyWeather.DT_IN_SEC[] # pull global "constant" + speedstring(sec_per_iter,dt_in_sec) end """