The fortran code given in the book by griffiths and Smith "Programming the finite element method " 5th edition. As after defining the free surface and calculating pore pressure as product of height below free surface and unit weight of water, the factor of safety obtained is not same as Bishop Simplified Methos