Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-20-2014, 12:03 PM   #1
Registered: Mar 2014
Posts: 444

Rep: Reputation: Disabled
Need an explanation for gfortran interface code.

Hi there,

I had this code. The original code, however, did not have that interface part that follows the comment: ! THIS IS THE RIGHT WAY.

program main
  integer*4 :: N, counter
  real (kind = 8), dimension(:), allocatable :: work
         subroutine test00_1 ( N, work )
           real*8, dimension(:) :: work
         end subroutine test00_1
      end interface
  open (unit=1,file="triangleWindow.dat",status = "old")
  N = 2310  
  allocate (work(1:N))
  call triangularWindow ( N, work )
10 format (E10.5)
  counter = 0
  do while (counter .le. N )
    counter = counter + 1
    write (1,10) work (counter)
  close (unit=1)
  call test00_1 ( N, work )
end program main
Without the Interface I was getting this compilation error:

Error: Dummy argument 'work' of procedure 'test00_1' at (1) has an attribute that requires an explicit interface for this procedure
Of, course I don't understand what it all means. So, I did some googling and found this webpage which turned out to be very useful.

The error disappeared. Fine, but I still do not understand why it worked. Any help will be appreciated. Thanks, A.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
explanation of a code uma.g Linux - Newbie 2 02-03-2013 10:23 AM
Can't compile f77 code using gfortran or g77 GradientDrift Programming 2 11-18-2009 10:18 PM
awk code explanation pete1234 Programming 2 10-14-2006 07:05 PM
Code explanation ... ? dbee Linux - Software 1 12-17-2005 01:06 AM
fat fs code explanation ramya272 Programming 0 03-06-2004 09:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration