forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

error 215 - Invalid expression on left hand side of assignme
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mike.smartcam



Joined: 02 Aug 2014
Posts: 40
Location: Lancashire, United Kingdom

PostPosted: Tue Nov 11, 2014 6:06 pm    Post subject: Reply with quote

Thank you for the advise and assistance from all
_________________
Regards

Mike
Back to top
View user's profile Send private message Send e-mail
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Nov 12, 2014 1:28 am    Post subject: Reply with quote

As Mecej4 has stated : "There are no separate rules for what you can have or not have in include-files."

There is a lot of flexibility in what you place in an include file.
I have used an include file list (all.f90), being include "filex.f90" to simplify the compile and link procedure. It makes the command much simpler, by effectively having only one file for the whole project. Finally: "FTN95 all /link" builds the project.
I use this approach to enable argument list checking or group those routines that I want to include for a /timing option. ( I'd recommend everyone should review the /timing option, as it is very useful for checking performance. Just make sure you exclude some of the low level routines.)

To think of the resulting file, after all includes have been merged gives a good understanding. Include can be any group of Fortran code snippets that suit the purpose.

John
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Nov 12, 2014 3:50 pm    Post subject: Reply with quote

MECEJ4,

When you port code from one compiler to another, you invariably run foul of the extensions allowed by the original compiler, and disallowed by the second. If you allow yourself to be distracted by altering your programming style at this point, you will compound the problem of ever getting the program working with the new compiler.

Watcom's authors took a different line on extensions to the standard than the authors of FTN77, the latter choosing to provide extra system routines (usually, but not always of the SUBPROGRAM@ variety). Watcom, on the other hand, permits extensions to Fortran 77 that look more like later Fortrans.

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 (as distinct to a computer scientist steeped in conventional theory), especially in the case of the former who just wants his DOS or mainframe software to work on his PC in Windows so that he can go on using it

If I was starting from scratch, and I were decades younger, then I would probably follow your advice to the letter. In this case, and at this point in the process, it may well not be the most helpful suggestion.

Eddie
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Wed Nov 12, 2014 5:10 pm    Post subject: Reply with quote

Eddie, the OP wrote "At this stage I am just trying to build working modules prior to porting to a Windows application." That is why I suggested using modules instead of common blocks.

It is reasonable to expect that the OP is going to evaluate any suggestions given here as to suitability, time commitment, usefulness, etc., before adopting them. If OpenWatcom were a viable replacement for the defunct Watcom compiler, and he/she is aware of OpenWatcom, there would have been fewer reasons to consider switching compilers. Given that a switch is being made, there is an opportunity here to make some worthwhile improvements.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Nov 12, 2014 5:45 pm    Post subject: Reply with quote

Understood, and point taken. However, don't forget that 'module' meant 'separately compilable file' for long before it meant what it does in Fortran 90 et seq.

E
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Wed Nov 12, 2014 6:20 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Nov 12, 2014 11:57 pm    Post subject: Reply with quote

Eddie,

You wrote
Quote:
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
Back to top
View user's profile Send private message
Masoud.Ravan



Joined: 17 May 2016
Posts: 1
Location: Iran

PostPosted: Tue May 17, 2016 8:51 pm    Post subject: Reply with quote

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:
(((error 215 - Invalid expression on left hand side of assignment)))
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]
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Tue May 17, 2016 10:22 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed May 18, 2016 6:34 am    Post subject: Reply with quote

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.
Code:
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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group