A hybrid adjoint approach for systems of arbitrarily complex partial differential equations