Hierarchical Bayesian inversion of global variables and large-scale spatial fields