The Epic of Gilgamesh is a mythical poem written by the Bronze Age Mesopotamians. Rational historians and archaeologists believe that the story of Noah's flood was developed from the Gilgamesh flood myth and wasn't divinely inspired. Earlier versions to refer to a local river flood when the dead bodies filled the river like dragonflies. Later versions to refer to a greater flood when the dead bodies filled the sea like the spawn of fish. Clearly the story became more dramatic with retelling. In the Epic of Gilgamesh also the hero escapes in a boat.
.(...) first the creation of men, then the kings who ruled before the Great Flood, and finally the Flood itself, culminating in an offer of eternal life to the Sumerian Noah, Ziusudra. It is essentially the same story as the "Priestly document" that appears to have been a source of the canonical version of Genesis. . A tablet with the Gilgamesh Epic was found at Megiddo showing that the Hebrews may have had access to the story. Probably there were one or more devastating floods in Mesopotamia and the flood story derives from that.