Solar Magnetism and Atmospheric Dynamics