Nonstationary Gaussian random fields with application to space and space-time modeling