Skip to content

Commit

Permalink
Merge pull request #297 from FourierFlows/ncc/convert-arrays
Browse files Browse the repository at this point in the history
Convert arrays to proper format depending on device
  • Loading branch information
navidcy authored Jul 15, 2022
2 parents 24791cd + 05382f4 commit 6343e42
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/singlelayerqg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ const EquivalentBarotropicQGParams = Params{<:AbstractFloat, <:AbstractArray, <:
Return the parameters for an Equivalent Barotropic QG problem (i.e., with finite Rossby radius of deformation).
"""
function EquivalentBarotropicQGParams(grid::AbstractGrid{T, A}, β, deformation_radius, eta, μ, ν, nν::Int, calcF) where {T, A}
eta_grid = typeof(eta) <: AbstractArray ? eta : FourierFlows.on_grid(eta, grid)
eta_gridh = rfft(eta_grid)
return Params(β, deformation_radius, eta_grid, eta_gridh, μ, ν, nν, calcF)
eta_on_grid = typeof(eta) <: AbstractArray ? A(eta) : FourierFlows.on_grid(eta, grid)
etah_on_grid = rfft(eta_on_grid)

return Params(β, deformation_radius, eta_on_grid, etah_on_grid, μ, ν, nν, calcF)
end

"""
Expand Down

0 comments on commit 6343e42

Please sign in to comment.