We have developed a computer program to calculate geomagnetic field changes due to the piezomagnetic effect, which is caused by hydrothermal pressurization. Our method was applied to actual volcanomagnetic field variations observed at the Merapi Volcano in Indonesia. As a result, our model reasonably explained the observed pattern of variations.