Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependence on OrdinaryDiffEq #2183

Merged
merged 3 commits into from
Oct 25, 2023
Merged

Remove dependence on OrdinaryDiffEq #2183

merged 3 commits into from
Oct 25, 2023

Conversation

charleskawczynski
Copy link
Member

@charleskawczynski charleskawczynski commented Oct 3, 2023

This PR removes the dependence on OrdinaryDiffEq 💥.

I did have to add a function for computing indefinite integrals:

function column_indefinite_integral!(
    f::Function,
    ᶠintegral::Fields.ColumnField,
    x₀,
    ᶜzfield::Fields.ColumnField,
    average = (a, b) -> (a + b) / 2,
)

(I guess we could maybe get rid of ᶜzfield and extract it from ᶠintegral?)

Which returns a new ColumnInterpolatableField object:

struct ColumnInterpolatableField{F, D}
    f::F
    data::D
    function ColumnInterpolatableField(f::Fields.ColumnField)
        zdata = vec(parent(Fields.Fields.coordinate_field(f).z))
        fdata = vec(parent(f))
        @assert length(zdata) == length(fdata)
        data = Dierckx.Spline1D(zdata, fdata; k = 1)
        return new{typeof(f), typeof(data)}(f, data)
    end
end
(f::ColumnInterpolatableField)(z) = Spaces.undertype(axes(f.f))(f.data(z))

Ultimately, this replaces ODE.solve, which itself is not an issue, but ODE.Tsit5() (and every other ODE algo implementation) is (reasonably) not in SciMLBase.

@charleskawczynski
Copy link
Member Author

charleskawczynski commented Oct 3, 2023

main branch

