Monte Carlo analysis of a Schottky diode with an automatic space-variable charge algorithm