- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a code that compiles smoothly in Microsoft Visual Developer using Digital visual FORTRAN Professional Edition 5.0A compiler in Win-XP in a virtual box (Oracle) in a INTEL I7 computer having (RAM 16GB). All arrays are declared for example as A(100),B(100),etc. The code executable file converges within 4 minutes. The Code output is correct as per scientific literature and calculations.
I have updated the code as per FORTRAN 90/95. I declared arrays as A(0:100), B(0:100), due to the upper bound error which is 1. Now code takes relatively large time to converge, it takes around 35 minutes, and also have a difference in output as compared to previous version of the code. I am using MVS-2022 and Intel FORTRAN compiler (2024 latest) in an intel I7 computer having (RAM 16GB).
I just changed the array format from A(100) to A(0:100). All of the arrays.
Both codes take 636 iterations to converge to a certain result.
I have also tested the code (old version executable file) in my personal computer, it takes around 11 minutes to converge with correct results. I have a Intel core m3 (8GB RAM). I have tested it again then it converged in 14 minutes.
Look at the following variable declaration (Old code)
Look at the following variable declaration (New code)
My task is to converge the code within less time as compared to the old version which converges within 4-mintues with correct results.
Link Copied
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
debug has all optimisation disabled and has additional code checking, it is much slower than release builds. look at the project properties page also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your old code used static arrays A(100), B(100), your test code should ALLOCATE(A(100), B(100)...), or if you wish to be more specific, ALLOCATE(A(1:100), B(1:100), ...), .NOT. A(0:100)
Not doing so can result in:
CALL FOO(A)
...
SUBROUTINE FOO(A)
REAL A(100)
REAL SUMPTN
SUMPTN = A(1) ! this references the 1st location of the dummy argument A, which is the caller's actual argument A(0).
This may be the cause of your different results.
If you need to rearrange your code to use zero based arrays, then you need to check for and correct such errors in programming.
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page