Skip to content

Commit

Permalink
Fix bad call to define.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Lattanzi committed Dec 13, 2023
1 parent 56dbb2d commit c7cd829
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Source/IO/Plotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,16 +601,12 @@ ERF::WritePlotFile (int which, Vector<std::string> plot_var_names)

// NOTE: Protect against accessing non-existent data
int q_size = qmoist[lev]->nComp();
MultiFab qv_mf, qc_mf, qi_mf, qr_mf, qs_mf, qg_mf;
qv_mf(*(qmoist[lev]), make_alias, 0, 1);
if (q_size>1) qc_mf(*(qmoist[lev]), make_alias, 1, 1);
if (q_size>2) qi_mf(*(qmoist[lev]), make_alias, 2, 1);
if (q_size>3) qr_mf(*(qmoist[lev]), make_alias, 3, 1);
if (q_size>4) qs_mf(*(qmoist[lev]), make_alias, 4, 1);
if (q_size>5) qg_mf(*(qmoist[lev]), make_alias, 5, 1);
MultiFab qv_mf(*(qmoist[lev]), make_alias, 0, 1);

if (containerHasElement(plot_var_names, "qt") && (q_size >= 3))
{
MultiFab qc_mf(*(qmoist[lev]), make_alias, 1, 1);
MultiFab qi_mf(*(qmoist[lev]), make_alias, 2, 1);
MultiFab::Copy(mf[lev],qv_mf,0,mf_comp,1,0);
MultiFab::Add (mf[lev],qc_mf,0,mf_comp,1,0);
MultiFab::Add (mf[lev],qi_mf,0,mf_comp,1,0);
Expand All @@ -619,6 +615,9 @@ ERF::WritePlotFile (int which, Vector<std::string> plot_var_names)

if (containerHasElement(plot_var_names, "qp") && (q_size >= 6))
{
MultiFab qr_mf(*(qmoist[lev]), make_alias, 3, 1);
MultiFab qs_mf(*(qmoist[lev]), make_alias, 4, 1);
MultiFab qg_mf(*(qmoist[lev]), make_alias, 5, 1);
MultiFab::Copy(mf[lev],qr_mf,0,mf_comp,1,0);
MultiFab::Add (mf[lev],qs_mf,0,mf_comp,1,0);
MultiFab::Add (mf[lev],qg_mf,0,mf_comp,1,0);
Expand All @@ -633,30 +632,35 @@ ERF::WritePlotFile (int which, Vector<std::string> plot_var_names)

if (containerHasElement(plot_var_names, "qc") && (q_size >= 2))
{
if (q_size>1) MultiFab::Copy(mf[lev],qc_mf,0,mf_comp,1,0);
MultiFab qc_mf(*(qmoist[lev]), make_alias, 1, 1);
MultiFab::Copy(mf[lev],qc_mf,0,mf_comp,1,0);
mf_comp += 1;
}

if (containerHasElement(plot_var_names, "qi") && (q_size >= 3))
{
if (q_size>1) MultiFab::Copy(mf[lev],qi_mf,0,mf_comp,1,0);
MultiFab qi_mf(*(qmoist[lev]), make_alias, 2, 1);
MultiFab::Copy(mf[lev],qi_mf,0,mf_comp,1,0);
mf_comp += 1;
}

if (containerHasElement(plot_var_names, "qrain") && (q_size >= 4))
{
MultiFab qr_mf(*(qmoist[lev]), make_alias, 3, 1);
MultiFab::Copy(mf[lev],qr_mf,0,mf_comp,1,0);
mf_comp += 1;
}

if (containerHasElement(plot_var_names, "qsnow") && (q_size >= 5))
{
MultiFab qs_mf(*(qmoist[lev]), make_alias, 4, 1);
MultiFab::Copy(mf[lev],qs_mf,0,mf_comp,1,0);
mf_comp += 1;
}

if (containerHasElement(plot_var_names, "qgraup") && (q_size >= 6))
{
MultiFab qg_mf(*(qmoist[lev]), make_alias, 5, 1);
MultiFab::Copy(mf[lev],qg_mf,0,mf_comp,1,0);
mf_comp += 1;
}
Expand Down

0 comments on commit c7cd829

Please sign in to comment.