From 6dbfc1e416d56569d4dd3a77947857bff8423872 Mon Sep 17 00:00:00 2001 From: jsjoona Date: Fri, 19 Jul 2024 12:35:20 +0300 Subject: [PATCH] Removed the prints from eval_rfof which previously kept it from crashing (miekkasarki fixed the actual problem in librfof), removed a few unused variables from rfof_interface --- src/libascot.c | 2 ++ src/rfof_interface.c | 17 +++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/libascot.c b/src/libascot.c index 9142e337..e1560bea 100644 --- a/src/libascot.c +++ b/src/libascot.c @@ -1049,11 +1049,13 @@ void libascot_eval_rfof( &(res_cond[k]), &nharm); /* Removing the print below will cause a mess in the figure. Something wrong with memory usage. */ + /* if(nharm==1){ printf("nharm = %d, R = %f\n", nharm, R[k]); }else{ printf("nharm = %d, \t\tR = %f\n", nharm, R[k]); } + */ // TODO: this should return a non-zero value if the evaluation failed. rfof_interface_get_rf_wave_local( &(R[k]), &(z[k]), &dummy_real, &dummy_real, diff --git a/src/rfof_interface.c b/src/rfof_interface.c index c0aef743..f8f08e16 100644 --- a/src/rfof_interface.c +++ b/src/rfof_interface.c @@ -335,8 +335,8 @@ void rfof_interface_do_rfof_stuff_gc(particle_simd_gc* ascot_marker, real* hin, ascot_marker->r[i], ascot_marker->ppar[i], psi, B, ascot_marker->B_phi[i]); - /** @brief Momentum norm */ - real p = physlib_pnorm_vnorm(ascot_marker->mass[i], speed); + /** @brief Momentum norm (was used in debugging) */ + //real p = physlib_pnorm_vnorm(ascot_marker->mass[i], speed); /** @brief pitch */ real xi = physlib_gc_xi(ascot_marker->mass[i], ascot_marker->mu[i], @@ -410,13 +410,14 @@ void rfof_interface_do_rfof_stuff_gc(particle_simd_gc* ascot_marker, real* hin, real* vdriftRho_ptr = &vdriftRho; real* acc_ptr = &acc; - //For debugging store the old values - real Ekin_old = Ekin; - real p_phi_old = p_phi; + /* Store the old values for debugging or to be able to evaluate the + new ppar after kick. */ + //real Ekin_old = Ekin; + //real p_phi_old = p_phi; real v_par_old = v_par; - real v_perp_old = v_perp; - real speed_old = speed; - real ppar_old = ascot_marker->ppar[i]; + //real v_perp_old = v_perp; + //real speed_old = speed; + //real ppar_old = ascot_marker->ppar[i]; /* Update the fields of RFOF marker */ __ascot5_icrh_routines_MOD_call_set_marker_pointers(