Some questions about the code of twobody.F90

what does if (lti) then
if (ltif2body(npot)) then
dUdl = dUdl + trm1r12
trm1 = trm1
elseif (ltib2body(npot)) then
dUdl = dUdl - trm1r12
trm1 = trm1
(1.0_dp - lambda)
mean? why all the potentials add this code? what does this design for any purpose?
I need revise the formula of the potential, how can I revise this part of code?

See your other post about TI. If you understand what thermodynamic integration is then you’ll see what this code does and why it applies to any potential selected by the user.