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

Update MOD files for 9.0 compatibility #1

Merged
merged 2 commits into from
May 27, 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
2 changes: 1 addition & 1 deletion cadecay.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ NEURON{
SUFFIX cad
USEION ca READ ica, cai WRITE cai
RANGE ica, channel_flow, depth, B
GLOBAL cai, tau, cainf
GLOBAL tau, cainf
}

UNITS {
Expand Down
2 changes: 1 addition & 1 deletion cadecay2.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ NEURON{
SUFFIX cad2
USEION ca READ ica, cai WRITE cai
RANGE ica, channel_flow, depth, B
GLOBAL cai, tau, cainf
GLOBAL tau, cainf
}

UNITS {
Expand Down
8 changes: 8 additions & 0 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,11 @@
See the alternate models in the pop-up list under the model file tab in
modeldb accession 183300 to find the matlab and other code versions
available for this paper.

Changelog
---------

* MOD files are updated for compatibility with upcoming NEURON v9.0
and migration to C++.
* Also, changes to compile with the latest neuron releases where
ion variables used as STATE can not be declared as GLOBAL.
13 changes: 9 additions & 4 deletions thetastim.mod
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ FUNCTION outer_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 @@ -114,7 +119,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 All @@ -134,11 +139,11 @@ ENDVERBATIM
PROCEDURE noiseFromRandom() {
VERBATIM
{
void** pv = (void**)(&_p_donotuse);
IvocVect** pv = (IvocVect**)(&_p_donotuse);
if (ifarg(1)) {
*pv = nrn_random_arg(1);
*pv = (IvocVect*)nrn_random_arg(1);
}else{
*pv = (void*)0;
*pv = (IvocVect*)0;
}
}
ENDVERBATIM
Expand Down
11 changes: 6 additions & 5 deletions vecstim.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ NET_RECEIVE (w) {
}

VERBATIM
#ifndef NRN_VERSION_GTEQ_8_2_0
extern double* vector_vec();
extern int vector_capacity();
extern void* vector_arg();
#endif
ENDVERBATIM

PROCEDURE element() {
VERBATIM
{ void* vv; int i, size; double* px;
{ int i, size; double* px;
i = (int)index;
if (i >= 0) {
vv = *((void**)(&space));
IvocVect* vv = *((IvocVect**)(&space));
if (vv) {
size = vector_capacity(vv);
px = vector_vec(vv);
Expand All @@ -59,9 +61,8 @@ ENDVERBATIM

PROCEDURE play() {
VERBATIM
void** vv;
vv = (void**)(&space);
*vv = (void*)0;
IvocVect** vv = (IvocVect**)(&space);
*vv = (IvocVect*)0;
if (ifarg(1)) {
*vv = vector_arg(1);
}
Expand Down