I'm trying to run code for a mathematical algorithm (Conjugate Gradient method). In doing so I input a double precision matrix, defined as such in my preamble. When compiling, I get the follow error:
A=RESHAPE((/ 0,8,0,4,26,8,0,17.5,0,0,0,17.5,0,2.5,-8,4,0,2.5,0,-5,26,0,-8,-5,0
1
Error: Element in INTEGER(4) array constructor at (1) is REAL(4)
make: FTranProjectBuilder: Error: Execution exited with code 2
*** [cg_main.o] Error 1
My definition in the program with the matrix being defined is given as such (the array definition is the first operation of my program):
PROGRAM cg_main
IMPLICIT NONE
INTEGER,PARAMETER ::d=5 !use a parameter for the dimensions (simple)
DOUBLE PRECISION,DIMENSION(d,d) ::A !matrix
INTEGER,DIMENSION(2) ::order2 = (/ 2, 1 /) !matrix reshape order
[MORE DECLARATIONS HERE]
A=RESHAPE((/ 0,8,0,4,26,8,0,17.5,0,0,0,17.5,0,2.5,-8,4,0,2.5,0,-5,26,0,-8,-5,0 /),(/d,d/), order2) !specify dxd matrix
[MORE CODE HERE]
END PROGRAM
The code works without the decimal numbers in my matrix input, but doesn't seem to with my decimals and I have no idea why.