From c43a2ce80c719411a82109a3ea1a00c6ccb40bef Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Tue, 21 Jul 2020 15:35:20 -0700 Subject: [PATCH] Rename state_conservative -> state_prognostic --- docs/src/APIs/BalanceLaws/BalanceLaws.md | 2 +- docs/src/GettingStarted/Atmos.md | 4 +- .../DGMethods/how_to_make_a_balance_law.md | 2 +- docs/src/Theory/Atmos/Model/tracers.md | 2 +- experiments/AtmosGCM/heldsuarez.jl | 2 +- experiments/AtmosLES/bomex.jl | 2 +- experiments/AtmosLES/dycoms.jl | 2 +- .../AtmosLES/schar_scalar_advection.jl | 2 +- experiments/AtmosLES/surfacebubble.jl | 2 +- experiments/AtmosLES/taylor-green.jl | 2 +- src/Atmos/Model/AtmosModel.jl | 26 +- src/Atmos/Model/bc_initstate.jl | 6 +- src/Atmos/Model/linear.jl | 2 +- src/Atmos/Model/tracers.jl | 2 +- src/BalanceLaws/BalanceLaws.jl | 2 +- src/BalanceLaws/interface.jl | 28 +- .../TurbulenceClosures/TurbulenceClosures.jl | 2 +- src/Diagnostics/atmos_gcm_default.jl | 20 +- .../atmos_les_default_perturbations.jl | 4 +- src/Driver/driver_configs.jl | 4 +- src/Driver/solver_configs.jl | 4 +- src/Land/Model/LandModel.jl | 2 +- src/Numerics/DGMethods/DGMethods.jl | 2 +- src/Numerics/DGMethods/DGModel.jl | 138 +++---- src/Numerics/DGMethods/DGModel_kernels.jl | 376 +++++++++--------- src/Numerics/DGMethods/NumericalFluxes.jl | 124 +++--- src/Numerics/DGMethods/remainder.jl | 90 ++--- .../HydrostaticBoussinesqModel.jl | 6 +- .../HydrostaticBoussinesq/LinearHBModel.jl | 2 +- src/Ocean/ShallowWater/ShallowWaterModel.jl | 4 +- .../SplitExplicit/VerticalIntegralModel.jl | 2 +- test/Atmos/Model/ref_state.jl | 2 +- .../Microphysics/KinematicModel.jl | 16 +- test/Diagnostics/diagnostic_fields_test.jl | 2 +- test/Driver/cr_unit_tests.jl | 2 +- test/Driver/gcm_driver_test.jl | 2 +- test/Driver/mms3.jl | 2 +- .../DGMethods/Euler/acousticwave_1d_imex.jl | 2 +- .../DGMethods/Euler/acousticwave_mrigark.jl | 2 +- .../DGMethods/Euler/isentropicvortex.jl | 2 +- .../DGMethods/Euler/isentropicvortex_imex.jl | 2 +- .../Euler/isentropicvortex_mrigark.jl | 2 +- .../isentropicvortex_mrigark_implicit.jl | 2 +- .../Euler/isentropicvortex_multirate.jl | 2 +- .../advection_diffusion_model.jl | 4 +- .../hyperdiffusion_model.jl | 4 +- .../density_current_model.jl | 2 +- .../mms_bc_atmos.jl | 4 +- .../compressible_Navier_Stokes/mms_model.jl | 8 +- .../compressible_Navier_Stokes/ref_state.jl | 6 +- .../Numerics/DGMethods/conservation/sphere.jl | 4 +- test/Numerics/DGMethods/courant.jl | 2 +- test/Numerics/DGMethods/integral_test.jl | 4 +- .../DGMethods/integral_test_sphere.jl | 4 +- test/Numerics/DGMethods/remainder_model.jl | 48 +-- test/Numerics/DGMethods/vars_test.jl | 4 +- test/Numerics/Mesh/filter.jl | 4 +- test/Numerics/Mesh/interpolation.jl | 4 +- test/Numerics/SystemSolvers/poisson.jl | 4 +- test/Utilities/SingleStackUtils/ssu_tests.jl | 4 +- tutorials/Atmos/agnesi_hs_lin.jl | 2 +- tutorials/Atmos/agnesi_nh_lin.jl | 2 +- tutorials/Atmos/burgers_single_stack.jl | 6 +- tutorials/Atmos/densitycurrent.jl | 2 +- tutorials/Atmos/dry_rayleigh_benard.jl | 2 +- tutorials/Atmos/heldsuarez.jl | 2 +- tutorials/Atmos/risingbubble.jl | 2 +- tutorials/Land/Heat/heat_equation.jl | 8 +- 68 files changed, 522 insertions(+), 522 deletions(-) diff --git a/docs/src/APIs/BalanceLaws/BalanceLaws.md b/docs/src/APIs/BalanceLaws/BalanceLaws.md index 7e5db1233a8..5fea4c913c7 100644 --- a/docs/src/APIs/BalanceLaws/BalanceLaws.md +++ b/docs/src/APIs/BalanceLaws/BalanceLaws.md @@ -32,7 +32,7 @@ vars_state ## Initial condition methods ```@docs -init_state_conservative! +init_state_prognostic! init_state_auxiliary! ``` diff --git a/docs/src/GettingStarted/Atmos.md b/docs/src/GettingStarted/Atmos.md index 01632714838..adb1e250d6d 100644 --- a/docs/src/GettingStarted/Atmos.md +++ b/docs/src/GettingStarted/Atmos.md @@ -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, ``` @@ -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, ``` diff --git a/docs/src/HowToGuides/Numerics/DGMethods/how_to_make_a_balance_law.md b/docs/src/HowToGuides/Numerics/DGMethods/how_to_make_a_balance_law.md index b0eb8b1662f..037c7feb0f1 100644 --- a/docs/src/HowToGuides/Numerics/DGMethods/how_to_make_a_balance_law.md +++ b/docs/src/HowToGuides/Numerics/DGMethods/how_to_make_a_balance_law.md @@ -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. | diff --git a/docs/src/Theory/Atmos/Model/tracers.md b/docs/src/Theory/Atmos/Model/tracers.md index 81f27797565..6880e09ca8d 100644 --- a/docs/src/Theory/Atmos/Model/tracers.md +++ b/docs/src/Theory/Atmos/Model/tracers.md @@ -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} diff --git a/experiments/AtmosGCM/heldsuarez.jl b/experiments/AtmosGCM/heldsuarez.jl index 9430ba5a0f7..86a29dc091c 100755 --- a/experiments/AtmosGCM/heldsuarez.jl +++ b/experiments/AtmosGCM/heldsuarez.jl @@ -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, ) diff --git a/experiments/AtmosLES/bomex.jl b/experiments/AtmosLES/bomex.jl index f0a2a01a3ae..77106409967 100755 --- a/experiments/AtmosLES/bomex.jl +++ b/experiments/AtmosLES/bomex.jl @@ -444,7 +444,7 @@ function config_bomex(FT, N, resolution, xmax, ymax, zmax) ), AtmosBC(), ), - init_state_conservative = ics, + init_state_prognostic = ics, ) # Assemble configuration diff --git a/experiments/AtmosLES/dycoms.jl b/experiments/AtmosLES/dycoms.jl index a27ba9eb3ba..26531945e07 100755 --- a/experiments/AtmosLES/dycoms.jl +++ b/experiments/AtmosLES/dycoms.jl @@ -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( diff --git a/experiments/AtmosLES/schar_scalar_advection.jl b/experiments/AtmosLES/schar_scalar_advection.jl index af55e9638eb..460016f371c 100644 --- a/experiments/AtmosLES/schar_scalar_advection.jl +++ b/experiments/AtmosLES/schar_scalar_advection.jl @@ -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, ) diff --git a/experiments/AtmosLES/surfacebubble.jl b/experiments/AtmosLES/surfacebubble.jl index d0d1bd5acdf..96c24cd0246 100755 --- a/experiments/AtmosLES/surfacebubble.jl +++ b/experiments/AtmosLES/surfacebubble.jl @@ -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", diff --git a/experiments/AtmosLES/taylor-green.jl b/experiments/AtmosLES/taylor-green.jl index d361a55d495..e8e7ed92365 100644 --- a/experiments/AtmosLES/taylor-green.jl +++ b/experiments/AtmosLES/taylor-green.jl @@ -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. diff --git a/src/Atmos/Model/AtmosModel.jl b/src/Atmos/Model/AtmosModel.jl index f692e70c313..49d71f57f1b 100644 --- a/src/Atmos/Model/AtmosModel.jl +++ b/src/Atmos/Model/AtmosModel.jl @@ -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!, @@ -95,7 +95,7 @@ Users may over-ride prescribed default values for each field. source, tracers, boundarycondition, - init_state_conservative + init_state_prognostic ) # Fields @@ -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 @@ -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, @@ -177,7 +177,7 @@ function AtmosModel{FT}( source, tracers, boundarycondition, - init_state_conservative, + init_state_prognostic, data_config, ) @@ -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, @@ -215,7 +215,7 @@ function AtmosModel{FT}( source, tracers, boundarycondition, - init_state_conservative, + init_state_prognostic, data_config, ) @@ -687,7 +687,7 @@ function source!( end @doc """ - init_state_conservative!( + init_state_prognostic!( m::AtmosModel, state::Vars, aux::Vars, @@ -697,8 +697,8 @@ 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, @@ -706,6 +706,6 @@ function init_state_conservative!( 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 diff --git a/src/Atmos/Model/bc_initstate.jl b/src/Atmos/Model/bc_initstate.jl index d49adb76dbe..6e87f33f2fd 100644 --- a/src/Atmos/Model/bc_initstate.jl +++ b/src/Atmos/Model/bc_initstate.jl @@ -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 @@ -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!( @@ -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 diff --git a/src/Atmos/Model/linear.jl b/src/Atmos/Model/linear.jl index 285823b5dc8..2910f28f461 100644 --- a/src/Atmos/Model/linear.jl +++ b/src/Atmos/Model/linear.jl @@ -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, diff --git a/src/Atmos/Model/tracers.jl b/src/Atmos/Model/tracers.jl index e38d14b2756..d94ea5d4221 100644 --- a/src/Atmos/Model/tracers.jl +++ b/src/Atmos/Model/tracers.jl @@ -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 diff --git a/src/BalanceLaws/BalanceLaws.jl b/src/BalanceLaws/BalanceLaws.jl index 88e972351a2..734aa380325 100644 --- a/src/BalanceLaws/BalanceLaws.jl +++ b/src/BalanceLaws/BalanceLaws.jl @@ -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!, diff --git a/src/BalanceLaws/interface.jl b/src/BalanceLaws/interface.jl index 303688af306..34bfd21bfcd 100644 --- a/src/BalanceLaws/interface.jl +++ b/src/BalanceLaws/interface.jl @@ -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!( @@ -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 @@ -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, @@ -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 @@ -96,7 +96,7 @@ function source! end compute_gradient_argument!( ::L, transformstate::Vars, - state_conservative::Vars, + state_prognostic::Vars, state_auxiliary::Vars, t::Real ) @@ -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 @@ -149,10 +149,10 @@ 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 @@ -160,10 +160,10 @@ function wavespeed end 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 @@ -171,11 +171,11 @@ function wavespeed end 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, diff --git a/src/Common/TurbulenceClosures/TurbulenceClosures.jl b/src/Common/TurbulenceClosures/TurbulenceClosures.jl index 1da8e286bbf..ec77aaf148a 100644 --- a/src/Common/TurbulenceClosures/TurbulenceClosures.jl +++ b/src/Common/TurbulenceClosures/TurbulenceClosures.jl @@ -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!, diff --git a/src/Diagnostics/atmos_gcm_default.jl b/src/Diagnostics/atmos_gcm_default.jl index 71b92e88df0..820f0d6b3c1 100644 --- a/src/Diagnostics/atmos_gcm_default.jl +++ b/src/Diagnostics/atmos_gcm_default.jl @@ -66,19 +66,19 @@ atmos_gcm_default_simple_3d_vars(m, array) = function atmos_gcm_default_simple_3d_vars!( atmos::AtmosModel, - state_conservative, + state_prognostic, thermo, dyni, vars, ) - vars.u = state_conservative.ρu[1] / state_conservative.ρ - vars.v = state_conservative.ρu[2] / state_conservative.ρ - vars.w = state_conservative.ρu[3] / state_conservative.ρ - vars.rho = state_conservative.ρ + vars.u = state_prognostic.ρu[1] / state_prognostic.ρ + vars.v = state_prognostic.ρu[2] / state_prognostic.ρ + vars.w = state_prognostic.ρu[3] / state_prognostic.ρ + vars.rho = state_prognostic.ρ vars.temp = thermo.temp vars.pres = thermo.pres vars.thd = thermo.θ_dry - vars.et = state_conservative.ρe / state_conservative.ρ + vars.et = state_prognostic.ρe / state_prognostic.ρ vars.ei = thermo.e_int vars.ht = thermo.h_tot vars.hi = thermo.h_int @@ -87,7 +87,7 @@ function atmos_gcm_default_simple_3d_vars!( atmos_gcm_default_simple_3d_vars!( atmos.moisture, - state_conservative, + state_prognostic, thermo, vars, ) @@ -96,7 +96,7 @@ function atmos_gcm_default_simple_3d_vars!( end function atmos_gcm_default_simple_3d_vars!( ::MoistureModel, - state_conservative, + state_prognostic, thermo, vars, ) @@ -104,11 +104,11 @@ function atmos_gcm_default_simple_3d_vars!( end function atmos_gcm_default_simple_3d_vars!( moist::EquilMoist, - state_conservative, + state_prognostic, thermo, vars, ) - vars.moisture.qt = state_conservative.moisture.ρq_tot / state_conservative.ρ + vars.moisture.qt = state_prognostic.moisture.ρq_tot / state_prognostic.ρ vars.moisture.ql = thermo.moisture.q_liq vars.moisture.qv = thermo.moisture.q_vap vars.moisture.qi = thermo.moisture.q_ice diff --git a/src/Diagnostics/atmos_les_default_perturbations.jl b/src/Diagnostics/atmos_les_default_perturbations.jl index 5c94325c651..558879b8f3a 100644 --- a/src/Diagnostics/atmos_les_default_perturbations.jl +++ b/src/Diagnostics/atmos_les_default_perturbations.jl @@ -247,7 +247,7 @@ function atmos_les_default_perturbations_collect( # Compute thermo variables thermo_array = Array{FT}(undef, npoints, num_thermo(atmos, FT), nrealelem) @visitQ nhorzelem nvertelem Nqk Nq begin - state = extract_state_conservative(dg, state_data, ijk, e) + state = extract_state_prognostic(dg, state_data, ijk, e) aux = extract_state_auxiliary(dg, aux_data, ijk, e) thermo = thermo_vars(atmos, view(thermo_array, ijk, :, e)) @@ -257,7 +257,7 @@ function atmos_les_default_perturbations_collect( # Interpolate the state and thermo variables. interpol = dgngrp.interpol istate = - ArrayType{FT}(undef, interpol.Npl, number_state_conservative(atmos, FT)) + ArrayType{FT}(undef, interpol.Npl, number_state_prognostic(atmos, FT)) interpolate_local!(interpol, Q.realdata, istate) ithermo = ArrayType{FT}(undef, interpol.Npl, num_thermo(atmos, FT)) diff --git a/src/Driver/driver_configs.jl b/src/Driver/driver_configs.jl index ce6071fa9a5..c41e60c6908 100644 --- a/src/Driver/driver_configs.jl +++ b/src/Driver/driver_configs.jl @@ -122,7 +122,7 @@ function AtmosLESConfiguration( model = AtmosModel{FT}( AtmosLESConfigType, param_set; - init_state_conservative = init_LES!, + init_state_prognostic = init_LES!, ), mpicomm = MPI.COMM_WORLD, boundary = ((0, 0), (0, 0), (1, 2)), @@ -209,7 +209,7 @@ function AtmosGCMConfiguration( model = AtmosModel{FT}( AtmosGCMConfigType, param_set; - init_state_conservative = init_GCM!, + init_state_prognostic = init_GCM!, ), mpicomm = MPI.COMM_WORLD, meshwarp::Function = cubedshellwarp, diff --git a/src/Driver/solver_configs.jl b/src/Driver/solver_configs.jl index 0bf424520ea..65cbb6a8252 100644 --- a/src/Driver/solver_configs.jl +++ b/src/Driver/solver_configs.jl @@ -63,8 +63,8 @@ the ODE solver, and return a `SolverConfiguration` to be used with # - `t0::FT`: simulation start time. # - `timeend::FT`: simulation end time. # - `driver_config::DriverConfiguration`: from `AtmosLESConfiguration()`, etc. -# - `init_args...`: passed through to `init_state_conservative!()`. -# - `init_on_cpu=false`: run `init_state_conservative!()` on CPU? +# - `init_args...`: passed through to `init_state_prognostic!()`. +# - `init_on_cpu=false`: run `init_state_prognostic!()` on CPU? # - `ode_solver_type=driver_config.solver_type`: override solver choice. # - `ode_dt=nothing`: override timestep computation. # - `modeldata=nothing`: passed through to `DGModel`. diff --git a/src/Land/Model/LandModel.jl b/src/Land/Model/LandModel.jl index d30823d81c0..10e22cb0cad 100644 --- a/src/Land/Model/LandModel.jl +++ b/src/Land/Model/LandModel.jl @@ -17,7 +17,7 @@ import ..BalanceLaws: compute_gradient_argument!, compute_gradient_flux!, init_state_auxiliary!, - init_state_conservative!, + init_state_prognostic!, update_auxiliary_state!, nodal_update_auxiliary_state! diff --git a/src/Numerics/DGMethods/DGMethods.jl b/src/Numerics/DGMethods/DGMethods.jl index ed2590685d0..e8fcec77e10 100644 --- a/src/Numerics/DGMethods/DGMethods.jl +++ b/src/Numerics/DGMethods/DGMethods.jl @@ -26,7 +26,7 @@ using ..BalanceLaws: import ..BalanceLaws: BalanceLaw, - init_state_conservative!, + init_state_prognostic!, init_state_auxiliary!, flux_first_order!, flux_second_order!, diff --git a/src/Numerics/DGMethods/DGModel.jl b/src/Numerics/DGMethods/DGModel.jl index 46b808e5600..1d8951ce08e 100644 --- a/src/Numerics/DGMethods/DGModel.jl +++ b/src/Numerics/DGMethods/DGModel.jl @@ -82,33 +82,33 @@ function basic_grid_info(dg::DGModel) end """ - (dg::DGModel)(tendency, state_conservative, nothing, t, α, β) + (dg::DGModel)(tendency, state_prognostic, nothing, t, α, β) Computes the tendency terms compatible with `IncrementODEProblem` - tendency .= α .* dQdt(state_conservative, p, t) .+ β .* tendency + tendency .= α .* dQdt(state_prognostic, p, t) .+ β .* tendency The 4-argument form will just compute - tendency .= dQdt(state_conservative, p, t) + tendency .= dQdt(state_prognostic, p, t) """ function (dg::DGModel)( tendency, - state_conservative, + state_prognostic, param, t; increment = false, ) # TODO deprecate increment argument - dg(tendency, state_conservative, param, t, true, increment) + dg(tendency, state_prognostic, param, t, true, increment) end -function (dg::DGModel)(tendency, state_conservative, _, t, α, β) +function (dg::DGModel)(tendency, state_prognostic, _, t, α, β) balance_law = dg.balance_law - device = array_device(state_conservative) + device = array_device(state_prognostic) grid = dg.grid topology = grid.topology @@ -124,13 +124,13 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) Qhypervisc_grad, Qhypervisc_div = dg.states_higher_order state_auxiliary = dg.state_auxiliary - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) nhyperviscstate = number_states(balance_law, Hyperdiffusive(), FT) num_state_tendency = size(tendency, 2) - @assert num_state_conservative ≤ num_state_tendency + @assert num_state_prognostic ≤ num_state_tendency Np = dofs_per_element(grid) @@ -140,7 +140,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) ndrange_interior_surface = Nfp * length(grid.interiorelems) ndrange_exterior_surface = Nfp * length(grid.exteriorelems) - if num_state_conservative < num_state_tendency && β != 1 + if num_state_prognostic < num_state_tendency && β != 1 # if we don't operate on the full state, then we need to scale here instead of volume_tendency! tendency .*= β β = β != 0 # if β==0 then we can avoid the memory load in volume_tendency! @@ -152,7 +152,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) update_auxiliary_state!( dg, balance_law, - state_conservative, + state_prognostic, t, dg.grid.topology.realelems, ) @@ -166,7 +166,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) hypervisc_indexmap = nothing end - exchange_state_conservative = NoneEvent() + exchange_state_prognostic = NoneEvent() exchange_state_gradient_flux = NoneEvent() exchange_Qhypervisc_grad = NoneEvent() exchange_Qhypervisc_div = NoneEvent() @@ -177,8 +177,8 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) # Gradient Computation # ######################## if communicate - exchange_state_conservative = MPIStateArrays.begin_ghost_exchange!( - state_conservative; + exchange_state_prognostic = MPIStateArrays.begin_ghost_exchange!( + state_prognostic; dependencies = comp_stream, ) end @@ -190,7 +190,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) Val(dim), Val(N), dg.diffusion_direction, - state_conservative.data, + state_prognostic.data, state_gradient_flux.data, Qhypervisc_grad.data, state_auxiliary.data, @@ -209,7 +209,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) Val(N), dg.diffusion_direction, dg.numerical_flux_gradient, - state_conservative.data, + state_prognostic.data, state_gradient_flux.data, Qhypervisc_grad.data, state_auxiliary.data, @@ -226,22 +226,22 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) ) if communicate - exchange_state_conservative = MPIStateArrays.end_ghost_exchange!( - state_conservative; - dependencies = exchange_state_conservative, + exchange_state_prognostic = MPIStateArrays.end_ghost_exchange!( + state_prognostic; + dependencies = exchange_state_prognostic, ) # update_aux may start asynchronous work on the compute device and # we synchronize those here through a device event. - wait(device, exchange_state_conservative) + wait(device, exchange_state_prognostic) update_auxiliary_state!( dg, balance_law, - state_conservative, + state_prognostic, t, dg.grid.topology.ghostelems, ) - exchange_state_conservative = Event(device) + exchange_state_prognostic = Event(device) end comp_stream = interface_gradients!(device, workgroups_surface)( @@ -250,7 +250,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) Val(N), dg.diffusion_direction, dg.numerical_flux_gradient, - state_conservative.data, + state_prognostic.data, state_gradient_flux.data, Qhypervisc_grad.data, state_auxiliary.data, @@ -263,7 +263,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) Val(hypervisc_indexmap), grid.exteriorelems; ndrange = ndrange_exterior_surface, - dependencies = (comp_stream, exchange_state_conservative), + dependencies = (comp_stream, exchange_state_prognostic), ) if communicate @@ -289,7 +289,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) update_auxiliary_state_gradient!( dg, balance_law, - state_conservative, + state_prognostic, t, dg.grid.topology.realelems, ) @@ -381,7 +381,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) dg.diffusion_direction, Qhypervisc_grad.data, Qhypervisc_div.data, - state_conservative.data, + state_prognostic.data, state_auxiliary.data, grid.vgeo, grid.ω, @@ -401,7 +401,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) CentralNumericalFluxHigherOrder(), Qhypervisc_grad.data, Qhypervisc_div.data, - state_conservative.data, + state_prognostic.data, state_auxiliary.data, grid.vgeo, grid.sgeo, @@ -430,7 +430,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) CentralNumericalFluxHigherOrder(), Qhypervisc_grad.data, Qhypervisc_div.data, - state_conservative.data, + state_prognostic.data, state_auxiliary.data, grid.vgeo, grid.sgeo, @@ -461,7 +461,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) Val(N), dg.direction, tendency.data, - state_conservative.data, + state_prognostic.data, state_gradient_flux.data, Qhypervisc_grad.data, state_auxiliary.data, @@ -484,7 +484,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) dg.numerical_flux_first_order, dg.numerical_flux_second_order, tendency.data, - state_conservative.data, + state_prognostic.data, state_gradient_flux.data, Qhypervisc_grad.data, state_auxiliary.data, @@ -516,7 +516,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) update_auxiliary_state_gradient!( dg, balance_law, - state_conservative, + state_prognostic, t, dg.grid.topology.ghostelems, ) @@ -529,22 +529,22 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) ) end else - exchange_state_conservative = MPIStateArrays.end_ghost_exchange!( - state_conservative; - dependencies = exchange_state_conservative, + exchange_state_prognostic = MPIStateArrays.end_ghost_exchange!( + state_prognostic; + dependencies = exchange_state_prognostic, ) # update_aux may start asynchronous work on the compute device and # we synchronize those here through a device event. - wait(device, exchange_state_conservative) + wait(device, exchange_state_prognostic) update_auxiliary_state!( dg, balance_law, - state_conservative, + state_prognostic, t, dg.grid.topology.ghostelems, ) - exchange_state_conservative = Event(device) + exchange_state_prognostic = Event(device) end end @@ -556,7 +556,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) dg.numerical_flux_first_order, dg.numerical_flux_second_order, tendency.data, - state_conservative.data, + state_prognostic.data, state_gradient_flux.data, Qhypervisc_grad.data, state_auxiliary.data, @@ -571,7 +571,7 @@ function (dg::DGModel)(tendency, state_conservative, _, t, α, β) ndrange = ndrange_exterior_surface, dependencies = ( comp_stream, - exchange_state_conservative, + exchange_state_prognostic, exchange_state_gradient_flux, exchange_Qhypervisc_grad, ), @@ -589,7 +589,7 @@ function init_ode_state(dg::DGModel, args...; init_on_cpu = false) balance_law = dg.balance_law grid = dg.grid - state_conservative = create_state(balance_law, grid, Prognostic()) + state_prognostic = create_state(balance_law, grid, Prognostic()) topology = grid.topology Np = dofs_per_element(grid) @@ -601,11 +601,11 @@ function init_ode_state(dg::DGModel, args...; init_on_cpu = false) if !init_on_cpu event = Event(device) - event = kernel_init_state_conservative!(device, min(Np, 1024))( + event = kernel_init_state_prognostic!(device, min(Np, 1024))( balance_law, Val(dim), Val(N), - state_conservative.data, + state_prognostic.data, state_auxiliary.data, grid.vgeo, topology.realelems, @@ -615,14 +615,14 @@ function init_ode_state(dg::DGModel, args...; init_on_cpu = false) ) wait(device, event) else - h_state_conservative = similar(state_conservative, Array) + h_state_prognostic = similar(state_prognostic, Array) h_state_auxiliary = similar(state_auxiliary, Array) h_state_auxiliary .= state_auxiliary - event = kernel_init_state_conservative!(CPU(), Np)( + event = kernel_init_state_prognostic!(CPU(), Np)( balance_law, Val(dim), Val(N), - h_state_conservative.data, + h_state_prognostic.data, h_state_auxiliary.data, Array(grid.vgeo), topology.realelems, @@ -630,21 +630,21 @@ function init_ode_state(dg::DGModel, args...; init_on_cpu = false) ndrange = Np * nrealelem, ) wait(event) # XXX: This could be `wait(device, event)` once KA supports that. - state_conservative .= h_state_conservative + state_prognostic .= h_state_prognostic end event = Event(device) event = MPIStateArrays.begin_ghost_exchange!( - state_conservative; + state_prognostic; dependencies = event, ) event = MPIStateArrays.end_ghost_exchange!( - state_conservative; + state_prognostic; dependencies = event, ) wait(device, event) - return state_conservative + return state_prognostic end function restart_ode_state(dg::DGModel, state_data; init_on_cpu = false) @@ -671,14 +671,14 @@ function restart_auxiliary_state(bl, grid, aux_data) end # fallback -function update_auxiliary_state!(dg, balance_law, state_conservative, t, elems) +function update_auxiliary_state!(dg, balance_law, state_prognostic, t, elems) return false end function update_auxiliary_state_gradient!( dg::DGModel, balance_law, - state_conservative, + state_prognostic, t, elems, ) @@ -688,13 +688,13 @@ end function indefinite_stack_integral!( dg::DGModel, m::BalanceLaw, - state_conservative::MPIStateArray, + state_prognostic::MPIStateArray, state_auxiliary::MPIStateArray, t::Real, elems::UnitRange = dg.grid.topology.elems, ) - device = array_device(state_conservative) + device = array_device(state_prognostic) grid = dg.grid topology = grid.topology @@ -704,7 +704,7 @@ function indefinite_stack_integral!( Nq = N + 1 Nqk = dim == 2 ? 1 : Nq - FT = eltype(state_conservative) + FT = eltype(state_prognostic) # do integrals nelem = length(elems) @@ -717,7 +717,7 @@ function indefinite_stack_integral!( Val(dim), Val(N), Val(nvertelem), - state_conservative.data, + state_prognostic.data, state_auxiliary.data, grid.vgeo, grid.Imat, @@ -731,7 +731,7 @@ end function reverse_indefinite_stack_integral!( dg::DGModel, m::BalanceLaw, - state_conservative::MPIStateArray, + state_prognostic::MPIStateArray, state_auxiliary::MPIStateArray, t::Real, elems::UnitRange = dg.grid.topology.elems, @@ -760,7 +760,7 @@ function reverse_indefinite_stack_integral!( Val(dim), Val(N), Val(nvertelem), - state_conservative.data, + state_prognostic.data, state_auxiliary.data, horzelems; ndrange = (length(horzelems) * Nq, Nqk), @@ -774,12 +774,12 @@ function nodal_update_auxiliary_state!( f!, dg::DGModel, m::BalanceLaw, - state_conservative::MPIStateArray, + state_prognostic::MPIStateArray, t::Real, elems::UnitRange = dg.grid.topology.realelems; diffusive = false, ) - device = array_device(state_conservative) + device = array_device(state_prognostic) grid = dg.grid topology = grid.topology @@ -801,7 +801,7 @@ function nodal_update_auxiliary_state!( Val(dim), Val(N), f!, - state_conservative.data, + state_prognostic.data, dg.state_auxiliary.data, dg.state_gradient_flux.data, t, @@ -816,7 +816,7 @@ function nodal_update_auxiliary_state!( Val(dim), Val(N), f!, - state_conservative.data, + state_prognostic.data, dg.state_auxiliary.data, t, elems, @@ -830,14 +830,14 @@ end """ courant(local_courant::Function, dg::DGModel, m::BalanceLaw, - state_conservative::MPIStateArray, direction=EveryDirection()) + state_prognostic::MPIStateArray, direction=EveryDirection()) Returns the maximum of the evaluation of the function `local_courant` pointwise throughout the domain. The function `local_courant` is given an approximation of the local node distance `Δx`. The `direction` controls which reference directions are considered when computing the minimum node distance `Δx`. An example `local_courant` function is - function local_courant(m::AtmosModel, state_conservative::Vars, state_auxiliary::Vars, + function local_courant(m::AtmosModel, state_prognostic::Vars, state_auxiliary::Vars, diffusive::Vars, Δx) return Δt * cmax / Δx end @@ -848,7 +848,7 @@ function courant( local_courant::Function, dg::DGModel, m::BalanceLaw, - state_conservative::MPIStateArray, + state_prognostic::MPIStateArray, Δt, simtime, direction = EveryDirection(), @@ -884,7 +884,7 @@ function courant( Val(N), pointwise_courant, local_courant, - state_conservative.data, + state_prognostic.data, dg.state_auxiliary.data, dg.state_gradient_flux.data, topology.realelems, @@ -897,7 +897,7 @@ function courant( wait(device, event) rank_courant_max = maximum(pointwise_courant) else - rank_courant_max = typemin(eltype(state_conservative)) + rank_courant_max = typemin(eltype(state_prognostic)) end MPI.Allreduce(rank_courant_max, max, topology.mpicomm) @@ -907,7 +907,7 @@ function MPIStateArrays.MPIStateArray(dg::DGModel) balance_law = dg.balance_law grid = dg.grid - state_conservative = create_state(balance_law, grid, Prognostic()) + state_prognostic = create_state(balance_law, grid, Prognostic()) - return state_conservative + return state_prognostic end diff --git a/src/Numerics/DGMethods/DGModel_kernels.jl b/src/Numerics/DGMethods/DGModel_kernels.jl index 2dc80853468..2e2cfe492b0 100644 --- a/src/Numerics/DGMethods/DGModel_kernels.jl +++ b/src/Numerics/DGMethods/DGModel_kernels.jl @@ -26,7 +26,7 @@ const _sM, _vMI = Grids._sM, Grids._vMI @doc """ volume_tendency!(balance_law::BalanceLaw, Val(polyorder), - tendency, state_conservative, state_gradient_flux, + tendency, state_prognostic, state_gradient_flux, state_auxiliary, vgeo, t, D, elems) Computational kernel: Evaluate the volume integrals on right-hand side of a @@ -38,7 +38,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a ::Val{polyorder}, direction, tendency, - state_conservative, + state_prognostic, state_gradient_flux, Qhypervisc_grad, state_auxiliary, @@ -52,8 +52,8 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a ) where {dim, polyorder} @uniform begin N = polyorder - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) @@ -64,21 +64,21 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a Nqk = dim == 2 ? 1 : Nq - local_source = MArray{Tuple{num_state_conservative}, FT}(undef) - local_state_conservative = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_source = MArray{Tuple{num_state_prognostic}, FT}(undef) + local_state_prognostic = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_gradient_flux = MArray{Tuple{num_state_gradient_flux}, FT}(undef) local_state_hyperdiffusion = MArray{Tuple{nhyperviscstate}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) - local_flux = MArray{Tuple{3, num_state_conservative}, FT}(undef) - local_flux_3 = MArray{Tuple{num_state_conservative}, FT}(undef) + local_flux = MArray{Tuple{3, num_state_prognostic}, FT}(undef) + local_flux_3 = MArray{Tuple{num_state_prognostic}, FT}(undef) end - shared_flux = @localmem FT (2, Nq, Nq, num_state_conservative) + shared_flux = @localmem FT (2, Nq, Nq, num_state_prognostic) s_D = @localmem FT (Nq, Nq) - local_tendency = @private FT (Nqk, num_state_conservative) + local_tendency = @private FT (Nqk, num_state_prognostic) local_MI = @private FT (Nqk,) e = @index(Group, Linear) @@ -88,7 +88,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a s_D[i, j] = D[i, j] @unroll for k in 1:Nqk ijk = i + Nq * ((j - 1) + Nq * (k - 1)) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[k, s] = zero(FT) end local_MI[k] = vgeo[ijk, _MI, e] @@ -113,8 +113,8 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a ξ3x3 = vgeo[ijk, _ξ3x3, e] end - @unroll for s in 1:num_state_conservative - local_state_conservative[s] = state_conservative[ijk, s, e] + @unroll for s in 1:num_state_prognostic + local_state_prognostic[s] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary @@ -134,7 +134,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a balance_law, Grad{vars_state(balance_law, Prognostic(), FT)}(local_flux), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -143,7 +143,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a (direction,), ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic shared_flux[1, i, j, s] = local_flux[1, s] shared_flux[2, i, j, s] = local_flux[2, s] local_flux_3[s] = local_flux[3, s] @@ -154,7 +154,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a balance_law, Grad{vars_state(balance_law, Prognostic(), FT)}(local_flux), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux, @@ -168,14 +168,14 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a t, ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic shared_flux[1, i, j, s] += local_flux[1, s] shared_flux[2, i, j, s] += local_flux[2, s] local_flux_3[s] += local_flux[3, s] end # Build "inside metrics" flux - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic F1, F2, F3 = shared_flux[1, i, j, s], shared_flux[2, i, j, s], local_flux_3[s] @@ -202,7 +202,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a local_flux, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -210,7 +210,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a t, (HorizontalDirection(),), ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic F1, F2, F3 = local_flux[1, s], local_flux[2, s], local_flux[3, s] shared_flux[1, i, j, s] += @@ -229,7 +229,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a local_flux, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -237,7 +237,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a t, (VerticalDirection(),), ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic F1, F2, F3 = local_flux[1, s], local_flux[2, s], local_flux[3, s] if dim == 2 @@ -254,7 +254,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a if dim == 3 && direction isa EveryDirection @unroll for n in 1:Nqk MI = local_MI[n] - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[n, s] += MI * s_D[k, n] * local_flux_3[s] end end @@ -265,7 +265,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a balance_law, Vars{vars_state(balance_law, Prognostic(), FT)}(local_source), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux, @@ -277,14 +277,14 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a (direction,), ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[k, s] += local_source[s] end @synchronize # Weak "inside metrics" derivative MI = local_MI[k] - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic @unroll for n in 1:Nq # ξ1-grid lines local_tendency[k, s] += @@ -301,7 +301,7 @@ Computational kernel: Evaluate the volume integrals on right-hand side of a @unroll for k in 1:Nqk ijk = i + Nq * ((j - 1) + Nq * (k - 1)) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic if β != 0 T = α * local_tendency[k, s] + β * tendency[ijk, s, e] else @@ -319,7 +319,7 @@ end ::Val{polyorder}, direction::VerticalDirection, tendency, - state_conservative, + state_prognostic, state_gradient_flux, Qhypervisc_grad, state_auxiliary, @@ -333,8 +333,8 @@ end ) where {dim, polyorder} @uniform begin N = polyorder - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) @@ -345,25 +345,25 @@ end Nqk = dim == 2 ? 1 : Nq - local_source = MArray{Tuple{num_state_conservative}, FT}(undef) - local_state_conservative = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_source = MArray{Tuple{num_state_prognostic}, FT}(undef) + local_state_prognostic = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_gradient_flux = MArray{Tuple{num_state_gradient_flux}, FT}(undef) local_state_hyperdiffusion = MArray{Tuple{nhyperviscstate}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) - local_flux = MArray{Tuple{3, num_state_conservative}, FT}(undef) - local_flux_total = MArray{Tuple{3, num_state_conservative}, FT}(undef) + local_flux = MArray{Tuple{3, num_state_prognostic}, FT}(undef) + local_flux_total = MArray{Tuple{3, num_state_prognostic}, FT}(undef) _ζx1 = dim == 2 ? _ξ2x1 : _ξ3x1 _ζx2 = dim == 2 ? _ξ2x2 : _ξ3x2 _ζx3 = dim == 2 ? _ξ2x3 : _ξ3x3 shared_flux_size = - dim == 2 ? (Nq, Nq, num_state_conservative) : (0, 0, 0) + dim == 2 ? (Nq, Nq, num_state_prognostic) : (0, 0, 0) end - local_tendency = @private FT (Nqk, num_state_conservative) + local_tendency = @private FT (Nqk, num_state_prognostic) local_MI = @private FT (Nqk,) shared_flux = @localmem FT shared_flux_size @@ -377,7 +377,7 @@ end @unroll for k in 1:Nqk ijk = i + Nq * ((j - 1) + Nq * (k - 1)) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[k, s] = zero(FT) end local_MI[k] = vgeo[ijk, _MI, e] @@ -394,8 +394,8 @@ end ζx2 = vgeo[ijk, _ζx2, e] ζx3 = vgeo[ijk, _ζx3, e] - @unroll for s in 1:num_state_conservative - local_state_conservative[s] = state_conservative[ijk, s, e] + @unroll for s in 1:num_state_prognostic + local_state_prognostic[s] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary @@ -415,7 +415,7 @@ end balance_law, Grad{vars_state(balance_law, Prognostic(), FT)}(local_flux), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -424,7 +424,7 @@ end (direction,), ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_flux_total[1, s] = local_flux[1, s] local_flux_total[2, s] = local_flux[2, s] local_flux_total[3, s] = local_flux[3, s] @@ -435,7 +435,7 @@ end balance_law, Grad{vars_state(balance_law, Prognostic(), FT)}(local_flux), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux, @@ -449,14 +449,14 @@ end t, ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_flux_total[1, s] += local_flux[1, s] local_flux_total[2, s] += local_flux[2, s] local_flux_total[3, s] += local_flux[3, s] end # Build "inside metrics" flux - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic F1, F2, F3 = local_flux_total[1, s], local_flux_total[2, s], local_flux_total[3, s] @@ -471,7 +471,7 @@ end if dim == 3 @unroll for n in 1:Nqk MI = local_MI[n] - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[n, s] += MI * s_D[k, n] * local_flux_total[1, s] end @@ -483,7 +483,7 @@ end balance_law, Vars{vars_state(balance_law, Prognostic(), FT)}(local_source), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux, @@ -495,7 +495,7 @@ end (direction,), ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[k, s] += local_source[s] end @@ -503,7 +503,7 @@ end if dim == 2 MI = local_MI[k] @unroll for n in 1:Nq - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic local_tendency[k, s] += MI * s_D[n, j] * shared_flux[i, n, s] end @@ -513,7 +513,7 @@ end @unroll for k in 1:Nqk ijk = i + Nq * ((j - 1) + Nq * (k - 1)) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic if β != 0 T = α * local_tendency[k, s] + β * tendency[ijk, s, e] else @@ -529,7 +529,7 @@ end interface_tendency!(balance_law::BalanceLaw, Val(polyorder), numerical_flux_first_order, numerical_flux_second_order, - tendency, state_conservative, state_gradient_flux, state_auxiliary, + tendency, state_prognostic, state_gradient_flux, state_auxiliary, vgeo, sgeo, t, vmap⁻, vmap⁺, elemtobndy, elems) @@ -544,7 +544,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a numerical_flux_first_order, numerical_flux_second_order, tendency, - state_conservative, + state_prognostic, state_gradient_flux, Qhypervisc_grad, state_auxiliary, @@ -559,8 +559,8 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a ) where {dim, polyorder} @uniform begin N = polyorder - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) nhyperviscstate = number_states(balance_law, Hyperdiffusive(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) @@ -590,18 +590,18 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a Nq = N + 1 Nqk = dim == 2 ? 1 : Nq - local_state_conservative⁻ = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic⁻ = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_gradient_flux⁻ = MArray{Tuple{num_state_gradient_flux}, FT}(undef) local_state_hyperdiffusion⁻ = MArray{Tuple{nhyperviscstate}, FT}(undef) local_state_auxiliary⁻ = MArray{Tuple{num_state_auxiliary}, FT}(undef) - # Need two copies since numerical_flux_first_order! can modify state_conservative⁺ - local_state_conservative⁺nondiff = - MArray{Tuple{num_state_conservative}, FT}(undef) - local_state_conservative⁺diff = - MArray{Tuple{num_state_conservative}, FT}(undef) + # Need two copies since numerical_flux_first_order! can modify state_prognostic⁺ + local_state_prognostic⁺nondiff = + MArray{Tuple{num_state_prognostic}, FT}(undef) + local_state_prognostic⁺diff = + MArray{Tuple{num_state_prognostic}, FT}(undef) # Need two copies since numerical_flux_first_order! can modify state_auxiliary⁺ local_state_auxiliary⁺nondiff = @@ -613,14 +613,14 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a MArray{Tuple{num_state_gradient_flux}, FT}(undef) local_state_hyperdiffusion⁺ = MArray{Tuple{nhyperviscstate}, FT}(undef) - local_state_conservative_bottom1 = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic_bottom1 = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_gradient_flux_bottom1 = MArray{Tuple{num_state_gradient_flux}, FT}(undef) local_state_auxiliary_bottom1 = MArray{Tuple{num_state_auxiliary}, FT}(undef) - local_flux = MArray{Tuple{num_state_conservative}, FT}(undef) + local_flux = MArray{Tuple{num_state_prognostic}, FT}(undef) end eI = @index(Group, Linear) @@ -650,8 +650,8 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a vid⁻, vid⁺ = ((id⁻ - 1) % Np) + 1, ((id⁺ - 1) % Np) + 1 # Load minus side data - @unroll for s in 1:num_state_conservative - local_state_conservative⁻[s] = state_conservative[vid⁻, s, e⁻] + @unroll for s in 1:num_state_prognostic + local_state_prognostic⁻[s] = state_prognostic[vid⁻, s, e⁻] end @unroll for s in 1:num_state_gradient_flux @@ -667,10 +667,10 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a end # Load plus side data - @unroll for s in 1:num_state_conservative - local_state_conservative⁺diff[s] = - local_state_conservative⁺nondiff[s] = - state_conservative[vid⁺, s, e⁺] + @unroll for s in 1:num_state_prognostic + local_state_prognostic⁺diff[s] = + local_state_prognostic⁺nondiff[s] = + state_prognostic[vid⁺, s, e⁺] end @unroll for s in 1:num_state_gradient_flux @@ -695,13 +695,13 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a Vars{vars_state(balance_law, Prognostic(), FT)}(local_flux), SVector(normal_vector), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺nondiff, + local_state_prognostic⁺nondiff, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺nondiff, @@ -715,7 +715,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a Vars{vars_state(balance_law, Prognostic(), FT)}(local_flux), normal_vector, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux⁻, @@ -727,7 +727,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a local_state_auxiliary⁻, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺diff, + local_state_prognostic⁺diff, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux⁺, @@ -743,9 +743,9 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a else if (dim == 2 && f == 3) || (dim == 3 && f == 5) # Loop up the first element along all horizontal elements - @unroll for s in 1:num_state_conservative - local_state_conservative_bottom1[s] = - state_conservative[n + Nqk^2, s, e⁻] + @unroll for s in 1:num_state_prognostic + local_state_prognostic_bottom1[s] = + state_prognostic[n + Nqk^2, s, e⁻] end @unroll for s in 1:num_state_gradient_flux local_state_gradient_flux_bottom1[s] = @@ -762,13 +762,13 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a Vars{vars_state(balance_law, Prognostic(), FT)}(local_flux), SVector(normal_vector), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺nondiff, + local_state_prognostic⁺nondiff, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺nondiff, @@ -777,7 +777,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a t, face_direction, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative_bottom1, + local_state_prognostic_bottom1, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary_bottom1, @@ -789,7 +789,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a Vars{vars_state(balance_law, Prognostic(), FT)}(local_flux), normal_vector, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux⁻, @@ -801,7 +801,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a local_state_auxiliary⁻, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺diff, + local_state_prognostic⁺diff, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux⁺, @@ -815,7 +815,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a bctype, t, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative_bottom1, + local_state_prognostic_bottom1, ), Vars{vars_state(balance_law, GradientFlux(), FT)}( local_state_gradient_flux_bottom1, @@ -827,7 +827,7 @@ Computational kernel: Evaluate the surface integrals on right-hand side of a end #Update RHS - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic # FIXME: Should we pretch these? tendency[vid⁻, s, e⁻] -= α * vMI * sM * local_flux[s] end @@ -841,7 +841,7 @@ end ::Val{dim}, ::Val{polyorder}, direction, - state_conservative, + state_prognostic, state_gradient_flux, Qhypervisc_grad, state_auxiliary, @@ -854,8 +854,8 @@ end @uniform begin N = polyorder - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) ngradstate = number_states(balance_law, Gradient(), FT) ngradlapstate = number_states(balance_law, GradientLaplacian(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) @@ -865,7 +865,7 @@ end Nqk = dim == 2 ? 1 : Nq - ngradtransformstate = num_state_conservative + ngradtransformstate = num_state_prognostic local_transform = MArray{Tuple{ngradstate}, FT}(undef) local_state_gradient_flux = @@ -875,7 +875,7 @@ end shared_transform = @localmem FT (Nq, Nq, ngradstate) s_D = @localmem FT (Nq, Nq) - local_state_conservative = @private FT (ngradtransformstate, Nqk) + local_state_prognostic = @private FT (ngradtransformstate, Nqk) local_state_auxiliary = @private FT (num_state_auxiliary, Nqk) local_transform_gradient = @private FT (3, ngradstate, Nqk) Gξ3 = @private FT (ngradstate, Nqk) @@ -895,7 +895,7 @@ end end ijk = i + Nq * ((j - 1) + Nq * (k - 1)) @unroll for s in 1:ngradtransformstate - local_state_conservative[s, k] = state_conservative[ijk, s, e] + local_state_prognostic[s, k] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary local_state_auxiliary[s, k] = state_auxiliary[ijk, s, e] @@ -907,7 +907,7 @@ end compute_gradient_argument!( balance_law, Vars{vars_state(balance_law, Gradient(), FT)}(local_transform), - Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_conservative[ + Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_prognostic[ :, k, ]), @@ -994,7 +994,7 @@ end :, k, ]), - Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_conservative[ + Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_prognostic[ :, k, ]), @@ -1019,7 +1019,7 @@ end ::Val{dim}, ::Val{polyorder}, ::VerticalDirection, - state_conservative, + state_prognostic, state_gradient_flux, Qhypervisc_grad, state_auxiliary, @@ -1032,8 +1032,8 @@ end @uniform begin N = polyorder - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) ngradstate = number_states(balance_law, Gradient(), FT) ngradlapstate = number_states(balance_law, GradientLaplacian(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) @@ -1043,7 +1043,7 @@ end Nqk = dim == 2 ? 1 : Nq - ngradtransformstate = num_state_conservative + ngradtransformstate = num_state_prognostic local_transform = MArray{Tuple{ngradstate}, FT}(undef) local_state_gradient_flux = @@ -1059,7 +1059,7 @@ end shared_transform = @localmem FT (Nq, Nq, ngradstate) s_D = @localmem FT (Nq, Nq) - local_state_conservative = @private FT (ngradtransformstate, Nqk) + local_state_prognostic = @private FT (ngradtransformstate, Nqk) local_state_auxiliary = @private FT (num_state_auxiliary, Nqk) local_transform_gradient = @private FT (3, ngradstate, Nqk) @@ -1084,7 +1084,7 @@ end end ijk = i + Nq * ((j - 1) + Nq * (k - 1)) @unroll for s in 1:ngradtransformstate - local_state_conservative[s, k] = state_conservative[ijk, s, e] + local_state_prognostic[s, k] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary local_state_auxiliary[s, k] = state_auxiliary[ijk, s, e] @@ -1099,7 +1099,7 @@ end compute_gradient_argument!( balance_law, Vars{vars_state(balance_law, Gradient(), FT)}(local_transform), - Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_conservative[ + Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_prognostic[ :, k, ]), @@ -1171,7 +1171,7 @@ end :, k, ]), - Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_conservative[ + Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_prognostic[ :, k, ]), @@ -1197,7 +1197,7 @@ end ::Val{polyorder}, direction, numerical_flux_gradient, - state_conservative, + state_prognostic, state_gradient_flux, Qhypervisc_grad, state_auxiliary, @@ -1212,8 +1212,8 @@ end ) where {dim, polyorder, hypervisc_indexmap} @uniform begin N = polyorder - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) ngradstate = number_states(balance_law, Gradient(), FT) ngradlapstate = number_states(balance_law, GradientLaplacian(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) @@ -1242,15 +1242,15 @@ end Nqk = dim == 2 ? 1 : N + 1 - ngradtransformstate = num_state_conservative + ngradtransformstate = num_state_prognostic - local_state_conservative⁻ = + local_state_prognostic⁻ = MArray{Tuple{ngradtransformstate}, FT}(undef) local_state_auxiliary⁻ = MArray{Tuple{num_state_auxiliary}, FT}(undef) local_transform⁻ = MArray{Tuple{ngradstate}, FT}(undef) l_nG⁻ = MArray{Tuple{3, ngradstate}, FT}(undef) - local_state_conservative⁺ = + local_state_prognostic⁺ = MArray{Tuple{ngradtransformstate}, FT}(undef) local_state_auxiliary⁺ = MArray{Tuple{num_state_auxiliary}, FT}(undef) local_transform⁺ = MArray{Tuple{ngradstate}, FT}(undef) @@ -1259,11 +1259,11 @@ end local_state_gradient_flux = MArray{Tuple{num_state_gradient_flux}, FT}(undef) local_transform_gradient = MArray{Tuple{3, ngradstate}, FT}(undef) - local_state_conservative⁻visc = + local_state_prognostic⁻visc = MArray{Tuple{num_state_gradient_flux}, FT}(undef) - local_state_conservative_bottom1 = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic_bottom1 = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_auxiliary_bottom1 = MArray{Tuple{num_state_auxiliary}, FT}(undef) end @@ -1289,7 +1289,7 @@ end # Load minus side data @unroll for s in 1:ngradtransformstate - local_state_conservative⁻[s] = state_conservative[vid⁻, s, e⁻] + local_state_prognostic⁻[s] = state_prognostic[vid⁻, s, e⁻] end @unroll for s in 1:num_state_auxiliary @@ -1301,7 +1301,7 @@ end balance_law, Vars{vars_state(balance_law, Gradient(), FT)}(local_transform⁻), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, @@ -1311,7 +1311,7 @@ end # Load plus side data @unroll for s in 1:ngradtransformstate - local_state_conservative⁺[s] = state_conservative[vid⁺, s, e⁺] + local_state_prognostic⁺[s] = state_prognostic[vid⁺, s, e⁺] end @unroll for s in 1:num_state_auxiliary @@ -1323,7 +1323,7 @@ end balance_law, Vars{vars_state(balance_law, Gradient(), FT)}(local_transform⁺), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺, + local_state_prognostic⁺, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺, @@ -1344,14 +1344,14 @@ end SVector(normal_vector), Vars{vars_state(balance_law, Gradient(), FT)}(local_transform⁻), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, ), Vars{vars_state(balance_law, Gradient(), FT)}(local_transform⁺), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺, + local_state_prognostic⁺, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺, @@ -1368,7 +1368,7 @@ end local_transform_gradient, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, @@ -1379,9 +1379,9 @@ end else if (dim == 2 && f == 3) || (dim == 3 && f == 5) # Loop up the first element along all horizontal elements - @unroll for s in 1:num_state_conservative - local_state_conservative_bottom1[s] = - state_conservative[n + Nqk^2, s, e⁻] + @unroll for s in 1:num_state_prognostic + local_state_prognostic_bottom1[s] = + state_prognostic[n + Nqk^2, s, e⁻] end @unroll for s in 1:num_state_auxiliary local_state_auxiliary_bottom1[s] = @@ -1395,14 +1395,14 @@ end SVector(normal_vector), Vars{vars_state(balance_law, Gradient(), FT)}(local_transform⁻), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, ), Vars{vars_state(balance_law, Gradient(), FT)}(local_transform⁺), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺, + local_state_prognostic⁺, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺, @@ -1410,7 +1410,7 @@ end bctype, t, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative_bottom1, + local_state_prognostic_bottom1, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary_bottom1, @@ -1426,7 +1426,7 @@ end local_transform_gradient, ), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, @@ -1455,11 +1455,11 @@ end compute_gradient_flux!( balance_law, Vars{vars_state(balance_law, GradientFlux(), FT)}( - local_state_conservative⁻visc, + local_state_prognostic⁻visc, ), Grad{vars_state(balance_law, Gradient(), FT)}(l_nG⁻), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, @@ -1474,7 +1474,7 @@ end sM * ( local_state_gradient_flux[s] - - local_state_conservative⁻visc[s] + local_state_prognostic⁻visc[s] ) end # Need to wait after even faces to avoid race conditions @@ -1482,7 +1482,7 @@ end end end -@kernel function kernel_init_state_conservative!( +@kernel function kernel_init_state_prognostic!( balance_law::BalanceLaw, ::Val{dim}, ::Val{polyorder}, @@ -1495,13 +1495,13 @@ end N = polyorder FT = eltype(state_auxiliary) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) Nq = N + 1 Nqk = dim == 2 ? 1 : Nq Np = Nq * Nq * Nqk - l_state = MArray{Tuple{num_state_conservative}, FT}(undef) + l_state = MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) I = @index(Global, Linear) @@ -1513,10 +1513,10 @@ end @unroll for s in 1:num_state_auxiliary local_state_auxiliary[s] = state_auxiliary[n, s, e] end - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic l_state[s] = state[n, s, e] end - init_state_conservative!( + init_state_prognostic!( balance_law, Vars{vars_state(balance_law, Prognostic(), FT)}(l_state), Vars{vars_state(balance_law, Auxiliary(), FT)}( @@ -1525,7 +1525,7 @@ end coords, args..., ) - @unroll for s in 1:num_state_conservative + @unroll for s in 1:num_state_prognostic state[n, s, e] = l_state[s] end end @@ -1581,7 +1581,7 @@ See [`BalanceLaw`](@ref) for usage. end @doc """ - kernel_nodal_update_auxiliary_state!(balance_law::BalanceLaw, ::Val{dim}, ::Val{N}, f!, state_conservative, state_auxiliary, [state_gradient_flux,] + kernel_nodal_update_auxiliary_state!(balance_law::BalanceLaw, ::Val{dim}, ::Val{N}, f!, state_prognostic, state_auxiliary, [state_gradient_flux,] t, elems, activedofs) where {dim, N} Update the auxiliary state array @@ -1591,14 +1591,14 @@ Update the auxiliary state array ::Val{dim}, ::Val{N}, f!, - state_conservative, + state_prognostic, state_auxiliary, t, elems, activedofs, ) where {dim, N} - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) Nq = N + 1 @@ -1607,7 +1607,7 @@ Update the auxiliary state array Np = Nq * Nq * Nqk - local_state_conservative = MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic = MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) I = @index(Global, Linear) @@ -1620,8 +1620,8 @@ Update the auxiliary state array active = activedofs[n + (e - 1) * Np] if active - @unroll for s in 1:num_state_conservative - local_state_conservative[s] = state_conservative[n, s, e] + @unroll for s in 1:num_state_prognostic + local_state_prognostic[s] = state_prognostic[n, s, e] end @unroll for s in 1:num_state_auxiliary @@ -1631,7 +1631,7 @@ Update the auxiliary state array f!( balance_law, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -1651,15 +1651,15 @@ end ::Val{dim}, ::Val{N}, f!, - state_conservative, + state_prognostic, state_auxiliary, state_gradient_flux, t, elems, activedofs, ) where {dim, N} - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) @@ -1669,7 +1669,7 @@ end Np = Nq * Nq * Nqk - local_state_conservative = MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic = MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) local_state_gradient_flux = MArray{Tuple{num_state_gradient_flux}, FT}(undef) @@ -1684,8 +1684,8 @@ end active = activedofs[n + (e - 1) * Np] if active - @unroll for s in 1:num_state_conservative - local_state_conservative[s] = state_conservative[n, s, e] + @unroll for s in 1:num_state_prognostic + local_state_prognostic[s] = state_prognostic[n, s, e] end @unroll for s in 1:num_state_auxiliary @@ -1699,7 +1699,7 @@ end f!( balance_law, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -1719,7 +1719,7 @@ end @doc """ kernel_indefinite_stack_integral!(balance_law::BalanceLaw, ::Val{dim}, ::Val{N}, - ::Val{nvertelem}, state_conservative, state_auxiliary, vgeo, + ::Val{nvertelem}, state_prognostic, state_auxiliary, vgeo, Imat, elems) where {dim, N, nvertelem} Computational kernel: compute indefinite integral along the vertical stack See [`BalanceLaw`](@ref) for usage. @@ -1729,23 +1729,23 @@ See [`BalanceLaw`](@ref) for usage. ::Val{dim}, ::Val{N}, ::Val{nvertelem}, - state_conservative, + state_prognostic, state_auxiliary, vgeo, Imat, elems, ) where {dim, N, nvertelem} @uniform begin - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) nout = number_states(balance_law, UpwardIntegrals(), FT) Nq = N + 1 Nqj = dim == 2 ? 1 : Nq - local_state_conservative = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) local_kernel = MArray{Tuple{nout, Nq}, FT}(undef) end @@ -1780,8 +1780,8 @@ See [`BalanceLaw`](@ref) for usage. @unroll for k in 1:Nq ijk = i + Nq * ((j - 1) + Nqj * (k - 1)) Jc = vgeo[ijk, _JcV, e] - @unroll for s in 1:num_state_conservative - local_state_conservative[s] = state_conservative[ijk, s, e] + @unroll for s in 1:num_state_prognostic + local_state_prognostic[s] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary @@ -1796,7 +1796,7 @@ See [`BalanceLaw`](@ref) for usage. k, )), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, @@ -2217,7 +2217,7 @@ end direction, Qhypervisc_grad, Qhypervisc_div, - state_conservative, + state_prognostic, state_auxiliary, vgeo, ω, @@ -2229,11 +2229,11 @@ end N = polyorder FT = eltype(Qhypervisc_grad) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) ngradlapstate = number_states(balance_law, GradientLaplacian(), FT) nhyperviscstate = number_states(balance_law, Hyperdiffusive(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) - ngradtransformstate = num_state_conservative + ngradtransformstate = num_state_prognostic Nq = N + 1 Nqk = dim == 2 ? 1 : Nq @@ -2245,7 +2245,7 @@ end s_lap = @localmem FT (Nq, Nq, Nqk, ngradlapstate) s_D = @localmem FT (Nq, Nq) s_ω = @localmem FT (Nq,) - local_state_conservative = @private FT (ngradtransformstate,) + local_state_prognostic = @private FT (ngradtransformstate,) local_state_auxiliary = @private FT (num_state_auxiliary,) e = @index(Group, Linear) @@ -2257,7 +2257,7 @@ end s_D[i, j] = D[i, j] @unroll for s in 1:ngradtransformstate - local_state_conservative[s] = state_conservative[ijk, s, e] + local_state_prognostic[s] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary @@ -2327,7 +2327,7 @@ end local_state_hyperdiffusion, ), Grad{vars_state(balance_law, GradientLaplacian(), FT)}(l_grad_lap), - Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_conservative[:]), + Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_prognostic[:]), Vars{vars_state(balance_law, Auxiliary(), FT)}(local_state_auxiliary[:]), t, ) @@ -2345,7 +2345,7 @@ end ::VerticalDirection, Qhypervisc_grad, Qhypervisc_div, - state_conservative, + state_prognostic, state_auxiliary, vgeo, ω, @@ -2357,11 +2357,11 @@ end N = polyorder FT = eltype(Qhypervisc_grad) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) ngradlapstate = number_states(balance_law, GradientLaplacian(), FT) nhyperviscstate = number_states(balance_law, Hyperdiffusive(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) - ngradtransformstate = num_state_conservative + ngradtransformstate = num_state_prognostic Nq = N + 1 Nqk = dim == 2 ? 1 : Nq @@ -2373,7 +2373,7 @@ end s_lap = @localmem FT (Nq, Nq, Nqk, ngradlapstate) s_D = @localmem FT (Nq, Nq) s_ω = @localmem FT (Nq,) - local_state_conservative = @private FT (ngradtransformstate,) + local_state_prognostic = @private FT (ngradtransformstate,) local_state_auxiliary = @private FT (num_state_auxiliary,) e = @index(Group, Linear) @@ -2385,7 +2385,7 @@ end s_D[i, j] = D[i, j] @unroll for s in 1:ngradtransformstate - local_state_conservative[s] = state_conservative[ijk, s, e] + local_state_prognostic[s] = state_prognostic[ijk, s, e] end @unroll for s in 1:num_state_auxiliary @@ -2435,7 +2435,7 @@ end local_state_hyperdiffusion, ), Grad{vars_state(balance_law, GradientLaplacian(), FT)}(l_grad_lap), - Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_conservative[:]), + Vars{vars_state(balance_law, Prognostic(), FT)}(local_state_prognostic[:]), Vars{vars_state(balance_law, Auxiliary(), FT)}(local_state_auxiliary[:]), t, ) @@ -2454,7 +2454,7 @@ end hyperviscnumflux, Qhypervisc_grad, Qhypervisc_div, - state_conservative, + state_prognostic, state_auxiliary, vgeo, sgeo, @@ -2467,11 +2467,11 @@ end @uniform begin N = polyorder FT = eltype(Qhypervisc_grad) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) ngradlapstate = number_states(balance_law, GradientLaplacian(), FT) nhyperviscstate = number_states(balance_law, Hyperdiffusive(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) - ngradtransformstate = num_state_conservative + ngradtransformstate = num_state_prognostic if dim == 1 Np = (N + 1) @@ -2500,11 +2500,11 @@ end l_lap⁺ = MArray{Tuple{ngradlapstate}, FT}(undef) local_state_hyperdiffusion = MArray{Tuple{nhyperviscstate}, FT}(undef) - local_state_conservative⁻ = + local_state_prognostic⁻ = MArray{Tuple{ngradtransformstate}, FT}(undef) local_state_auxiliary⁻ = MArray{Tuple{num_state_auxiliary}, FT}(undef) - local_state_conservative⁺ = + local_state_prognostic⁺ = MArray{Tuple{ngradtransformstate}, FT}(undef) local_state_auxiliary⁺ = MArray{Tuple{num_state_auxiliary}, FT}(undef) end @@ -2530,7 +2530,7 @@ end # Load minus side data @unroll for s in 1:ngradtransformstate - local_state_conservative⁻[s] = state_conservative[vid⁻, s, e⁻] + local_state_prognostic⁻[s] = state_prognostic[vid⁻, s, e⁻] end @unroll for s in 1:num_state_auxiliary @@ -2543,7 +2543,7 @@ end # Load plus side data @unroll for s in 1:ngradtransformstate - local_state_conservative⁺[s] = state_conservative[vid⁺, s, e⁺] + local_state_prognostic⁺[s] = state_prognostic[vid⁺, s, e⁺] end @unroll for s in 1:num_state_auxiliary @@ -2565,14 +2565,14 @@ end normal_vector, Vars{vars_state(balance_law, GradientLaplacian(), FT)}(l_lap⁻), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, ), Vars{vars_state(balance_law, GradientLaplacian(), FT)}(l_lap⁺), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺, + local_state_prognostic⁺, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺, @@ -2589,14 +2589,14 @@ end normal_vector, Vars{vars_state(balance_law, GradientLaplacian(), FT)}(l_lap⁻), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁻, + local_state_prognostic⁻, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁻, ), Vars{vars_state(balance_law, GradientLaplacian(), FT)}(l_lap⁺), Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative⁺, + local_state_prognostic⁺, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary⁺, @@ -2621,7 +2621,7 @@ end ::Val{N}, pointwise_courant, local_courant, - state_conservative, + state_prognostic, state_auxiliary, state_gradient_flux, elems, @@ -2630,8 +2630,8 @@ end direction, ) where {dim, N} @uniform begin - FT = eltype(state_conservative) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + FT = eltype(state_prognostic) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) num_state_gradient_flux = number_states(balance_law, GradientFlux(), FT) num_state_auxiliary = number_states(balance_law, Auxiliary(), FT) @@ -2641,8 +2641,8 @@ end Np = Nq * Nq * Nqk - local_state_conservative = - MArray{Tuple{num_state_conservative}, FT}(undef) + local_state_prognostic = + MArray{Tuple{num_state_prognostic}, FT}(undef) local_state_auxiliary = MArray{Tuple{num_state_auxiliary}, FT}(undef) local_state_gradient_flux = MArray{Tuple{num_state_gradient_flux}, FT}(undef) @@ -2653,8 +2653,8 @@ end n = (I - 1) % Np + 1 @inbounds begin - @unroll for s in 1:num_state_conservative - local_state_conservative[s] = state_conservative[n, s, e] + @unroll for s in 1:num_state_prognostic + local_state_prognostic[s] = state_prognostic[n, s, e] end @unroll for s in 1:num_state_auxiliary @@ -2669,7 +2669,7 @@ end c = local_courant( balance_law, Vars{vars_state(balance_law, Prognostic(), FT)}( - local_state_conservative, + local_state_prognostic, ), Vars{vars_state(balance_law, Auxiliary(), FT)}( local_state_auxiliary, diff --git a/src/Numerics/DGMethods/NumericalFluxes.jl b/src/Numerics/DGMethods/NumericalFluxes.jl index 08bb675a8d4..392ebc365e2 100644 --- a/src/Numerics/DGMethods/NumericalFluxes.jl +++ b/src/Numerics/DGMethods/NumericalFluxes.jl @@ -32,8 +32,8 @@ Any `P <: NumericalFluxGradient` should define methods for: numerical_flux_gradient!(gnf::P, balance_law::BalanceLaw, diffF, n⁻, Q⁻, Qstate_gradient_flux⁻, Qaux⁻, Q⁺, Qstate_gradient_flux⁺, Qaux⁺, t) - numerical_boundary_flux_gradient!(gnf::P, balance_law::BalanceLaw, local_state_gradient_flux, n⁻, local_transform⁻, local_state_conservative⁻, - local_state_auxiliary⁻, local_transform⁺, local_state_conservative⁺, local_state_auxiliary⁺, bctype, t) + numerical_boundary_flux_gradient!(gnf::P, balance_law::BalanceLaw, local_state_gradient_flux, n⁻, local_transform⁻, local_state_prognostic⁻, + local_state_auxiliary⁻, local_transform⁺, local_state_prognostic⁺, local_state_auxiliary⁺, bctype, t) """ abstract type NumericalFluxGradient end @@ -50,10 +50,10 @@ function numerical_flux_gradient!( transform_gradient::MMatrix, normal_vector::SVector, state_gradient⁻::Vars{T}, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, state_gradient⁺::Vars{T}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, t, ) where {T, S, A} @@ -69,10 +69,10 @@ function numerical_boundary_flux_gradient!( transform_gradient::MMatrix, normal_vector::SVector, state_gradient⁻::Vars{T}, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, state_gradient⁺::Vars{T}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, bctype, t, @@ -82,10 +82,10 @@ function numerical_boundary_flux_gradient!( boundary_state!( numerical_flux, balance_law, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, bctype, t, @@ -96,7 +96,7 @@ function numerical_boundary_flux_gradient!( compute_gradient_argument!( balance_law, state_gradient⁺, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, ) @@ -132,9 +132,9 @@ function numerical_boundary_flux_first_order!( balance_law::BalanceLaw, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, bctype, t, @@ -146,10 +146,10 @@ function numerical_boundary_flux_first_order!( boundary_state!( numerical_flux, balance_law, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, bctype, t, @@ -162,9 +162,9 @@ function numerical_boundary_flux_first_order!( balance_law, fluxᵀn, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, direction, @@ -192,9 +192,9 @@ function numerical_flux_first_order!( balance_law::BalanceLaw, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, t, direction, @@ -205,9 +205,9 @@ function numerical_flux_first_order!( balance_law, fluxᵀn, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, direction, @@ -217,7 +217,7 @@ function numerical_flux_first_order!( wavespeed⁻ = wavespeed( balance_law, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, t, direction, @@ -225,7 +225,7 @@ function numerical_flux_first_order!( wavespeed⁺ = wavespeed( balance_law, normal_vector, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, direction, @@ -233,7 +233,7 @@ function numerical_flux_first_order!( max_wavespeed = max.(wavespeed⁻, wavespeed⁺) penalty = max_wavespeed .* - (parent(state_conservative⁻) - parent(state_conservative⁺)) + (parent(state_prognostic⁻) - parent(state_prognostic⁺)) # TODO: should this operate on ΔQ or penalty? update_penalty!( @@ -242,9 +242,9 @@ function numerical_flux_first_order!( normal_vector, max_wavespeed, Vars{S}(penalty), - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, ) @@ -270,35 +270,35 @@ function numerical_flux_first_order!( balance_law::BalanceLaw, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, t, direction, ) where {S, A} FT = eltype(fluxᵀn) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) fluxᵀn = parent(fluxᵀn) - flux⁻ = similar(fluxᵀn, Size(3, num_state_conservative)) + flux⁻ = similar(fluxᵀn, Size(3, num_state_prognostic)) fill!(flux⁻, -zero(FT)) flux_first_order!( balance_law, Grad{S}(flux⁻), - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, t, direction, ) - flux⁺ = similar(fluxᵀn, Size(3, num_state_conservative)) + flux⁺ = similar(fluxᵀn, Size(3, num_state_prognostic)) fill!(flux⁺, -zero(FT)) flux_first_order!( balance_law, Grad{S}(flux⁺), - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, direction, @@ -353,11 +353,11 @@ function numerical_flux_second_order!( balance_law::BalanceLaw, fluxᵀn::Vars{S}, normal_vector⁻::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_gradient_flux⁻::Vars{D}, state_hyperdiffusive⁻::Vars{HD}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_gradient_flux⁺::Vars{D}, state_hyperdiffusive⁺::Vars{HD}, state_auxiliary⁺::Vars{A}, @@ -365,27 +365,27 @@ function numerical_flux_second_order!( ) where {S, D, HD, A} FT = eltype(fluxᵀn) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) fluxᵀn = parent(fluxᵀn) - flux⁻ = similar(fluxᵀn, Size(3, num_state_conservative)) + flux⁻ = similar(fluxᵀn, Size(3, num_state_prognostic)) fill!(flux⁻, -zero(FT)) flux_second_order!( balance_law, Grad{S}(flux⁻), - state_conservative⁻, + state_prognostic⁻, state_gradient_flux⁻, state_hyperdiffusive⁻, state_auxiliary⁻, t, ) - flux⁺ = similar(fluxᵀn, Size(3, num_state_conservative)) + flux⁺ = similar(fluxᵀn, Size(3, num_state_prognostic)) fill!(flux⁺, -zero(FT)) flux_second_order!( balance_law, Grad{S}(flux⁺), - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_hyperdiffusive⁺, state_auxiliary⁺, @@ -446,10 +446,10 @@ function numerical_flux_higher_order!( hyperdiff::Vars{HD}, normal_vector::SVector, lap⁻::Vars{GL}, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, lap⁺::Vars{GL}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, t, ) where {HD, GL, S, A} @@ -458,7 +458,7 @@ function numerical_flux_higher_order!( balance_law, hyperdiff, Grad{GL}(G), - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, t, ) @@ -470,10 +470,10 @@ function numerical_boundary_flux_higher_order!( hyperdiff::Vars{HD}, normal_vector::SVector, lap⁻::Vars{GL}, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, lap⁺::Vars{GL}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, bctype, t, @@ -481,11 +481,11 @@ function numerical_boundary_flux_higher_order!( boundary_state!( numerical_flux, balance_law, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, lap⁺, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, lap⁻, bctype, @@ -497,10 +497,10 @@ function numerical_boundary_flux_higher_order!( hyperdiff, normal_vector, lap⁻, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, lap⁺, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, ) @@ -511,11 +511,11 @@ numerical_boundary_flux_second_order!( balance_law::BalanceLaw, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_gradient_flux⁻::Vars{D}, state_hyperdiffusive⁻::Vars{HD}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_gradient_flux⁺::Vars{D}, state_hyperdiffusive⁺::Vars{HD}, state_auxiliary⁺::Vars{A}, @@ -529,11 +529,11 @@ numerical_boundary_flux_second_order!( balance_law, fluxᵀn, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_gradient_flux⁻, state_hyperdiffusive⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_hyperdiffusive⁺, state_auxiliary⁺, @@ -549,11 +549,11 @@ function normal_boundary_flux_second_order!( balance_law::BalanceLaw, fluxᵀn::Vars{S}, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_gradient_flux⁻, state_hyperdiffusive⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_hyperdiffusive⁺, state_auxiliary⁺, @@ -564,21 +564,21 @@ function normal_boundary_flux_second_order!( aux1⁻, ) where {S} FT = eltype(fluxᵀn) - num_state_conservative = number_states(balance_law, Prognostic(), FT) + num_state_prognostic = number_states(balance_law, Prognostic(), FT) fluxᵀn = parent(fluxᵀn) - flux = similar(fluxᵀn, Size(3, num_state_conservative)) + flux = similar(fluxᵀn, Size(3, num_state_prognostic)) fill!(flux, -zero(FT)) boundary_flux_second_order!( numerical_flux, balance_law, Grad{S}(flux), - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_hyperdiffusive⁺, state_auxiliary⁺, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_gradient_flux⁻, state_hyperdiffusive⁻, state_auxiliary⁻, @@ -597,12 +597,12 @@ function boundary_flux_second_order!( numerical_flux::NumericalFluxSecondOrder, balance_law, flux, - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_hyperdiffusive⁺, state_auxiliary⁺, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_gradient_flux⁻, state_hyperdiffusive⁻, state_auxiliary⁻, @@ -615,11 +615,11 @@ function boundary_flux_second_order!( boundary_state!( numerical_flux, balance_law, - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_auxiliary⁺, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_gradient_flux⁻, state_auxiliary⁻, bctype, @@ -631,7 +631,7 @@ function boundary_flux_second_order!( flux_second_order!( balance_law, flux, - state_conservative⁺, + state_prognostic⁺, state_gradient_flux⁺, state_hyperdiffusive⁺, state_auxiliary⁺, diff --git a/src/Numerics/DGMethods/remainder.jl b/src/Numerics/DGMethods/remainder.jl index fd739452216..2bc5187bc4b 100644 --- a/src/Numerics/DGMethods/remainder.jl +++ b/src/Numerics/DGMethods/remainder.jl @@ -3,7 +3,7 @@ export remainder_DGModel import ..BalanceLaws: vars_state, - init_state_conservative!, + init_state_prognostic!, init_state_auxiliary!, flux_first_order!, flux_second_order!, @@ -196,8 +196,8 @@ boundary_state!(nf, rem_balance_law::RemBL, args...) = init_state_auxiliary!(rem_balance_law::RemBL, args...) = init_state_auxiliary!(rem_balance_law.main, args...) -init_state_conservative!(rem_balance_law::RemBL, args...) = - init_state_conservative!(rem_balance_law.main, args...) +init_state_prognostic!(rem_balance_law::RemBL, args...) = + init_state_prognostic!(rem_balance_law.main, args...) """ function flux_first_order!( @@ -402,9 +402,9 @@ import ..DGMethods.NumericalFluxes: rem_balance_law::RemBL, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, t, directions, @@ -426,9 +426,9 @@ function numerical_flux_first_order!( rem_balance_law::RemBL, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, t, ::Dirs, @@ -440,9 +440,9 @@ function numerical_flux_first_order!( rem_balance_law.main, fluxᵀn, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, t, (rem_balance_law.maindir,), @@ -460,18 +460,18 @@ function numerical_flux_first_order!( nf = numerical_fluxes[2][k] FT = eltype(a_fluxᵀn) - num_state_conservative = number_states(sub, Prognostic(), FT) + num_state_prognostic = number_states(sub, Prognostic(), FT) - a_sub_fluxᵀn = MVector{num_state_conservative, FT}(undef) - a_sub_state_conservative⁻ = - MVector{num_state_conservative, FT}(undef) - a_sub_state_conservative⁺ = - MVector{num_state_conservative, FT}(undef) + a_sub_fluxᵀn = MVector{num_state_prognostic, FT}(undef) + a_sub_state_prognostic⁻ = + MVector{num_state_prognostic, FT}(undef) + a_sub_state_prognostic⁺ = + MVector{num_state_prognostic, FT}(undef) state_rng = static(1):static(number_states(sub, Prognostic(), FT)) a_sub_fluxᵀn .= a_fluxᵀn[state_rng] - a_sub_state_conservative⁻ .= parent(state_conservative⁻)[state_rng] - a_sub_state_conservative⁺ .= parent(state_conservative⁺)[state_rng] + a_sub_state_prognostic⁻ .= parent(state_prognostic⁻)[state_rng] + a_sub_state_prognostic⁺ .= parent(state_prognostic⁺)[state_rng] # compute this submodels flux fill!(a_sub_fluxᵀn, -zero(eltype(a_sub_fluxᵀn))) @@ -481,11 +481,11 @@ function numerical_flux_first_order!( Vars{vars_state(sub, Prognostic(), FT)}(a_sub_fluxᵀn), normal_vector, Vars{vars_state(sub, Prognostic(), FT)}( - a_sub_state_conservative⁻, + a_sub_state_prognostic⁻, ), state_auxiliary⁻, Vars{vars_state(sub, Prognostic(), FT)}( - a_sub_state_conservative⁺, + a_sub_state_prognostic⁺, ), state_auxiliary⁺, t, @@ -507,9 +507,9 @@ end rem_balance_law::RemBL, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, bctype, t, @@ -533,22 +533,22 @@ function numerical_boundary_flux_first_order!( rem_balance_law::RemBL, fluxᵀn::Vars{S}, normal_vector::SVector, - state_conservative⁻::Vars{S}, + state_prognostic⁻::Vars{S}, state_auxiliary⁻::Vars{A}, - state_conservative⁺::Vars{S}, + state_prognostic⁺::Vars{S}, state_auxiliary⁺::Vars{A}, bctype, t, ::Dirs, - state_conservative1⁻::Vars{S}, + state_prognostic1⁻::Vars{S}, state_auxiliary1⁻::Vars{A}, ) where {NumSubFluxes, S, A, Dirs <: NTuple{2, Direction}} # Since the fluxes are allowed to modified these we need backups so they can # be reset as we go - a_state_conservative⁺ = parent(state_conservative⁺) + a_state_prognostic⁺ = parent(state_prognostic⁺) a_state_auxiliary⁺ = parent(state_auxiliary⁺) - a_back_state_conservative⁺ = copy(a_state_conservative⁺) + a_back_state_prognostic⁺ = copy(a_state_prognostic⁺) a_back_state_auxiliary⁺ = copy(a_state_auxiliary⁺) @@ -559,14 +559,14 @@ function numerical_boundary_flux_first_order!( rem_balance_law.main, fluxᵀn, normal_vector, - state_conservative⁻, + state_prognostic⁻, state_auxiliary⁻, - state_conservative⁺, + state_prognostic⁺, state_auxiliary⁺, bctype, t, (rem_balance_law.maindir,), - state_conservative1⁻, + state_prognostic1⁻, state_auxiliary1⁻, ) end @@ -582,26 +582,26 @@ function numerical_boundary_flux_first_order!( nf = numerical_fluxes[2][k] # reset the plus-side data - a_state_conservative⁺ .= a_back_state_conservative⁺ + a_state_prognostic⁺ .= a_back_state_prognostic⁺ a_state_auxiliary⁺ .= a_back_state_auxiliary⁺ FT = eltype(a_fluxᵀn) - num_state_conservative = number_states(sub, Prognostic(), FT) + num_state_prognostic = number_states(sub, Prognostic(), FT) - a_sub_fluxᵀn = MVector{num_state_conservative, FT}(undef) - a_sub_state_conservative⁻ = - MVector{num_state_conservative, FT}(undef) - a_sub_state_conservative⁺ = - MVector{num_state_conservative, FT}(undef) - a_sub_state_conservative1⁻ = - MVector{num_state_conservative, FT}(undef) + a_sub_fluxᵀn = MVector{num_state_prognostic, FT}(undef) + a_sub_state_prognostic⁻ = + MVector{num_state_prognostic, FT}(undef) + a_sub_state_prognostic⁺ = + MVector{num_state_prognostic, FT}(undef) + a_sub_state_prognostic1⁻ = + MVector{num_state_prognostic, FT}(undef) state_rng = static(1):static(number_states(sub, Prognostic(), FT)) a_sub_fluxᵀn .= a_fluxᵀn[state_rng] - a_sub_state_conservative⁻ .= parent(state_conservative⁻)[state_rng] - a_sub_state_conservative⁺ .= parent(state_conservative⁺)[state_rng] - a_sub_state_conservative1⁻ .= - parent(state_conservative1⁻)[state_rng] + a_sub_state_prognostic⁻ .= parent(state_prognostic⁻)[state_rng] + a_sub_state_prognostic⁺ .= parent(state_prognostic⁺)[state_rng] + a_sub_state_prognostic1⁻ .= + parent(state_prognostic1⁻)[state_rng] # compute this submodels flux @@ -612,18 +612,18 @@ function numerical_boundary_flux_first_order!( Vars{vars_state(sub, Prognostic(), FT)}(a_sub_fluxᵀn), normal_vector, Vars{vars_state(sub, Prognostic(), FT)}( - a_sub_state_conservative⁻, + a_sub_state_prognostic⁻, ), state_auxiliary⁻, Vars{vars_state(sub, Prognostic(), FT)}( - a_sub_state_conservative⁺, + a_sub_state_prognostic⁺, ), state_auxiliary⁺, bctype, t, (rem_balance_law.subsdir[k],), Vars{vars_state(sub, Prognostic(), FT)}( - a_sub_state_conservative1⁻, + a_sub_state_prognostic1⁻, ), state_auxiliary1⁻, ) diff --git a/src/Ocean/HydrostaticBoussinesq/HydrostaticBoussinesqModel.jl b/src/Ocean/HydrostaticBoussinesq/HydrostaticBoussinesqModel.jl index 5d3dd6cb27d..b95326b1d7e 100644 --- a/src/Ocean/HydrostaticBoussinesq/HydrostaticBoussinesqModel.jl +++ b/src/Ocean/HydrostaticBoussinesq/HydrostaticBoussinesqModel.jl @@ -20,7 +20,7 @@ using ...BalanceLaws: number_states import ...BalanceLaws: vars_state, - init_state_conservative!, + init_state_prognostic!, init_state_auxiliary!, compute_gradient_argument!, compute_gradient_flux!, @@ -133,13 +133,13 @@ function vars_state(m::HBModel, ::Prognostic, T) end """ - init_state_conservative!(::HBModel) + init_state_prognostic!(::HBModel) sets the initial value for state variables dispatches to ocean_init_state! which is defined in a problem file such as SimpleBoxProblem.jl """ function ocean_init_state! end -function init_state_conservative!(m::HBModel, Q::Vars, A::Vars, coords, t) +function init_state_prognostic!(m::HBModel, Q::Vars, A::Vars, coords, t) return ocean_init_state!(m, m.problem, Q, A, coords, t) end diff --git a/src/Ocean/HydrostaticBoussinesq/LinearHBModel.jl b/src/Ocean/HydrostaticBoussinesq/LinearHBModel.jl index ada2ac9f84e..769320eb9b4 100644 --- a/src/Ocean/HydrostaticBoussinesq/LinearHBModel.jl +++ b/src/Ocean/HydrostaticBoussinesq/LinearHBModel.jl @@ -43,7 +43,7 @@ vars_state(lm::LinearHBModel, ::UpwardIntegrals, FT) = @vars() No need to init, initialize by full model """ init_state_auxiliary!(lm::LinearHBModel, A::Vars, geom::LocalGeometry) = nothing -init_state_conservative!(lm::LinearHBModel, Q::Vars, A::Vars, coords, t) = +init_state_prognostic!(lm::LinearHBModel, Q::Vars, A::Vars, coords, t) = nothing """ diff --git a/src/Ocean/ShallowWater/ShallowWaterModel.jl b/src/Ocean/ShallowWater/ShallowWaterModel.jl index d3e89376ce6..074df5ae4cb 100644 --- a/src/Ocean/ShallowWater/ShallowWaterModel.jl +++ b/src/Ocean/ShallowWater/ShallowWaterModel.jl @@ -15,7 +15,7 @@ using ...BalanceLaws import ...DGMethods.NumericalFluxes: update_penalty! import ...BalanceLaws: vars_state, - init_state_conservative!, + init_state_prognostic!, init_state_auxiliary!, compute_gradient_argument!, compute_gradient_flux!, @@ -241,7 +241,7 @@ function init_state_auxiliary!(m::SWModel, aux::Vars, geom::LocalGeometry) end function shallow_init_state! end -function init_state_conservative!(m::SWModel, state::Vars, aux::Vars, coords, t) +function init_state_prognostic!(m::SWModel, state::Vars, aux::Vars, coords, t) shallow_init_state!(m, m.problem, state, aux, coords, t) end diff --git a/src/Ocean/SplitExplicit/VerticalIntegralModel.jl b/src/Ocean/SplitExplicit/VerticalIntegralModel.jl index 457380db03e..fb22afcf472 100644 --- a/src/Ocean/SplitExplicit/VerticalIntegralModel.jl +++ b/src/Ocean/SplitExplicit/VerticalIntegralModel.jl @@ -1,6 +1,6 @@ import ...BalanceLaws: vars_state, - init_state_conservative!, + init_state_prognostic!, init_state_auxiliary!, update_auxiliary_state!, integral_load_auxiliary_state!, diff --git a/test/Atmos/Model/ref_state.jl b/test/Atmos/Model/ref_state.jl index 6b39bcfbd47..d4a9fccd2ed 100644 --- a/test/Atmos/Model/ref_state.jl +++ b/test/Atmos/Model/ref_state.jl @@ -55,7 +55,7 @@ using Test param_set; moisture = DryModel(), ref_state = HydrostaticState(profile, RH), - init_state_conservative = x -> x, + init_state_prognostic = x -> x, ) z = collect(range(FT(0), stop = FT(25e3), length = 100)) diff --git a/test/Atmos/Parameterizations/Microphysics/KinematicModel.jl b/test/Atmos/Parameterizations/Microphysics/KinematicModel.jl index 23d5e101b90..9d8fbab3d6d 100644 --- a/test/Atmos/Parameterizations/Microphysics/KinematicModel.jl +++ b/test/Atmos/Parameterizations/Microphysics/KinematicModel.jl @@ -91,7 +91,7 @@ using ClimateMachine.BalanceLaws: import ClimateMachine.BalanceLaws: vars_state, - init_state_conservative!, + init_state_prognostic!, init_state_auxiliary!, update_auxiliary_state!, nodal_update_auxiliary_state!, @@ -132,7 +132,7 @@ struct KinematicModel{FT, PS, O, M, P, S, BC, IS, DC} <: BalanceLaw precipitation::P source::S boundarycondition::BC - init_state_conservative::IS + init_state_prognostic::IS data_config::DC end @@ -144,12 +144,12 @@ function KinematicModel{FT}( precipitation::P = nothing, source::S = nothing, boundarycondition::BC = nothing, - init_state_conservative::IS = nothing, + init_state_prognostic::IS = nothing, data_config::DC = nothing, ) where {FT <: AbstractFloat, O, M, P, S, BC, IS, DC} @assert param_set ≠ nothing - @assert init_state_conservative ≠ nothing + @assert init_state_prognostic ≠ nothing atmos = ( param_set, @@ -158,7 +158,7 @@ function KinematicModel{FT}( precipitation, source, boundarycondition, - init_state_conservative, + init_state_prognostic, data_config, ) @@ -202,7 +202,7 @@ function init_state_auxiliary!( end end -function init_state_conservative!( +function init_state_prognostic!( m::KinematicModel, state::Vars, aux::Vars, @@ -210,7 +210,7 @@ function init_state_conservative!( t, args..., ) - m.init_state_conservative(m, state, aux, coords, t, args...) + m.init_state_prognostic(m, state, aux, coords, t, args...) end function update_auxiliary_state!( @@ -315,7 +315,7 @@ function config_kinematic_eddy( model = KinematicModel{FT}( AtmosLESConfigType, param_set; - init_state_conservative = init_kinematic_eddy!, + init_state_prognostic = init_kinematic_eddy!, data_config = kmc, ) diff --git a/test/Diagnostics/diagnostic_fields_test.jl b/test/Diagnostics/diagnostic_fields_test.jl index fb2275036c2..8d1169fd4cc 100644 --- a/test/Diagnostics/diagnostic_fields_test.jl +++ b/test/Diagnostics/diagnostic_fields_test.jl @@ -102,7 +102,7 @@ function config_risingbubble(FT, N, resolution, xmax, ymax, zmax) turbulence = SmagorinskyLilly{FT}(C_smag), source = (Gravity(),), ref_state = ref_state, - init_state_conservative = init_risingbubble!, + init_state_prognostic = init_risingbubble!, ) # Problem configuration diff --git a/test/Driver/cr_unit_tests.jl b/test/Driver/cr_unit_tests.jl index 0fcb5dac975..67840b9deac 100644 --- a/test/Driver/cr_unit_tests.jl +++ b/test/Driver/cr_unit_tests.jl @@ -89,7 +89,7 @@ function main() turbulence = turbulence, moisture = DryModel(), source = Gravity(), - init_state_conservative = setup, + init_state_prognostic = setup, ) driver_config = ClimateMachine.AtmosGCMConfiguration( diff --git a/test/Driver/gcm_driver_test.jl b/test/Driver/gcm_driver_test.jl index 77afab58a4d..d790f9aa5da 100644 --- a/test/Driver/gcm_driver_test.jl +++ b/test/Driver/gcm_driver_test.jl @@ -80,7 +80,7 @@ function main() turbulence = turbulence, moisture = DryModel(), source = Gravity(), - init_state_conservative = setup, + init_state_prognostic = setup, ) ode_solver = ClimateMachine.MultirateSolverType( diff --git a/test/Driver/mms3.jl b/test/Driver/mms3.jl index e35bc93b18b..d8c8d699ff1 100644 --- a/test/Driver/mms3.jl +++ b/test/Driver/mms3.jl @@ -130,7 +130,7 @@ function main() moisture = MMSDryModel(), source = mms3_source!, boundarycondition = InitStateBC(), - init_state_conservative = mms3_init_state!, + init_state_prognostic = mms3_init_state!, ) brickrange = ( diff --git a/test/Numerics/DGMethods/Euler/acousticwave_1d_imex.jl b/test/Numerics/DGMethods/Euler/acousticwave_1d_imex.jl index ca2157f9e3d..fb446318c39 100644 --- a/test/Numerics/DGMethods/Euler/acousticwave_1d_imex.jl +++ b/test/Numerics/DGMethods/Euler/acousticwave_1d_imex.jl @@ -126,7 +126,7 @@ function run( moisture = DryModel(), tracers = NTracers{length(δ_χ), FT}(δ_χ), source = Gravity(), - init_state_conservative = setup, + init_state_prognostic = setup, ) linearmodel = AtmosAcousticGravityLinearModel(model) diff --git a/test/Numerics/DGMethods/Euler/acousticwave_mrigark.jl b/test/Numerics/DGMethods/Euler/acousticwave_mrigark.jl index f9fca021061..1925c6f6dea 100644 --- a/test/Numerics/DGMethods/Euler/acousticwave_mrigark.jl +++ b/test/Numerics/DGMethods/Euler/acousticwave_mrigark.jl @@ -135,7 +135,7 @@ function run( moisture = DryModel(), tracers = NTracers{length(δ_χ), FT}(δ_χ), source = Gravity(), - init_state_conservative = setup, + init_state_prognostic = setup, ) dg = DGModel( fullmodel, diff --git a/test/Numerics/DGMethods/Euler/isentropicvortex.jl b/test/Numerics/DGMethods/Euler/isentropicvortex.jl index bf286f65577..893f74931fc 100644 --- a/test/Numerics/DGMethods/Euler/isentropicvortex.jl +++ b/test/Numerics/DGMethods/Euler/isentropicvortex.jl @@ -195,7 +195,7 @@ function run( moisture = DryModel(), source = nothing, boundarycondition = (), - init_state_conservative = isentropicvortex_initialcondition!, + init_state_prognostic = isentropicvortex_initialcondition!, ) dg = DGModel( diff --git a/test/Numerics/DGMethods/Euler/isentropicvortex_imex.jl b/test/Numerics/DGMethods/Euler/isentropicvortex_imex.jl index 9bcde29a94a..2b67c21ba20 100644 --- a/test/Numerics/DGMethods/Euler/isentropicvortex_imex.jl +++ b/test/Numerics/DGMethods/Euler/isentropicvortex_imex.jl @@ -161,7 +161,7 @@ function run( moisture = DryModel(), source = nothing, boundarycondition = (), - init_state_conservative = isentropicvortex_initialcondition!, + init_state_prognostic = isentropicvortex_initialcondition!, ) linear_model = AtmosAcousticLinearModel(model) diff --git a/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark.jl b/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark.jl index 197974a7c43..a1d58748ff8 100644 --- a/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark.jl +++ b/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark.jl @@ -155,7 +155,7 @@ function run( moisture = DryModel(), source = nothing, boundarycondition = (), - init_state_conservative = isentropicvortex_initialcondition!, + init_state_prognostic = isentropicvortex_initialcondition!, ) # The linear model has the fast time scales fast_model = AtmosAcousticLinearModel(model) diff --git a/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark_implicit.jl b/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark_implicit.jl index 102e3ec744a..d391ed7a3e0 100644 --- a/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark_implicit.jl +++ b/test/Numerics/DGMethods/Euler/isentropicvortex_mrigark_implicit.jl @@ -156,7 +156,7 @@ function run( moisture = DryModel(), source = nothing, boundarycondition = (), - init_state_conservative = isentropicvortex_initialcondition!, + init_state_prognostic = isentropicvortex_initialcondition!, ) # This is a bad idea; this test is just testing how # implicit GARK composes with explicit methods diff --git a/test/Numerics/DGMethods/Euler/isentropicvortex_multirate.jl b/test/Numerics/DGMethods/Euler/isentropicvortex_multirate.jl index 99e91d5cefe..06f37197b7c 100644 --- a/test/Numerics/DGMethods/Euler/isentropicvortex_multirate.jl +++ b/test/Numerics/DGMethods/Euler/isentropicvortex_multirate.jl @@ -159,7 +159,7 @@ function run( moisture = DryModel(), source = nothing, boundarycondition = (), - init_state_conservative = isentropicvortex_initialcondition!, + init_state_prognostic = isentropicvortex_initialcondition!, ) # The linear model has the fast time scales fast_model = AtmosAcousticLinearModel(model) diff --git a/test/Numerics/DGMethods/advection_diffusion/advection_diffusion_model.jl b/test/Numerics/DGMethods/advection_diffusion/advection_diffusion_model.jl index 20d59e26fd3..95ea53732cd 100644 --- a/test/Numerics/DGMethods/advection_diffusion/advection_diffusion_model.jl +++ b/test/Numerics/DGMethods/advection_diffusion/advection_diffusion_model.jl @@ -14,7 +14,7 @@ import ClimateMachine.BalanceLaws: compute_gradient_flux!, init_state_auxiliary!, update_auxiliary_state!, - init_state_conservative!, + init_state_prognostic!, boundary_state!, wavespeed @@ -245,7 +245,7 @@ function update_auxiliary_state!( return false end -function init_state_conservative!( +function init_state_prognostic!( m::AdvectionDiffusion, state::Vars, aux::Vars, diff --git a/test/Numerics/DGMethods/advection_diffusion/hyperdiffusion_model.jl b/test/Numerics/DGMethods/advection_diffusion/hyperdiffusion_model.jl index 4c8a3f509fb..51f2e002c18 100644 --- a/test/Numerics/DGMethods/advection_diffusion/hyperdiffusion_model.jl +++ b/test/Numerics/DGMethods/advection_diffusion/hyperdiffusion_model.jl @@ -16,7 +16,7 @@ import ClimateMachine.BalanceLaws: compute_gradient_argument!, compute_gradient_flux!, init_state_auxiliary!, - init_state_conservative!, + init_state_prognostic!, boundary_state!, wavespeed, transform_post_gradient_laplacian! @@ -129,7 +129,7 @@ function init_state_auxiliary!( init_hyperdiffusion_tensor!(m.problem, aux, geom) end -function init_state_conservative!( +function init_state_prognostic!( m::HyperDiffusion, state::Vars, aux::Vars, diff --git a/test/Numerics/DGMethods/compressible_Navier_Stokes/density_current_model.jl b/test/Numerics/DGMethods/compressible_Navier_Stokes/density_current_model.jl index bf826a9d201..f328d3b4318 100644 --- a/test/Numerics/DGMethods/compressible_Navier_Stokes/density_current_model.jl +++ b/test/Numerics/DGMethods/compressible_Navier_Stokes/density_current_model.jl @@ -137,7 +137,7 @@ function run( ref_state = HydrostaticState(T_profile), turbulence = AnisoMinDiss{FT}(1), source = source, - init_state_conservative = Initialise_Density_Current!, + init_state_prognostic = Initialise_Density_Current!, ) # -------------- Define DGModel --------------------------- # dg = DGModel( diff --git a/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_bc_atmos.jl b/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_bc_atmos.jl index 2438583f37b..4e67ab2cf0b 100644 --- a/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_bc_atmos.jl +++ b/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_bc_atmos.jl @@ -164,7 +164,7 @@ function run(mpicomm, ArrayType, dim, topl, warpfun, N, timeend, FT, dt) moisture = MMSDryModel(), source = mms2_source!, boundarycondition = InitStateBC(), - init_state_conservative = mms2_init_state!, + init_state_prognostic = mms2_init_state!, ) else model = AtmosModel{FT}( @@ -176,7 +176,7 @@ function run(mpicomm, ArrayType, dim, topl, warpfun, N, timeend, FT, dt) moisture = MMSDryModel(), source = mms3_source!, boundarycondition = InitStateBC(), - init_state_conservative = mms3_init_state!, + init_state_prognostic = mms3_init_state!, ) end diff --git a/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_model.jl b/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_model.jl index 3aa7e8ea385..254b46c0c4c 100644 --- a/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_model.jl +++ b/test/Numerics/DGMethods/compressible_Navier_Stokes/mms_model.jl @@ -14,7 +14,7 @@ import ClimateMachine.BalanceLaws: compute_gradient_argument!, compute_gradient_flux!, init_state_auxiliary!, - init_state_conservative! + init_state_prognostic! import ClimateMachine.DGMethods: init_ode_state using ClimateMachine.Mesh.Geometry: LocalGeometry @@ -159,7 +159,7 @@ function boundary_state!( t, _..., ) - init_state_conservative!(bl, stateP, auxP, (auxM.x1, auxM.x2, auxM.x3), t) + init_state_prognostic!(bl, stateP, auxP, (auxM.x1, auxM.x2, auxM.x3), t) end # FIXME: This is probably not right.... @@ -179,7 +179,7 @@ function boundary_state!( t, _..., ) - init_state_conservative!(bl, stateP, auxP, (auxM.x1, auxM.x2, auxM.x3), t) + init_state_prognostic!(bl, stateP, auxP, (auxM.x1, auxM.x2, auxM.x3), t) end function init_state_auxiliary!(::MMSModel, aux::Vars, g::LocalGeometry) @@ -189,7 +189,7 @@ function init_state_auxiliary!(::MMSModel, aux::Vars, g::LocalGeometry) aux.x3 = x3 end -function init_state_conservative!( +function init_state_prognostic!( bl::MMSModel{dim}, state::Vars, aux::Vars, diff --git a/test/Numerics/DGMethods/compressible_Navier_Stokes/ref_state.jl b/test/Numerics/DGMethods/compressible_Navier_Stokes/ref_state.jl index 71d4880254b..d26675c1c34 100644 --- a/test/Numerics/DGMethods/compressible_Navier_Stokes/ref_state.jl +++ b/test/Numerics/DGMethods/compressible_Navier_Stokes/ref_state.jl @@ -34,7 +34,7 @@ using ClimateMachine.Atmos using ClimateMachine.Atmos: internal_energy, thermo_state import ClimateMachine.Atmos: MoistureModel, temperature, pressure, soundspeed -init_state_conservative!(bl, state, aux, coords, t) = nothing +init_state_prognostic!(bl, state, aux, coords, t) = nothing # initial condition using ClimateMachine.Atmos: vars_state @@ -54,7 +54,7 @@ function run1(mpicomm, ArrayType, dim, topl, N, timeend, FT, dt) AtmosLESConfigType, param_set; ref_state = HydrostaticState(T_profile), - init_state_conservative = init_state_conservative!, + init_state_prognostic = init_state_prognostic!, ) dg = DGModel( @@ -92,7 +92,7 @@ function run2(mpicomm, ArrayType, dim, topl, N, timeend, FT, dt) AtmosLESConfigType, param_set; ref_state = HydrostaticState(T_profile), - init_state_conservative = init_state_conservative!, + init_state_prognostic = init_state_prognostic!, ) dg = DGModel( diff --git a/test/Numerics/DGMethods/conservation/sphere.jl b/test/Numerics/DGMethods/conservation/sphere.jl index d2f9355908a..730f02fcc6f 100644 --- a/test/Numerics/DGMethods/conservation/sphere.jl +++ b/test/Numerics/DGMethods/conservation/sphere.jl @@ -37,7 +37,7 @@ import ClimateMachine.DGMethods: source!, boundary_state!, init_state_auxiliary!, - init_state_conservative! + init_state_prognostic! import ClimateMachine.DGMethods: init_ode_state using ClimateMachine.Mesh.Geometry: LocalGeometry @@ -67,7 +67,7 @@ function init_state_auxiliary!( ) end -function init_state_conservative!( +function init_state_prognostic!( ::ConservationTestModel, state::Vars, aux::Vars, diff --git a/test/Numerics/DGMethods/courant.jl b/test/Numerics/DGMethods/courant.jl index 4f47d5d51ff..db5250a9092 100644 --- a/test/Numerics/DGMethods/courant.jl +++ b/test/Numerics/DGMethods/courant.jl @@ -124,7 +124,7 @@ let moisture = DryModel(), source = Gravity(), boundarycondition = (), - init_state_conservative = initialcondition!, + init_state_prognostic = initialcondition!, ) dg = DGModel( diff --git a/test/Numerics/DGMethods/integral_test.jl b/test/Numerics/DGMethods/integral_test.jl index 5ef58de241c..6f787153cbc 100644 --- a/test/Numerics/DGMethods/integral_test.jl +++ b/test/Numerics/DGMethods/integral_test.jl @@ -21,7 +21,7 @@ import ClimateMachine.BalanceLaws: wavespeed, boundary_state!, init_state_auxiliary!, - init_state_conservative!, + init_state_prognostic!, update_auxiliary_state!, indefinite_stack_integral!, reverse_indefinite_stack_integral!, @@ -54,7 +54,7 @@ flux_first_order!(::IntegralTestModel, _...) = nothing flux_second_order!(::IntegralTestModel, _...) = nothing source!(::IntegralTestModel, _...) = nothing boundary_state!(_, ::IntegralTestModel, _...) = nothing -init_state_conservative!(::IntegralTestModel, _...) = nothing +init_state_prognostic!(::IntegralTestModel, _...) = nothing wavespeed(::IntegralTestModel, _...) = 1 function init_state_auxiliary!( diff --git a/test/Numerics/DGMethods/integral_test_sphere.jl b/test/Numerics/DGMethods/integral_test_sphere.jl index 9f8ce1c6a0c..f0cc4af8235 100644 --- a/test/Numerics/DGMethods/integral_test_sphere.jl +++ b/test/Numerics/DGMethods/integral_test_sphere.jl @@ -32,7 +32,7 @@ import ClimateMachine.BalanceLaws: boundary_state!, compute_gradient_argument!, init_state_auxiliary!, - init_state_conservative!, + init_state_prognostic!, integral_set_auxiliary_state!, reverse_integral_load_auxiliary_state!, reverse_integral_set_auxiliary_state! @@ -74,7 +74,7 @@ flux_first_order!(::IntegralTestSphereModel, _...) = nothing flux_second_order!(::IntegralTestSphereModel, _...) = nothing source!(::IntegralTestSphereModel, _...) = nothing boundary_state!(_, ::IntegralTestSphereModel, _...) = nothing -init_state_conservative!(::IntegralTestSphereModel, _...) = nothing +init_state_prognostic!(::IntegralTestSphereModel, _...) = nothing wavespeed(::IntegralTestSphereModel, _...) = 1 function init_state_auxiliary!( diff --git a/test/Numerics/DGMethods/remainder_model.jl b/test/Numerics/DGMethods/remainder_model.jl index ce07507f56b..1a5b924f464 100644 --- a/test/Numerics/DGMethods/remainder_model.jl +++ b/test/Numerics/DGMethods/remainder_model.jl @@ -111,7 +111,7 @@ function run( turbulence = Vreman(FT(0.23)), moisture = DryModel(), source = Gravity(), - init_state_conservative = setup, + init_state_prognostic = setup, ) dg = DGModel( fullmodel, @@ -156,7 +156,7 @@ function run( # Create some random data to check the wavespeed function with nM = rand(3) nM /= norm(nM) - state_conservative = + state_prognostic = Vars{vars_state(dg.balance_law, Prognostic(), FT)}(rand( FT, number_states(dg.balance_law, Prognostic(), FT), @@ -168,7 +168,7 @@ function run( full_wavespeed = wavespeed( dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(),), @@ -176,7 +176,7 @@ function run( acoustic_wavespeed = wavespeed( acoustic_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(),), @@ -219,7 +219,7 @@ function run( every_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(),), @@ -229,7 +229,7 @@ function run( horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (HorizontalDirection(),), @@ -239,7 +239,7 @@ function run( vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (VerticalDirection(),), @@ -249,7 +249,7 @@ function run( every_wavespeed .+ horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), HorizontalDirection()), @@ -259,7 +259,7 @@ function run( every_wavespeed .+ vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), VerticalDirection()), @@ -301,7 +301,7 @@ function run( every_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(),), @@ -311,7 +311,7 @@ function run( horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (HorizontalDirection(),), @@ -321,7 +321,7 @@ function run( vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (VerticalDirection(),), @@ -331,7 +331,7 @@ function run( every_wavespeed .+ horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), HorizontalDirection()), @@ -341,7 +341,7 @@ function run( every_wavespeed .+ vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), VerticalDirection()), @@ -379,7 +379,7 @@ function run( every_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(),), @@ -389,7 +389,7 @@ function run( horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (HorizontalDirection(),), @@ -399,7 +399,7 @@ function run( vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (VerticalDirection(),), @@ -409,7 +409,7 @@ function run( every_wavespeed .+ horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), HorizontalDirection()), @@ -419,7 +419,7 @@ function run( every_wavespeed .+ vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), VerticalDirection()), @@ -457,7 +457,7 @@ function run( every_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(),), @@ -467,7 +467,7 @@ function run( horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (HorizontalDirection(),), @@ -477,7 +477,7 @@ function run( vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (VerticalDirection(),), @@ -487,7 +487,7 @@ function run( every_wavespeed .+ horz_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), HorizontalDirection()), @@ -497,7 +497,7 @@ function run( every_wavespeed .+ vert_wavespeed .≈ wavespeed( rem_dg.balance_law, nM, - state_conservative, + state_prognostic, state_auxiliary, FT(0), (EveryDirection(), VerticalDirection()), diff --git a/test/Numerics/DGMethods/vars_test.jl b/test/Numerics/DGMethods/vars_test.jl index 2f071748424..68c70904e81 100644 --- a/test/Numerics/DGMethods/vars_test.jl +++ b/test/Numerics/DGMethods/vars_test.jl @@ -23,7 +23,7 @@ import ClimateMachine.BalanceLaws: update_auxiliary_state!, boundary_state!, init_state_auxiliary!, - init_state_conservative! + init_state_prognostic! import ClimateMachine.DGMethods: init_ode_state using ClimateMachine.Mesh.Geometry: LocalGeometry @@ -42,7 +42,7 @@ source!(::VarsTestModel, _...) = nothing boundary_state!(_, ::VarsTestModel, _...) = nothing wavespeed(::VarsTestModel, _...) = 1 -function init_state_conservative!( +function init_state_prognostic!( m::VarsTestModel, state::Vars, aux::Vars, diff --git a/test/Numerics/Mesh/filter.jl b/test/Numerics/Mesh/filter.jl index d093c303946..e8319f8c73f 100644 --- a/test/Numerics/Mesh/filter.jl +++ b/test/Numerics/Mesh/filter.jl @@ -125,7 +125,7 @@ filtered(::HorizontalDirection, dim, x, y, z) = ClimateMachine.BalanceLaws.vars_state(::FilterTestModel{4}, ::Prognostic, FT) = @vars(q1::FT, q2::FT, q3::FT, q4::FT) -function ClimateMachine.BalanceLaws.init_state_conservative!( +function ClimateMachine.BalanceLaws.init_state_prognostic!( ::FilterTestModel{4}, state::Vars, aux::Vars, @@ -216,7 +216,7 @@ ClimateMachine.BalanceLaws.vars_state( ::Prognostic, FT, ) where {N} = @vars(q::FT) -function ClimateMachine.BalanceLaws.init_state_conservative!( +function ClimateMachine.BalanceLaws.init_state_prognostic!( ::FilterTestModel{1}, state::Vars, aux::Vars, diff --git a/test/Numerics/Mesh/interpolation.jl b/test/Numerics/Mesh/interpolation.jl index ec41959316b..70cc554bb91 100644 --- a/test/Numerics/Mesh/interpolation.jl +++ b/test/Numerics/Mesh/interpolation.jl @@ -127,7 +127,7 @@ function run_brick_interpolation_test() ref_state = NoReferenceState(), turbulence = ConstantViscosityWithDivergence(FT(0)), source = (Gravity(),), - init_state_conservative = Initialize_Brick_Interpolation_Test!, + init_state_prognostic = Initialize_Brick_Interpolation_Test!, ) dg = DGModel( @@ -288,7 +288,7 @@ function run_cubed_sphere_interpolation_test() turbulence = ConstantViscosityWithDivergence(FT(0)), moisture = DryModel(), source = nothing, - init_state_conservative = setup, + init_state_prognostic = setup, ) dg = DGModel( diff --git a/test/Numerics/SystemSolvers/poisson.jl b/test/Numerics/SystemSolvers/poisson.jl index 730a531fcb1..c143b0d5482 100644 --- a/test/Numerics/SystemSolvers/poisson.jl +++ b/test/Numerics/SystemSolvers/poisson.jl @@ -23,7 +23,7 @@ import ClimateMachine.DGMethods: compute_gradient_argument!, compute_gradient_flux!, init_state_auxiliary!, - init_state_conservative! + init_state_prognostic! import ClimateMachine.DGMethods: numerical_boundary_flux_second_order! using ClimateMachine.Mesh.Geometry: LocalGeometry @@ -148,7 +148,7 @@ function init_state_auxiliary!( end end -function init_state_conservative!( +function init_state_prognostic!( ::PoissonModel{dim}, state::Vars, aux::Vars, diff --git a/test/Utilities/SingleStackUtils/ssu_tests.jl b/test/Utilities/SingleStackUtils/ssu_tests.jl index 39516b2b7a1..3249d702bab 100644 --- a/test/Utilities/SingleStackUtils/ssu_tests.jl +++ b/test/Utilities/SingleStackUtils/ssu_tests.jl @@ -17,7 +17,7 @@ using ClimateMachine.DGMethods: LocalGeometry using ClimateMachine.BalanceLaws: BalanceLaw, Auxiliary, Prognostic, Gradient, GradientFlux import ClimateMachine.BalanceLaws: - vars_state, init_state_auxiliary!, init_state_conservative! + vars_state, init_state_auxiliary!, init_state_prognostic! struct EmptyBalLaw{FT, PS} <: BalanceLaw "Parameters" @@ -40,7 +40,7 @@ function init_state_auxiliary!(m::EmptyBalLaw, aux::Vars, geom::LocalGeometry) aux.z = geom.coord[3] end -function init_state_conservative!( +function init_state_prognostic!( m::EmptyBalLaw, state::Vars, aux::Vars, diff --git a/tutorials/Atmos/agnesi_hs_lin.jl b/tutorials/Atmos/agnesi_hs_lin.jl index 5a1e646b6b6..a16515ad161 100644 --- a/tutorials/Atmos/agnesi_hs_lin.jl +++ b/tutorials/Atmos/agnesi_hs_lin.jl @@ -231,7 +231,7 @@ function config_agnesi_hs_lin(FT, N, resolution, xmax, ymax, zmax) moisture = DryModel(), source = source, tracers = NoTracers(), - init_state_conservative = init_agnesi_hs_lin!, + init_state_prognostic = init_agnesi_hs_lin!, ref_state = ref_state, ) diff --git a/tutorials/Atmos/agnesi_nh_lin.jl b/tutorials/Atmos/agnesi_nh_lin.jl index 9150937cfb8..657d6e3aec5 100644 --- a/tutorials/Atmos/agnesi_nh_lin.jl +++ b/tutorials/Atmos/agnesi_nh_lin.jl @@ -236,7 +236,7 @@ function config_agnesi_hs_lin(FT, N, resolution, xmax, ymax, zmax) moisture = DryModel(), source = source, tracers = NoTracers(), - init_state_conservative = init_agnesi_hs_lin!, + init_state_prognostic = init_agnesi_hs_lin!, ref_state = ref_state, ) diff --git a/tutorials/Atmos/burgers_single_stack.jl b/tutorials/Atmos/burgers_single_stack.jl index 9d836364dce..b89a7407af8 100644 --- a/tutorials/Atmos/burgers_single_stack.jl +++ b/tutorials/Atmos/burgers_single_stack.jl @@ -89,7 +89,7 @@ import ClimateMachine.BalanceLaws: update_auxiliary_state!, nodal_update_auxiliary_state!, init_state_auxiliary!, - init_state_conservative!, + init_state_prognostic!, boundary_state! # ## Initialization @@ -169,7 +169,7 @@ vars_state(::BurgersEquation, ::GradientFlux, FT) = # ## Define the compute kernels # Specify the initial values in `aux::Vars`, which are available in -# `init_state_conservative!`. Note that +# `init_state_prognostic!`. Note that # - this method is only called at `t=0` # - `aux.z` and `aux.T` are available here because we've specified `z` and `T` # in `vars_state` @@ -186,7 +186,7 @@ end; # - this method is only called at `t=0` # - `state.ρ`, `state.ρu` and`state.ρcT` are available here because # we've specified `ρ`, `ρu` and `ρcT` in `vars_state` -function init_state_conservative!( +function init_state_prognostic!( m::BurgersEquation, state::Vars, aux::Vars, diff --git a/tutorials/Atmos/densitycurrent.jl b/tutorials/Atmos/densitycurrent.jl index 60b78f08e49..aba30977a79 100644 --- a/tutorials/Atmos/densitycurrent.jl +++ b/tutorials/Atmos/densitycurrent.jl @@ -213,7 +213,7 @@ function config_densitycurrent(FT, N, resolution, xmax, ymax, zmax) source = (Gravity(),), # Gravity is the only source term here tracers = NoTracers(), # Tracer model with diffusivity coefficients ref_state = ref_state, # Reference state - init_state_conservative = init_densitycurrent!, # Apply the initial condition + init_state_prognostic = init_densitycurrent!, # Apply the initial condition ) ## Finally, we pass a `Problem Name` string, the mesh information, and the diff --git a/tutorials/Atmos/dry_rayleigh_benard.jl b/tutorials/Atmos/dry_rayleigh_benard.jl index e72fe8d0635..eebd8e58de3 100644 --- a/tutorials/Atmos/dry_rayleigh_benard.jl +++ b/tutorials/Atmos/dry_rayleigh_benard.jl @@ -151,7 +151,7 @@ function config_problem(FT, N, resolution, xmax, ymax, zmax) ), ), tracers = NTracers{ntracers, FT}(δ_χ), - init_state_conservative = init_problem!, + init_state_prognostic = init_problem!, data_config = data_config, ) diff --git a/tutorials/Atmos/heldsuarez.jl b/tutorials/Atmos/heldsuarez.jl index f4108c9f7ac..8548eb59912 100644 --- a/tutorials/Atmos/heldsuarez.jl +++ b/tutorials/Atmos/heldsuarez.jl @@ -186,7 +186,7 @@ model = AtmosModel{FT}( hyperdiffusion = hyperdiffusion_model, moisture = DryModel(), source = (Gravity(), Coriolis(), held_suarez_forcing!, sponge), - init_state_conservative = init_heldsuarez!, + init_state_prognostic = init_heldsuarez!, ); # This concludes the setup of the physical model! diff --git a/tutorials/Atmos/risingbubble.jl b/tutorials/Atmos/risingbubble.jl index f0a16610fd7..7100d1ba64c 100644 --- a/tutorials/Atmos/risingbubble.jl +++ b/tutorials/Atmos/risingbubble.jl @@ -235,7 +235,7 @@ function config_risingbubble(FT, N, resolution, xmax, ymax, zmax) source = (Gravity(),), # Gravity is the only source term here tracers = NTracers{ntracers, FT}(δ_χ), # Tracer model with diffusivity coefficients ref_state = ref_state, # Reference state - init_state_conservative = init_risingbubble!, # Apply the initial condition + init_state_prognostic = init_risingbubble!, # Apply the initial condition ) ## Finally, we pass a `Problem Name` string, the mesh information, and the diff --git a/tutorials/Land/Heat/heat_equation.jl b/tutorials/Land/Heat/heat_equation.jl index 5b6621a5133..22757b0e40d 100644 --- a/tutorials/Land/Heat/heat_equation.jl +++ b/tutorials/Land/Heat/heat_equation.jl @@ -83,7 +83,7 @@ import ClimateMachine.BalanceLaws: update_auxiliary_state!, nodal_update_auxiliary_state!, init_state_auxiliary!, - init_state_conservative!, + init_state_prognostic!, boundary_state! # ## Initialization @@ -150,7 +150,7 @@ vars_state(::HeatModel, ::GradientFlux, FT) = @vars(α∇ρcT::SVector{3, FT}); # ## Define the compute kernels # Specify the initial values in `aux::Vars`, which are available in -# `init_state_conservative!`. Note that +# `init_state_prognostic!`. Note that # - this method is only called at `t=0` # - `aux.z` and `aux.T` are available here because we've specified `z` and `T` # in `vars_state` @@ -163,7 +163,7 @@ end; # - this method is only called at `t=0` # - `state.ρcT` is available here because we've specified `ρcT` in # `vars_state` -function init_state_conservative!( +function init_state_prognostic!( m::HeatModel, state::Vars, aux::Vars, @@ -385,7 +385,7 @@ export_plot_snapshot( ); # ![](initial_condition.png) -# It matches what we have in `init_state_conservative!(m::HeatModel, ...)`, so +# It matches what we have in `init_state_prognostic!(m::HeatModel, ...)`, so # let's continue. # # Solver hooks / callbacks