how do temperature and pressure effect magma formation