"And God spoke unto Noah, saying: Go forth from the ark" (Genesis 8:15-16). Let our master instruct us: What is the law concerning placing tasteless spittle upon the eye on the Sabbath? Rabbi Hiyya bar Abba said: It is forbidden to place tasteless spittle upon the eye on the Sabbath, for this is like one who heals on the Sabbath. Come and see that there is no affliction in the world that has no cure. And what is the cure for the evil inclination? Repentance. Rabbi Judah bar Shalom said in the name of Rabbi Eliezer: Three things annul a harsh decree, and these are they: prayer, repentance, and charity. Rabbi Huna son of Rabbi Yose said: Also a change of name and good deeds. Therefore the Holy One, blessed be He, was hoping for the generation of the Flood, that perhaps they would repent and He would receive them. And since they did not repent, He wiped them away with water, as it is said, "And He wiped out every living thing" (Genesis 7:23). He left over Noah and his sons in the ark. When the waters rested, Noah needed to go out from the ark. But Noah said: I entered by permission [of the Holy One, blessed be He], as it is said, "Come, you" etc. (Genesis 7:1), and now shall I go out without permission? The Holy One, blessed be He, said to him: Permission you seek? Here is permission for you, [from what we have read on the matter:] "Go forth from the ark."
Noah Asks Permission to Leave the Ark and the Cure for the Evil Inclination
Midrash Tanchuma Buber, Noach 13:1
וידבר אלהים אל נח [לאמר], צא מן התבה (בראשית ח טו טז), (שנו רבותינו) [ילמדנו רבינו] מהו ליתן רוק תפל על העין בשבת, אמר ר' חייא בר אבא אסור ליתן רוק תפל על גב העין בשבת, שהוא כמרפא בשבת, בוא וראה שאין מכה בעולם שאין לה רפואה, ומה רפואתו של יצר הרע, תשובה, אמר ר' יהודה בר שלום בשם ר' אליעזר שלשה דברים מבטלין גזירה קשה, אלו הן, תפלה תשובה וצדקה, אמר ר' הונא בר' יוסי אף שינוי השם, ומעשים טובים, לפיכך היה הקב"ה מקוה לדור המבול שמא יעשו תשובה ויקבלם, וכיון שלא עשו תשובה, מיחה אותם במים, שנאמר וימח את כל היקום (שם ז כג), שייר נח ובניו בתבה, כיון שנחו המים, היה נח צריך לצאת מן התבה, אלא אמר נח ברשות [הקב"ה] נכנסתי, שנאמר בא אתה וגו' (שם שם א), ועכשיו אצא שלא ברשות, א"ל הקב"ה רשות אתה מבקש, הרי לך רשות, (שנאמר) [ממה שקרינו בענין] צא מן התבה.