Skip to content

Commit

Permalink
Fix some compiler warnings with SDC+NSE (#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 authored Apr 3, 2024
1 parent dfc746f commit ab9345c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/compiler-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,46 @@ jobs:
run: |
cd unit_test/burn_cell
make realclean
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=subch_simple -j 2
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=subch_simple -j 4
- name: Compile burn_cell w/o debug
run: |
cd unit_test/burn_cell
make realclean
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=subch_simple -j 2
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=subch_simple -j 4
- name: Compile burn_cell_sdc w/ debug
run: |
cd unit_test/burn_cell_sdc
make realclean
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=subch_simple USE_NSE_NET=TRUE SCREEN_METHOD=chabrier1998 -j 4
- name: Compile burn_cell_sdc w/o debug
run: |
cd unit_test/burn_cell_sdc
make realclean
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=subch_simple USE_NSE_NET=TRUE SCREEN_METHOD=chabrier1998 -j 4
- name: Compile test_eos w/ debug
run: |
cd unit_test/test_eos
make realclean
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE EOS_DIR=gamma_law -j 2
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE EOS_DIR=gamma_law -j 4
- name: Compile test_eos w/o debug
run: |
cd unit_test/test_eos
make realclean
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE EOS_DIR=gamma_law -j 2
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE EOS_DIR=gamma_law -j 4
- name: Compile test_sdc w/ debug
run: |
cd unit_test/test_sdc
make realclean
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE -j 2
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE -j 4
- name: Compile test_sdc w/o debug
run: |
cd unit_test/test_sdc
make realclean
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE -j 2
make USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE -j 4
12 changes: 7 additions & 5 deletions integration/nse_update_sdc.H
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,11 @@ void sdc_nse_burn(BurnT& state, const amrex::Real dt) {
zbar *= abar;

#ifdef NEUTRINOS
constexpr int do_derivatives = 0;
sneut5<do_derivatives>(T_in, rho_old, abar, zbar,
snu, dsnudt, dsnudd, dsnuda, dsnudz);
{
constexpr int do_derivatives = 0;
sneut5<do_derivatives>(T_in, rho_old, abar, zbar,
snu, dsnudt, dsnudd, dsnuda, dsnudz);
}
#endif
amrex::Real snu_old = snu;

Expand All @@ -364,7 +366,7 @@ void sdc_nse_burn(BurnT& state, const amrex::Real dt) {
// weak interactions, we would evaluate the NSE state here and
// get dYe/dt.

amrex::Real dyedt_old = 0.0;
//amrex::Real dyedt_old = 0.0;


// predict the U^{n+1,*} state with only estimates of the X
Expand Down Expand Up @@ -431,7 +433,7 @@ void sdc_nse_burn(BurnT& state, const amrex::Real dt) {
rhoX_tilde[n] = state.y[SRHO] * nse_state.xn[n] - dt * state.ydot_a[SFS+n];
}

amrex::Real dyedt = 0.0_rt; // we can update this in the future by calling actual_rhs()
//amrex::Real dyedt = 0.0_rt; // we can update this in the future by calling actual_rhs()

// we want to compute (rho eps) = - N_A c^2 sum{m_i (rhoX_tilde - rhoX_old) / A_i}
rho_enucdot = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion nse_solver/nse_check.H
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ void nse_grouping(amrex::Array1D<int, 1, NumSpec>& group_ind, const burn_t& stat
// Then fill in the reaction timescale and index for each rate.

amrex::Array1D<amrex::Real, 1, Rates::NumRates> reaction_timescales;
amrex::Array1D<amrex::Real, 1, Rates::NumRates> rate_indices;
amrex::Array1D<int, 1, Rates::NumRates> rate_indices;

for (int n = 1; n <= Rates::NumRates; ++n) {
fill_reaction_timescale(reaction_timescales, n, state, Y,
Expand Down

0 comments on commit ab9345c

Please sign in to comment.