Skip to content

Commit

Permalink
updated nltepop
Browse files Browse the repository at this point in the history
  • Loading branch information
jpollin98 committed Apr 26, 2024
1 parent 1a6d27c commit c7177d0
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions nltepop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,17 @@ void solve_nlte_pops_element(const int element, const int modelgridindex, const
}

double cell_Te = grid::get_Te(modelgridindex);
if (cell_Te < 1001) {
printout("Not solving for NLTE populations in cell %d at timestep %d for element Z=%d due to low temperature\n",
modelgridindex, timestep, atomic_number);

if (cell_Te < 1001.) {
printout(
"Not solving for NLTE populations in cell %d at timestep %d for element Z=%d due to low temperature Te=%g\n",
modelgridindex, timestep, atomic_number, cell_Te);
set_element_pops_lte(modelgridindex, element);
return;
}

assert_always(cell_Te >= 1001.);

const time_t sys_time_start_nltesolver = time(nullptr);

const double t_mid = globals::timesteps[timestep].mid;
Expand Down Expand Up @@ -975,13 +979,6 @@ void solve_nlte_pops_element(const int element, const int modelgridindex, const
"Attempting to use LTE solution instead\n",
modelgridindex, timestep, atomic_number);
set_element_pops_lte(modelgridindex, element);
} else if (cell_Te < 1001) {
printout(
"WARNING: Can't solve for NLTE populations in cell %d at timestep %d for element Z=%d due "
"to bad temperatures. Te: %g\n",
modelgridindex, timestep, atomic_number, cell_Te);
printout("Attempting to use LTE solution instead\n");
set_element_pops_lte(modelgridindex, element);
} else {
// check calculated NLTE populations are valid
for (int index = 0; index < nlte_dimension; index++) {
Expand Down

0 comments on commit c7177d0

Please sign in to comment.