From c7177d0ea7a26014a311bc1a25cc7c74c2aa88de Mon Sep 17 00:00:00 2001 From: jpollin98 Date: Fri, 26 Apr 2024 10:27:12 +0100 Subject: [PATCH] updated nltepop --- nltepop.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/nltepop.cc b/nltepop.cc index 78dfad328..ee65d6347 100644 --- a/nltepop.cc +++ b/nltepop.cc @@ -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; @@ -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++) {