Calculation of oxygen isotope fractionation in magmatic rocks