
   Integer, Parameter :: N=33
   Integer :: i, k, N_Spell 
   Integer :: X(N)
   Real :: X1(N), M1(N), IMAX1, Spells(N), N_Spell_1, I_Start(N), I_End(N), Miss
   Character (Len=255) :: St

   St="1 0 0 1 1 0 1 1 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 0 1"

   read (St,*) (X(i),i=1,N)
   print "(10I3)", (X(i),i=1,N)
   X1(:) = X(:)
   
   Call NSpell_and_Leng (X1, N, M1, Imax1, Spells, N_Spell_1, I_Start, I_End, -99.)

   print "(10I5)", (Int(M1(i)),i=1,Int(Imax1))
   print*
   print "(10I5)", (i,i=1,Int(N_Spell_1))
   print "(10I5)", (Int(Spells(i)),i=1,Int(N_Spell_1))
   print*
   print "(10I5)", (Int(I_Start(i)),i=1,Int(N_Spell_1))
   print "(10I5)", (Int(I_End(i)),i=1,Int(N_Spell_1))

   CONTAINS
   Include "/home/tanpv/Mylibs/Sub_NSpell_and_Leng.f90"

   END
