Skip to content

Commit

Permalink
Merge #608
Browse files Browse the repository at this point in the history
608: Use more ClimaCore operators r=charleskawczynski a=charleskawczynski



Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
  • Loading branch information
bors[bot] and charleskawczynski committed Dec 2, 2021
2 parents 4f3f607 + 2b140d3 commit 970336f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 28 deletions.
1 change: 0 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CurrentModule = TurbulenceConvection

```@docs
TurbulenceConvection.ClimaParams
TurbulenceConvection.ccut_downwind
TurbulenceConvection.ccut_upwind
TurbulenceConvection.daul_f2c_upwind
TurbulenceConvection.dual_centers
Expand Down
22 changes: 0 additions & 22 deletions src/Operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,28 +105,6 @@ interpf2c(f::SA.SVector, grid::Grid, ::BottomBCTag, bc::SetValue) = (bc.value +
##### Generic functions
#####

function ∇_staggered(f::SA.SVector, grid::Grid)
@assert length(f) == 2
return (f[2] - f[1]) * grid.Δzi
end

"""
ccut_downwind
Used when
- traversing cell centers
- grabbing one-sided (downwind) stencil of cell center `k` and cell center `k+1`
This is needed for "upwinding" rain, which travels _down_ (hence the direction change).
"""
function ccut_downwind(f, grid, k::Cent)
if is_toa_center(grid, k)
return SA.SVector(f[k])
else
return SA.SVector(f[k], f[k + 1])
end
end

"""
ccut_upwind
Expand Down
8 changes: 3 additions & 5 deletions src/Radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ function calculate_radiation(self::RadiationBase{RadiationDYCOMS_RF01}, grid, st
end
end

@inbounds for k in real_center_indices(grid)
f_rad_dual = dual_faces(aux_gm_f.f_rad, grid, k)
∇f_rad = ∇_staggered(f_rad_dual, grid)
aux_gm.dTdt_rad[k] = -∇f_rad / ρ0_c[k] / cp_d
end
∇c = CCO.DivergenceF2C()
wvec = CC.Geometry.WVector
@. aux_gm.dTdt_rad = -∇c(wvec(aux_gm_f.f_rad)) / ρ0_c / cp_d

return
end
Expand Down

0 comments on commit 970336f

Please sign in to comment.