Modelling the radiative transfer in discontinuous canopies of asymmetric crowns. I. Model structure and algorithms