function permitted=check(h,k,l)
permitted=0;
% check for systematic extinstions of Space Group 227
% besides, it does not allow the reflection 000 
    
if h==0
    if and(and(mod(k+l,4)==0,mod(k,2)==0),mod(l,2)==0) ; 
      permitted=1;
    end;
else
    if h==k
      if mod(h+l,2)==0 ;
        permitted=1; 
      end;
    else 
      if and(k==0,l==0)
        if mod(h,4)==0
          permitted=1;
        end;
      else     
       if and(and(mod(h+k,2)==0,mod(h+l,2)==0),mod(k+l,2)==0) ; % hkl is an extinction in Si lattice and hkl has reduced Miller indices
         permitted=1;
       end; 
      end;
    end;
end;

if and(and(h==0,k==0),l==0)
    permitted=0;
end;

