subroutine write_sdf(self, unit, energy, gnorm)
class(structure_type), intent(in) :: self
integer, intent(in) :: unit
real(wp), intent(in), optional :: energy
real(wp), intent(in), optional :: gnorm
!type(tb_buffer) :: sd_values
character(len=:), allocatable :: line
character(len=*), parameter :: sd_format = &
& '("> <", a, ">", /, f20.12, /)'
call write_molfile(self, unit)
! sd_values = self%info
! call sd_values%reset
! do while(sd_values%next())
! call sd_values%getline(line)
! write(unit, '(a)') line
! enddo
if (present(energy)) then
write(unit, sd_format) "total energy / Eh", energy
endif
if (present(gnorm)) then
write(unit, sd_format) "gradient norm / Eh/a0", gnorm
endif
write(unit, '("$$$$")')
end subroutine write_sdf