int c, m, n, l, res_num, npore, abv_i, j, i;
float radius, xp, yp, zp, pore_rad;
char *atom_name, *res_name, chain_name;
main()
{
  c=1;
  radius=3.5;                /*in Angstroms*/
  pore_rad=94.5;            /*enter the radius of the layer here!*/
  for(l=0;l<=9;++l)
    {
      
   
      atom_name="bdy";
      if(l==0 || l==9) 	     /* name top and bottom layer*/
	atom_name="scg";     /*scg to be able to assign charge */ 
      res_name="fil";
      chain_name='O';
      res_num=l+1;      /* res_num goes from 1 to 10 ie points to a layer */
      
      
      
      npore=(pore_rad/radius-1)/2;
      for(i=npore;i>= -npore;--i){
	yp=radius*1.7320508*i;
	abv_i=i;
	if(i<0)
	  abv_i= -i;
	for(j=2*npore-abv_i;j>= -2*npore+abv_i;j=j-2){
	 
	  xp=j*radius;      	   
	  zp= -radius -l*2*radius + 35.0;  /* 31.5 ... -31.5 */
	  
	  
	  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;
	}
      }
    }
}
