VMS Help  —  FORTRAN  Statements  DATA
  Assigns values to variables at compile time.  The values within the
  backslashes are assigned to the preceding variables left to right;
  the number of values must equal the number of variable elements.
  Statement format:

     DATA nlist/clist/[[,] nlist/clist]...

     nlist  Is a list combining any combination of variables
            and implied-DO lists, separated by commas.  RECORD
            structures are not allowed in this list.

            Subscript expressions and expressions in substring
            references must be initialization expressions.

            An implied-DO list in a DATA statement takes the
            following form:

            (dlist, i = n1,n2[,n3])

            dlist     Is a list of one or more array elements,
                      character substrings, scalar structure
                      components or implied-DO lists, separated
                      by commas.

            i         Is the name of a scalar integer variable.

            n1,n2,n3  Are scalar integer expressions.  The
                      expression can contain implied-DO variables
                      of other implied-DO lists that have this
                      implied-DO list within their ranges.

     clist  Is a list of constants separated by commas; "clist"
            constants take one of the following forms:

            c OR n*c

            c  Is a constant or the symbolic name of a constant.

            n  Defines the number of times the same value is to
               be assigned to successive entities in the associated
               "nlist"; "n" is a nonzero, unsigned integer constant
               or the symbolic name of an unsigned integer constant.

  The DATA statement assigns the constant values in each "clist" to
  the entities in the preceding "nlist", from left to right, as they
  appear in the "nlist".  The number of constants must equal the
  number of entities in the "nlist".

  When an unsubscripted array name appears in a DATA statement,
  values are assigned to every element of that array in the order of
  subscript progression.  The associated constant list must contain
  enough values to fill the array.

  The following objects cannot be initialized in a DATA statement:

   o  A dummy argument

   o  A function

   o  A function result

   o  An automatic object

   o  An allocatable array

   o  A variable that is accessible by use or host association

   o  A variable in a named common block (unless the DATA statement
      is in a block data program unit)

   o  A variable in blank common

  For details, see the HP Fortran for OpenVMS Language Reference
  Manual.
Close Help