subroutine chop_string (long_string, lines, nl) use cesrv_struct use cesrv_interface implicit none character(*) long_string character(*) lines(:) integer nl, i, i_max do i=0,3 i_max = min(len(long_string), i*99+99) lines(nl+1) = long_string(i*99+1:i_max) if (len_trim(lines(nl+1)) == 0) return nl = nl + 1 enddo end subroutine