Silverfrost Forums

Welcome to our forums

Dum Array

7 Jul 2020 10:05 #25930

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

      CALL RAOPHS (AOMGE(1,IH),RAO1(1,1,IH),DUM,RAO2(1,1,KH),DUM,      
     2 KREC(IH),IR,IV,IH,IPHS)
                                      

RAOPHS.for

      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]

8 Jul 2020 7:26 #25933

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.

8 Jul 2020 3:49 (Edited: 8 Jul 2020 6:37) #25939

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

8 Jul 2020 4:31 #25941

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.

13 Sep 2020 6:18 #26348

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.

18 Sep 2020 10:04 #26372

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.

12 Dec 2020 3:49 #26759

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.

Please login to reply.