Custom parallelization of 1D real transform in z direction moved to a separate subroutine. TODO: parallelize y direction too.