FloatingFeather
Programmer
Hi. I don't know what is causing this. I have written two different codes, and I wanted to use a subroutine I wrote, in both codes. The thing is that this subroutine calls DGELS to do some computations. But in one code it works fine, and in the other gives a wrong result. I don't really know what could be causing this, I have tried almost everything. I thought that maybe some array was ill defined or something, but the subroutine should be doing all the calculations internally, with the arrays defined inside the subroutine. Moreover, I have checked that the matrix and vectors I define to call dgels are just equally defined in both programs just before calling DGELS.
Both programs should be performing exactly the same task. I call DGELS this way:
CALL DGELS( 'N',2*totang,maxcol,1,A,2*totang,BB,maxcol,work,lwork,info)
The two subroutines are exactly equal, and I think there shouldn't be any issue with the modules I am using. However, when I print the vector BB in both programs, they give different results:
In one program it gives the correct array:
-0.383305771911842
-1.707704987396421E-002
2.265606036888344E-002
3.045356540705808E-002
3.318346674669321E-002
...
But the other gives something totally wrong:
2.414855226838399E+120
-3.551108555014026E+121
-1.463416206213795E+119
1.610216121107897E+118
9.975041298589036E+117
7.225310830463566E+117
...
But both, the matrix A, and the vector BB that I provide to DGELS are exactly the same when I print them before calling DGELS in both programs.
Any idea of what could be going on with this?
Both programs should be performing exactly the same task. I call DGELS this way:
CALL DGELS( 'N',2*totang,maxcol,1,A,2*totang,BB,maxcol,work,lwork,info)
The two subroutines are exactly equal, and I think there shouldn't be any issue with the modules I am using. However, when I print the vector BB in both programs, they give different results:
In one program it gives the correct array:
-0.383305771911842
-1.707704987396421E-002
2.265606036888344E-002
3.045356540705808E-002
3.318346674669321E-002
...
But the other gives something totally wrong:
2.414855226838399E+120
-3.551108555014026E+121
-1.463416206213795E+119
1.610216121107897E+118
9.975041298589036E+117
7.225310830463566E+117
...
But both, the matrix A, and the vector BB that I provide to DGELS are exactly the same when I print them before calling DGELS in both programs.
Any idea of what could be going on with this?