1.013*10^5 N / M^2 is atmospheric pressure (101 kPa)
1000 kg / M^3 is the density of water 1 M^3 = 1000 liters
9.8 M / S^2 is the gravitational acceleration at the surface of the earth
40 M is the height from which the water falls
So the first term (minus the 4 degree celsius) is the energy...