#define DEBUG 0

int myodestep(double *job, double *job_result)
{
  int i = 0, j, nStts = 1;

  double t, tDet_t, dtmin;

  extern double Det_t;

  extern int nits, length;

  dtmin = 1e-25;

  t = 0.0;

  /* Putting the Input as the first row of output */

    job_result[0] = job[0];
    job_result[1] = job[1];
    job_result[2] = 0.0;
    job_result[3] = nStts;
    job_result[4] = job[4];
    job_result[5] = job[5]; 
    job_result[6] = job[6];
    job_result[7] = job[7];
    job_result[8] = job[8];
    job_result[9] = job[9];

  for ( i = 1; i <= nits; i++)
    {
      
      tDet_t = t + Det_t;
    
      if (DEBUG)      printf("job: = %f %f %f %f %f %f %f %f %f %f\n",
			     job[0], job[1], job[2], job[3], job[4], \
			     job[5], job[6], job[7], job[8], job[9] );

      if (DEBUG) printf("%f %f %d\n",t , tDet_t, nStts);
      
      odestep_( &job[4], &t, &tDet_t, &nStts, &dtmin); 
		  
      if (DEBUG)       printf("job: = %f %f %f %f %f %f %f %f %f %f\n",
			      job[0], job[1], job[2], job[3], job[4], \
			      job[5], job[6], job[7], job[8], job[9] );

      job_result[i * length + 0] = job[0];
      job_result[i * length + 1] = job[1];
      job_result[i * length + 2] = t;
      job_result[i * length + 3] = nStts;
      job_result[i * length + 4] = job[4];
      job_result[i * length + 5] = job[5];
      job_result[i * length + 6] = job[6];
      job_result[i * length + 7] = job[7];
      job_result[i * length + 8] = job[8];
      job_result[i * length + 9] = job[9];


      if ( nStts == 0 )
	{
	  /* this nStts is a duplicate of the already existent flag 
	     variable inside the job array */

	  return(i+1); /* value of i is n and not n -1 */
	}

    }

  return(i); /* value of i is n and not n-1 as it gets incremented in the for loop*/
}





