calc_total_emissions function

Calculate total emissions (robust and boundary-aware)