Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Rename state_conservative -> state_prognostic
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jul 21, 2020
1 parent 7759e4b commit 354affe
Show file tree
Hide file tree
Showing 68 changed files with 514 additions and 542 deletions.
2 changes: 1 addition & 1 deletion docs/src/APIs/BalanceLaws/BalanceLaws.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ vars_state
## Initial condition methods

```@docs
init_state_conservative!
init_state_prognostic!
init_state_auxiliary!
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/GettingStarted/Atmos.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ possible options for each subcomponent.
source::S = (Gravity(), Coriolis(), GeostrophicForcing{FT}(7.62e-5, 0, 0)),
tracers::TR = NoTracers(),
boundarycondition::BC = AtmosBC(),
init_state_conservative::IS = nothing,
init_state_prognostic::IS = nothing,
data_config::DC = nothing,
```

Expand Down Expand Up @@ -54,6 +54,6 @@ possible options for each subcomponent.
source::S = (Gravity(), Coriolis()),
tracers::TR = NoTracers(),
boundarycondition::BC = AtmosBC(),
init_state_conservative::IS = nothing,
init_state_prognostic::IS = nothing,
data_config::DC = nothing,
```
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ the following methods, which are computed locally at each nodal point:
## Methods to set initial conditions
| **Method** | Purpose |
|:-----|:-----|
| [`init_state_conservative!`](@ref) | provide initial values for the conservative state as a function of time and space. |
| [`init_state_prognostic!`](@ref) | provide initial values for the conservative state as a function of time and space. |
| [`init_state_auxiliary!`](@ref) | provide initial values for the auxiliary variables as a function of the geometry. |


Expand Down
2 changes: 1 addition & 1 deletion docs/src/Theory/Atmos/Model/tracers.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ tracers required. Note that tracer naming is not currently supported,
i.e. the user must track each tracer variable based on its numerical
index. Sources can be added to each tracer based on the corresponding
numerical vector index. Initial profiles must be specified using the
`init_state_conservative!` hook at the experiment level.
`init_state_prognostic!` hook at the experiment level.

```@docs
ClimateMachine.Atmos.NTracers{N,FT}
Expand Down
2 changes: 1 addition & 1 deletion experiments/AtmosGCM/heldsuarez.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function config_heldsuarez(FT, poly_order, resolution)
hyperdiffusion = DryBiharmonic(τ_hyper),
moisture = DryModel(),
source = (Gravity(), Coriolis(), held_suarez_forcing!, sponge),
init_state_conservative = init_heldsuarez!,
init_state_prognostic = init_heldsuarez!,
data_config = HeldSuarezDataConfig(T_ref),
tracers = tracers,
)
Expand Down
2 changes: 1 addition & 1 deletion experiments/AtmosLES/bomex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function config_bomex(FT, N, resolution, xmax, ymax, zmax)
),
AtmosBC(),
),
init_state_conservative = ics,
init_state_prognostic = ics,
)

# Assemble configuration
Expand Down
2 changes: 1 addition & 1 deletion experiments/AtmosLES/dycoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function config_dycoms(FT, N, resolution, xmax, ymax, zmax)
),
AtmosBC(),
),
init_state_conservative = ics,
init_state_prognostic = ics,
)

ode_solver = ClimateMachine.ExplicitSolverType(
Expand Down
2 changes: 1 addition & 1 deletion experiments/AtmosLES/schar_scalar_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function config_schar(FT, N, resolution, xmax, ymax, zmax)
moisture = DryModel(),
source = source,
tracers = NTracers{1, FT}(_δχ),
init_state_conservative = init_schar!,
init_state_prognostic = init_schar!,
ref_state = ref_state,
)

