Skip to content

Commit

Permalink
modified: src/initial_conditions/initial_conditions.jl
Browse files Browse the repository at this point in the history
	modified:   src/solver/type_getters.jl
  • Loading branch information
Akshay Sridhar committed Dec 16, 2024
1 parent 2bbc9cb commit df1a3ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/initial_conditions/initial_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ overwrite_initial_conditions!(initial_condition::InitialCondition, args...) =
"""
overwrite_initial_conditions!(initial_condition, Y, thermo_params, config)
Given a prognostic state `Y`, an `initial condition` (specifically, where
initial values are assigned from interpolations of existing datasets), a `thermo_state`,
and the `config::AtmosConfig` object, this function overwrites the default initial condition
initial values are assigned from interpolations of existing datasets), a `thermo_state`, this function overwrites the default initial condition
and populates prognostic variables with interpolated values using the `SpaceVaryingInputs`
tool. To mitigate issues related to unbalanced states following the interpolation operation,
we recompute vertical pressure levels assuming hydrostatic balance, given the surface pressure
Expand All @@ -399,7 +398,6 @@ function overwrite_initial_conditions!(
initial_condition::DYAMONDSummer,
Y,
thermo_params,
config,
)
# Get file from AtmosArtifacts
file_path = AA.dyamond_summer_artifact_path(; context = config.comms_ctx)
Expand Down Expand Up @@ -448,12 +446,14 @@ function overwrite_initial_conditions!(
compute_kinetic!(e_kin, Y.c.uₕ, Y.f.u₃)
e_pot = Fields.coordinate_field(Y.c).z .* thermo_params.grav
Y.c.ρe_tot .= TD.total_energy.(thermo_params, ᶜts, e_kin, e_pot) .* Y.c.ρ
if config.parsed_args["moist"] == "dry"
error("`dry` configurations are incompatible with the interpolated DYAMOND-summer initial conditions.")
else
if hasproperty(Y.c, :ρq_tot)
Y.c.ρq_tot .= ᶜq_tot .* Y.c.ρ
else
error(
"`dry` configurations are incompatible with the interpolated initial conditions.",
)
end
if config.parsed_args["precip_model"] == "1M"
if hasproperty(Y.c, :ρq_sno) && hasproperty(Y.c, :ρq_rai)
Y.c.ρq_sno .=
SpaceVaryingInputs.SpaceVaryingInput(
file_path,
Expand Down
1 change: 0 additions & 1 deletion src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ function get_simulation(config::AtmosConfig)
initial_condition,
Y,
params.thermodynamics_params,
config,
)

s = @timed_str begin
Expand Down

0 comments on commit df1a3ad

Please sign in to comment.