I accidentally tried to use a value that didn’t exist yet. If the error message gave a bit more detail (i.e. “You gave the X component a value for the Y parameter that doesn’t exist in timestep Z”) that would make hunting bugs much easier.
Here’s the error message I received:
ERROR: MissingException: Cannot get index; data is missing. You may have tried to access a value that has not yet been computed.
Stacktrace:
[1] _missing_data_check(::Missing) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\time.jl:192
[2] getindex at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\time.jl:222 [inlined]
[3] run_timestep_rf_ch4_etminan(::Mimi.ComponentInstanceParameters{NamedTuple{(:a₃, :b₃, :N₂O_0, :scale_CH₄, :CH₄_0, :N₂O, :CH₄),Tuple{Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.TimestepArray{Mimi.FixedTimestep{1765,1,LAST} where LAST,Float64,1,1},Mimi.TimestepArray{Mimi.FixedTimestep{1765,1,LAST} where LAST,Union{Missing, Float64},1,1}}}}, ::Mimi.ComponentInstanceVariables{NamedTuple{(:rf_CH₄,),Tuple{Mimi.TimestepArray{Mimi.FixedTimestep{1765,1,LAST} where LAST,Union{Missing, Float64},1,1}}}}, ::Mimi.DimDict, ::Mimi.FixedTimestep{1765,1,2300}) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\defcomp.jl:21
[4] run_timestep(::Mimi.ComponentInstance{Mimi.ComponentInstanceVariables{NamedTuple{(:rf_CH₄,),Tuple{Mimi.TimestepArray{Mimi.FixedTimestep{1765,1,LAST} where LAST,Union{Missing, Float64},1,1}}}},Mimi.ComponentInstanceParameters{NamedTuple{(:a₃, :b₃, :N₂O_0, :scale_CH₄, :CH₄_0, :N₂O, :CH₄),Tuple{Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.ScalarModelParameter{Float64},Mimi.TimestepArray{Mimi.FixedTimestep{1765,1,LAST} where LAST,Float64,1,1},Mimi.TimestepArray{Mimi.FixedTimestep{1765,1,LAST} where LAST,Union{Missing, Float64},1,1}}}}}, ::Mimi.Clock{Mimi.FixedTimestep}) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\instances.jl:264
[5] _run_components(::Mimi.ModelInstance, ::Mimi.Clock{Mimi.FixedTimestep}, ::Array{Int64,1}, ::Array{Int64,1}, ::Array{Mimi.Clock{Mimi.FixedTimestep},1}) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\instances.jl:277
[6] run(::Mimi.ModelInstance, ::Int64, ::Nothing) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\instances.jl:313
[7] #run#116(::Int64, ::Nothing, ::typeof(run), ::Model) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\model.jl:399
[8] run(::Model) at C:\Users\Frank Errickson\.julia\packages\Mimi\fpiRX\src\core\model.jl:390
[9] top-level scope at REPL[6]:100: