A hierarchical max-infinitely divisible spatial model for extreme precipitation