Variational theory for the total scalar curvature functional for riemannian metrics and related topics