Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Array assignment in fortran
Array assignment in fortran
The meaning of this error message is that all elements in the array assignment statement must be of the same data type.

The variable A is real(8). Although the assignment in the program is plastic (/ 1, 2,3/), fortran will automatically convert it into real(8).

C=(/ 1, a(2:3)/) In this sentence, 1 is plastic, and the following A (2: 3) is a real number (8), so the data type is different, so the error is reported.

Can be changed to

c=(/ 1.0_8,a(2:3)/)