// granule.tem
// Template for granule cell model
 
begintemplate Gran
  
  public  dist, gemm, ngemm, d2g, AMPArS
  
  create d2g, gemm
  objref AMPArS
  proc init() { local Len, Erest, RM, Atotal, AMPAtau, Erev

    create d2g, gemm

    ngemm = 1

    Erest		= -65		// mV
    Atotal		= 8353		// um2

    RM			= 4000 		// ohm.cm2 //Davison versus Anton Granger

    Ri			= 70 		//ohm.cm
    Len			= 50
  
    AMPAtau		= 3		// ms
    Erev		= 0		// mV

    // spine neck
    d2g {
	diam 	= 0.2      // um Anton Granger 1993
        Ra 		= 150*10   // ohm.um Anton Granger 1993 
        L 		= 3        // um Anton Granger 1993 
    }

   gemm {
	r           = 0.4
	L 	    = 1.747 * r 		//conversion sphere/cylindre
        diam	    = 2*r
	Ra 	    = 80 //  ohm.um Anton Granger 1993 
        insert pas
        e_pas 		= Erest
        g_pas 		= 1/RM
        AMPArS = new ExpSyn(0.5)    	// not taken into account but can be an option later
        AMPArS.tau 	= AMPAtau  	// idem
        AMPArS.e 	= Erev		// idem
   }

   forall if (ismembrane("na_ion")) {
             ena = 45	// mV
          }

   forall if (ismembrane("k_ion")) {
          ek  = -70	//  mV
   }

   forall if (ismembrane("ca_ion")) {
      eca = 70		// mV 
      cai = 0.00001	// mM 
      cao = 2		// mM
      ion_style("ca_ion",3,2,0,0,1)
   }
   connect gemm(0), d2g(1)
}

endtemplate Gran