Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid errors with STATE variables without DERIVATE block #2

Merged
merged 4 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,17 @@
For any questions or further assistance please contact:
salvadordura at gmail.com


------------------------------------------------------------------------------------------------------
Changelog
-------------------------------------------------------------------------------------------------------

2022-05:
* Updated MOD files to compile with upcoming 9.0 neuron release
with migration to C++.
* izhi2007.mod is updated in order to compile with current neuron
releases where STATE variables without ODEs or SOLVE block gives an error.
See discussion in https://github.com/ModelDBRepository/194897/pull/2

</pre></html>

10 changes: 4 additions & 6 deletions izhi2007.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ ASSIGNED {
:t0 : Previous time
factor : Voltage factor used for calculating the current
eventflag : For diagnostic information
}

: State variables without ODEs / SOLVE block and hence converted
: to ASSIGN. See https://github.com/ModelDBRepository/194897/pull/2

: State variables
STATE {
V (mV) : Membrane voltage
u (mV) : Slow current/recovery variable
V : Membrane voltage
u : Slow current/recovery variable
gAMPA : AMPA conductance
gNMDA : NMDA conductance
gGABAA : GABAA conductance
Expand Down Expand Up @@ -125,7 +124,6 @@ PROCEDURE useverbose() { : Create user-accessible function
}



: Define neuron dynamics
BREAKPOINT {
delta = t-t0 : Find time difference
Expand Down
7 changes: 6 additions & 1 deletion nsloc.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ FUNCTION invl(mean (ms)) (ms) {
}
}
VERBATIM
#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif
ENDVERBATIM

FUNCTION erand() {
Expand All @@ -91,7 +96,7 @@ VERBATIM
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.negexp(1)
*/
_lerand = nrn_random_pick(_p_donotuse);
_lerand = nrn_random_pick(RANDCAST _p_donotuse);
}else{
/* only can be used in main thread */
if (_nt != nrn_threads) {
Expand Down
14 changes: 7 additions & 7 deletions vecevent.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ NET_RECEIVE (w) {

DESTRUCTOR {
VERBATIM
void* vv = (void*)(_p_ptr);
if (vv) {
IvocVect* vv = (IvocVect*)(_p_ptr);
if (vv) {
hoc_obj_unref(*vector_pobj(vv));
}
ENDVERBATIM
Expand All @@ -46,8 +46,8 @@ VERBATIM
if (i >= 0) {
vv = (void*)(_p_ptr);
if (vv) {
size = vector_capacity(vv);
px = vector_vec(vv);
size = vector_capacity((IvocVect*)vv);
px = vector_vec((IvocVect*)vv);
if (i < size) {
etime = px[i];
index += 1.;
Expand All @@ -65,15 +65,15 @@ ENDVERBATIM
PROCEDURE play() {
VERBATIM
void** pv;
void* ptmp = NULL;
IvocVect* ptmp = NULL;
if (ifarg(1)) {
ptmp = vector_arg(1);
hoc_obj_ref(*vector_pobj(ptmp));
}
pv = (void**)(&_p_ptr);
if (*pv) {
hoc_obj_unref(*vector_pobj(*pv));
hoc_obj_unref(*vector_pobj((IvocVect*)*pv));
}
*pv = ptmp;
ENDVERBATIM
}
}