subroutine write_json_array(unit, array, indent)
integer, intent(in) :: unit
real(wp), intent(in) :: array(:)
character(len=:), allocatable, intent(in) :: indent
integer :: i
write(unit, '("[")', advance='no')
do i = 1, size(array)
if (allocated(indent)) write(unit, '(/,a)', advance='no') repeat(indent, 2)
write(unit, '(es23.16)', advance='no') array(i)
if (i /= size(array)) write(unit, '(",")', advance='no')
end do
if (allocated(indent)) write(unit, '(/,a)', advance='no') repeat(indent, 1)
write(unit, '("]")', advance='no')
end subroutine write_json_array