-
Notifications
You must be signed in to change notification settings - Fork 32
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
SingleLayerQG #160
SingleLayerQG #160
Conversation
@glwagner, me and @liasiegelman have worked on this PR. We feel it's time for somebody else to have a look. What do you think? |
@glwagner, there is no preview of docs (something related with Documenter ssh keys and what not). But you can preview the docs locally if you run julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'; julia --project=docs/ docs/make.jl; open docs/build/index.html from the repo's home directory. |
@navidcy that's neat. The title for the right panel should probably read \Lap \psi - psi/L_d^2 if it is sol that you are plotting |
The animation indeed shows ∇²ψ for both cases. |
oki :) |
I'll take a look! |
const BarotropicQGParams = Params{<:AbstractFloat, <:AbstractArray, <:AbstractArray, Nothing} | ||
const EquivalentBarotropicQGParams = Params{<:AbstractFloat, <:AbstractArray, <:AbstractArray, <:AbstractFloat} | ||
|
||
get_topographicPV_grid_values(eta::Function, grid::AbstractGrid{T, A}) where {T, A} = A([eta(grid.x[i], grid.y[j]) for i=1:grid.nx, j=1:grid.ny]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe out of scope, but this works for any function of x, y (not just topographic PV), so you could put this in FourierFlows utils.jl
or something and instead call it
on_grid(func, grid::TwoDimGrid{T, A}) where {T, A} = ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Let's do it in a separate PR.
src/singlelayerqg.jl
Outdated
eta_grid = typeof(eta) <: AbstractArray ? eta : get_topographicPV_grid_values(eta, grid) | ||
eta_gridh = rfft(eta_grid) | ||
return Params(β, nothing, eta_grid, eta_gridh, μ, ν, nν, calcF) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be
BarotropicQGParams(grid::AbstractGrid{T, A}, β, eta, μ, ν, nν::Int, calcF) where {T, A} =
EquivalentBarotropicQGParams(grid, β, nothing, eta, μ, ν, nν, calcF)
src/singlelayerqg.jl
Outdated
|
||
""" | ||
set_q!(prob, q) | ||
set_q!(sol, vars, params, grid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it makes sense just to document the user API here via set_q!(prob, q)
rather than also including the "lower-level" form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note there's also a typo in the lower level form, should be set_q!(sol, vars, params, grid, q)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are suggesting that set_q!(sol, vars, params, grid, q)
is useless and we just need to have set_q!(prob, q)
? I think I agree... I don't remember where set_q!(sol, vars, params, grid, q)
was useful for... perhaps legacy now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've done a great job with this! Great work all!
This PR renames the BarotropicQG module to SingleLayerQG and adds the ability to include finite Rossby radius of deformation. Also takes the chance to refactor/optimize certain features.
Closes #137.