Rates of primary production, respiration and grazing in accordance with the balances of energy and entropy