function NaClPeakIntensity

Lambda = 1.54056;
a = 5.64;

h = 1;
k = 1;
l = 1;
for h=1:2
    for k=0:2
        for l=0:2
            if (h == k & k == l) 
                M = 8;
            end
            if (k == 0 || l == 0) 
                M = 12; 
            end
            if (k == 0 && l == 0) 
                M = 6; 
            end
            
nfNa = 1 + real(exp(-i*2*pi*(h/2+k/2))) + real(exp(-i*2*pi*(h/2+l/2))) + real(exp(-i*2*pi*(k/2+l/2)));
nfCl = real(exp(-i*2*pi*(h/2+k/2+l/2))) + real(exp(-i*2*pi*(h/2))) + real(exp(-i*2*pi*(k/2))) + real(exp(-i*2*pi*(l/2)));
d = a/sqrt(h^2+k^2+l^2);
Theta = asin(Lambda/(2*d));
fNa = 11*sin(Theta)/Lambda;
fCl = 17*sin(Theta)/Lambda;
LP = (1.0  + (cos(2*Theta))^2)/(8*cos(Theta)*(sin(Theta))^2);
S = nfNa*fNa + nfCl*fCl;
if (abs(nfNa) > 0 || abs(nfCl) > 0) 
fprintf(1,'%d %d %d %d %d %.2f %.2f %.2f %.2f %.2f %.2f %d %.2f %.2f\n', h, k, l, nfNa, nfCl, d, Lambda/(2*d), 180*Theta/pi, fNa, fCl, LP, M, S, S*S*M*LP);
end
end
end
end