Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
OsKnoth committed Nov 20, 2023
1 parent 114ef4a commit 78d19f6
Show file tree
Hide file tree
Showing 4 changed files with 1,431 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Examples/testNHSphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Stretch = parsed_args["Stretch"]
StretchType = parsed_args["StretchType"]
TopoS = parsed_args["TopoS"]
GridType = parsed_args["GridType"]
RadEarth = parsed_args["RadEarth"]
# CG Element
OrdPoly = parsed_args["OrdPoly"]
# Viscosity
Expand Down Expand Up @@ -206,7 +207,7 @@ if RadEarth == 0.0
RadEarth = Phys.RadEarth
end

Topography = (TopoS=TopoS,H=H,Rad=Phys.RadEarth)
Topography = (TopoS=TopoS,H=H,Rad=RadEarth)

@show "InitSphere"
(CG, Metric, Exchange, Global) = DyCore.InitSphere(backend,FTB,OrdPoly,OrdPolyZ,nz,nPanel,H,
Expand Down
1 change: 1 addition & 0 deletions src/GPU/GPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ..Grids
using StaticArrays
using KernelAbstractions
using KernelAbstractions: @atomic, @atomicswap, @atomicreplace
using KernelAbstractions.Extras

include("OperatorKernel.jl")
include("FcnGPU.jl")
Expand Down
8 changes: 4 additions & 4 deletions src/GPU/OperatorKernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@ end
@kernel function DivRhoKernel!(F,@Const(U),@Const(D),@Const(dXdxI),
@Const(JJ),@Const(M),@Const(Glob))

# gi, gj, gz, gF = @index(Group, NTuple)
I, J, iz = @index(Local, NTuple)
_,_,Iz,IF = @index(Global, NTuple)

Expand Down Expand Up @@ -1046,9 +1045,10 @@ end

if Iz <= Nz
ID = I + (J - 1) * N
@inbounds DivRho = D[I,1] * uConCol[1,J,iz]
@inbounds DivRho += D[J,1] * vConCol[I,1,iz]
for k = 2 : N
# @inbounds DivRho = D[I,1] * uConCol[1,J,iz]
# @inbounds DivRho += D[J,1] * vConCol[I,1,iz]
DivRho = eltype(F)(0)
@unroll for k = 1 : N
@inbounds DivRho += D[I,k] * uConCol[k,J,iz]
@inbounds DivRho += D[J,k] * vConCol[I,k,iz]
end
Expand Down
Loading

0 comments on commit 78d19f6

Please sign in to comment.