Fortran implementation
WS: first check in of Fortran code