Expand Down
2 changes: 1 addition & 1 deletion experiments/AtmosLES/surfacebubble.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function config_surfacebubble(FT, N, resolution, xmax, ymax, zmax)
AtmosBC(),
),
moisture = EquilMoist{FT}(),
init_state_conservative = init_surfacebubble!,
init_state_prognostic = init_surfacebubble!,
)
config = ClimateMachine.AtmosLESConfiguration(
"SurfaceDrivenBubble",
Expand Down
2 changes: 1 addition & 1 deletion experiments/AtmosLES/taylor-green.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function config_greenvortex(
turbulence = Vreman(_C_smag), # Turbulence closure model
moisture = DryModel(),
source = (),
init_state_conservative = init_greenvortex!, # Apply the initial condition
init_state_prognostic = init_greenvortex!, # Apply the initial condition
)

# Finally, we pass a `Problem Name` string, the mesh information, and the model type to the [`AtmosLESConfiguration`] object.
Expand Down
26 changes: 13 additions & 13 deletions src/Atmos/Model/AtmosModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import ClimateMachine.BalanceLaws:
compute_gradient_flux!,
transform_post_gradient_laplacian!,
init_state_auxiliary!,
init_state_conservative!,
init_state_prognostic!,
update_auxiliary_state!,
indefinite_stack_integral!,
reverse_indefinite_stack_integral!,
Expand Down Expand Up @@ -95,7 +95,7 @@ Users may over-ride prescribed default values for each field.
source,
tracers,
boundarycondition,
init_state_conservative
init_state_prognostic
)
# Fields
Expand Down Expand Up @@ -128,7 +128,7 @@ struct AtmosModel{FT, PS, O, RS, T, TC, HD, M, P, R, S, TR, BC, IS, DC} <:
"Boundary condition specification"
boundarycondition::BC
"Initial Condition (Function to assign initial values of state variables)"
init_state_conservative::IS
init_state_prognostic::IS
"Data Configuration (Helper field for experiment configuration)"
data_config::DC
end
Expand Down Expand Up @@ -158,11 +158,11 @@ function AtmosModel{FT}(
),
tracers::TR = NoTracers(),
boundarycondition::BC = AtmosBC(),
init_state_conservative::IS = nothing,
init_state_prognostic::IS = nothing,
data_config::DC = nothing,
) where {FT <: AbstractFloat, O, RS, T, TC, HD, M, P, R, S, TR, BC, IS, DC}
@assert param_set nothing
@assert init_state_conservative nothing
@assert init_state_prognostic nothing

