int c,m,n,l,res_num;
float radius, x_slide, xp, yp, zp;
char *atom_name, *res_name, chain_name;
main()
{
  c=1;
  radius=3.5;                /*in Angstroms*/
  for(l=0;l<=9;++l)
    {
      
    for(n= -34;n<=34;++n)
      {
        x_slide=0.0;          /* x position depends on y; that is why this is here */
        for(m= -29;m<=29;++m)
          {
           atom_name="bdy";
	   if(l==0 || l==9)   /* name top and bottom layer scg to be able to assign charge */ 
	     atom_name="scg";
           res_name="fil";
           chain_name='O';
           res_num=l+1;      /* res_num goes from 1 to 10 ie points to a layer */
	                     /* there are 40710 atoms total, 4071 in each "slice" */
           if(n%2 != 0)               /* test y position */
             x_slide=radius;          /* add radius to x position */
          
           xp=2*radius*m + x_slide;
           yp=1.7320508*radius*n;
           zp= -radius -l*2*radius;  /* -3.5 -10.5 .. -66.5 */

           /* x_goes[-203,203] and [-199.5,206.5] */
	   /* x_range[-203-3.5=-206.5, 206.5+3.5=210] */
	   /* x_max - x_min = x_slide = radius */
	   
	   /* y_goes[-206.11405, 206.11405] */
	   /* y_range[-s,s], s=209.61405 */

           /* z_goes[-3.5, -66.5] */
	   /* z_range[0,-70] */

           printf("ATOM%7d %-5s%3s%2c%4d%11.2f%9.3f%8.3f\n",   c, atom_name, res_name, chain_name, res_num, xp, yp, zp);
           c+=1;
	   
          }
      }
  }
}
