First you drill. Then if you find oil, you go into production. Then if you sell the oil you calculate your profit. Then, if there is a profit, you might pay a dividend. This process will probably take several years so don't start spending your dividends yet.
You don't calculate dividends. The company does. They take the revenue and subtract all expenses + capital expansion + reserves for unanticipated future costs then they pick a comfortable number they can live with and as more revenue comes into the company they adjust upward, also if less comes in the adjustment is downward. Not usual to go down though.