ggebbie / TMItransient.jl

Transient simulations with the TMI circulation matrix
MIT License
0 stars 1 forks source link

monotonic interpolation not implemented for type Field #7

Open ggebbie opened 2 years ago

ggebbie commented 2 years ago

one or oneunit not implemented, see vintagedistribution

monotonic interpolation works for Vector{Float64}, doesn't work for Vector{Field}

ggebbie commented 2 years ago
julia> itp = interpolate(τ, Δ, FritschCarlsonMonotonicInterpolation())
calling one with Float64
ERROR: MethodError: no method matching Field(::Field{Float64})
Closest candidates are:
  Field(::Array{T, 3}, ::Grid, ::Symbol, ::String, ::String) where T at ~/projects/TMI.jl/src/TMI.jl:105
Stacktrace:
 [1] oneunit(#unused#::Type{Field})
   @ Base ./number.jl:358
 [2] interpolate(knots::Vector{Float64}, A::Vector{Field}, it::FritschCarlsonMonotonicInterpolation)
   @ Interpolations ~/.julia/packages/Interpolations/y4lLj/src/monotonic/monotonic.jl:181
 [3] top-level scope
   @ REPL[13]:1
ggebbie commented 1 year ago

This may be related in scripts/vintages_driver.jl

julia> g = vintagedistribution(1850,2022,Δ,τ,tmodern=2022,interp="spline")
warning: not implemented yet for type Field
calling one with Float64
calling one with Float64
calling one with Float64
calling one with Float64
calling one with Float64
calling one with Float64
calling one with Float64
calling one with Float64
calling one with Float64
ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getindex
   @ ./essentials.jl:13 [inlined]
 [2] first
   @ ./abstractarray.jl:445 [inlined]
 [3] calcTangents(#unused#::Type{TMI.Field{Float64}}, x::Vector{Float64}, y::Vector{TMI.Field}, method::Interpolations.FritschCarlsonMonotonicInterpolation)
   @ Interpolations ~/.julia/packages/Interpolations/nDwIa/src/monotonic/monotonic.jl:328
 [4] interpolate(#unused#::Type{Float64}, #unused#::Type{TMI.Field{Float64}}, #unused#::Type{TMI.Field{Float64}}, #unused#::Type{TMI.Field{Float64}}, knots::Vector{Float64}, A::Vector{TMI.Field}, it::Interpolations.FritschCarlsonMonotonicInterpolation)
   @ Interpolations ~/.julia/packages/Interpolations/nDwIa/src/monotonic/monotonic.jl:178
 [5] interpolate(knots::Vector{Float64}, A::Vector{TMI.Field}, it::Interpolations.FritschCarlsonMonotonicInterpolation)
   @ Interpolations ~/.julia/packages/Interpolations/nDwIa/src/monotonic/monotonic.jl:198
 [6] vintagedistribution(t₀::Int64, tf::Int64, Δ::Vector{TMI.Field}, τ::Vector{Float64}; tmodern::Int64, interp::String)
   @ TMItransient ~/projects/TMItransient/src/TMItransient.jl:310
 [7] top-level scope
   @ REPL[10]:1