{# NEURON section template Template varables are: - modelName: string with the name of the current system - hasEvents: boolean flag indicating if there any discrete events defined in the current system - exports: list of strings with the names of exported quantities of the current system - currents: list of strings with the names of the currents defined in the current system - permeatingIons: the permeating ions defined in the current system; a list where each entry is an object with the following fields: - species - name of the species (or "non-specific") - e - name of the reversal potential quantity - i - name of the current quantity - poolIons: the pool ions defined in the current system: a list where each entry is an object with the following fields: - in - internal concentration - out - external concentration - modulatingIons: the modulating ions defined in the current system: a list where each entry is an object with the following fields: - in - internal concentration - out - external concentration - accumulatingIons: obsolete, do not use - rangeParameters: list with the names of parameters that appear on the right-hand side of assignments, rate equations, reactions, and functions - useIons: the roles of all ionic species that appear in the current system a list where each entry is an object with the following fields: - nonSpecific - true is the ion is non-specific, false otherwise - name - the name of the ionic species - read - the name(s) of the variable(s) being read - write - the name of the variable being written to - valence - the valence of the species #} NEURON { {% if (hasEvents) %} POINT_PROCESS {{modelName}} {% endif %} {# NMODL has a line character limit, so we limit the number of entries in each RANGE stmt to 10 #} {% for export in exports %} {% if ((loop.index0 % 10) == 0) %} RANGE {{export}}{% else %}, {{export}}{% endif %} {% endfor %} {% if (not (currents == [])) %} RANGE {{currents | join(", ")}} {% endif %} {# if rev potential is defined for this ion, declare the ionic current and reversal potential as range variables, otherwise declare only the ionic current as a range variable #} {% for p in permeatingIons %} {% if (p.species == "non-specific") %} RANGE {{p.e}} {% elif (p.erev) %} RANGE {{p.i}}, {{p.e}} {% else %} RANGE {{p.i}} {% endif %} {% endfor %} {% for p in poolIons %} RANGE {{p.in}}, {{p.out}} {% endfor %} {% if (accumulatingIons == []) %} {% for p in poolIons %} RANGE {{p.in}}, {{p.out}} {% endfor %} {% for m in modulatingIons %} RANGE {{m.in}}, {{m.out}} {% endfor %} {% else %} {% for a in accumulatingIons %} RANGE {{a.i}} {% endfor %} {% endif %} {% for parameter in rangeParameters %} {% if ((loop.index0 % 10) == 0) %} RANGE {{parameter}} {% else %}, {{parameter}}{% endif %} {% endfor %} {% for useIon in useIons %} {% if (useIon.nonSpecific) %} NONSPECIFIC_CURRENT {{useIon.name}} {% elif (useIon.valence and (not (useIon.write == [])) and (not (useIon.read == [])) ) %} USEION {{useIon.name}} READ {{useIon.read | join (", ")}} WRITE {{useIon.write | join (", ")}} VALENCE {{useIon.valence}} {% elif (useIon.valence and (useIon.write == []) and (not (useIon.read == [])) ) %} USEION {{useIon.name}} READ {{useIon.read | join (", ")}} VALENCE {{useIon.valence}} {% elif ((not (useIon.write == [])) and (not (useIon.read == [])) ) %} USEION {{useIon.name}} READ {{useIon.read | join (", ")}} WRITE {{useIon.write | join (", ")}} {% elif ((useIon.write == []) and (not (useIon.read == [])) ) %} USEION {{useIon.name}} READ {{useIon.read | join (", ")}} {% endif %} {% endfor %} }