replaced setg by direct fortran call