def AdvectionRK4_3D(particle, fieldset, time):
    """Advection of particles using fourth-order Runge-Kutta integration including vertical velocity.

    Function needs to be converted to Kernel object before execution"""
    u1, v1, w1 = fieldset.UVW[time, particle.depth, particle.lat, particle.lon]
    lon1 = particle.lon + u1 * 0.5 * particle.dt
    lat1 = particle.lat + v1 * 0.5 * particle.dt
    dep1 = particle.depth + w1 * 0.5 * particle.dt
    u2, v2, w2 = fieldset.UVW[time + 0.5 * particle.dt, dep1, lat1, lon1]
    lon2 = particle.lon + u2 * 0.5 * particle.dt
    lat2 = particle.lat + v2 * 0.5 * particle.dt
    dep2 = particle.depth + w2 * 0.5 * particle.dt
    u3, v3, w3 = fieldset.UVW[time + 0.5 * particle.dt, dep2, lat2, lon2]
    lon3 = particle.lon + u3 * particle.dt
    lat3 = particle.lat + v3 * particle.dt
    dep3 = particle.depth + w3 * particle.dt
    u4, v4, w4 = fieldset.UVW[time + particle.dt, dep3, lat3, lon3]
    particle.lon += (u1 + 2 * u2 + 2 * u3 + u4) / 6.0 * particle.dt
    particle.lat += (v1 + 2 * v2 + 2 * v3 + v4) / 6.0 * particle.dt
    particle.depth += (w1 + 2 * w2 + 2 * w3 + w4) / 6.0 * particle.dt
