FORTRAN 77 Statements

Document Sample
FORTRAN 77 Statements Powered By Docstoc
					                Краткий справочник по языку Fortran
              FORTRAN 77                              FORTRAN 90(95)
                                 Типы данных
   INTEGER 4 bytes                          TYPE [[, access] :: ] name
   REAL 4                                      component-definition
   DOUBLE PRECISION 8                          [component-definition]...
                                              END TYPE [ name ]
   COMPLEX 8
                                             Конструктор: name (value, [value])
   LOGICAL 4
   CHARACTER 1
   CHARACTER*n n (maximum n is 32,767)
                            Команды (Statements)
                                    Объявления
 IMPLICIT type (letters) [, type  CHARACTER[(LEN=length)] v
(letters)] ...                             REAL[([KIND=]8)], INTEGER[([KIND=]2)]
 PARAMETER      (name=constexpr      [,  TYPE(typeName) v
name=constexpr] ...)                       type v(:[,:]) [,v(:[,:]) ] ...
 type v[(dim)] [, v[(dim)] ] ...          type [ [, attr ]... ::] v[=value]...
 DIMENSION array ([lower:]upper [,         attr=(INTENT(IN|OUT) | POINTER | ...)
{[lower:]upper ] )                         OPTIONAL [::] d-arg [, d-arg] ...
 EXTERNAL name [, name ] ...
                                   Единицы кода
 PROGRAM program-name                     MODULE name
 SUBROUTINE    subr   [([  formal    [,       [specification-part]
formal ] ...] )]                             [CONTAINS
 [type] FUNCTION func ([formal ] [,           module-subprogram
formal ] ...)                                  [module-subprogram] ...]
 END                                      END FUNCTION, END SUBROUTINE
 STOP [message]                           USE name [, rename-list ] ...
 RETURN [ordinal ]                        USE name, ONLY : [, only-list ]
 CALL sub [( [actuals] )]                 INTERFACE [ generic-spec ]
                                               [ interface-body ] ...
                                             END INTERFACE [ generic-spec ]
                             Управляющие конструкции
 result = v[(index)]                      ALLOCATE (ob[(...)] [, ob[(...)] ] )
 DO [label] var = start, stop [, inc]  DEALLOCATE (ob [, ob ] )
 [label] CONTINUE                         NULLIFY (ob [, ob ] )
 GOTO label                               result = typed_var%component
 IF (expression) statement                result => NULL() (Fortran 95)
 IF (expression) THEN                     END DO, CYCLE, EXIT
      statementblock1                      SELECT CASE (expr)
   [ELSE IF (expression) THEN                [CASE (value [,value] ...) [name]
      statementblock2] ...                     block] ...
   [ELSE                                     [CASE DEFAULT [name]
      statementblock3]                         block]
   END IF                                    END SELECT [name]
                                    Ввод/вывод
 OPEN ( [UNIT=]unitspec [, ACCESS=access] [, BLANK=blanks] [, ERR=errlabel] [,
FILE=file] [, FORM=form] [, IOSTAT=iocheck] [, RECL=recl] [, STATUS=status] )
 CLOSE ( [UNIT=]unitspec [, ERR=errlabel] [, IOSTAT=iost] [, STATUS=status] )
 PRINT { *, | formatspec | } [, iolist]
 WRITE ( [UNIT=] unitspec [, [FMT=] formatspec] [, ERR=errlabel] [,
IOSTAT=iocheck] [, REC=rec] ) iolist
 READ {formatspec, | ( [UNIT=] unitspec [, [FMT=]formatspec] [, END=endlabel ]
   [, ERR=errlabel] [, IOSTAT=iocheck] [, REC=rec] )} iolist
 FORMAT [editlist]