Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OsKnoth committed Oct 3, 2024
1 parent c4312ff commit 498b45b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Examples/testFVGrad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ for iE = 1 : Grid.NumEdges
x = Grid.Edges[iF].Mid.x
y = Grid.Edges[iF].Mid.y
z = Grid.Edges[iF].Mid.z
u = 3*x^4 + 4*y^3 + 5 * z^2
v = 3*x^4 + 4*y^3 + 5 * z^2
w = 3*x^4 + 4*y^3 + 5 * z^2
(lon,lat,r)= Grids.cart2sphere(x,y,z)
uS = 3*lon^4 + 4*lat^3
vS = 4*lon^3 + 5 * lat^2
end
stop

Expand Down
11 changes: 7 additions & 4 deletions src/Examples/force.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ function (Force::HeldSuarezForcing)(Param,Phys)
function local_force(U,p,lat)
FT = eltype(U)
Sigma = p / Phys.p0
SigmaPowKappa = fast_powGPU(Sigma,Phys.kappa)
height_factor = max(FT(0), (Sigma - Param.sigma_b) / (FT(1) - Param.sigma_b))
coslat = cos(lat)
sinlat = sin(lat)
Fu = -(Param.k_f * height_factor) * U[2]
Fv = -(Param.k_f * height_factor) * U[3]
if Sigma < FT(0.7)
kT = Param.k_a + (Param.k_s - Param.k_a) * height_factor * cos(lat) * cos(lat) * cos(lat) * cos(lat)
kT = Param.k_a + (Param.k_s - Param.k_a) * height_factor * coslat * coslat * coslat * coslat
else
kT = FT(0)
end
Teq = (Param.T_equator - Param.DeltaT_y * sin(lat) * sin(lat) -
Param.DeltaTh_z * log(Sigma) * cos(lat) * cos(lat)) * Sigma^Phys.kappa
Teq = (Param.T_equator - Param.DeltaT_y * sinlat * sinlat -
Param.DeltaTh_z * log(Sigma) * coslat * coslat) * SigmaPowKappa
Teq = max(Param.T_min, Teq)
DeltaT = kT * (Phys.p0 * Sigma / (U[1] * Phys.Rd) - Teq)
FRhoTh = -U[1] * DeltaT / Sigma^Phys.kappa
FRhoTh = -U[1] * DeltaT / SigmaPowKappa
return FT(0),Fu,Fv,FT(0),FRhoTh
end
return local_force
Expand Down

0 comments on commit 498b45b

Please sign in to comment.