An algorithm for calculating the shade created by greenhouse integrated photovoltaics