2

I have 5 arrays defined as

Real, Allocatable :: ruvw(:,:,:)
Real, Allocatable, Dimension(13) :: a, b, c, d, e

Allocate (ruvw(13,5,2))
Allocate (a(13),b(13),c(13),d(13),e(13))

I am trying to fill ruvw using the other array in the following way

ruvw(:,:,1) = [a,b,c,d,e]

I am getting error

Incompatible ranks 2 and 1 in assignment at (1)

1 Answer 1

3

Yes, what the

 [a,b,c,d,e]

does is that it concatenates the 1D arrays in to a long one, it does not build a 2D one. You have to use reshape([a,b,c,d,e], [13, 5] ) to get the 2D array out of it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.