Dev

fixes to scalable to make it work with adjoint derivatives.