
! -- Simon's strings library.
!
!    MODULES: -- code reuse
!             -- encapsulation
!             -- libraries
!             -- beginnings of object-orientation...

! -- A MODULE is very different from and much superior to a Fortran 77-style
!    collection of SUBOUTINEs in a file:
!    
!     -- privacy (PRIVATE/PUBLIC);
!     -- explicit interface for USErs of SUBROUTINEs;

MODULE strings

IMPLICIT NONE
CONTAINS

  ! -- This subroutine is in a different file from the calling code, however
  !    the compiler can still check actual against dummy arguments because
  !    the interface is explicit through USE :

  SUBROUTINE print_string(string)
    IMPLICIT NONE
    CHARACTER(LEN=*), INTENT(IN) :: string

      PRINT *, string

  ENDSUBROUTINE print_string

  ! ---------------------------------------------------------------------------

  SUBROUTINE something_else_stringy()
    IMPLICIT NONE

      ! -- some
      !    lines of code

  ENDSUBROUTINE 

END MODULE strings
