Another interpretation: For seven days the Holy One, blessed be He, mourned over His world before He brought the flood. What is the reason? "And it grieved Him at His heart" (Genesis 6:6), and grief means nothing other than mourning, as you say, "The king was grieved over his son." Rabbi Tzadok says: On the tenth of Marcheshvan he entered the ark, and on the seventeenth of it the waters of the flood came down from heaven, which are male waters, and the waters of the deep rose up, which are female waters, and these joined with those and grew mighty to destroy the world, as it is said, "And the waters prevailed" (Genesis 7:19). And all that existed was wiped out except Noah, as it is said, "And only Noah remained," and except Og king of Bashan, for he sat himself upon one beam beneath the ladder of the ark and swore to Noah and to his sons that he would be a perpetual servant to them. What did Noah do? He bored a single hole in the ark and would hand him his food every single day, and so he too survived, as it is said, "For only Og king of Bashan remained of the remnant of the Rephaim" (Deuteronomy 3:11). And except the Land of Israel, upon which the waters of the flood did not come down, as it is said, "Son of man, [say to her,] you are a land that is not cleansed, [it is] not rained upon in the day of indignation" (Ezekiel 22:24).
God's Grief Before the Flood and the Survival of Og
Yalkut Shimoni on Torah 56:6
דָּבָר אַחֵר, שִׁבְעַת יָמִים נִתְאַבֵּל הַקָּדוֹשׁ בָּרוּךְ הוּא עַל עוֹלָמוֹ (קוֹדֶם) עַד שֶׁלֹּא הֵבִיא הַמַּבּוּל מַה טַעַם (בראשית ו, ו) "וַיִּתְעַצֵּב אֶל לִבּוֹ", וְאֵין עֲצֵבָה אֶלָּא אֵבֶל, כְּהָאִיךְ דְאַתְּ אַמְרֵת "נֶעֱצַב הַמֶּלֶךְ עַל בְּנוֹ". רַבִּי צָדוֹק אוֹמֵר, בַּעֲשָׂרָה בְּמַרְחֶשְׁוָן נִכְנַס לַתֵּבָה וּבְשִׁבְעָה עָשָׁר בּוֹ יָרְדוּ מֵי הַמַּבּוּל מִן הַשָּׁמַיִם שֶׁהֵן מַיִם זְכָרִים, וְעָלוּ מֵי הַתְּהוֹמוֹת שֶׁהֵן מַיִם נְקֵבוֹת, וְנִצְמְדוּ אֵלּוּ עִם אֵלּוּ וְגָבְרוּ לְהַחֲרִיב אֶת הָעוֹלָם, שֶׁנֶּאֱמַר (להלן פסוק יט) "וְהַמַּיִם גָּבְרוּ" וְנִמְחוּ כָּל הַיְּקוּמִים חוּץ מִנֹּחַ שֶׁנֶּאֱמַר "וַיִּשָּׁאֶר אַךְ נֹחַ" וְחוּץ מִעוֹג מֶלֶךְ הַבָּשָׁן, כִּי יָשַׁב לוֹ עַל עֵץ אֶחָד תַּחַת סוּלָּמוֹ שֶׁל תֵּבָה וְנִשְׁבַּע לְנֹחַ וּלְבָנָיו שֶׁיִּהְיֶה לָהֶם עֶבֶד עוֹלָם, מֶה עָשָׂה נֹחַ, נָקַב חוֹר אֶחָד בַּתֵּבָה וְהָיָה מוֹשִׁיט לוֹ מְזוֹנוֹ בְּכָל יוֹם וָיוֹם, וְנִשְׁאַר גַּם הוּא, שֶׁנֶּאֱמַר (דברים ג, יא) "כִּי רַק עוֹג מֶלֶךְ הַבָּשָׁן נִשְאַר מִיֶּתֶר הָרְפָאִים", וְחוּץ מֵאֶרֶץ יִשְׂרָאֵל שֶׁלֹּא יָרְדוּ עָלֶיהָ מֵי מַבּוּל שֶׁנֶּאֱמַר (יחזקאל כב, כד) "בֶּן אָדָם [אֶמָר לָהּ] אַתְּ אֶרֶץ לֹא מְטֹהָרָה [הִיא] (וְ)לֹא גֻּשְׁמָהּ בְּיוֹם זָעַם".