venext - FUNC_DESC
Posted: Sun Oct 12, 2014 10:13 am
I have written an external function which calculates a vector and uses input from three vectors. Everything works as expected - e.g. during the first call, everything is looking good. Unfortunately Vensim calls the routine 3 times vector subscripts and then returns the result times 3 times vector subscripts. If I put any positive value in num_loop to avoid multiple calls the subroutine does not receive the correct inputs. It seems as if they get shifted by one vector...
This is the change I am making:
static FUNC_DESC Flist[] = {{"GROUPCONSOLIDATION"," {vector} , {vector} , {vector} , {vector} ",4,4,GROUPCON_FUNC,0,1,0,0}, {'\0',0,0,0}} ;
static FUNC_DESC Flist[] = {{"GROUPCONSOLIDATION"," {vector} , {vector} , {vector} , {vector} ",4,4,GROUPCON_FUNC,1,1,0,0}, {'\0',0,0,0}} ;
Any ideas what I should better be doing?
It seems that it makes no difference if I use matrix or vector in argument_desc. I always use vector although two of the vectors have 2-dimensions and I accomodate for that in the subroutine.
PS: The reference to venext.h in comments section three had me searching for that file for quite a while...
This is the change I am making:
static FUNC_DESC Flist[] = {{"GROUPCONSOLIDATION"," {vector} , {vector} , {vector} , {vector} ",4,4,GROUPCON_FUNC,0,1,0,0}, {'\0',0,0,0}} ;
static FUNC_DESC Flist[] = {{"GROUPCONSOLIDATION"," {vector} , {vector} , {vector} , {vector} ",4,4,GROUPCON_FUNC,1,1,0,0}, {'\0',0,0,0}} ;
Any ideas what I should better be doing?
It seems that it makes no difference if I use matrix or vector in argument_desc. I always use vector although two of the vectors have 2-dimensions and I accomodate for that in the subroutine.
PS: The reference to venext.h in comments section three had me searching for that file for quite a while...