Skip to content

Commit

Permalink
Unify fieldvector names
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Sep 8, 2023
1 parent 5cf92c1 commit ba08c9e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/TurbulenceConvection_deprecated/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ struct State{P, A, T, CACHE, C, SC}
surface_conditions::SC
end

Grid(state::State) = Grid(axes(state.prog.cent))
Grid(state::State) = Grid(axes(state.prog.c))

float_type(state::State) = eltype(state.prog)
# float_type(field::CC.Fields.Field) = CC.Spaces.undertype(axes(field))
Expand Down
4 changes: 2 additions & 2 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ function compute_diagnostics(integrator)
) .+ ᶜa⁺ .* cloud_fraction.(ᶜts⁺, ᶜa⁺),
)
elseif p.atmos.turbconv_model isa TC.EDMFModel
tc_cent(p) = p.edmf_cache.aux.cent.turbconv
tc_face(p) = p.edmf_cache.aux.face.turbconv
tc_cent(p) = p.edmf_cache.aux.c.turbconv
tc_face(p) = p.edmf_cache.aux.f.turbconv
turbulence_convection_diagnostic = (;
bulk_up_area = tc_cent(p).bulk.area,
bulk_up_h_tot = tc_cent(p).bulk.h_tot,
Expand Down
10 changes: 5 additions & 5 deletions src/dycore_equations_deprecated/sgs_flux_tendencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function turbconv_aux(atmos, edmf, Y, ::Type{FT}) where {FT}

aux_cent_fields = cent_aux_vars.(FT, ᶜlocal_geometry, atmos, edmf)
aux_face_fields = face_aux_vars.(FT, ᶠlocal_geometry, atmos, edmf)
aux = Fields.FieldVector(cent = aux_cent_fields, face = aux_face_fields)
aux = Fields.FieldVector(; c = aux_cent_fields, f = aux_face_fields)
return aux
end

Expand Down Expand Up @@ -174,8 +174,8 @@ function implicit_sgs_flux_tendency!(Yₜ, Y, p, t, colidx, ::TC.EDMFModel)

grid = TC.Grid(state)
if test_consistency
parent(state.aux.face) .= NaN
parent(state.aux.cent) .= NaN
parent(state.aux.f) .= NaN
parent(state.aux.c) .= NaN
end

assign_thermo_aux!(state, edmf.moisture_model, thermo_params)
Expand Down Expand Up @@ -213,8 +213,8 @@ function explicit_sgs_flux_tendency!(Yₜ, Y, p, t, colidx, ::TC.EDMFModel)

grid = TC.Grid(state)
if test_consistency
parent(state.aux.face) .= NaN
parent(state.aux.cent) .= NaN
parent(state.aux.f) .= NaN
parent(state.aux.c) .= NaN
end

assign_thermo_aux!(state, edmf.moisture_model, thermo_params)
Expand Down
20 changes: 10 additions & 10 deletions src/parameterized_tendencies/microphysics/precipitation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ function compute_precipitation_cache!(
)
(; ᶜS_ρq_tot) = p
qt_tendency_precip_formation_en =
p.edmf_cache.aux.cent.turbconv.en.qt_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.en.qt_tendency_precip_formation[colidx]
qt_tendency_precip_formation_bulk =
p.edmf_cache.aux.cent.turbconv.bulk.qt_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.bulk.qt_tendency_precip_formation[colidx]

@. ᶜS_ρq_tot[colidx] =
Y.c.ρ[colidx] *
Expand Down Expand Up @@ -196,21 +196,21 @@ function compute_precipitation_cache!(

# Sources of precipitation from EDMF SGS sub-domains
e_tot_tendency_precip_formation_en =
p.edmf_cache.aux.cent.turbconv.en.e_tot_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.en.e_tot_tendency_precip_formation[colidx]
e_tot_tendency_precip_formation_bulk =
p.edmf_cache.aux.cent.turbconv.bulk.e_tot_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.bulk.e_tot_tendency_precip_formation[colidx]
qt_tendency_precip_formation_en =
p.edmf_cache.aux.cent.turbconv.en.qt_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.en.qt_tendency_precip_formation[colidx]
qt_tendency_precip_formation_bulk =
p.edmf_cache.aux.cent.turbconv.bulk.qt_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.bulk.qt_tendency_precip_formation[colidx]
qr_tendency_precip_formation_en =
p.edmf_cache.aux.cent.turbconv.en.qr_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.en.qr_tendency_precip_formation[colidx]
qr_tendency_precip_formation_bulk =
p.edmf_cache.aux.cent.turbconv.bulk.qr_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.bulk.qr_tendency_precip_formation[colidx]
qs_tendency_precip_formation_en =
p.edmf_cache.aux.cent.turbconv.en.qs_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.en.qs_tendency_precip_formation[colidx]
qs_tendency_precip_formation_bulk =
p.edmf_cache.aux.cent.turbconv.bulk.qs_tendency_precip_formation[colidx]
p.edmf_cache.aux.c.turbconv.bulk.qs_tendency_precip_formation[colidx]

thermo_params = CAP.thermodynamics_params(params)
cm_params = CAP.microphysics_params(params)
Expand Down

0 comments on commit ba08c9e

Please sign in to comment.