SpeedyWeather / StochasticStir.jl

Twist it, spin it, but randomly.
GNU General Public License v3.0
4 stars 0 forks source link

mask=true/false for StochasticStirring, JetDrag initialization with model.spectral_transform #12

Closed milankl closed 5 months ago

milankl commented 5 months ago

I hit this error when initialization a T340 JetDrag

julia> simulation = initialize!(model)
ERROR: BoundsError
Stacktrace:
 [1] _divergence!(kernel::SpeedyWeather.SpeedyTransforms.var"#kernel#35"{…}, div::LowerTriangularMatrix{…}, u::LowerTriangularMatrix{…}, v::LowerTriangularMatrix{…}, S::SpectralTransform{…})
   @ SpeedyWeather.SpeedyTransforms ~/.julia/packages/SpeedyWeather/hY1td/src/SpeedyTransforms/spectral_gradients.jl:55
 [2] #curl!#34
   @ ~/.julia/packages/SpeedyWeather/hY1td/src/SpeedyTransforms/spectral_gradients.jl:19 [inlined]
 [3] curl!(curl::LowerTriangularMatrix{…}, u::LowerTriangularMatrix{…}, v::LowerTriangularMatrix{…}, S::SpectralTransform{…})
   @ SpeedyWeather.SpeedyTransforms ~/.julia/packages/SpeedyWeather/hY1td/src/SpeedyTransforms/spectral_gradients.jl:8
 [4] initialize!(drag::JetDrag{…}, model::BarotropicModel{…})
   @ StochasticStir ~/.julia/packages/StochasticStir/Dp1uV/src/jet_drag.jl:62
 [5] initialize!(model::BarotropicModel{…}; time::DateTime)
   @ SpeedyWeather ~/.julia/packages/SpeedyWeather/hY1td/src/models/barotropic.jl:76
 [6] initialize!(model::BarotropicModel{…})
   @ SpeedyWeather ~/.julia/packages/SpeedyWeather/hY1td/src/models/barotropic.jl:66
 [7] top-level scope
   @ REPL[20]:1
Some type information was truncated. Use `show(err)` to see complete types.

So it now reuses model.spectral_transform which seems to solve the problem