Hi,
I have encountered a problem when porting fortran algorithm to C++.
The console has reported forrtl severe (408) fort (19) Dummy character variable 'TASK' has length 60 which is greater than actual variable length -3689***********
The calling code looks like this
SETULB(&n_, &m_, ¶m_.x[0], ¶m_.lb[0], ¶m_.ub[0],
¶m_.constraints[0], &f_, &g_[0], &factr_, &pgtol_, &wa_[0],
&iwa_[0], &task_[0], &iprint, csave_, lsave_, isave_,
dsave_, 60, 60);
where char task_[60];
And the fortran routine looks like
subroutine setulb(n, m, x, l, u, nbd, f, g, factr, pgtol, wa, iwa,
+ task, iprint, csave, lsave, isave, dsave)
character(60) task, csave
logical lsave(4)
integer n, m, iprint,
+ nbd(n), iwa(3*n), isave(44)
double precision f, factr, pgtol, x(n), l(n), u(n), g(n),
c
c-jlm-jn
+ wa(2*m*n + 5*n + 11*m*m + 8*m), dsave(29)
The code breaks at
if (task .eq. 'START') then ...
Could anyone give some instructions on how to solve this problem? By the way, I'm using Visual Studio 2010 for C++ compiler