Fortran code ported