Melting of atomic layers in carbon nanotubes