the clang thing maybe wasn't the problem, trying with explicit resizing of valarrays before assignment