Ecological succession among late palaeozoic and mesozoic tetrapods