CALCULATE DISCHARGE