anchor.diff:  else
     strNf=strNi
   endif
  +
  +! Modifications made by GLWH 03/05/2014.
  +!
  +! If the parent cell for a cluster expansion contains "spectator
  +! atoms" (sites where the same atom always appears---no
  +! configurational degrees of freedom) then we need to add these to the
  +! poscar files (but as the code is written now, spectators are not
  +! explicitly included in the CE input and output). The short-term
  +! workaround (watch it last for years. Argh) is to add the spectators
  +! by hand using a "spectators.in" file. 
  +
  +! This file contains on line 1 a list of how many atoms (spectators
  +! only) of each type are in the file (just like line 6 in the poscar
  +! file). Each line after that lists the position of the spectator
  +! atoms (in direct coordinates!) in blocks of the same type
  +! (consistent with line 1 of the file).
  +inquire(file="spectators.in", exist=file_exists)
  +if (file_exists) then ! figure out how many spectators there are
  +   open(14,file="spectators.in",action="read")
  +   read(14,'(a80)') specAtoms
  +   nSpec = 0
  +   nType = 0
  +   dummy = specAtoms
  +   do
  +      read(dummy,*) iAt
  +      nSpec = iAt + nSpec
  +      dummy = adjustl(dummy(index(dummy," "):)) ! Throw away the number we just read in
  +      nType = nType + 1
  +      if (dummy == "") exit
  +   end do
  +   ! Now figure out how many of each type there are
  +   allocate(nSpecType(nType))
  +   dummy = specAtoms
  +   do iAt = 1, nType
  +      print *, iAt,"iAT","ntype",nType
  +      read(dummy,*) jAt
  +      nSpecType(iAt) = jAt
  +      dummy = adjustl(dummy(index(dummy," "):)) ! Throw away the number we just read in
  +   end do
  +end if
   
   !call read_nth_line_from_enumlist()
   open(11,file=fname,status='old',iostat=ioerr)
  
positive.code:          endif
        enddo
     enddo
     close(12);
     deallocate(spin,x,gIndx,aBas)
  enddo ! structure loop
  close(11)
  close(13)
  END PROGRAM makeStr
  
negative.code: implicit none
  character(80) fname, title, strname, strNstring
  character(maxLabLength) :: labeling
  integer ioerr, iline, ic, i, ilab, pgOps, nD, hnfN, iAt, jAt, iSpec, nSpec
  integer k, strN, istrN, strNi, strNf, sizeN, n, diag(3), a,b,c,d,e,f, nType
  integer HNF(3,3), L(3,3), hnf_degen, lab_degen, tot_degen, cSpec
  integer, pointer :: gIndx(:)
  real(dp) :: p(3,3), sLV(3,3), eps, v(3), Ainv(3,3), sLVinv(3,3), shift(3)
  real(dp), pointer :: aBas(:,:), dvec(:,:) ! pointer so it can be passed in to a routine
  integer, pointer :: nSpecType(:) 
  character(1) bulksurf
  character(80) dummy, specAtoms 
  integer, pointer :: spin(:) ! Occupation variable of the positions
  real(dp), pointer :: x(:) ! Concentration of each component
  logical :: file_exists
  
  open(13,file="readcheck_makestr.out")
  write(13,'(5(/),"This file echoes the input for the makestr.x program and")')
  