1 c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 c This file must be used under the terms of the CeCILL.
6 c This source file is licensed as described in the file COPYING, which
7 c you should have received as part of this distribution. The terms
8 c are also available at
9 c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11 subroutine bjac(ny,t,y,ml,mu,jac,nrowj)
16 double precision y(ny),jac(nrowj,ny),t(*)
19 integer vol,tops,nordre
20 data nordre/2/,mlhs/1/
34 if(istk(ils).eq.10) then
35 c Case of a Fortran simulator
36 call fjac(ny,t,y,ml,mu,jac,nrowj)
39 c external is a Scilab function
41 c On return ierror=1 is used to notify to the ode solver that
42 c scilab was not able to evaluate the external
45 c Putting Fortran arguments on Scilab stack
47 call ftob(t,1,istk(il+1))
48 if(err.gt.0.or.err1.gt.0) return
49 call ftob(y,ny,istk(il+2))
50 if(err.gt.0.or.err1.gt.0) return
55 c Retrieving the simulator's address
58 if(istk(ils).eq.15) then
59 c Case when the simulator is described by a list
64 c Retrieving the simulator's address
67 c Managing the additional simulator parameters coming from
68 c the context (elements of the list describing the simulator)
72 l=l+istk(ils+1)-istk(ils)
73 vol=istk(ils+nelt+1)-istk(ils+1)
74 if(top+1+nelt.ge.bot) then
78 err=lstk(top+1)+vol-lstk(bot)
83 call unsfdcopy(vol,stk(l),1,stk(lstk(top+1)),1)
86 lstk(top+1)=lstk(top)+istk(ils+i+1)-istk(ils+i)
92 c Running the macro defining the simulator
109 include 'callinter.h.f'
116 c Transferring the output to Fortran
117 if(ml.gt.0.or.mu.gt.0) then
119 call btofm(jac,nrowj,mm,ny)
124 if(err.gt.0.or.err1.gt.0) return
126 c normal return ierror set to 0