error message when running mkrndll

NMODL and the Channel Builder.
Post Reply
MH

error message when running mkrndll

Post by MH »

Hi!
I am getting the following message when trying to make a dll of my file:

Translating SodiumCurrent.mod into SodiumCurrent.c
gcc -mno-cygwn -I/cygdrive/c/nrn58/src/scopmath -I/cygdrive/c/nrn58/src/nrnoc -I/cygdrive/c/nrn58/src/oc -I/cygdrive/c/nrn58/lib -I/cygdrive/c/nrn58/mingw -c SodiumCurrent.c
SodiumCurrent.c:104: error: 'j0' redeclared as different kind of symbol
SodiumCurrent.c:104: error: 'j0' redeclared as different kind of symbol
make: *** [SodiumCurrent.o] Error 1

I don;t understand why it says 'j0' is being redeclared... There is no j0 in my code?!
MH
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Identifying the cause of the problem requires examination of the NMODL
code. If regard it as proprietary, or if it is more than ~30 lines long,
you may email it to me at
ted dot carnevale at yale dot edu
if you wish me to examine it.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

The mod file uses a STATE called j. When this mod file is translated to C,
the symbol j0 is automatically generated (for every user-declared STATE x,
the NMODL translator generates a corresponding initial condition variable
called x0). This conflicts with a predefined symbol j0 (j0 is reserved for one
of the Bessel functions). The workaround is to change the name of the
STATE to something other than j, e.g. jj or jx.
MH

the mkrndll works! but the running of init.hoc doesn't?!

Post by MH »

Hi!
I fixed the name and now no error comes up but when I try to run the init.hoc file the sh:// window states "Na_ion ion valence must be defined in the USEION statement of any model using this ion" and "neuron exited abnormally?!"

Code: Select all

NEURON {
	SUFFIX Nad			
	USEION Na READ eNa WRITE iNa
	RANGE g_Na, g, iNa		
}

UNITS {
	(pS) = (picosiemens)
	(mV) = (millivolt)
	(nA) = (nanoamp)
                (cm2) = (square centimetre)
}

PARAMETER {				
	g_Na = 0.8 (pS/cm2)             
}	

ASSIGNED {				
	v (mV)
	eNa(mV)				
	iNa (nA/cm2)
	g (pS/cm2)			
}

STATE { m h p }				

INITIAL {
	m = 4.164108e-03	
	h = 6.735613e-01              
	p = 6.729362e-01		
}

BREAKPOINT {				
	SOLVE states METHOD cnexp 
	g=g_Na * m^3 * h
	iNa = g * (v - eNa)
}

DERIVATIVE states {
	m' = (mbar(v) - m) / tao_m(v)
	h' = (hbar(v) - h) / tao_h(v)
	p' = (pbar(v) - p) / tao_p(v)
}

FUNCTION mbar (v (mV)) { 		
	UNITSOFF
	mbar = 1 / (1 + exp((v + 45.0) / -6.5))
	UNITSON
}

FUNCTION hbar (v (mV)) {		
	UNITSOFF
	hbar = 1 / (1 + exp((v + 76.1) / 6.07))
	UNITSON
}

FUNCTION pbar (v (mV)) {		
	UNITSOFF
	pbar = hbar(v)
	UNITSON
}

FUNCTION tao_m (v (mV)) {		
	UNITSOFF
	tao_m = 0.00136 / (0.32 * (v + 47.13) / (1.0 - exp(-0.1 * (v + 47.13) )) + 0.08 * exp(v / 11))
	UNITSON
}

FUNCTION tao_h (v (mV)) {		
	UNITSOFF
	if (v >= -40) {
		tao_h = 0.0004537 * (1.0 + exp((v + 10.66) / 11.1))
	} else {
		tao_h = 0.00349 / (0.135 * exp((v+80.0)/6.8) + 3.56 * exp(0.079 * v) + 3.1 * 10^05 * exp(0.35 * v))
	}
	UNITSON
}

FUNCTION tao_p (v (mV)) {		
	UNITSOFF
	if (v >= -40) {		
		tao_p = 0.01163 * (1.0 + exp(-0.1 * (v + 32.0))) / exp(-2.535 * 10^-07 * v)
	} else {
		tao_p = 0.00349 / (((v + 37.78) / (1.0 + exp(0.311 * (v + 79.23)))) * (-127140.0 * exp(0.2444 * v) - 3.474 * 10^-05 * exp(-0.04391 * v)) +  ((0.1212 * exp(-0.01052 * v)) / (1.0 + exp(-0.1378 * (v + 40.14)))))	
	}
	UNITSON
}
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

The error message means that NMODL doesn't know anything about Na.
The reserved symbol for sodium is na. Unless there is a very good reason
to "invent" a "new" ionic species, the mod file should declare
USEION na READ ena WRITE ina
If you decide that it is absolutely necessary to refer to the ion as Na, then
the USEION statement should be
USEION Na READ eNa WRITE iNa VALENCE 1
(assuming that Na has valence 1).

Other errors may also be present. In addition, be sure to verify consistency
of units with modlunit.
Post Reply