def METHOD_NAME(
    self, cube, zsurf=None, sampling="nearest", mask=True, deadtraces=True
):
    """
    This is the new version, optimised for the case where the surface has exact same
    topology as the cube. This should both simplify and speed up calculations
    From xtgeo 2.9
    """
    logger.info("Slice cube algorithm 2 with sampling %s", sampling)
    if zsurf is not None:
        other = zsurf
    else:
        other = self.copy()
    if not self.compare_topology(other, strict=False):
        raise RuntimeError("Topology of maps differ. Stop!")
    optmask = 0
    if mask:
        optmask = 1
    if deadtraces:
        # set dead traces to cxtgeo UNDEF -> special treatment in the C code
        olddead = cube.values_dead_traces(xtgeo.UNDEF)
    optnearest = 1
    if sampling == "trilinear":
        optnearest = 0
    # cube and surf shall share same topology, e.g. cube.col == surf.ncol etc
    # print(self.values.mask)
    istat = _cxtgeo.surf_slice_cube_v3(
        cube.ncol,
        cube.nrow,
        cube.nlay,
        cube.zori,
        cube.zinc,
        cube.values,
        other.values.data,
        self.values.data,
        self.values.mask,
        optnearest,
        optmask,
    )
    if istat != 0:
        logger.warning("Problem, ISTAT = %s", istat)
    if deadtraces:
        cube.values_dead_traces(olddead)  # reset value for dead traces
    return istat