soccer jersey forums.silverfrost.com :: View topic - Dum Array
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 

Dum Array

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato
View previous topic :: View next topic  
Author Message
AKS



Joined: 19 Mar 2008
Posts: 29

PostPosted: Tue Jul 07, 2020 11:05 pm    Post subject: Dum Array Reply with quote

I have a program that runs fine on one machine but when I take it to another machine I get this runtime error:

Runtime error from program:c:\users\aks\desktop\smpnew\checkmate\win32\smp.exe
Run-time Error
Attempt to call a routine with argument number five containing too few array elements

RAOPHS - in file raophs.for at line 28 [+0136]

RMSTOE - in file rmstoe.for at line 143 [+0ba8]

IRGSEA - in file irgsea.for at line 28 [+013b]

main - in file smp91.for at line 128 [+031e]

break point
RMSTOE.for
Code:
      CALL RAOPHS (AOMGE(1,IH),RAO1(1,1,IH),DUM,RAO2(1,1,KH),DUM,     
     2 KREC(IH),IR,IV,IH,IPHS)


RAOPHS.for
Code:
      COMMON/PHYSCO/II,TPI,PI,PIOT,DEGRAD,RADDEG,VKMETR,METRVK,GRAV,RHO,
     2 GNU,RHOS,RHOF,GNUS,GNUF,FTMETR,PUNITS,REYSCL


The errors come in the lines that begin with 2. I checked the variable named DUM and it says that it's undefined. This code works on another computer without any issues[/i]
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 08, 2020 8:26 am    Post subject: Reply with quote

AKS

This issue relates to the FTN95 compiler rather than the Plato editor/IDE but since you raise it here...

If you are using FTN95 on both machines then in this context you will almost certainly get the same results provided that you use the same command line options. My assumption here is that you have used something like /CHECKMATE on one machine but not on the other.

I don't know if you have provided enough information for me to identify your error. If you compile using /CHECKMATE and run the program using the debugger SDBG (or SDBG64 for 64 bits) then the execution will stop at the error and you should be able to discover the fault.
Back to top
View user's profile Send private message AIM Address
AKS



Joined: 19 Mar 2008
Posts: 29

PostPosted: Wed Jul 08, 2020 4:49 pm    Post subject: Reply with quote

On both machines I'm using FTN95 with Checkmate/Win32. I stepped through in the the debugger and it gives me an error at the 2nd line of the call command

Edit: The computer where it works is running the program from a shared network and the one where it doesn't is being run from the local drive


Last edited by AKS on Wed Jul 08, 2020 7:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1896

PostPosted: Wed Jul 08, 2020 5:31 pm    Post subject: Reply with quote

Your program may have a benign bug: passing a scalar such as DUM as an argument when the corresponding dummy argument in the called subroutine/function is an array. The name DUM suggests that this argument is merely a placeholder, and that it will never be used in the callee.

Compiling and running with /CHECKMATE will give you the following problem: regardless of whether DUM will be used in the subprogram, as soon as that subprogram is entered the scalar vs. array mismatch will be detected and execution will stop.

If this is the case, either fix the code or do not use /CHECKMATE.
Back to top
View user's profile Send private message
TonyGray



Joined: 12 Sep 2020
Posts: 2
Location: Edinburgh

PostPosted: Sun Sep 13, 2020 7:18 pm    Post subject: Reply with quote

This is a left over from old Fortan IV code. Whilst you can usually compile individual programs with old code like this, you can't link them if the variables to be passed between subroutines have different dimensions.

In Subroutine RMSTOE you need to dimension DUM by adding a line of code
DIMENSION DUM (30,8)

The outcome is that DUM will now have the same dimensions as PHS1 and PHS2 in subroutine RAOPHS.

This applies to SMP81, SMP84 and SMP93.
Back to top
View user's profile Send private message Send e-mail
TonyGray



Joined: 12 Sep 2020
Posts: 2
Location: Edinburgh

PostPosted: Fri Sep 18, 2020 11:04 am    Post subject: Reply with quote

SMP stands for the Standard Ship Motion Program. The digits XX refer to the year of release. The printed code and manuals for earlier versions are freely available on the internet.
My academic interest is in ship motions, and I have spent many hours, off and on, converting these old CDC 7600 codes to F77 so they will run on a PC.
Back to top
View user's profile Send private message Send e-mail
mecej4



Joined: 31 Oct 2006
Posts: 1896

PostPosted: Sat Dec 12, 2020 4:49 pm    Post subject: Reply with quote

John, the '2' is just a continuation mark in column 6, and is not material to the error.

If the source file had been free-form Fortran, and the two lines had been unfolded into a single line, the error would still remain. Such errors (rank of actual array argument not the same as rank of dummy array argument) are usually detected at run time, and then only if checking code has been inserted. In this case, the error is benign and the program works as originally intended if the checking is turned off.

Things could have been clearer if the source code had been posted and you could try running the compiler on it.
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 -> Plato All times are GMT + 1 Hour
Page 1 of 1

 
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