Fortran

Guide To Learn

New Fortran elements, at a glance

  • functionend function for defining a function.
  • subroutineend subroutine for defining a subroutine.
  • contains statement, used to define procedures within the body of a program.
  • call statement for invoking a subroutine.
  • intent attribute to specify the intention of each procedure argument. (Possible values are intent(in) for an input argument, intent(out) for an output argument, and intent(in out) for an input-output argument.)
  • pure attribute can be used to prohibit side effects in procedures.
  • elemental attribute allows procedures to operate on both scalars and arrays of any rank and size. (By default, elemental procedures are also pure.) impure elemental can be used when you need an elemental procedure that can’t be defined as pure.
  • optional attribute allows you to declare a procedure argument as optional (keyword).
  • Built-in functions:
    • real–Converts a numerical value to a real value. (This function is distinct from the real data type used in declarations.)
    • size–Returns the integer size of an array.
    • present–Checks for the presence of an optional argument inside the procedure.
New Fortran elements, at a glance

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top