adjust some matrices to be allocatable, as requird