atmos = (
param_set,
Expand All @@ -177,7 +177,7 @@ function AtmosModel{FT}(
source,
tracers,
boundarycondition,
init_state_conservative,
init_state_prognostic,
data_config,
)

Expand All @@ -197,11 +197,11 @@ function AtmosModel{FT}(
source::S = (Gravity(), Coriolis(), turbconv_sources(turbconv)...),
tracers::TR = NoTracers(),
boundarycondition::BC = AtmosBC(),
init_state_conservative::IS = nothing,
init_state_prognostic::IS = nothing,
data_config::DC = nothing,
) where {FT <: AbstractFloat, O, RS, T, TC, HD, M, P, R, S, TR, BC, IS, DC}
@assert param_set nothing
@assert init_state_conservative nothing
@assert init_state_prognostic nothing
atmos = (
param_set,
orientation,
Expand All @@ -215,7 +215,7 @@ function AtmosModel{FT}(
source,
tracers,
boundarycondition,
init_state_conservative,
init_state_prognostic,
data_config,
)

Expand Down Expand Up @@ -687,7 +687,7 @@ function source!(
end

@doc """
init_state_conservative!(
init_state_prognostic!(
m::AtmosModel,
state::Vars,
aux::Vars,
Expand All @@ -697,15 +697,15 @@ end
Initialise state variables.
`args...` provides an option to include configuration data
(current use cases include problem constants, spline-interpolants)
""" init_state_conservative!
function init_state_conservative!(
""" init_state_prognostic!
function init_state_prognostic!(
m::AtmosModel,
state::Vars,
aux::Vars,
coords,
t,
args...,
)
m.init_state_conservative(m, state, aux, coords, t, args...)
m.init_state_prognostic(m, state, aux, coords, t, args...)
end
end # module
6 changes: 3 additions & 3 deletions src/Atmos/Model/bc_initstate.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
InitStateBC
Set the value at the boundary to match the `init_state_conservative!` function. This is
Set the value at the boundary to match the `init_state_prognostic!` function. This is
mainly useful for cases where the problem has an explicit solution.
# TODO: This should be fixed later once BCs are figured out (likely want
Expand All @@ -21,7 +21,7 @@ function atmos_boundary_state!(
t,
_...,
)
init_state_conservative!(m, state⁺, aux⁺, aux⁺.coord, t)
init_state_prognostic!(m, state⁺, aux⁺, aux⁺.coord, t)
end

function atmos_normal_boundary_flux_second_order!(
Expand Down Expand Up @@ -78,5 +78,5 @@ function boundary_state!(
t,
args...,
)
init_state_conservative!(m, state⁺, aux⁺, aux⁺.coord, t)
init_state_prognostic!(m, state⁺, aux⁺, aux⁺.coord, t)
end
2 changes: 1 addition & 1 deletion src/Atmos/Model/linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function boundary_state!(
end
init_state_auxiliary!(lm::AtmosLinearModel, aux::Vars, geom::LocalGeometry) =
nothing
init_state_conservative!(
init_state_prognostic!(
lm::AtmosLinearModel,
state::Vars,
aux::Vars,
Expand Down
2 changes: 1 addition & 1 deletion src/Atmos/Model/tracers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct NoTracers <: TracerModel end
# i.e. the user must track each tracer variable based on its
# numerical index. Sources can be added to each tracer based on the
# same numerical index. Initial profiles must be specified using the
# `init_state_conservative!` hook at the experiment level.
# `init_state_prognostic!` hook at the experiment level.

"""
NTracers{N, FT} <: TracerModel
Expand Down
2 changes: 1 addition & 1 deletion src/BalanceLaws/BalanceLaws.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using ..Courant
export BalanceLaw,
vars_state,
number_states,
init_state_conservative!,
init_state_prognostic!,
init_state_auxiliary!,
compute_gradient_flux!,
compute_gradient_argument!,
Expand Down
28 changes: 14 additions & 14 deletions src/BalanceLaws/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ function vars_state end
vars_state(::BalanceLaw, ::AbstractStateType, FT) = @vars()

"""
init_state_conservative!(
init_state_prognostic!(
::L,
state_conservative::Vars,
state_prognostic::Vars,
state_auxiliary::Vars,
coords,
args...)
Initialize the conservative state variables at ``t = 0``
"""
function init_state_conservative! end
function init_state_prognostic! end

"""
init_state_auxiliary!(
Expand All @@ -53,7 +53,7 @@ function init_state_auxiliary! end
flux_first_order!(
::L,
flux::Grad,
state_conservative::Vars,
state_prognostic::Vars,
state_auxiliary::Vars,
t::Real,
directions
Expand All @@ -67,7 +67,7 @@ function flux_first_order! end
flux_second_order!(
::L,
flux::Grad,
state_conservative::Vars,
state_prognostic::Vars,
state_gradient_flux::Vars,
hyperdiffusive::Vars,
state_auxiliary::Vars,
Expand All @@ -82,7 +82,7 @@ function flux_second_order! end
source!(
::L,
source::Vars,
state_conservative::Vars,
state_prognostic::Vars,
diffusive::Vars,
state_auxiliary::Vars,
t::Real
Expand All @@ -96,7 +96,7 @@ function source! end
compute_gradient_argument!(
::L,
transformstate::Vars,
state_conservative::Vars,
state_prognostic::Vars,
state_auxiliary::Vars,
t::Real
)
Expand Down Expand Up @@ -135,7 +135,7 @@ function transform_post_gradient_laplacian! end
wavespeed(
::L,
n⁻,
state_conservative::Vars,
state_prognostic::Vars,
state_auxiliary::Vars,
t::Real,
direction
Expand All @@ -149,33 +149,33 @@ function wavespeed end
boundary_state!(
::NumericalFluxGradient,
::L,
state_conservative⁺::Vars,
state_prognostic⁺::Vars,
state_auxiliary⁺::Vars,
normal⁻,
state_conservative⁻::Vars,
state_prognostic⁻::Vars,
state_auxiliary⁻::Vars,
bctype,
t
)
boundary_state!(
::NumericalFluxFirstOrder,
::L,
state_conservative⁺::Vars,
state_prognostic⁺::Vars,
state_auxiliary⁺::Vars,
normal⁻,
state_conservative⁻::Vars,
state_prognostic⁻::Vars,
state_auxiliary⁻::Vars,
bctype,
t
)
boundary_state!(
::NumericalFluxSecondOrder,
::L,
state_conservative⁺::Vars,
state_prognostic⁺::Vars,
state_gradient_flux⁺::Vars,
state_auxiliary⁺:
Vars, normal⁻,
state_conservative⁻::Vars,
state_prognostic⁻::Vars,
state_gradient_flux⁻::Vars,
state_auxiliary⁻::Vars,
bctype,
Expand Down
2 changes: 1 addition & 1 deletion src/Common/TurbulenceClosures/TurbulenceClosures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import ClimateMachine.BalanceLaws:
compute_gradient_argument!,
compute_gradient_flux!,
transform_post_gradient_laplacian!,
init_state_conservative!,
init_state_prognostic!,
update_auxiliary_state!,
nodal_update_auxiliary_state!,
indefinite_stack_integral!,
Expand Down
Loading

0 comments on commit 354affe

Please sign in to comment.