julia> @time_imports using ClimaAtmos
[ Info: Precompiling ClimaAtmos [b2c96348-7fb7-4fe0-8da9-78d88439e717]
      0.1 ms  CUDA_Driver_jll
      0.1 ms  JuliaNVTXCallbacks_jll
      0.1 ms  NVTX_jll
      0.2 ms  Adapt  AdaptStaticArraysExt
      0.2 ms  ArrayInterface  ArrayInterfaceCUDAExt
      0.2 ms  Compat
      0.2 ms  DataValueInterfaces
      0.2 ms  PackageExtensionCompat
      0.2 ms  PrecompileTools
      0.2 ms  TableTraits
      0.2 ms  TruncatedStacktraces
      0.3 ms  Adapt
      0.3 ms  ArrayInterface  ArrayInterfaceGPUArraysCoreExt
      0.3 ms  ArrayInterface  ArrayInterfaceStaticArraysCoreExt
      0.3 ms  AxisAlgorithms
      0.3 ms  CommonSolve
      0.3 ms  Compat  CompatLinearAlgebraExt
      0.3 ms  ConstructionBase  ConstructionBaseIntervalSetsExt
      0.3 ms  CubedSphere
      0.3 ms  CUDA_Runtime_jll
      0.3 ms  Distances  DistancesSparseArraysExt
      0.3 ms  ExprTools
      0.3 ms  FillArrays  FillArraysStatisticsExt
      0.3 ms  FiniteDiff  FiniteDiffBandedMatricesExt
      0.3 ms  FiniteDiff  FiniteDiffStaticArraysExt
      0.3 ms  IntervalSets  IntervalSetsStatisticsExt
      0.3 ms  IteratorInterfaceExtensions
      0.3 ms  JLLWrappers
      0.3 ms  MPIPreferences
      0.3 ms  Requires
      0.3 ms  Scratch
      0.3 ms  SimpleUnPack
      0.3 ms  StaticArrays  StaticArraysStatisticsExt
      0.3 ms  SuiteSparse
      0.3 ms  TextWrap
      0.3 ms  Tricks
      0.3 ms  UnPack
      0.4 ms  AbstractFFTs  AbstractFFTsTestExt
      0.4 ms  ArrayInterface  ArrayInterfaceBandedMatricesExt
      0.4 ms  BandedMatrices  BandedMatricesSparseArraysExt
      0.4 ms  CommonSubexpressions
      0.4 ms  CustomUnitRanges
      0.4 ms  DiffEqBase  DiffEqBaseDistributionsExt
      0.4 ms  Elliptic
      0.4 ms  FastBroadcast
      0.4 ms  GaussQuadrature
      0.4 ms  GilbertCurves
      0.4 ms  IfElse
      0.4 ms  LinearSolve  LinearSolveCUDAExt
      0.4 ms  LogExpFunctions
      0.4 ms  MPI  CUDAExt
      0.4 ms  MuladdMacro
      0.4 ms  Parameters
      0.4 ms  Reexport
      0.4 ms  SIMDTypes
      0.4 ms  SnoopPrecompile
      0.4 ms  StatsAPI
      0.5 ms  AbstractFFTs  AbstractFFTsChainRulesCoreExt
      0.5 ms  BitTwiddlingConvenienceFunctions
      0.5 ms  ColorVectorSpace  SpecialFunctionsExt
      0.5 ms  ConcreteStructs
      0.5 ms  ConstructionBase  ConstructionBaseStaticArraysExt
      0.5 ms  DiffRules
      0.5 ms  EnumX
      0.5 ms  FunctionWrappersWrappers
      0.5 ms  HDF5  MPIExt
      0.5 ms  LinearSolve  LinearSolveKernelAbstractionsExt
      0.5 ms  LogExpFunctions  LogExpFunctionsChainRulesCoreExt
      0.5 ms  LoopVectorization  SpecialFunctionsExt
      0.5 ms  NaNMath
      0.5 ms  TensorCore
      0.5 ms  ZygoteRules
      0.6 ms  ForwardDiff  ForwardDiffStaticArraysExt
      0.6 ms  ProgressBars
      0.6 ms  SpecialFunctions  SpecialFunctionsChainRulesCoreExt
      0.6 ms  StatsFuns  StatsFunsChainRulesCoreExt
      0.6 ms  SymbolicIndexingInterface
      0.6 ms  VertexSafeGraphs
      0.7 ms  FastClosures
      0.7 ms  FastGaussQuadrature
      0.7 ms  Inflate
      0.8 ms  ArtifactWrappers
      0.8 ms  AtmosphericProfilesLibrary
      0.8 ms  Rmath
      0.8 ms  SciMLNLSolve
      0.8 ms  StaticArrayInterface  StaticArrayInterfaceOffsetArraysExt
      0.9 ms  Dierckx
      0.9 ms  MosaicViews
      0.9 ms  Polyester
      0.9 ms  Statistics
      0.9 ms  TerminalLoggers
      1.0 ms  ArrayLayouts  ArrayLayoutsSparseArraysExt
      1.0 ms  DelimitedFiles
      1.0 ms  DocStringExtensions
      1.0 ms  OpenSpecFun_jll
      1.0 ms  Zstd_jll
      1.1 ms  ClimaComms
      1.1 ms  GPUArraysCore
      1.1 ms  PreallocationTools
      1.1 ms  Ratios  RatiosFixedPointNumbersExt
      1.1 ms  SortingAlgorithms
      1.2 ms  Random123
      1.2 ms  Rmath_jll
      1.2 ms  StaticArrayInterface  StaticArrayInterfaceStaticArraysExt
      1.3 ms  AMD
      1.3 ms  Bzip2_jll
      1.3 ms  ConstructionBase
      1.3 ms  HypergeometricFunctions
      1.3 ms  libaec_jll
      1.3 ms  Libiconv_jll
      1.3 ms  RuntimeGeneratedFunctions
      1.4 ms  Calculus
      1.4 ms  CommonDataModel
      1.4 ms  CPUSummary
      1.4 ms  DataAPI
      1.4 ms  Insolation
      1.4 ms  NetCDF_jll
      1.4 ms  XML2_jll
      1.5 ms  ArgParse
      1.6 ms  FFTW_jll
      1.6 ms  LLVMOpenMP_jll
      1.7 ms  CEnum
      1.8 ms  StaticArraysCore
      1.9 ms  CLIMAParameters
      2.0 ms  ArrayInterface
      2.0 ms  Distributions  DistributionsChainRulesCoreExt
      2.0 ms  UnsafeAtomicsLLVM
      2.2 ms  NLsolve
      2.3 ms  LDLFactorizations
      2.3 ms  OpenLibm_jll
      2.4 ms  DiffResults
      2.4 ms  FiniteDiff
      2.4 ms  PaddedViews
      2.6 ms  ADTypes
      2.6 ms  LoopVectorization  ForwardDiffExt
      2.6 ms  NonlinearSolve
      2.6 ms  StackViews
      2.7 ms  UnsafeAtomics
      2.7 ms  Zlib_jll
      2.9 ms  TranscodingStreams
      3.0 ms  ManualMemory
      3.0 ms  TriangularSolve
      3.1 ms  BFloat16s
      3.1 ms  SLEEFPirates
      3.1 ms  StatsFuns
      3.1 ms  WoodburyMatrices
      3.2 ms  HDF5_jll
      3.3 ms  RootSolvers
      3.3 ms  StringEncodings
      3.5 ms  IrrationalConstants
      3.5 ms  SimpleTraits
      3.6 ms  Sparspak
      3.7 ms  CloseOpenIntervals
      3.7 ms  DiffEqBase  DiffEqBaseMPIExt
      3.7 ms  FillArrays  FillArraysSparseArraysExt
      3.7 ms  LLVMExtra_jll 72.68% compilation time
      3.8 ms  Functors
      3.8 ms  YAML
      4.0 ms  OpenSSL_jll
      4.1 ms  ComputationalResources
      4.2 ms  MappedArrays
      4.2 ms  Ratios
      4.3 ms  Distances
      4.6 ms  ArnoldiMethod
      4.7 ms  StaticArrayInterface
      5.0 ms  LayoutPointers
      5.0 ms  Thermodynamics
      5.1 ms  LeftChildRightSiblingTrees
      5.2 ms  NVTX
      5.3 ms  MPICH_jll
      5.4 ms  ArrayInterfaceCore
      5.4 ms  MacroTools
      5.4 ms  ProgressLogging
      5.6 ms  LineSearches
      5.7 ms  FastLapackInterface
      6.1 ms  NLSolversBase
      6.3 ms  SparseDiffTools
      6.4 ms  LambertW
      6.4 ms  OrderedCollections
      6.4 ms  QuadGK
      6.6 ms  CloudMicrophysics
      6.7 ms  PolyesterWeave
      6.8 ms  DiffEqCallbacks
      7.1 ms  Atomix
      7.1 ms  Preferences
      7.5 ms  SpecialFunctions
      7.9 ms  RRTMGP
      8.1 ms  RandomNumbers
      8.2 ms  Lazy
      8.2 ms  TiledIteration
      9.1 ms  CFTime
      9.3 ms  ThreadingUtilities
     10.1 ms  LinearOperators
     10.2 ms  RecipesBase
     11.0 ms  KernelAbstractions
     11.0 ms  RecursiveArrayTools
     11.6 ms  Missings
     11.7 ms  FFTViews
     12.0 ms  CatIndices
     12.2 ms  FunctionWrappers
     12.3 ms  SciMLOperators
     12.5 ms  SurfaceFluxes
     12.7 ms  AbstractFFTs 65.42% compilation time (100% recompilation)
     13.2 ms  DualNumbers
     13.6 ms  CompilerSupportLibraries_jll 20.19% compilation time
     14.1 ms  TimerOutputs
     15.6 ms  HostCPUFeatures
     17.1 ms  GenericSchur
     17.8 ms  Setfield
     18.2 ms  KLU
     20.1 ms  IntervalSets
     20.3 ms  Krylov
     20.5 ms  ChainRulesCore
     21.0 ms  LLVM
     21.4 ms  Static
     22.0 ms  Tables
     22.3 ms  ClimaTimeSteppers
     22.3 ms  StatsBase
     22.7 ms  MPI
     23.1 ms  AbstractTrees
     23.6 ms  ImageBase
     26.9 ms  PDMats
     27.4 ms  FixedPointNumbers
     30.2 ms  Interpolations
     34.8 ms  Graphs
     35.7 ms  TaylorSeries
     37.6 ms  SuiteSparse_jll
     38.4 ms  ColorTypes
     40.1 ms  Colors
     42.8 ms  ForwardDiff
     43.9 ms  OffsetArrays
     52.2 ms  DataStructures
     55.5 ms  PkgVersion
     59.9 ms  HDF5 17.87% compilation time (100% recompilation)
     62.0 ms  GPUArrays
     62.0 ms  NCDatasets
     68.4 ms  FillArrays
     70.7 ms  FFTW
    103.3 ms  LoopVectorization
    116.1 ms  Dierckx_jll 98.80% compilation time (100% recompilation)
    117.8 ms  FileIO
    118.2 ms  ColorVectorSpace 4.27% compilation time (100% recompilation)
    123.1 ms  ClimaCore
    135.6 ms  BlockArrays
    137.9 ms  GPUCompiler 3.10% compilation time
    149.8 ms  SimpleNonlinearSolve
    173.0 ms  JLD2 12.28% compilation time
    180.3 ms  VectorizationBase
    187.5 ms  RecursiveFactorization
    203.4 ms  SciMLBase 3.20% compilation time (100% recompilation)
    211.3 ms  StrideArraysCore
    222.6 ms  ImageFiltering
    242.6 ms  DiffEqBase
    242.6 ms  StaticArrays
    293.7 ms  ImageCore 1.48% compilation time (100% recompilation)
    338.5 ms  BandedMatrices
    376.5 ms  Distributions
    400.9 ms  ClimaAtmos
    451.1 ms  LinearSolve
    604.7 ms  CUDA
    612.4 ms  OrdinaryDiffEq
    976.0 ms  ArrayLayouts
   1137.7 ms  ExponentialUtilities

This branch

julia> @time_imports using ClimaAtmos
[ Info: Precompiling ClimaAtmos [b2c96348-7fb7-4fe0-8da9-78d88439e717]
      0.1 ms  CUDA_Driver_jll
      0.1 ms  JuliaNVTXCallbacks_jll
      0.2 ms  Adapt  AdaptStaticArraysExt
      0.2 ms  ArrayInterface  ArrayInterfaceCUDAExt
      0.2 ms  AxisAlgorithms
      0.2 ms  CommonSolve
      0.2 ms  Compat
      0.2 ms  Compat  CompatLinearAlgebraExt
      0.2 ms  CubedSphere
      0.2 ms  CUDA_Runtime_jll
      0.2 ms  DataValueInterfaces
      0.2 ms  IteratorInterfaceExtensions
      0.2 ms  NVTX_jll
      0.2 ms  PrecompileTools
      0.2 ms  TableTraits
      0.2 ms  TruncatedStacktraces
      0.2 ms  UnPack
      0.3 ms  Adapt
      0.3 ms  ArrayInterface  ArrayInterfaceGPUArraysCoreExt
      0.3 ms  ArrayInterface  ArrayInterfaceStaticArraysCoreExt
      0.3 ms  ConstructionBase  ConstructionBaseIntervalSetsExt
      0.3 ms  DiffEqBase  DiffEqBaseDistributionsExt
      0.3 ms  Distances  DistancesSparseArraysExt
      0.3 ms  ExprTools
      0.3 ms  FillArrays  FillArraysStatisticsExt
      0.3 ms  FiniteDiff  FiniteDiffBandedMatricesExt
      0.3 ms  FiniteDiff  FiniteDiffStaticArraysExt
      0.3 ms  GaussQuadrature
      0.3 ms  GilbertCurves
      0.3 ms  IfElse
      0.3 ms  IntervalSets  IntervalSetsStatisticsExt
      0.3 ms  JLLWrappers
      0.3 ms  LogExpFunctions
      0.3 ms  MPIPreferences
      0.3 ms  MuladdMacro
      0.3 ms  Parameters
      0.3 ms  Requires
      0.3 ms  StaticArrays  StaticArraysStatisticsExt
      0.3 ms  StatsFuns  StatsFunsChainRulesCoreExt
      0.3 ms  SuiteSparse
      0.3 ms  TextWrap
      0.4 ms  AbstractFFTs  AbstractFFTsChainRulesCoreExt
      0.4 ms  AbstractFFTs  AbstractFFTsTestExt
      0.4 ms  ArrayInterface  ArrayInterfaceBandedMatricesExt
      0.4 ms  BandedMatrices  BandedMatricesSparseArraysExt
      0.4 ms  BitTwiddlingConvenienceFunctions
      0.4 ms  CustomUnitRanges
      0.4 ms  Elliptic
      0.4 ms  EnumX
      0.4 ms  FastBroadcast
      0.4 ms  FastClosures
      0.4 ms  FastGaussQuadrature
      0.4 ms  MPI  CUDAExt
      0.4 ms  NaNMath
      0.4 ms  OpenSpecFun_jll
      0.4 ms  Reexport
      0.4 ms  Scratch
      0.4 ms  SIMDTypes
      0.4 ms  StatsAPI
      0.4 ms  Tricks
      0.4 ms  Zstd_jll
      0.5 ms  ArtifactWrappers
      0.5 ms  Bzip2_jll
      0.5 ms  ColorVectorSpace  SpecialFunctionsExt
      0.5 ms  CommonSubexpressions
      0.5 ms  HDF5  MPIExt
      0.5 ms  LogExpFunctions  LogExpFunctionsChainRulesCoreExt
      0.5 ms  ProgressBars
      0.5 ms  Rmath
      0.5 ms  SymbolicIndexingInterface
      0.5 ms  TensorCore
      0.6 ms  AtmosphericProfilesLibrary
      0.6 ms  ConstructionBase  ConstructionBaseStaticArraysExt
      0.6 ms  DiffEqBase  DiffEqBaseMPIExt
      0.6 ms  DiffRules
      0.6 ms  ForwardDiff  ForwardDiffStaticArraysExt
      0.6 ms  SpecialFunctions  SpecialFunctionsChainRulesCoreExt
      0.6 ms  StaticArrayInterface  StaticArrayInterfaceOffsetArraysExt
      0.6 ms  TerminalLoggers
      0.6 ms  XML2_jll
      0.7 ms  DataAPI
      0.7 ms  FFTW_jll
      0.8 ms  Dierckx
      0.8 ms  Libiconv_jll
      0.8 ms  LLVMOpenMP_jll
      0.8 ms  MosaicViews
      0.8 ms  NetCDF_jll
      0.8 ms  ZygoteRules
      0.9 ms  ArrayLayouts  ArrayLayoutsSparseArraysExt
      0.9 ms  CLIMAParameters
      0.9 ms  Polyester
      0.9 ms  SortingAlgorithms
      1.0 ms  Calculus
      1.0 ms  DelimitedFiles
      1.0 ms  Distributions  DistributionsChainRulesCoreExt
      1.0 ms  DocStringExtensions
      1.0 ms  HypergeometricFunctions
      1.0 ms  Rmath_jll
      1.0 ms  StaticArrayInterface  StaticArrayInterfaceStaticArraysExt
      1.0 ms  Statistics
      1.1 ms  ClimaComms
      1.1 ms  GPUArraysCore
      1.1 ms  Insolation
      1.1 ms  PreallocationTools
      1.1 ms  Ratios  RatiosFixedPointNumbersExt
      1.2 ms  AMD
      1.2 ms  CommonDataModel
      1.2 ms  FunctionWrappersWrappers
      1.2 ms  OpenSSL_jll
      1.2 ms  Random123
      1.2 ms  RuntimeGeneratedFunctions
      1.4 ms  ArgParse
      1.4 ms  ManualMemory
      1.5 ms  ConstructionBase
      1.6 ms  libaec_jll
      1.8 ms  CEnum
      1.8 ms  CPUSummary
      1.8 ms  LDLFactorizations
      1.9 ms  ArrayInterface
      1.9 ms  HDF5_jll
      1.9 ms  OpenLibm_jll
      1.9 ms  UnsafeAtomicsLLVM
      2.0 ms  PaddedViews
      2.0 ms  StaticArraysCore
      2.1 ms  DiffResults
      2.2 ms  FiniteDiff
      2.2 ms  NLsolve
      2.4 ms  StackViews
      2.5 ms  StatsFuns
      2.6 ms  Zlib_jll
      2.7 ms  UnsafeAtomics
      2.9 ms  ADTypes
      3.0 ms  StringEncodings
      3.0 ms  TranscodingStreams
      3.1 ms  BFloat16s
      3.1 ms  RootSolvers
      3.1 ms  WoodburyMatrices
      3.2 ms  MappedArrays
      3.3 ms  Functors
      3.3 ms  ProgressLogging
      3.4 ms  YAML
      3.6 ms  FillArrays  FillArraysSparseArraysExt
      3.6 ms  MPICH_jll
      3.7 ms  CloseOpenIntervals
      3.7 ms  IrrationalConstants
      3.8 ms  ComputationalResources
      3.9 ms  LLVMExtra_jll 71.47% compilation time
      4.0 ms  LeftChildRightSiblingTrees
      4.1 ms  Ratios
      4.3 ms  LayoutPointers
      4.5 ms  Distances
      4.7 ms  Thermodynamics
      5.1 ms  CloudMicrophysics
      5.1 ms  LambertW
      5.2 ms  QuadGK
      5.4 ms  MacroTools
      5.6 ms  LineSearches
      5.6 ms  OrderedCollections
      5.7 ms  NLSolversBase
      5.8 ms  DiffEqCallbacks
      6.0 ms  StaticArrayInterface
      6.6 ms  NVTX
      6.9 ms  PolyesterWeave
      6.9 ms  TiledIteration
      7.1 ms  Atomix
      7.4 ms  RRTMGP
      7.6 ms  SpecialFunctions
      7.9 ms  Missings
      8.0 ms  Preferences
      8.0 ms  RandomNumbers
      8.2 ms  LinearOperators
      8.2 ms  ThreadingUtilities
      8.3 ms  CFTime
      8.3 ms  Lazy
      9.7 ms  FFTViews
      9.9 ms  RecipesBase
      9.9 ms  SurfaceFluxes
     10.1 ms  CatIndices
     10.1 ms  DualNumbers
     10.4 ms  RecursiveArrayTools
     10.8 ms  CompilerSupportLibraries_jll 26.68% compilation time
     10.9 ms  PkgVersion
     11.1 ms  KernelAbstractions
     11.2 ms  SciMLOperators
     12.6 ms  AbstractFFTs 65.21% compilation time (100% recompilation)
     13.3 ms  FunctionWrappers
     14.4 ms  StatsBase
     14.9 ms  TimerOutputs
     17.3 ms  AbstractTrees
     17.6 ms  ClimaTimeSteppers
     18.6 ms  PDMats
     18.7 ms  Static
     19.0 ms  Krylov
     19.6 ms  Setfield
     20.3 ms  LLVM
     20.4 ms  ChainRulesCore
     20.8 ms  IntervalSets
     21.5 ms  ImageBase
     23.2 ms  MPI
     25.1 ms  Interpolations
     29.2 ms  SuiteSparse_jll
     31.0 ms  FixedPointNumbers
     33.7 ms  Tables
     34.0 ms  TaylorSeries
     41.0 ms  ColorTypes
     41.9 ms  ForwardDiff
     42.1 ms  OffsetArrays
     43.7 ms  Colors
     47.8 ms  DataStructures
     47.9 ms  HDF5 22.36% compilation time (100% recompilation)
     52.3 ms  FFTW
     60.9 ms  NCDatasets
     61.7 ms  GPUArrays
     65.1 ms  FillArrays
     79.4 ms  ColorVectorSpace 4.79% compilation time (100% recompilation)
    106.4 ms  FileIO
    112.0 ms  Dierckx_jll 99.47% compilation time (100% recompilation)
    114.1 ms  ClimaCore
    126.2 ms  GPUCompiler 3.44% compilation time
    131.6 ms  BlockArrays
    155.8 ms  JLD2 12.26% compilation time
    186.5 ms  ImageFiltering
    187.7 ms  ClimaAtmos
    207.6 ms  StrideArraysCore
    207.8 ms  SciMLBase 3.17% compilation time (100% recompilation)
    234.2 ms  Distributions
    236.3 ms  DiffEqBase
    240.1 ms  ImageCore 1.53% compilation time (100% recompilation)
    254.1 ms  StaticArrays
    340.9 ms  BandedMatrices
    611.4 ms  CUDA
    983.3 ms  ArrayLayouts

main branch

julia> @time using ClimaAtmos
 10.005621 seconds (25.39 M allocations: 1.805 GiB, 3.84% gc time, 10.84% compilation time: 91% of which was recompilation)

this branch

julia> @time using ClimaAtmos
  7.041344 seconds (17.92 M allocations: 1.396 GiB, 4.76% gc time, 15.34% compilation time: 90% of which was recompilation)

@charleskawczynski charleskawczynski force-pushed the ck/interpolatable_field branch 7 times, most recently from a107715 to a804f66 Compare October 6, 2023 16:09
@charleskawczynski charleskawczynski marked this pull request as ready for review October 6, 2023 16:21
Copy link
Member

@szy21 szy21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change looks good to me. I didn't check the actual integral, maybe it would be good for @dennisYatunin to check?

Remove use of OrdinaryDiffEq

Fixes

Use ClimaCore operator

Fix merge conflict
@charleskawczynski
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Oct 25, 2023
2183: Remove dependence on OrdinaryDiffEq r=charleskawczynski a=charleskawczynski

This PR removes the dependence on OrdinaryDiffEq 💥.

I did have to add a function for computing indefinite integrals:
```julia
function column_indefinite_integral!(
    f::Function,
    ᶠintegral::Fields.ColumnField,
    x₀,
    ᶜzfield::Fields.ColumnField,
    average = (a, b) -> (a + b) / 2,
)
```
(I guess we could maybe get rid of `ᶜzfield` and extract it from `ᶠintegral`?)

Which returns a new `ColumnInterpolatableField` object:

```julia
struct ColumnInterpolatableField{F, D}
    f::F
    data::D
    function ColumnInterpolatableField(f::Fields.ColumnField)
        zdata = vec(parent(Fields.Fields.coordinate_field(f).z))
        fdata = vec(parent(f))
        `@assert` length(zdata) == length(fdata)
        data = Dierckx.Spline1D(zdata, fdata; k = 1)
        return new{typeof(f), typeof(data)}(f, data)
    end
end
(f::ColumnInterpolatableField)(z) = Spaces.undertype(axes(f.f))(f.data(z))
```

Ultimately, this replaces `ODE.solve`, which itself is not an issue, but `ODE.Tsit5()` (and every other ODE algo implementation) is (reasonably) not in SciMLBase.

2282: Increase job memory for perf jobs and lower allocations r=charleskawczynski a=Sbozzolo



Co-authored-by: Charles Kawczynski <[email protected]>
Co-authored-by: Gabriele Bozzola <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 25, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Oct 25, 2023
2183: Remove dependence on OrdinaryDiffEq r=charleskawczynski a=charleskawczynski

This PR removes the dependence on OrdinaryDiffEq 💥.

I did have to add a function for computing indefinite integrals:
```julia
function column_indefinite_integral!(
    f::Function,
    ᶠintegral::Fields.ColumnField,
    x₀,
    ᶜzfield::Fields.ColumnField,
    average = (a, b) -> (a + b) / 2,
)
```
(I guess we could maybe get rid of `ᶜzfield` and extract it from `ᶠintegral`?)

Which returns a new `ColumnInterpolatableField` object:

```julia
struct ColumnInterpolatableField{F, D}
    f::F
    data::D
    function ColumnInterpolatableField(f::Fields.ColumnField)
        zdata = vec(parent(Fields.Fields.coordinate_field(f).z))
        fdata = vec(parent(f))
        `@assert` length(zdata) == length(fdata)
        data = Dierckx.Spline1D(zdata, fdata; k = 1)
        return new{typeof(f), typeof(data)}(f, data)
    end
end
(f::ColumnInterpolatableField)(z) = Spaces.undertype(axes(f.f))(f.data(z))
```

Ultimately, this replaces `ODE.solve`, which itself is not an issue, but `ODE.Tsit5()` (and every other ODE algo implementation) is (reasonably) not in SciMLBase.

Co-authored-by: Charles Kawczynski <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 25, 2023

Build failed:

@charleskawczynski
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 25, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 0baa1a6 into main Oct 25, 2023
7 of 8 checks passed
@bors bors bot deleted the ck/interpolatable_field branch October 25, 2023 06:12
bors bot added a commit that referenced this pull request Oct 25, 2023
2284: Remove explicit use of CUDA in benchmark_step r=charleskawczynski a=charleskawczynski

This PR removes an explicit use of CUDA in `benchmark_step!`, so that we have no direct package loading of CUDA.

2288: Remove OrdinaryDiffEq from environments r=charleskawczynski a=charleskawczynski

This PR removes OrdinaryDiffEq from the environments, a followup to #2183. Now, OrdinaryDiffEq is only a weakdep, which conditionally comes in (if used) through DiffEqCallbacks.

Co-authored-by: Charles Kawczynski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants