@@ -630,7 +630,7 @@ void Mesh::UserWorkInLoop() {
630
630
if (ipert == 2 ) {
631
631
int exe_rank_dby = (Globals::nranks>1 )? 1 : 0 ;
632
632
Real inv_nik = 1.0 /static_cast <Real>(mesh_size.nx3 *mesh_size.nx1 );
633
- Real inv_half_nx2 = static_cast <Real>(mesh_size.nx2 /2 );
633
+ Real inv_half_nx2 = 1.0 / static_cast <Real>(mesh_size.nx2 /2 );
634
634
int abs_nwy = std::abs (nwy);
635
635
// calculate FFT of dbx
636
636
if (Globals::my_rank == 0 ) {
@@ -647,19 +647,13 @@ void Mesh::UserWorkInLoop() {
647
647
// calculation
648
648
Real amp_wave;
649
649
Real amp_others = 0.0 ;
650
- Real x1 = (static_cast <Real>(i)+0.5 )*Lx
651
- /static_cast <Real>(mesh_size.nx1 )
652
- +mesh_size.x1min ;
653
- Real x3 = (static_cast <Real>(k)+0.5 )*Lz
654
- /static_cast <Real>(mesh_size.nx3 )
655
- +mesh_size.x3min ;
656
650
for (int j=0 ; j<mesh_size.nx2 /2 ; j++) {
657
651
if (j == abs_nwy) {
658
652
amp_wave = std::sqrt (SQR (fft_data[j][0 ])+SQR (fft_data[j][1 ]))
659
- / inv_half_nx2;
653
+ * inv_half_nx2;
660
654
} else {
661
655
amp_others += std::sqrt (SQR (fft_data[j][0 ])+SQR (fft_data[j][1 ]))
662
- / inv_half_nx2;
656
+ * inv_half_nx2;
663
657
}
664
658
}
665
659
ruser_mesh_data[2 ](0 ) += amp_wave*inv_nik;
@@ -680,14 +674,8 @@ void Mesh::UserWorkInLoop() {
680
674
}
681
675
fftw_execute (fplan);
682
676
// calculation
683
- Real x1 = (static_cast <Real>(i)+0.5 )*Lx
684
- /static_cast <Real>(mesh_size.nx1 )
685
- +mesh_size.x1min ;
686
- Real x3 = (static_cast <Real>(k)+0.5 )*Lz
687
- /static_cast <Real>(mesh_size.nx3 )
688
- +mesh_size.x3min ;
689
677
Real amp_wave = std::sqrt (SQR (fft_data[abs_nwy][0 ])
690
- +SQR (fft_data[abs_nwy][1 ]))/ inv_half_nx2;
678
+ +SQR (fft_data[abs_nwy][1 ]))* inv_half_nx2;
691
679
ruser_mesh_data[3 ](0 ) += amp_wave*inv_nik;
692
680
}
693
681
}
0 commit comments