Index: TrouNoir/TrouNoir.py
===================================================================
--- TrouNoir/TrouNoir.py	(revision 227)
+++ TrouNoir/TrouNoir.py	(revision 228)
@@ -285,7 +285,7 @@
   int q,raie;
 
   m=Mass;
-  rs=2.*m;
+  rs=2.e0f*m;
   ri=InternalRadius;
   re=ExternalRadius;
   tho=Angle;
@@ -295,21 +295,22 @@
   float bmx,db,b,h;
   float rp0,rpp,rps;
   float phi,phd;
-  int nh;
-  float zp=0.,fp=0.;
+  uint nh=0;
+  float zp=0.e0f,fp=0.e0f;
 
   // Autosize for image
-  bmx=1.25*re;
+  bmx=1.25e0f*re;
 
   h=4.e0f*PI/(float)TRACKPOINTS;
 
   // set origin as center of image
-  float x=(float)xi-(float)(sizex/2)+(float)5e-1f;
-  float y=(float)yi-(float)(sizey/2)+(float)5e-1f;
+  float x=(float)xi-(float)(sizex/2)+(float)5.e-1f;
+  float y=(float)yi-(float)(sizey/2)+(float)5.e-1f;
   // angle extracted from cylindric symmetry
   phi=atanp(x,y);
   phd=atanp(cos(phi)*sin(tho),cos(tho));
 
+
   float up,vp,pp,us,vs,ps;
 
   // impact parameter
@@ -317,11 +318,9 @@
   // step of impact parameter;
   db=bmx/(float)(sizex);
 
-  up=0.;
-  vp=1.;
-      
-  pp=0.;
-  nh=0;
+  up=0.e0f;
+  vp=1.e0f;
+  pp=0.e0f;
 
   rungekutta(&ps,&us,&vs,pp,up,vp,h,m,b);
 
@@ -336,20 +335,20 @@
      pp=ps;
      up=us;
      vp=vs;
-     rpp=rps;
      rungekutta(&ps,&us,&vs,pp,up,vp,h,m,b);
      rps=fabs(b/us);
      ExitOnImpact = ((fmod(pp,PI)<fmod(phd,PI))&&(fmod(ps,PI)>fmod(phd,PI)))&&(rps>=ri)&&(rps<=re)?1:0;       
 
-  } while ((rps>=rs)&&(rps<=rp0)&&(ExitOnImpact==0));
+  } while ((rps>=rs)&&(rps<=rp0)&&(ExitOnImpact==0)&&(nh<TRACKPOINTS));
 
+
   if (ExitOnImpact==1) {
-     impact(phi,rpp,b,tho,m,&zp,&fp,q,db,h,raie);
+     impact(phi,rps,b,tho,m,&zp,&fp,q,db,h,raie);
   }
   else
   {
-     zp=0.;
-     fp=0.;
+     zp=0.e0f;
+     fp=0.e0f;
   }
 
   barrier(CLK_GLOBAL_MEM_FENCE);
@@ -1625,17 +1624,28 @@
     
     #    BlackHoleCL = cl.Program(ctx,KERNEL_CODE.substitute(kernel_params)).build()
 
-    BuildOptions="-cl-mad-enable -DPHYSICS=%i -DSETTRACKPOINTS=%i " % (PhysicsList[Physics],InputCL['TrackPoints'])
+    BuildOptions="-DPHYSICS=%i -DSETTRACKPOINTS=%i " % (PhysicsList[Physics],InputCL['TrackPoints'])
 
+    print('My Platform is ',platform.name)
+    
+    if 'Intel' in platform.name or 'Experimental' in platform.name or 'Clover' in platform.name or 'Portable' in platform.name :
+        print('No extra options for Intel and Clover!')
+    else:
+        BuildOptions = BuildOptions+" -cl-mad-enable"
+
+    print(BuildOptions)
+    
     BlackHoleCL = cl.Program(ctx,BlobOpenCL).build(options = BuildOptions)
     
     # Je recupere les flag possibles pour les buffers
     mf = cl.mem_flags
 
-    TrajectoriesCL = cl.Buffer(ctx, mf.WRITE_ONLY | mf.COPY_HOST_PTR, hostbuf=Trajectories)
+    if Method=='TrajectoPixel' or Method=='TrajectoCircle':
+        TrajectoriesCL = cl.Buffer(ctx, mf.WRITE_ONLY | mf.COPY_HOST_PTR, hostbuf=Trajectories) 
+        IdLastCL = cl.Buffer(ctx, mf.WRITE_ONLY | mf.COPY_HOST_PTR, hostbuf=IdLast)
+
     zImageCL = cl.Buffer(ctx, mf.WRITE_ONLY | mf.COPY_HOST_PTR, hostbuf=zImage)
     fImageCL = cl.Buffer(ctx, mf.WRITE_ONLY | mf.COPY_HOST_PTR, hostbuf=fImage)
-    IdLastCL = cl.Buffer(ctx, mf.WRITE_ONLY | mf.COPY_HOST_PTR, hostbuf=IdLast)
     
     start_time=time.time() 
 
@@ -1695,23 +1705,23 @@
                                         numpy.float32(Angle),
                                         numpy.int32(Line))
         
-        CLLaunch=BlackHoleCL.Pixel(queue,(zImage.shape[0],
-                                          zImage.shape[1]),None,
+        CLLaunch=BlackHoleCL.Pixel(queue,(zImage.shape[0],zImage.shape[1]),None,
                                    zImageCL,fImageCL,TrajectoriesCL,IdLastCL,
                                    numpy.uint32(Trajectories.shape[0]),
-                                        numpy.float32(Mass),
-                                        numpy.float32(InternalRadius),
-                                        numpy.float32(ExternalRadius),
-                                        numpy.float32(Angle),
-                                        numpy.int32(Line))
+                                   numpy.float32(Mass),
+                                   numpy.float32(InternalRadius),
+                                   numpy.float32(ExternalRadius),
+                                   numpy.float32(Angle),
+                                   numpy.int32(Line))
         CLLaunch.wait()
     
     compute = time.time()-start_time
     
     cl.enqueue_copy(queue,zImage,zImageCL).wait()
     cl.enqueue_copy(queue,fImage,fImageCL).wait()
-    cl.enqueue_copy(queue,Trajectories,TrajectoriesCL).wait()
-    cl.enqueue_copy(queue,IdLast,IdLastCL).wait()
+    if Method=='TrajectoPixel' or Method=='TrajectoCircle':
+        cl.enqueue_copy(queue,Trajectories,TrajectoriesCL).wait()
+        cl.enqueue_copy(queue,IdLast,IdLastCL).wait()
     elapsed = time.time()-start_time
     print("\nCompute Time : %f" % compute)
     print("Elapsed Time : %f\n" % elapsed)
@@ -1723,8 +1733,9 @@
     zImageCL.release()
     fImageCL.release()
 
-    TrajectoriesCL.release()
-    IdLastCL.release()
+    if Method=='TrajectoPixel' or Method=='TrajectoCircle':
+        TrajectoriesCL.release()
+        IdLastCL.release()
 
     return(elapsed)
 
