Flip Y and Z dz arrays when writing