Skip to content

Commit

Permalink
Merge #1340
Browse files Browse the repository at this point in the history
1340: change les_data_kwarg to aux_data_kwarg r=trontrytel a=jbphyswx



Co-authored-by: Jordan Benjamin <jbenjami@sampo.gps.caltech.edu>
  • Loading branch information
bors[bot] and Jordan Benjamin authored May 25, 2023
2 parents bda14ec + b70f242 commit ebbeb89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions driver/Cases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ RadiationBase(case::AbstractCaseType, FT) = RadiationBase{Cases.get_radiation_ty
forcing_kwargs(::AbstractCaseType, namelist) = (; coriolis_param = namelist["forcing"]["coriolis"])
forcing_kwargs(case::DYCOMS_RF01, namelist) = (; divergence = large_scale_divergence(case))
forcing_kwargs(case::DYCOMS_RF02, namelist) = (; divergence = large_scale_divergence(case))
les_data_kwarg(::AbstractCaseType, namelist) = ()
aux_data_kwarg(::AbstractCaseType, namelist) = ()

ForcingBase(case::AbstractCaseType, FT; kwargs...) = ForcingBase{get_forcing_type(case), FT}(; kwargs...)

Expand Down Expand Up @@ -1122,7 +1122,7 @@ function forcing_kwargs(::LES_driven_SCM, namelist)
return (; wind_nudge_τᵣ, scalar_nudge_zᵢ, scalar_nudge_zᵣ, scalar_nudge_τᵣ, coriolis_param)
end

function les_data_kwarg(::LES_driven_SCM, namelist)
function aux_data_kwarg(::LES_driven_SCM, namelist)
les_filename = namelist["meta"]["lesfile"]
# load data here
LESDat = NC.Dataset(les_filename, "r") do data
Expand Down
18 changes: 9 additions & 9 deletions driver/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function DiffEqNoiseProcess.wiener_randn!(rng::Random.AbstractRNG, rand_vec::CC.
parent(rand_vec.face) .= Random.randn.()
end

struct Simulation1d{IONT, P, A, C, F, R, SM, EDMF, PM, RFM, D, TIMESTEPPING, STATS, PS, SRS, LESDK}
struct Simulation1d{IONT, P, A, C, F, R, SM, EDMF, PM, RFM, D, TIMESTEPPING, STATS, PS, SRS, AUXDK}
io_nt::IONT
prog::P
aux::A
Expand All @@ -65,7 +65,7 @@ struct Simulation1d{IONT, P, A, C, F, R, SM, EDMF, PM, RFM, D, TIMESTEPPING, STA
dt_min::Float64
truncate_stack_trace::Bool
surf_ref_state::SRS
les_data_kwarg::LESDK
aux_data_kwarg::AUXDK
end

function open_files(sim::Simulation1d)
Expand Down Expand Up @@ -215,8 +215,8 @@ function Simulation1d(namelist)
TS = TimeStepping(FT, namelist)

Ri_bulk_crit::FTD = namelist["turbulence"]["EDMF_PrognosticTKE"]["Ri_crit"]
les_data_kwarg = Cases.les_data_kwarg(case, namelist)
surf_params = Cases.surface_params(case, surf_ref_state, param_set; Ri_bulk_crit = Ri_bulk_crit, les_data_kwarg...)
aux_data_kwarg = Cases.aux_data_kwarg(case, namelist)
surf_params = Cases.surface_params(case, surf_ref_state, param_set; Ri_bulk_crit = Ri_bulk_crit, aux_data_kwarg...)

calibrate_io = namelist["stats_io"]["calibrate_io"]
aux_dict = calibrate_io ? TC.io_dictionary_aux_calibrate() : TC.io_dictionary_aux()
Expand Down Expand Up @@ -246,15 +246,15 @@ function Simulation1d(namelist)
dt_min,
truncate_stack_trace,
surf_ref_state,
les_data_kwarg,
aux_data_kwarg,
)
end

function initialize(sim::Simulation1d)
TC = TurbulenceConvection

(; prog, aux, edmf, case, forcing, radiation, surf_params, param_set, surf_ref_state) = sim
(; les_data_kwarg, skip_io, Stats, io_nt, diagnostics, truncate_stack_trace) = sim
(; aux_data_kwarg, skip_io, Stats, io_nt, diagnostics, truncate_stack_trace) = sim

ts_gm = ["Tsurface", "shf", "lhf", "ustar", "wstar", "lwp_mean", "iwp_mean"]
ts_edmf = [
Expand Down Expand Up @@ -298,12 +298,12 @@ function initialize(sim::Simulation1d)
add_write_field(ds, "p_c", vec(TC.center_aux_grid_mean(state).p), group, ("zc",))
end
end
Cases.initialize_profiles(case, grid, param_set, state; les_data_kwarg...)
Cases.initialize_profiles(case, grid, param_set, state; aux_data_kwarg...)
set_thermo_state_from_aux!(state, grid, edmf.moisture_model, param_set)
set_grid_mean_from_thermo_state!(param_set, state, grid)
assign_thermo_aux!(state, grid, edmf.moisture_model, param_set)
Cases.initialize_forcing(case, forcing, grid, state, param_set; les_data_kwarg...)
Cases.initialize_radiation(case, radiation, grid, state, param_set; les_data_kwarg...)
Cases.initialize_forcing(case, forcing, grid, state, param_set; aux_data_kwarg...)
Cases.initialize_radiation(case, radiation, grid, state, param_set; aux_data_kwarg...)
initialize_edmf(edmf, grid, state, surf_params, param_set, t, case)
if !skip_io
stats = Stats[colidx]
Expand Down

0 comments on commit ebbeb89

Please sign in to comment.