Fortran sparse matrix generator