     }
 }
 
-__device__ int ros_Integrator(double * __restrict__ var, double * __restrict__ fix, double Tstart, double Tend, double &T,
+__device__ static int ros_Integrator(double * __restrict__ var, const double * __restrict__ fix, const double Tstart, const double Tend, double &T,
         //  Rosenbrock method coefficients
-        const int ros_S, const double * ros_M, const double *  ros_E, const double * __restrict__ ros_A, const double *  ros_C, 
-        const double *ros_Alpha, const double * ros_Gamma, const double ros_ELO, const int * ros_NewF, 
+        const int ros_S, const double * __restrict__ ros_M, const double * __restrict__ ros_E, const double * __restrict__ ros_A, const double * __restrict__  ros_C, 
+        const double * __restrict__ ros_Alpha, const double * __restrict__ ros_Gamma, const double ros_ELO, const int * ros_NewF, 
         //  Integration parameters
-        int autonomous, int vectorTol, int Max_no_steps, 
-        double roundoff, double Hmin, double Hmax, double Hstart, double &Hexit, 
-        double FacMin, double FacMax, double FacRej, double FacSafe, 
+        const int autonomous, const int vectorTol, const int Max_no_steps, 
+        const double roundoff, const double Hmin, const double Hmax, const double Hstart, double &Hexit, 
+        const double FacMin, const double FacMax, const double FacRej, const double FacSafe, 
         //  Status parameters
         int &Nfun, int &Njac, int &Nstp, int &Nacc, int &Nrej, int &Ndec, int &Nsol, int &Nsng,
         //  cuda global mem buffers              
-        const double *rconst,  const double * __restrict__ absTol, const double * __restrict__ relTol, double * __restrict__ varNew, double * __restrict__ Fcn0, 
+        const double * __restrict__ rconst,  const double * __restrict__ absTol, const double * __restrict__ relTol, double * __restrict__ varNew, double * __restrict__ Fcn0, 
         double * __restrict__ K, double * __restrict__ dFdT, double * __restrict__ jac0, double * __restrict__ Ghimj, double * __restrict__ varErr,
         // VL_GLO
-        int VL_GLO)
+        const int VL_GLO)
 {
     int index = blockIdx.x*blockDim.x+threadIdx.x;
 



__global__ 
void Rosenbrock(double *conc, double Tstart, double Tend, double *rstatus, int *istatus,
                // values calculated from icntrl and rcntrl at host
                int autonomous, int vectorTol, int UplimTol, int method, int Max_no_steps,
                double Hmin, double Hmax, double Hstart, double FacMin, double FacMax, double FacRej, double FacSafe, double roundoff,
                //  cuda global mem buffers              
                const double * __restrict__ absTol, const double * __restrict__ relTol,
                // extra
                int VL_GLO, int pe)
{
    int index = blockIdx.x*blockDim.x+threadIdx.x;



=#=#=#=#=#=#=#=#=#=#=kppSolve=#=#=#=#=#=#=#=#=#=#=

__device__ void ros_Solve(double * __restrict__ Ghimj, double * __restrict__ K, int &Nsol, const int istage, const int ros_S)
{

    #pragma unroll 4 
