Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: populate terrain arrays before initializing microphysics object #1749

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions Source/ERF_make_new_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,27 +192,6 @@ void ERF::MakeNewLevelFromScratch (int lev, Real time, const BoxArray& ba,
zflux_imask[lev] = nullptr;
}

//********************************************************************************************
// Microphysics
// *******************************************************************************************
int q_size = micro->Get_Qmoist_Size(lev);
qmoist[lev].resize(q_size);
micro->Define(lev, solverChoice);
if (solverChoice.moisture_type != MoistureType::None)
{
micro->Init(lev, vars_new[lev][Vars::cons],
grids[lev], Geom(lev), 0.0,
z_phys_nd[lev], detJ_cc[lev]); // dummy dt value
}
for (int mvar(0); mvar<qmoist[lev].size(); ++mvar) {
qmoist[lev][mvar] = micro->Get_Qmoist_Ptr(lev,mvar);
}

// ********************************************************************************************
// Initialize the integrator class
// ********************************************************************************************
initialize_integrator(lev, lev_new[Vars::cons],lev_new[Vars::xvel]);

// ********************************************************************************************
// Initialize the data itself
// If (init_type == "real") then we are initializing terrain and the initial data in
Expand Down Expand Up @@ -240,6 +219,27 @@ void ERF::MakeNewLevelFromScratch (int lev, Real time, const BoxArray& ba,
}
}

//********************************************************************************************
// Microphysics
// *******************************************************************************************
int q_size = micro->Get_Qmoist_Size(lev);
qmoist[lev].resize(q_size);
micro->Define(lev, solverChoice);
if (solverChoice.moisture_type != MoistureType::None)
{
micro->Init(lev, vars_new[lev][Vars::cons],
grids[lev], Geom(lev), 0.0,
z_phys_nd[lev], detJ_cc[lev]); // dummy dt value
}
for (int mvar(0); mvar<qmoist[lev].size(); ++mvar) {
qmoist[lev][mvar] = micro->Get_Qmoist_Ptr(lev,mvar);
}

// ********************************************************************************************
// Initialize the integrator class
// ********************************************************************************************
initialize_integrator(lev, lev_new[Vars::cons],lev_new[Vars::xvel]);

// ********************************************************************************************
// If we are making a new level then the FillPatcher for this level hasn't been allocated yet
// ********************************************************************************************
Expand Down
Loading