Skip to content

Commit

Permalink
Merge pull request #83 from FourierFlows/GPUifyBarotropicQGQL
Browse files Browse the repository at this point in the history
GPUify BarotropicQGQL Module
  • Loading branch information
navidcy authored May 29, 2020
2 parents cf304c6 + 7dfb701 commit 99ca46e
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 327 deletions.
4 changes: 2 additions & 2 deletions examples/barotropicqgql_betaforced.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ forcing_bandwidth = 1.5 # the width of the forcing spectrum

gr = TwoDGrid(nx, Lx)

k = [ gr.kr[i] for i=1:gr.nkr, j=1:gr.nl] # a 2D grid with the zonal wavenumber
k = [ gr.kr[i] for i=1:gr.nkr, j=1:gr.nl ] # a 2D grid with the zonal wavenumber

forcing_spectrum = @. exp( -(sqrt(gr.Krsq)-forcing_wavenumber)^2 / (2forcing_bandwidth^2) )
@. forcing_spectrum[ gr.Krsq < (2π/Lx*2)^2 ] = 0
Expand All @@ -77,7 +77,7 @@ nothing # hide
# a viscosity coefficient ν leads to the module's default value: ν=0. In this
# example numerical instability due to accumulation of enstrophy in high wavenumbers
# is taken care with the `FilteredTimestepper` we picked.
prob = BarotropicQGQL.Problem(nx=nx, Lx=Lx, beta=β, mu=μ, dt=dt, stepper=stepper,
prob = BarotropicQGQL.Problem(nx=nx, Lx=Lx, β=β, μ=μ, dt=dt, stepper=stepper,
calcF=calcF!, stochastic=true)
nothing # hide

Expand Down
Loading

0 comments on commit 99ca46e

Please sign in to comment.