Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

My FORTRAN object oriented code is very slow. Any suggestions?

$
0
0

Hi..

Would you please help me understand what is wrong with the below code structure. I spent a couple of months for converting my straight code into modules and subroutines similar to a form as below. Now, the speed of my code has decreased four times. By the way, in the new structure I didnt use 'interface" and the code works fine. The huge issue is right now is the speed. 

The new object oriented code structure

module arrayMod
  real,dimension(:,:) :: theArray
end module arrayMod

program test
   use arrayMod
   implicit none

   call arraySub
   write(*,*) (thenewArray)

end program test

subroutine arraySub
   use arrayMod

   write(*,*) 'Inside arraySub()'
   perform operations

end subroutine arraySub

 

The old straight forward code structure

program test
   implicit none
   real,dimension(:,:) :: theArray

   perform the operations
   write(*,*) (thenewArray)

end program test

 


Viewing all articles
Browse latest Browse all 2746

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>