title: Contains statement
body: <p>I am not understanding the importance of <strong>CONTAINS</strong> statement in fortran 90</p>
  
  <p>For example</p>
  
  <pre><code>PROGRAM BLABLA
  
  IMPLICIT NONE
  
  INTEGER :: i,j,k
  
  i = 1; j = 1;k =1
  
  PRINT *, i,j,k
  
  CALL ABC(i,j,k)
  
  PRINT *, i,j,k
  
  CONTAINS
  
      SUBROUTINE ABC(r,s,t)
  
      IMPLICIT NONE
  
      INTEGER, INTENT(IN) :: r,s
      INTEGER, INTENT(OUT) :: t
  
      t = r + s
  
     END SUBROUTINE ABC
  END PROGRAM BLABLA
  </code></pre>
  
  <p>and one by defining subroutines outside the main program. I understand for functions, one need to specify the type of the function, but for subroutines it is not required. I am interested in understanding whether there are any additional caveats in doing so?</p>
  
  <pre><code>PROGRAM BLABLA
  
  IMPLICIT NONE
  
  INTEGER :: i,j,k
  
  i = 1; j = 1;k =1
  
  PRINT *, i,j,k
  
  CALL ABC(i,j,k)
  
  PRINT *, i,j,k
  
  END PROGRAM BLABLA
  
  SUBROUTINE ABC(r,s,t)
  
  IMPLICIT NONE
  
  INTEGER, INTENT(IN) :: r,s
  INTEGER, INTENT(OUT) :: t
  
  t = r + s
  
  END SUBROUTINE ABC
  </code></pre>