Skip to content

Commit

Permalink
Removed the prints from eval_rfof which previously kept it from crash…
Browse files Browse the repository at this point in the history
…ing (miekkasarki fixed the actual problem in librfof), removed a few unused variables from rfof_interface
  • Loading branch information
jsjoona committed Jul 19, 2024
1 parent 408a5a0 commit 6dbfc1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/libascot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
17 changes: 9 additions & 8 deletions src/rfof_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6dbfc1e

Please sign in to comment.