subroutine print_c6(iunit)
integer, intent(in) :: iunit
integer :: ipair, ioffset, icn
if (.not.allocated(reference_c6)) call copy_c6(reference_c6)
do ipair = 1, max_elem*(1+max_elem)/2, 95
write(iunit, '(3x,"c6ab(:, :, ",i0,":",i0,") = reshape([ &")') &
& ipair, ipair+94
do ioffset = 0, 94
do icn = 1, 5
if (icn.eq.5 .and. ioffset.eq.94) then
write(iunit, '(6x,"&",4(f10.4,"_wp,"),f10.4,"_wp],&")') &
& reference_c6(:, icn, ipair+ioffset)
write(iunit, '(6x,"&",4x,"[max_ref, max_ref, 95])",/)')
else
write(iunit, '(6x,"&",5(f10.4,"_wp,"),1x,"&")') &
& reference_c6(:, icn, ipair+ioffset)
end if
end do
end do
end do
end subroutine print_c6