(len=:),allocatable :: array(:) ! output array of tokens
    write(*,*)'INPUT LINE:['//LINE//']'
    write(*,'(80("="))')
    write(*,*)'typical call:'
    CALL split(line,array)
    write(*,'(i0," ==&gt; ",a)')(i,trim(array(i)),i=1,size(array))
    write(*,*)'SIZE:',SIZE(array)
    write(*,'(80("-"))')
    write(*,*)'custom list of delimiters (colon and vertical line):'
    CALL split(line,array,delimiters=':|',order='sequential',nulls='ignore')
    write(*,'(i0," ==&gt; ",a)')(i,trim(array(i)),i=1,size(ar