I want to element wise multiply two arrays A and a sub array of B in fortran(90)
A is 4d and B is 5d. Initially I tried this but the compiler doesn't like it
C(:,:,:,:)=A(:,:,:,:)*B(:,:,:,:,1)
is there an easy way to extract B(:,:,:,:,1) as a 4d array such that I can do the binary operation *?
edit - error message from compiler
tracer1_field(:,:,:,:) = tbase(:,:,:,:,1)*domain(:,:,:,:) ! *12*12*!2 due to grid size.
1
Error: Rank mismatch in array reference at (1) (5/4)
tbaseis of rank 4 instead of anything else. I'd check that before anything.