Hello,
r_pot gives the value of the averaged potential at the rightmost side of the interface, e.g., at Z = 400,200,80 Ang of Fig.6 in PRB 93 155302 (2016).
In fact, few lines later in the script you can see that the Schottky barrier at the interface is evaluated as:
schottky = max(av_pot-r_pot)
Regards,
Daniele.