Specifying too much precision for the eigenvalues in ``getEs'' can cause the program to get stuck in a long loop. Rather, you should use a tolerance of about 1e-12, which is both sufficiently accurate and stable. You should specify this in ``getEs'' with a statement like
.
.
E[k]=zriddrp480(func_Schrodinger,E1,E2,TOL,0,Veff,r,dr,N);
.
.
with TOL defined in an appropriate #define statement.