anchor.diff:                  end if
               end do
   
  +            ! nbasis/2 functions of this spin.
  +            ! all basis functions of this spin are even.
  +            ! Convert number, x, in range [1,nbasis/2] to even number in range
  +            ! [1,nbasis] using 2*x
               fac = 2
               shift = 0
               na = nbasis/2
  
positive.code:                 end if
              end do
  
              fac = 2
              shift = 1
              na = nbasis/2
  
negative.code:         select case(spin)
          case(-2)
              ! a must be down.
              ! Convert number, x, in range [1,nbasis/2] to odd number in range
              ! [1,nbasis] using 2*x-1
              fac = 2
              shift = 1
              na = nbasis/2
          case(0)
              ! a can be up or down.
              ! Convert number, x, in range [1,nbasis] to any number in range
              ! [1,nbasis] using simply x (for compatibility with spin=-2,2).
              fac = 1
              shift = 0
              na = nbasis
          case(2)
              ! a must be up.
              ! Convert number, x, in range [1,nbasis/2] to even number in range
              ! [1,nbasis] using 2*x
              fac = 2
              shift = 0
              na = nbasis/2
  