Subaru has a procedure for replacing the roof using welds and adhesive. The procedure can be found at:

The roof procedure is in section "7. Panel Replacement", more specifically "7-24. Roof Panel total replacement".

For short videos that show how to purchase and access the Subaru collision repair information, check out the Subaru OEM Information page.

Check out the I-CAR Collision Repair News article: Reading Subaru Repair Procedures: UPDATE