Index: .gitignore
===================================================================
--- .gitignore	(revision df4dc86e6a7ca1d5dd8961a1f3a5f0f54d3f8e37)
+++ .gitignore	(revision 946cdc8e3a248b1d6d56a371c9aef64f499bced8)
@@ -1,4 +1,5 @@
 /build/
 /dist/
+/*.csv
 *.pyc
 *.cl
Index: sasmodels/kernelcl.py
===================================================================
--- sasmodels/kernelcl.py	(revision 87fce00c768607daaeafbbd67ca19eb27459bc2e)
+++ sasmodels/kernelcl.py	(revision da32ec3c8f278d6e8b397d2dc433724bdd4b0d2f)
@@ -30,7 +30,14 @@
 try:
     import pyopencl as cl
-except RuntimeError,exc:
+except ImportError,exc:
     warnings.warn(str(exc))
     raise RuntimeError("OpenCL not available")
+
+try:
+    context = cl.create_some_context(interactive=False)
+    del context
+except cl.RuntimeError, exc:
+    warnings.warn(str(exc))
+    raise RuntimeError("OpenCl not available")
 
 from pyopencl import mem_flags as mf
Index: sasmodels/kerneldll.py
===================================================================
--- sasmodels/kerneldll.py	(revision 87fce00c768607daaeafbbd67ca19eb27459bc2e)
+++ sasmodels/kerneldll.py	(revision afb2c7807a7e3f42111b09c19299e1e75edcf0a5)
@@ -24,5 +24,6 @@
     #COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s"
     #COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /openmp /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s"
-    COMPILE = "gcc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm"
+    #COMPILE = "gcc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm"
+    COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %(source)s -o %(output)s -lm"
 else:
     COMPILE = "cc -shared -fPIC -std=c99 -fopenmp -O2 -Wall %(source)s -o %(output)s -lm"
Index: sasmodels/models/fcc.c
===================================================================
--- sasmodels/models/fcc.c	(revision 3271e207340eb2fd5f01b1d8ba963ab4fe9ede8c)
+++ sasmodels/models/fcc.c	(revision e7b3d7b015b4e57d299b8d962e6f11825c0bad69)
@@ -5,10 +5,10 @@
     double theta, double phi, double psi);
 
-double _BCC_Integrand(double q, double dnn, double d_factor, double theta, double phi);
-double _BCCeval(double Theta, double Phi, double temp1, double temp3);
+double _FCC_Integrand(double q, double dnn, double d_factor, double theta, double phi);
+double _FCCeval(double Theta, double Phi, double temp1, double temp3);
 double _sphereform(double q, double radius, double sld, double solvent_sld);
 
 
-double _BCC_Integrand(double q, double dnn, double d_factor, double theta, double phi) {
+double _FCC_Integrand(double q, double dnn, double d_factor, double theta, double phi) {
 
 	const double Da = d_factor*dnn;
@@ -16,9 +16,9 @@
 	const double temp3 = q*dnn;
 
-	double retVal = _BCCeval(theta,phi,temp1,temp3)/(4.0*M_PI);
+	double retVal = _FCCeval(theta,phi,temp1,temp3)/(4.0*M_PI);
 	return(retVal);
 }
 
-double _BCCeval(double Theta, double Phi, double temp1, double temp3) {
+double _FCCeval(double Theta, double Phi, double temp1, double temp3) {
 
 	double temp6,temp7,temp8,temp9,temp10;
@@ -26,9 +26,9 @@
 
 	temp6 = sin(Theta);
-	temp7 = sin(Theta)*cos(Phi)+sin(Theta)*sin(Phi)+cos(Theta);
-	temp8 = -1.0*sin(Theta)*cos(Phi)-sin(Theta)*sin(Phi)+cos(Theta);
-	temp9 = -1.0*sin(Theta)*cos(Phi)+sin(Theta)*sin(Phi)-cos(Theta);
+	temp7 = sin(Theta)*sin(Phi)+cos(Theta);
+	temp8 = -1.0*sin(Theta)*cos(Phi)+cos(Theta);
+	temp9 = -1.0*sin(Theta)*cos(Phi)+sin(Theta)*sin(Phi);
 	temp10 = exp((-1.0/8.0)*temp1*((temp7*temp7)+(temp8*temp8)+(temp9*temp9)));
-	result = pow(1.0-(temp10*temp10),3)*temp6/((1.0-2.0*temp10*cos(0.5*temp3*(temp7))+(temp10*temp10))*(1.0-2.0*temp10*cos(0.5*temp3*(temp8))+(temp10*temp10))*(1.0-2.0*temp10*cos(0.5*temp3*(temp9))+(temp10*temp10)));
+	result = pow((1.0-(temp10*temp10)),3)*temp6/((1.0-2.0*temp10*cos(0.5*temp3*(temp7))+(temp10*temp10))*(1.0-2.0*temp10*cos(0.5*temp3*(temp8))+(temp10*temp10))*(1.0-2.0*temp10*cos(0.5*temp3*(temp9))+(temp10*temp10)));
 
 	return (result);
@@ -54,6 +54,6 @@
 
 	//Volume fraction calculated from lattice symmetry and sphere radius
-	const double s1 = dnn/sqrt(0.75);
-	const double latticescale = 2.0*(4.0/3.0)*M_PI*(radius*radius*radius)/(s1*s1*s1);
+	const double s1 = dnn*sqrt(2.0);
+	const double latticescale = 4.0*(4.0/3.0)*M_PI*(radius*radius*radius)/(s1*s1*s1);
 
     const double va = 0.0;
@@ -71,5 +71,5 @@
 			//20 gauss points for the inner integral
 			double ztheta = ( Gauss150Z[j]*(vbj-vaj) + vaj + vbj )/2.0;		//the inner dummy is theta
-			double yyy = Gauss150Wt[j] * _BCC_Integrand(q,dnn,d_factor,ztheta,zphi);
+			double yyy = Gauss150Wt[j] * _FCC_Integrand(q,dnn,d_factor,ztheta,zphi);
 			summj += yyy;
 		}
@@ -140,13 +140,13 @@
     // The following test should always pass
     if (fabs(cos_val_b3)>1.0) {
-      //printf("bcc_ana_2D: Unexpected error: cos()>1\n");
+      //printf("FCC_ana_2D: Unexpected error: cos()>1\n");
       cos_val_b3 = 1.0;
     }
     if (fabs(cos_val_b2)>1.0) {
-      //printf("bcc_ana_2D: Unexpected error: cos()>1\n");
+      //printf("FCC_ana_2D: Unexpected error: cos()>1\n");
       cos_val_b2 = 1.0;
     }
     if (fabs(cos_val_b1)>1.0) {
-      //printf("bcc_ana_2D: Unexpected error: cos()>1\n");
+      //printf("FCC_ana_2D: Unexpected error: cos()>1\n");
       cos_val_b1 = 1.0;
     }
Index: sasmodels/models/fcc.py
===================================================================
--- sasmodels/models/fcc.py	(revision 3271e207340eb2fd5f01b1d8ba963ab4fe9ede8c)
+++ sasmodels/models/fcc.py	(revision e7b3d7b015b4e57d299b8d962e6f11825c0bad69)
@@ -1,7 +1,7 @@
-#bcc paracrystal model
+#fcc paracrystal model
 #note model title and parameter table are automatically inserted
 #note - calculation requires double precision
-"""
-Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
+r"""
+Calculates the scattering from a **face-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
 are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is
 assumed to be isotropic and characterized by a Gaussian distribution.
@@ -14,14 +14,14 @@
 The scattering intensity *I(q)* is calculated as
 
-.. image:: img/image167.jpg
+.. image:: img/image158.jpg
 
 where *scale* is the volume fraction of spheres, *Vp* is the volume of the primary particle, *V(lattice)* is a volume
 correction for the crystal structure, *P(q)* is the form factor of the sphere (normalized), and *Z(q)* is the
-paracrystalline structure factor for a body-centered cubic structure.
+paracrystalline structure factor for a face-centered cubic structure.
 
-Equation (1) of the 1990 reference is used to calculate *Z(q)*, using equations (29)-(31) from the 1987 paper for
+Equation (1) of the 1990 reference is used to calculate *Z(q)*, using equations (23)-(25) from the 1987 paper for
 *Z1*\ , *Z2*\ , and *Z3*\ .
 
-The lattice correction (the occupied volume of the lattice) for a body-centered cubic structure of particles of radius
+The lattice correction (the occupied volume of the lattice) for a face-centered cubic structure of particles of radius
 *R* and nearest neighbor separation *D* is
 
@@ -34,7 +34,7 @@
 where *g* is a fractional distortion based on the nearest neighbor distance.
 
-The body-centered cubic lattice is
+The face-centered cubic lattice is
 
-.. image:: img/image168.jpg
+.. image:: img/image161.jpg
 
 For a crystal, diffraction peaks appear at reduced q-values given by
@@ -42,8 +42,8 @@
 .. image:: img/image162.jpg
 
-where for a body-centered cubic lattice, only reflections where (\ *h* + *k* + *l*\ ) = even are allowed and
-reflections where (\ *h* + *k* + *l*\ ) = odd are forbidden. Thus the peak positions correspond to (just the first 5)
+where for a face-centered cubic lattice *h*\ , *k*\ , *l* all odd or all even are allowed and reflections where
+*h*\ , *k*\ , *l* are mixed odd/even are forbidden. Thus the peak positions correspond to (just the first 5)
 
-.. image:: img/image169.jpg
+.. image:: img/image163.jpg
 
 **NB: The calculation of** *Z(q)* **is a double numerical integral that must be carried out with a high density of**
@@ -52,8 +52,8 @@
 makes a triple integral. Very, very slow. Go get lunch!
 
-This example dataset is produced using 200 data points, *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above
+This example dataset is produced using 200 data points, *qmin* = 0.01 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above
 default values.
 
-.. image:: img/image170.jpg
+.. image:: img/image164.jpg
 
 *Figure. 1D plot in the linear scale using the default values (w/200 data point).*
@@ -65,5 +65,5 @@
 .. image:: img/image165.gif
 
-.. image:: img/image171.jpg
+.. image:: img/image166.jpg
 
 *Figure. 2D plot using the default values (w/200X200 pixels).*
@@ -80,8 +80,8 @@
 from numpy import pi, inf
 
-name = "BCCparacrystal"
-title = "Body-centred cubic lattic with paracrystalline distortion"
+name = "fcc_paracrystal"
+title = "Face-centred cubic lattic with paracrystalline distortion"
 description = """
-    Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
+    Calculates the scattering from a **face-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
     are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is
     assumed to be isotropic and characterized by a Gaussian distribution.
@@ -100,5 +100,5 @@
     ]
 
-source = [ "lib/J1.c", "lib/gauss150.c", "bcc.c" ]
+source = [ "lib/J1.c", "lib/gauss150.c", "fcc.c" ]
 
 def ER(radius, length):
@@ -119,5 +119,5 @@
 # For testing against the old sasview models, include the converted parameter
 # names and the target sasview model name.
-oldname='BCCrystalModel'
+oldname='FCCrystalModel'
 oldpars=dict(sld='sldSph',
              solvent_sld='sldSolv')
