Silverfrost Forums

Welcome to our forums

error 215 - Invalid expression on left hand side of assignme

12 Nov 2014 5:20 #15052

About 'load modules', a la IBM 360. It took me many months to digest that concept, given that the only interface allowed ordinary mortals involved turning in a pack of punched cards and coming back a day later to receive the cards with printed output.

I think that even today some large computers use 'module' in the sense of a large system package, such as Abaqus or CERN, that the user's program is supposed to be linked to. There are shell commands to access and use such system modules.

12 Nov 2014 10:57 #15060

Eddie,

You wrote

It's a moot point as to whether the facilities of Fortran 90/95/2003 are always of much benefit to the engineer who programs

I struggle with this all the time, as I see changes in F2003 and also F2008 which look to make Fortran programming much too complex. I am not sure if these approaches are generally used by Fortran programmers but I wonder how robust these programming approaches are. In the 80's I developed 'bandwidth optimisers' which were basically manipulating tree connectivity relationships. These were probably the most complex inter related data structures I have had to use. I found that the solution was not so much a way of describing the tree structure in some elegant TYPE structure, but adapting the relationship indexing to provide a simple and more efficient problem definition. Most of my coding involves setting up fairly simple data lists (using TYPE in a MODULE) and managing the computation in an efficient way, where the simplicity of the clearly defined data structures usually delivers the efficiency.

My views on robust and simple coding techniques are not shared in the F2008 community, but I wonder what they do. One even told me to leave !

John

17 May 2016 7:51 #17489

Hi group I want to have a subroutine that could process on matrices...I have written a simple program but the compilation was failed and i got this error: ((([color=red:827a41c26e]error 215 - Invalid expression on left hand side of assignment[/color:827a41c26e]))) Program Code: PROGRAM TEST IMPLICIT NONE INTEGER N REAL, ALLOCATABLE :: A( : ), B( : ) READ(,) N ALLOCATE(A(N)) ALLOCATE(B(N)) A=1 CALL TDMA(N, A, B) END PROGRAM

!-----------------------------------

SUBROUTINE TDMA(N,A, B) INTEGER I DO I=1, N A(I)=B(I) END DO END SUBROUTINE TDMA

Help me Please


Regards Masoud[/code]

17 May 2016 9:22 #17490

In the subroutine you need to declare A and B as arrays. Since you are passing the size of the arrays, you could use this in the array declaration.

18 May 2016 5:34 #17491

You need to declare A and B in the subroutine. Also, as you have A = B, you also need to initialise B with values before you use it. The following applies these corrections. PROGRAM TEST IMPLICIT NONE INTEGER N REAL, ALLOCATABLE :: A( : ), B( : ) ! READ(,) N ALLOCATE(A(N)) ALLOCATE(B(N)) ! A=1 ! you assign B to A so B should first be defined b = 1 CALL TDMA(N, A, B) write (,) ' B and A now defined' END PROGRAM

 !----------------------------------- 

 SUBROUTINE TDMA(N,A, B) 
 integer n
 real a(n), b(n)
 INTEGER I 
!
 DO I=1, N 
   A(I)=B(I) 
 END DO 
 END SUBROUTINE TDMA 
Please login to reply.