/* DEFINE CONSTANTS */
#define RD1 &n,&crat,&drat,&gap,&rmin,&l,&D,&tplse,&gmma,&Gamma,&h,&kT,&R,\
	&sigma,&C,&Ri,&init_G,&Z,&t,&dt,&qp,&rrup,&V0,&el,&n0,&nIs
/* RD1 is the input array 
   n + 1 is the number of grid points in radius space
   crat is the pore creation rate prefactor in cm/s
   drat is the pore destruction rate prefactor in 1/s
   gap is the activation energy for pore destruction in ergs
   rmin is the minimum pore size in cm
   l is the maximum pore size in cm
   gamma is the edge energy in ergs/cm
   Gamma the membrane surface tension in ergs/cm/cm
   h is the membrane thickness in cm
   kT is the temperature in ergs
   R is the radius of the small ions in cm
     We assume only two species of ions with the same radius)
   sigma is the conductivity of the bulk solution in mhos/cm
   Z is the magnitude of the charge on the ions
   qp is the coefficient of the dimensionless voltage squared in the 
     expression for the pore creation rate
   el is the dielectric constant of the lipid
   n0 is the number of time steps in the output file ofile2
*/
#define iprintf if(0)printf
#define UFLOW 80.  /* Check for underflow before executing exponential */
#define UFLOW_G 30. /* Check underflow before executing exponential for G */
#define NIN 26  /* Number of INput parameters */
#define pi 3.141592654
#define e 4.8e-10 /* proton charge in cgs units */
#define STVLT 300.  /* conversion factor between volts and STatVoLTs */
#define ew 80. /* Dielectric constant of water */
#define flag 1
#define KK 7.2e5 /* Numerical constant for computation of membrane capacitance
  per unit area */

/* DEFINE EXTERNAL VARIABLES */
double l; /* maximum pore size; also unit of length for reduced variables */
double D; /* Diffusion constant for pore in radius space in s/cm/cm */
double tplse; /* pulse length */
double gmma; /* edge energy in ergs/cm */
double Gamma; /* surface tension in ergs/cm/cm */
double h; /* membrane thickness in cm */
double kT; /* temperature in ergs */
double R; /* radius of small ions in cm */
double Rdeb; /* debye length in cm */
double sigma; /* conductance of bulk solution in mhos/cm */
double C; /* capacitance of membrane in farads */
double Ri; /* total resistance in series with membrane during pulse in ohms */
double init_G; /* initial conductance of membrane in mhos */
double Z; /* magnitude of charge on small ions */
double t; /* time elapsed since start of simulation */
double dt; /* step size in units (grid spacing squared) / D */ 
double beta; /* reduced pore death rate */
double qp; /* coefficient or dimensionless voltage squared in the
                            expression for the pore creation rate */
double V0; /* magnitude of applied voltage pulse */
double el; /* dielectric constant of water */
double *f; /* pore density function (index indicates radius) */
double *g; /* conductance function (index indicates radius) */
double *Gs; /* Spreading resistance function (index indicates radius) */
double *Gp; /* pore resistance function (index indicates radius) */
/* The index in the previous four items labels the grid point. */
double U; /* membrane voltage */
double gama; /* reduced gmma */
double Gama; /* reduced Gamma */
double hh; /* reduced h */
double RR; /* reduced R */
double Ldeb; /* reduced Rdeb */
double Ze; /* reduced small ion charge */
double tau0; /* an electrical time constant in EQ 35 */
double tau1; /* an electrical time constant in EQ 35 */
double tau2; /* an electrical time constant in EQ 35 */
double tpls; /* duration of voltage pulse */
double q; /* dimensionless grid spacing */
double a; /* constant coefficient in pore creation energy barrier */
double *alpha; /* alpha function defined by Eq 6 */
double *tout; /* array of times to print out pore density function */
double G; /* membrane conductance */
double *dVdx; /* effective force increasing pore radius */
double *fout; /* output array of density functions */
double V; /* applied voltage */
double *UU; /* output array for U(t), G(t), etc */
double t0; /* diffusion time based on grid spacing */
double crat; /* pore creation rate */
double crt; /* dimensionless pore creation rate */
double drat; /* pore death rate */
double gap; /* pore death rate energy barrier */
double gape; /* gap / kT */
double rmin; /* minimum pore size */
double dmin; /* dimensionless minimum pore size */
double  Nl; /* number of large pores */
double xbig; /* size of a large pore */
double rrup; /* pore size required to rupture membrane */
double xrup; /* dimensionless pore size required to rupture membrane */
double Gbig(); /* conductance of large pores */
double xp; /* dimensionless radius of maximum pore energy at U = 0 */
double *GPI; /* number of probe molecules transported */
double *gPI; /* conductance of probe molecules */
double rp;
double A0;
double *fPI;
double *ZPI;
double *Zeff;
double *RPI;
double *sigma_molec;
unsigned int n;
unsigned int nout;
unsigned int nt;
unsigned int n0;
int *lon;
int *nnout;
int nn;
int *bp;
int *shape;
int nIs;
char *calloc();
char *pulse_type;
double tau_pulse;

