NSCF calculations should use the same FFT mesh as the one employed in the GS task
        (in principle, it's possible to interpolate inside Abinit but tests revealed some numerical noise
        Here we change the input file of the NSCF task to have the same FFT mesh.

def setup(self):
        """
        NSCF calculations should use the same FFT mesh as the one employed in the GS task
        (in principle, it's possible to interpolate inside Abinit but tests revealed some numerical noise
        Here we change the input file of the NSCF task to have the same FFT mesh.
        """
        for dep in self.deps:
            if "DEN" in dep.exts:
                parent_task = dep.node
                break
        else:
            raise RuntimeError("Cannot find parent node producing DEN file")

        with parent_task.open_gsr() as gsr:
            den_mesh = 3 * [None]
            den_mesh[0] = gsr.reader.read_dimvalue("number_of_grid_points_vector1")
            den_mesh[1] = gsr.reader.read_dimvalue("number_of_grid_points_vector2")
            den_mesh[2] = gsr.reader.read_dimvalue("number_of_grid_points_vector3")
            if self.ispaw:
                self.set_vars(ngfftdg=den_mesh)
            else:
                self.set_vars(ngfft=den_mesh)

        super().setup()