check_dimensions function

Check dimensions of the parameters