- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
I was compiling some old code and I got an error
Error 8284 If the actual argument is scalar the dummy argument shall be scalar:
The code dates from '72 and it has not been modified.
Error 7983 The storage extend of the the dummy argument exceeds that of the actual argument
Ideas?
John
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aren't you happy that the compiler found a bug in the old code? It sounds as if the programmer violated multiple Fortran language rules about scalar/array argument matching for convenience, knowing that compilers of the day didn't catch the error.
The first error is if you call a routine passing a scalar to an array - sometimes this was done with passing a 1 for a separate size argument. The language has never allowed this, but you could get away with it if compilers didn't check. With generated interface checking, we do. If the called routine doesn't modify the argument, you can change it to an array constructor by enclosing the scalar in []. For example:
call foo (,1)
The second error is if you do something like this:
integer a(5) call sub (a) ... subroutine sub (aa) integer aa(10)
The compiler notices that a is only 5 elements but aa is 10. This is an error. I can't suggest how to fix this other than to note that explicit dimensions for dummy arguments can often be a problem - maybe use (*) instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the comments - yes I am having fun.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This program is TABS, had it since 81 never been able to get it running - thought I would waste a day
He passes T(18) to an subroutine as t(3,6)
In the original routine he calls T(1) - how do you map the T(18) to T(3,6)
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
size(T(18)) .eq. size(t(3,6))
perfectly acceptable.
>> how do you map the T(18) to T(3,6)
In Fortran array subscript priority is left to right
(1,1,), (2,1), (3,1), (1,2), (2,2), (3,2), ...
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jim is correct - it's perfectly fine to pass a rank-1 array to a rank-2 array when the interface is implicit.
John, please look at the standard intrinsic procedure SYSTEM_CLOCK (for elapsed time) and CPU_TIME (for CPU time). "second" is a nonstandard library routine that may or may not match what we have in the portability library.
You are not getting any error messages. The warnings you get aren't about the type not matching. Rather, you are getting warnings that items in the common blocks are not aligned on natural boundaries - this can hurt performance. You can either rearrange the COMMONs so that each item starts on an offset that is a multiple of its type size (4 bytes for integer and real, 8 for double precision, etc.), or you can turn off alignment warnings, or just ignore the warnings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is the read statements that are killing me and the lack of a manual.
It I set up for Punch cards and doing it in a text files is challenging -- a bit of surgery will be needed
Sorted the commons
Slow going.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
John Nichols wrote:
It is the read statements that are killing me and the lack of a manual.
Perhaps this the documentation that you need: https://nisee.berkeley.edu/elibrary/Text/150136 .
The code that you posted is not the original Fortran-4 or Fortran-77 code, and your modifications seem incomplete, since the code cannot be compiled. Do you have the original code without modules?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have the original code - attached.
I have a membership to NISEE and I am trying at the moment to get the manual - just did not have any luck yesterday. I will probably get it today.
I have played with TABS a few times over the years and have not managed to get it running - only program that eludes me from the UCB days that I am interested in.
I am looking to use it to check the results from Harrison -- and ULARC.
The original file taken from the mag-tape is in this set - it is easy to spot. T.DAT is the only data file I have that is original.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The missing SECOND() subroutine is just for timing the runs. You can use the matching routine in IFPORT, or simply write a dummy subroutine that just returns 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks --
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had a nice email from NISEE telling me how to get the manual, they are moving to the cloud and apparently things are a bit confused.
They guy said TABS had suddenly become popular. I just smiled and then explained about the forum posting.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The data file as originally stood is copied off punch cards, the compiled program is having some trouble with it. One of the issues is putting strings at the end of integer data lines, it was not reading properly. I put the comment lines in as separate lines so that is slowly working out the problems.
Slowly getting there. The real problem is that the A matrix is created at the main program and used to store everything -- the writers stored reals, characters and integers in it . As I pull the code apart and make the variables declared it is causing some interesting problems. I just have to get rid of A and create separate matrices.
I thanked mecej4 in a paper for all the help. I was asked by the editor -- what is an mecej4. I said a brilliant programmer who shall remain nameless.
Lot of fun - and likely to be useful.
Microsoft pushed out an update from Windows 10 fast ring in 2 days -- EDGE was flaky for since the last update - wonder what happened - never been this fast.
YOu can now open doc files in Edge and edit them -- or so I read
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
COMMON /JUNK1/JNK(130) COMMON /JUNK2/ NLD,N,ND,MM,MN,LM(6),SS(6,6),P(6,3),T(6) COMMON /JUNK3/ NLD,N,ND,MM,MN,LM(6),SS(6,6),P(6,3) COMMON /JUNK4/ NLD,N,ND,MM,MN,LM(6),SS(6,6),P(6,3),T(2,4) COMMON /JUNK5/ NLD,LOC(30) COMMON /JUNK6/AI(3),AJ(3)
In TABS, the SS matrix is shown in junk --- numbered consequitvely -- it is the stiffness matrix - it is made and then stored in Junk4 - but JUNK4 is no where else -- is there something about JUNK commons I am missing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the original there is no junk1..7 only junk. In the main we have jnk(130) which reserves some memory. The other junks are just different temporary ways of re-using the same memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Note that jnk in main is never actually used the name junk implies that this is just a temorary work space and as many compilers reserved static memory for locals it would have overall saved a bit of memory. Do you know what the integer and real kinds that were used?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Certainly an interesting program.
I have played with the oldest one -- as you noted the JUNK is only a single common. The authors use an interesting technique of not putting in node numbers for the structure - but looking at the structure as a regular array of elements -- quite novel actually --
The problem with the original one is that the element called NB or number of beams counts to 2 as it reflects the beams on a single floor on one frame, but the LM array is counting all the beams -- so it gets to 4 by 3 by 2 so it gets upset as there is only 8 points in the array
I have got further on the module one -- slowly working out how their mind works.
Fun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
andrew_4619 wrote:
Note that jnk in main is never actually used the name junk implies that this is just a temorary work space and as many compilers reserved static memory for locals it would have overall saved a bit of memory. Do you know what the integer and real kinds that were used?
No I have no idea what computer was used in 72 when the program was written - nor the size of the Integers or reals.
I got the it running upto static analysis a short while ago, the easiest steps seemed to be:
Pull out the A matrix which was used to store everything and had a size of 3000 - the program just divided it up - passed the pointers to the start locations for each division and then use it for any variable it needed to store in an array. I worked backwards and created arrays at the main program routine of decent sizes and then passed to them in place of A(N1), A(N3) etc.
Unfortunately some of the array names were reused, but were not the same array - took some working out.
The authors used unformatted tmp files to hold (tape) data between routines, I was getting errors where the program just halted at the read - so I put in a tmp formatted file for each of the write (2) type statements and then I could check the data and the read (2) statements. Interestingly in one location they read the first line, but missed the third element - did the same read again but asked for the 3rd element - of course no rewind, so the program ran out of data.
But topologically this has some interesting concepts.
So the fun continues.
We appear to potentially have some student homework questions being asked.
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page