Both Caspar Friedrich and JMW Turner are considered to be Romantic era artists. They and others believed that their art should simultaneouly illustrate the natural world in a realistic way and also instruct the viewer that he or she is looking at God's creation. Friedrich was once quoted as saying that an artist should paint not only what is in front of him, but also what is within him.
In order to arouse feeling of the sublime in the viewer, Romantic artists typically chose to paint scenes which, while realistic, also demonstrated extremes, as a way to express nature's, and by extension God's, power. The images, while beautiful, are not necessarily pretty. Often storms were a feature of these paintings; sometimes in the foreground, womtimes in the distance, somtimes implied by a view of an aftermath. They sought to engender feelings of awe or impending doom in the viewer, intending to emotionally involve the viewer in the painting, as opposed to allowing the viewer to merely observe the painting.