You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The routine sfsetnk is calling the routine to construct the jacobian jac_calc using the argument sf, which is also the dummy output argument of sfsetnk used to assign sfscal in the calls to sfsetnk (line 266,289,297 in odesolve.m).
The argument sf in the call to jac_cal, however, corresponds to the dummy argument wk which is a worker array in jac_calc and is thus modified in jac_calc. Meanwhile, the value of sfscal is also used in jac_calc to build the jacobian, leading to a recursive assignment of sfscal during the call to jac_calc. A numerical glitch may thus appear depending on the compiler and the compilation option (e.g. fno-automatic).
A simple fix is to defined temporary worker array in sfsetnk to be used when calling jac_calc:
real wk(neq)
...
wk(1:neq)=0 ! just for precaution
call jac_calc (neq, tp, yl, yldot0, lbw, ubw, wk,
. nnzmx, jac, jacj, jaci)
The text was updated successfully, but these errors were encountered:
The routine sfsetnk is calling the routine to construct the jacobian jac_calc using the argument sf, which is also the dummy output argument of sfsetnk used to assign sfscal in the calls to sfsetnk (line 266,289,297 in odesolve.m).
The argument sf in the call to jac_cal, however, corresponds to the dummy argument wk which is a worker array in jac_calc and is thus modified in jac_calc. Meanwhile, the value of sfscal is also used in jac_calc to build the jacobian, leading to a recursive assignment of sfscal during the call to jac_calc. A numerical glitch may thus appear depending on the compiler and the compilation option (e.g. fno-automatic).
A simple fix is to defined temporary worker array in sfsetnk to be used when calling jac_calc:
real wk(neq)
...
wk(1:neq)=0 ! just for precaution
call jac_calc (neq, tp, yl, yldot0, lbw, ubw, wk,
. nnzmx, jac, jacj, jaci)
The text was updated successfully, but these errors were encountered: