concept specific procedure in category fortran

appears as: Specific procedure, A specific procedure, specific procedures, specific procedures, specific procedure
Modern Fortran: Building efficient parallel applications

This is an excerpt from Manning's book Modern Fortran: Building efficient parallel applications.

  • Specific procedure--A specific procedure is the implementation of a function or subroutine that’s specific to the input data type. For example, if you’re writing a function to average integer or real numbers, you’d write specific functions, for example, average_int and average_real.
  • Listing 9.4. Defining a generic interface to specific procedures
    language="fortran" linenumbering="unnumbered">module mod_average
      ...
      private           #1
      public :: average #2
      ...
      interface average                     #3
        module procedure :: average_int     #4
        module procedure :: average_real   #4
        module procedure :: average_logical #4
      end interface average                 #5
      ...
    contains
      ...               #6
    end module mod_average

    The interface specifies the name of our new generic procedure, average, and lists the specific procedures that are to be overridden. Recall the interface that we wrote in the previous chapter (section 8.2.6) to override the default type constructor with a custom function: