Field-regulated switching of the magnetization of Co-porphyrin on graphene