   Integer, Parameter :: N=35
   Real, parameter :: Miss=-99.
   Integer :: i, k, N_Spell  ! N_Spell Number of Spell
   Integer :: X(N), M(N), IMAX, IStart, IEnd
   Real :: X1(N), M1(N), IMAX1, Spells(N), N_Spell_1, I_Start(N), I_End(N)


   Open (1,file="data.txt",status="old")
   read (1,*) (X1(i),i=1,N)

   print "(50F3.0)",X1(1:N)
   Call NSpell_and_Leng (X1, N, M1, Imax1, Spells, N_Spell_1, I_Start, I_End, Miss)

   print*,"So dot: ",N_Spell_1
   print*,"Do dai dai nhat: ",Imax1
   print*,"M=",M1(1:Imax1)
   print "(50F4.0)",Spells(1:Int(N_Spell_1))
   print "(50F4.0)",(I_Start(i),I_End(i),i=1,Int(N_Spell_1))
  
   CONTAINS
   Include "/work/users/hmo/remoclic/Phuong/Dr_SEA_2020/Library/Mylibs/Sub_NSpell_and_Leng.f90"
   END
