@@ -109,16 +109,23 @@ function puff(scenario::Scenario, ::Type{SLAB}, eqs::EquationSet=DefaultSet();
109109 rh = _rel_humidity (scenario. atmosphere),
110110 stab = stab,
111111 ala = _slab_ala (scenario. atmosphere))
112+
113+ # run SLAB and collect output
112114 out = slab_main (inp)
115+
116+ # SLAB can return results out of order
117+ # since v8.0.1 this causes DataInterpolations to error
118+ xperm = sortperm (out. cc. x)
119+ tperm = sortperm (out. cc. t)
113120 return SLABSolution (scenario,:SLAB ,inp,out,c_max,
114- AkimaInterpolation (out. cc. cc, out. cc. x),
115- AkimaInterpolation (out. cc. b, out. cc. x),
116- AkimaInterpolation (out. cc. betac, out. cc. x),
117- AkimaInterpolation (out. cc. zc, out. cc. x),
118- AkimaInterpolation (out. cc. sig, out. cc. x),
119- AkimaInterpolation (out. cc. xc, out. cc. t),
120- AkimaInterpolation (out. cc. bx, out. cc. t),
121- AkimaInterpolation (out. cc. betax, out. cc. t))
121+ AkimaInterpolation (out. cc. cc[xperm] , out. cc. x[xperm] ),
122+ AkimaInterpolation (out. cc. b[xperm] , out. cc. x[xperm] ),
123+ AkimaInterpolation (out. cc. betac[xperm] , out. cc. x[xperm] ),
124+ AkimaInterpolation (out. cc. zc[xperm] , out. cc. x[xperm] ),
125+ AkimaInterpolation (out. cc. sig[xperm] , out. cc. x[xperm] ),
126+ AkimaInterpolation (out. cc. xc[tperm] , out. cc. t[tperm] ),
127+ AkimaInterpolation (out. cc. bx[tperm] , out. cc. t[tperm] ),
128+ AkimaInterpolation (out. cc. betax[tperm] , out. cc. t[tperm] ))
122129end
123130
124131function plume (scenario:: Scenario{<:AbstractSubstance,<:VerticalJet,<:Atmosphere} , :: Type{SLAB} , eqs:: EquationSet = DefaultSet (); release_angle:: Number = π/ 2 , k2:: Number = 6.0 , k3:: Number = 5.0 )
0 commit comments