The writer speaks of God as if he were a huge rock that would provide protection from enemy attack.
To "go mourning" is to perform customs related to being very sad.