Alfven waves in inhomogeneous magnetic fields