mirror of
https://github.com/cosmo-sims/monofonIC.git
synced 2024-09-19 17:03:45 +02:00
Bug fix: Nyquist modes set to zero for case where the mode power would otherwise be set to the mean power, instead of NaN
This commit is contained in:
parent
ef8cc6d863
commit
af2c77fcd8
1 changed files with 3 additions and 1 deletions
4
external/panphasia_ho/pan_mpi_routines.c
vendored
4
external/panphasia_ho/pan_mpi_routines.c
vendored
|
@ -441,13 +441,15 @@ int m;
|
||||||
ky = (iy > nfft_dim/2) ? iy-nfft_dim : iy;
|
ky = (iy > nfft_dim/2) ? iy-nfft_dim : iy;
|
||||||
kz = (iz > nfft_dim/2) ? iz-nfft_dim : iz;
|
kz = (iz > nfft_dim/2) ? iz-nfft_dim : iz;
|
||||||
ksquared = kx*kx + ky*ky + kz*kz;
|
ksquared = kx*kx + ky*ky + kz*kz;
|
||||||
|
if ( (kx!=nfft_dim/2)&&(ky!=nfft_dim/2)&&(kz!=nfft_dim/2)){ //Omit Nyquist modes
|
||||||
|
|
||||||
if ((ksquared<=descriptor_kk_limit)&&(ksquared!=0)){
|
if ((ksquared<=descriptor_kk_limit)&&(ksquared!=0)){
|
||||||
index1 = ix*N0_fourier_grid*(N0_fourier_grid/2+1) + iy*(N0_fourier_grid/2+1) + iz;
|
index1 = ix*N0_fourier_grid*(N0_fourier_grid/2+1) + iy*(N0_fourier_grid/2+1) + iz;
|
||||||
weight = cabs(return_field[index1]);
|
weight = cabs(return_field[index1]);
|
||||||
return_field[index1] /= weight;
|
return_field[index1] /= weight;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
//printf("Reached here 12!\n");
|
//printf("Reached here 12!\n");
|
||||||
|
|
Loading…
Reference in a new issue