diff --git a/src/trapping/clffft.cpp b/src/trapping/clffft.cpp index d841cdb67de24642bfd5ef3ea6e5a45836da9764..39bd1ea3142a56e0ee4c32289315f96b5fb41b4e 100644 --- a/src/trapping/clffft.cpp +++ b/src/trapping/clffft.cpp @@ -275,103 +275,103 @@ void lffft(string data_file, string output_path) { ws[ie] = wsl[iel]; } // i175 loop } - // label 180 - if (is != 2222) { - if (is != 1111) { - if (is > 0) { // Goes to 305 - ac = new complex<double>[cil->nlemt](); - camp(ac, am0m, ws, cil); - // Goes to 445 - } else if (is < 0) { // Goes to 405 - ac = new complex<double>[cil->nlemt](); - czamp(ac, amd, indam, ws, cil); - // Goes to 445 - } - } else { + } // i loop + // label 180 + if (is != 2222) { + if (is != 1111) { + if (is > 0) { // Goes to 305 + ac = new complex<double>[cil->nlemt](); + camp(ac, am0m, ws, cil); + // Goes to 445 + } else if (is < 0) { // Goes to 405 ac = new complex<double>[cil->nlemt](); - samp(ac, tmsm, tmse, ws, cil); + czamp(ac, amd, indam, ws, cil); // Goes to 445 } } else { ac = new complex<double>[cil->nlemt](); - sampoa(ac, tms, ws, cil); + samp(ac, tmsm, tmse, ws, cil); // Goes to 445 } - bool goto475 = false; - // label 445 - if (jft <= 0) { - double *fffe = new double[3](); - double *fffs = new double[3](); - ffrf(zpv, ac, ws, fffe, fffs, cil, ccr); - if (jss == 1) { + } else { + ac = new complex<double>[cil->nlemt](); + sampoa(ac, tms, ws, cil); + // Goes to 445 + } + bool goto475 = false; + // label 445 + if (jft <= 0) { + double *fffe = new double[3](); + double *fffs = new double[3](); + ffrf(zpv, ac, ws, fffe, fffs, cil, ccr); + if (jss == 1) { + // Writes to 66 + fprintf( + output66, " %18.16lE%18.16lE%18.16lE\n", + fffe[0], fffs[0], fffe[0] - fffs[0] + ); + fprintf( + output66, " %18.16lE%18.16lE%18.16lE\n", + fffe[1], fffs[1], fffe[1] - fffs[1] + ); + fprintf( + output66, " %18.16lE%18.16lE%18.16lE\n", + fffe[2], fffs[2], fffe[2] - fffs[2] + ); + } else { // label 450 + for (int i = 0; i < 3; i++) { + double value = fffe[i] - fffs[i]; + tlfff.write(reinterpret_cast<char *>(&value), sizeof(double)); + } + if (jtw == 1) { // Writes to 66 fprintf( - output66, " %18.16lE%18.16lE%18.16lE\n", - fffe[0], fffs[0], fffe[0] - fffs[0] - ); - fprintf( - output66, " %18.16lE%18.16lE%18.16lE\n", - fffe[1], fffs[1], fffe[1] - fffs[1] - ); - fprintf( - output66, " %18.16lE%18.16lE%18.16lE\n", - fffe[2], fffs[2], fffe[2] - fffs[2] + output66, " %5d%4d%4d%15.4lE%15.4lE%15.4lE\n", + ix475 + 1, iy475 + 1, iz475 + 1, + fffe[0] - fffs[0], fffe[1] - fffs[1], fffe[2] - fffs[2] ); - } else { // label 450 - for (int i = 0; i < 3; i++) { - double value = fffe[i] - fffs[i]; - tlfff.write(reinterpret_cast<char *>(&value), sizeof(double)); - } - if (jtw == 1) { - // Writes to 66 - fprintf( - output66, " %5d%4d%4d%15.4lE%15.4lE%15.4lE\n", - ix475 + 1, iy475 + 1, iz475 + 1, - fffe[0] - fffs[0], fffe[1] - fffs[1], fffe[2] - fffs[2] - ); - } } - if (jft < 0) goto475 = true; - delete[] fffe; - delete[] fffs; } - // label 460 - if (!goto475) { - double *ffte = new double[3](); - double *ffts = new double[3](); - ffrt(ac, ws, ffte, ffts, cil); - if (jss == 1) { + if (jft < 0) goto475 = true; + delete[] fffe; + delete[] fffs; + } + // label 460 + if (!goto475) { + double *ffte = new double[3](); + double *ffts = new double[3](); + ffrt(ac, ws, ffte, ffts, cil); + if (jss == 1) { + // Writes to 67 + fprintf( + output67, " %18.16lE%18.16lE%18.16lE\n", + ffte[0], ffts[0], ffte[0] - ffts[0] + ); + fprintf( + output67, " %18.16lE%18.16lE%18.16lE\n", + ffte[1], ffts[1], ffte[1] - ffts[1] + ); + fprintf( + output67, " %18.16lE%18.16lE%18.16lE\n", + ffte[2], ffts[2], ffte[2] - ffts[2] + ); + } else { // label 470 + for (int i = 0; i < 3; i++) { + double value = ffte[i] - ffts[i]; + tlfft.write(reinterpret_cast<char *>(&value), sizeof(double)); + } + if (jtw == 1) { // Writes to 67 fprintf( - output67, " %18.16lE%18.16lE%18.16lE\n", - ffte[0], ffts[0], ffte[0] - ffts[0] - ); - fprintf( - output67, " %18.16lE%18.16lE%18.16lE\n", - ffte[1], ffts[1], ffte[1] - ffts[1] + output67, " %5d%4d%4d%15.4lE%15.4lE%15.4lE\n", + ix475 + 1, iy475 + 1, iz475 + 1, + ffte[0] - ffts[0], ffte[1] - ffts[1], ffte[2] - ffts[2] ); - fprintf( - output67, " %18.16lE%18.16lE%18.16lE\n", - ffte[2], ffts[2], ffte[2] - ffts[2] - ); - } else { // label 470 - for (int i = 0; i < 3; i++) { - double value = ffte[i] - ffts[i]; - tlfft.write(reinterpret_cast<char *>(&value), sizeof(double)); - } - if (jtw == 1) { - // Writes to 67 - fprintf( - output67, " %5d%4d%4d%15.4lE%15.4lE%15.4lE\n", - ix475 + 1, iy475 + 1, iz475 + 1, - ffte[0] - ffts[0], ffte[1] - ffts[1], ffte[2] - ffts[2] - ); - } } - delete[] ffte; - delete[] ffts; } - } // i loop + delete[] ffte; + delete[] ffts; + } } // ix475 loop } // iy475 loop } // iz475 loop