Fortran Coder

查看: 5721|回复: 3
打印 上一主题 下一主题

[讨论] Fortran是否是关键字最多的语言?

[复制链接]

69

帖子

7

主题

0

精华

专家

F 币
320 元
贡献
224 点
跳转到指定楼层
楼主
发表于 2014-10-9 06:09:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fortran每个标准都在增加功能,增加功能就增加关键字,有人清楚Fortran2008有多少关键字?在学过的几门语言中个人感觉好像没有Fortran这么多关键字的。

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

736

帖子

4

主题

0

精华

大师

农村外出务工人员

F 币
700 元
贡献
359 点

新人勋章爱心勋章水王勋章元老勋章热心勋章

沙发
发表于 2014-10-9 08:26:31 | 只看该作者
[Fortran] 纯文本查看 复制代码
!=====================================================================
! Fortran 90/95/2003 Syntax Highlighting Schemes
!=====================================================================
!
! Fortran Keywords:
!
!   1. Statements (except Types, Attributes, and I/O)
!      and Statement Clauses
!
!   2. Type Statements
!
!   3. Intrinsic Precedures
!
!   4. Attributes
!
!   5. I/O Statements
!
!   6. Specifiers/Clauses and Parameters,
!      followed by "=" and enclosed in ()
!
!   7. Logical Operators and Constants
!
!   8. Intrinsic Modules
!
!=====================================================================

!==================================================
! 1. Statements (except Types, Attributes, and I/O)
!    and Statement Clauses
!==================================================

END PROGRAM ENDPROGRAM MODULE ENDMODULE

FUNCTION ENDFUNCTION SUBROUTINE ENDSUBROUTINE

RECURSIVE PURE ELEMENTAL RESULT

USE ONLY IMPLICIT NONE CONTAINS STOP RETURN CALL

TYPE ENDTYPE SEQUENCE GENERIC FINAL CLASS PROCEDURE

INTERFACE ENDINTERFACE ASSIGNMENT OPERATOR IMPORT

DO WHILE EXIT CYCLE ENDDO

IF THEN ELSE ELSEIF ENDIF

SELECT CASE SELECTCASE SELECTTYPE DEFAULT ENDSELECT IS
! "IS": a clause used in "TYPE IS" and "CLASS IS" statements (f2003)

ALLOCATE DEALLOCATE NULLIFY

WHERE ELSEWHERE ENDWHERE FORALL ENDFORALL

ENUM ENDENUM ENUMERATOR ASSOCIATE ENDASSOCIATE

! Redundant/Obsolescent, not recommended to use
DATA COMMON EQUIVALENCE INCLUDE ENTRY CONTINUE PAUSE

! Redundant/Obsolescent, not recommended to use
BLOCK BLOCKDATA ENDBLOCK ENDBLOCKDATA ASSIGN TO GO GOTO

!-------------
! Fortran 2008
!-------------

ENDPROCEDURE

SUBMODULE ENDSUBMODULE

ALLSTOP

CRITICAL ENDCRITICAL

!===================
! 2. Type Statements
!===================

INTEGER REAL COMPLEX CHARACTER LOGICAL

! Redundant/Obsolescent, not recommended to use
DOUBLE PRECISION DOUBLEPRECISION

!========================
! 3. Intrinsic Procedures
!========================

! Numeric Function that may Type/Kind Convert (Generic)
INT NINT CEILING FLOOR AINT ANINT REAL DBLE DPROD CMPLX AIMAG LOGICAL
! duplicate with "REAL" and "LOGICAL" type statements

! Numeric Function that do not Type/Kind Convert (Generic)
MAX MIN ABS SIGN DIM MOD MODULO CONJG MERGE

! Mathematical Computing (Generic)
SQRT EXP LOG LOG10 SIN COS TAN ASIN ACOS ATAN ATAN2 SINH COSH TANH

! Character Handeling (Generic)
LEN LEN_TRIM CHAR ICHAR ACHAR IACHAR INDEX SCAN VERIFY
LGE LGT LLE LLT ADJUSTL ADJUSTR TRIM REPEAT NEW_LINE

! Numeric Manupulation (Generic)
RADIX DIGITS MAXEXPONENT MINEXPONENT TINY HUGE RANGE PRECISION
EPSILON EXPONENT FRACTION SPACING RRSPACING NEAREST SCALE SET_EXPONENT
! duplicate with "PRECISION", a clause of type "DOUBLE PRECISION"

! Bit Manipulation (Generic)
BIT_SIZE BTEST IBSET IBCLR IAND IOR IEOR NOT IBITS MVBITS ISHFT ISHFTC

! Array Operation (Generic)
ALLOCATED SHAPE SIZE LBOUND UBOUND
DOT_PRODUCT MATMUL TRANSPOSE CSHIFT EOSHIFT
ALL ANY COUNT SUM PRODUCT MAXVAL MINVAL MAXLOC MINLOC
RESHAPE PACK UNPACK SPREAD

! Random Number and System/Fortran Environment (Generic)
RANDOM_SEED RANDOM_NUMBER
DATE_AND_TIME SYSTEM_CLOCK CPU_TIME
COMMAND_ARGUMENT_COUNT GET_COMMAND GET_COMMAND_ARGUMENT
GET_ENVIRONMENT_VARIABLE IS_IOSTAT_END IS_IOSTAT_EOR

! Miscellaneous (Generic)
KIND SELECTED_INT_KIND SELECTED_REAL_KIND SELECTED_CHAR_KIND
PRESENT ASSOCIATED SAME_TYPE_AS EXTENDS_TYPE_OF
NULL TRANSFER MOVE_ALLOC

! Specific Procedures (not recommended to use)
IFIX IDINT DINT IDNINT DNINT FLOAT SNGL
MAX0 MIN0 MAX1 MIN1 AMAX0 AMIN0 AMAX1 AMIN1 DMAX1 DMIN1
IABS DABS CABS ISIGN DSIGN IDIM DDIM AMOD DMOD
DSQRT CSQRT DEXP CEXP ALOG DLOG CLOG ALOG10 DLOG10
DSIN CSIN DCOS CCOS DTAN DASIN DACOS DATAN DATAN2 DSINH DCOSH DTANH

!-------------
! Fortran 2008
!-------------

! Bit Manipulation (19)
BGE, BGT, BLE, BLT, SHIFTA, SHIFTL, SHIFTR,
DSHIFTL, DSHIFTR, LEADZ, POPCNT, POPPAR, TRAILZ,
MASKL, MASKR, MERGE_BITS, IALL, IANY, IPARITY

! Mathematical Computing (15)
ACOSH, ASINH, ATANH
BESSEL_J0, BESSEL_J1, BESSEL_JN, BESSEL_Y0, BESSEL_Y1, BESSEL_YN
ERF, ERFC, ERFC_SCALED, GAMMA, LOG_GAMMA
HYPOT

! Array Operation (4)
IS_CONTIGUOUS
NORM2, PARITY, FINDLOC

! System/Fortran Environment (2)
EXECUTE_COMMAND_LINE, STORAGE_SIZE

!Co-Array (7)
IMAGE_INDEX, LCOBOUND, UCOBOUND, NUM_IMAGES, THIS_IMAGE
ATOMIC_DEFINE, ATOMIC_REF

!==============
! 4. Attributes
!==============

PARAMETER DIMENSION ALLOCATABLE EXTERNAL INTRINSIC

POINTER TARGET NON_INTRINSIC ASYNCHRONOUS VOLATILE

INTENT VALUE OPTIONAL SAVE PRIVATE PUBLIC PROTECTED

NON_OVERRIDABLE EXTENDS BIND ABSTRACT DEFERRED PASS NOPASS

!------------
!Fortran 2008
!------------

CONTIGUOUS

!==================
! 5. I/O statements
!==================

NAMELIST FORMAT READ WRITE PRINT FLUSH WAIT

OPEN CLOSE INQUIRE REWIND BACKSPACE ENDFILE FILE
! "FILE", a clause of i/o statement "END FILE" (i.e., "ENDDFILE")

!======================================
! 6. Specifiers/Clauses and Parameters,
!    followed by "=" and enclosed in ()
!======================================

! READ/WRITE/OPEN/CLOSE/INQUIRE/REWIND/BACKSPACE/ENDFILE/WAIT/FLUSH
UNIT IOSTAT IOMSG ERR ! "ERR" is not recommended to use

! READ/WRITE/WAIT
END EOR               ! "END" and "EOR" are not recommended to use
! duplicate with "END" statement

! READ/WRITE
FMT NML REC ADVANCE

! OPEN/CLOSE
STATUS

! READ/WRITE/OPEN/INQUIRE
ASYNCHRONOUS SIGN PAD BLANK DELIM DECIMAL ROUND
! duplicate with "ASYNCHRONOUS/SIGN" attribute/procedure

! READ/WRITE/INQUIRE
SIZE POS ID
! duplicate with "SIZE" procedure

! OPEN/INQUIRE
FILE ACTION FORM ACCESS RECL POSITION ENCODING
! duplicate with "FILE", a clause of i/o statement "END FILE"

! INQUIRE
EXIST OPENED NAMED NUMBER NAME IOLENGTH NEXTREC PENDING
READ WRITE READWRITE FORMATTED UNFORMATTED SEQUENTIAL DIRECT STREAM
! duplicate with "READ/WRITE" i/o statements

! ALLOCATE/DEALLOCATE
SOURCE STAT ERRMSG

! Intrinsic Types
KIND LEN
! duplicate with "KIND/LEN" procedures

!===================================
! 7. Logical Operators and Constants
!    (coloring is editor dependent)
!===================================

.EQ. .NE. .GE. .GT. .LE. .LT.

.NOT. .AND. .OR. .EQV. .NEQV.
! may duplicate with "NOT" intrinsic procedure

.TRUE. .FALSE.

!=====================
! 8. Intrinsic Modules
!=====================

ISO_FORTRAN_ENV

ISO_C_BINDING

IEEE_FEATURES IEEE_EXCEPTIONS IEEE_ARITHMETIC

ISO_VARYING_STRING ! varying length strings (ISO/IEC 1539-2:2000)

!----------------
! ISO_FORTRAN_ENV
!----------------

INPUT_UNIT              ! constants
OUTPUT_UNIT
ERROR_UNIT

IOSTAT_END
IOSTAT_EOR

NUMERIC_STORAGE_SIZE
CHARACTER_STORAGE_SIZE
FILE_STORAGE_SIZE

!--------------
! ISO_C_BINDING
!--------------

C_INT                   ! constants
C_SHORT
C_LONG
C_LONG_LONG
C_SIGNED_CHAR
C_SIZE_T
C_INT8_T
C_INT16_T
C_INT32_T
C_INT64_T
C_INT_LEAST8_T
C_INT_LEAST16_T
C_INT_LEAST32_T
C_INT_LEAST64_T
C_INT_FAST8_T
C_INT_FAST16_T
C_INT_FAST32_T
C_INT_FAST64_T
C_INTMAX_T
C_INTPTR_T
C_FLOAT
C_DOUBLE
C_LONG_DOUBLE
C_FLOAT_COMPLEX
C_DOUBLE_COMPLEX
C_LONG_DOUBLE_COMPLEX
C_BOOL
C_CHAR

C_NULL_CHAR
C_ALERT
C_BACKSPACE
C_FORM_FEED
C_NEW_LINE
C_CARRIAGE_RETURN
C_HORIZONTAL_TAB
C_VERTICAL_TAB

C_NULL_FUNPTR
C_NULL_PTR

C_PTR                   ! types
C_FUNPTR

C_LOC                   ! procedures
C_FUNLOC
C_ASSOCIATED
C_F_POINTER
C_F_PROCPOINTER

!--------------
! IEEE_FEATURES
!--------------

IEEE_FEATURES_TYPE      ! type

IEEE_DATATYPE           ! constants
IEEE_DENORMAL
IEEE_DIVIDE
IEEE_HALTING
IEEE_INEXACT_FLAG
IEEE_INF
IEEE_INVALID_FLAG
IEEE_NAN
IEEE_ROUNDING
IEEE_SQRT
IEEE_UNDERFLOW_FLAG

!----------------
! IEEE_EXCEPTIONS
!----------------

IEEE_STATUS_TYPE        ! types
IEEE_FLAG_TYPE

IEEE_DIVIDE_BY_ZERO     ! constants
IEEE_INEXACT
IEEE_INVALID
IEEE_OVERFLOW
IEEE_UNDERFLOW
IEEE_USUAL
IEEE_ALL

IEEE_GET_FLAG           ! procedures
IEEE_GET_HALTING_MODE
IEEE_GET_STATUS
IEEE_SET_FLAG
IEEE_SET_HALTING_MODE
IEEE_SET_STATUS
IEEE_SUPPORT_FLAG
IEEE_SUPPORT_HALTING

!----------------
! IEEE_ARITHMETIC
!----------------

IEEE_ROUND_TYPE         ! types
IEEE_CLASS_TYPE

IEEE_DOWN               ! constants
IEEE_NEAREST
IEEE_TO_ZERO
IEEE_UP
IEEE_OTHER

IEEE_NEGATIVE_DENORMAL
IEEE_NEGATIVE_INF
IEEE_NEGATIVE_NORMAL
IEEE_NEGATIVE_ZERO
IEEE_POSITIVE_DENORMAL
IEEE_POSITIVE_INF
IEEE_POSITIVE_NORMAL
IEEE_POSITIVE_ZERO
IEEE_QUIET_NAN
IEEE_SIGNALING_NAN
IEEE_OTHER_VALUE

IEEE_SELECTED_REAL_KIND ! procedures

IEEE_SUPPORT_DATATYPE
IEEE_SUPPORT_DENORMAL
IEEE_SUPPORT_DIVIDE
IEEE_SUPPORT_INF
IEEE_SUPPORT_IO
IEEE_SUPPORT_NAN
IEEE_SUPPORT_ROUNDING
IEEE_SUPPORT_SQRT
IEEE_SUPPORT_STANDARD
IEEE_SUPPORT_UNDERFLOW_CONTROL

IEEE_GET_ROUNDING_MODE
IEEE_SET_ROUNDING_MODE
IEEE_GET_UNDERFLOW_MODE
IEEE_SET_UNDERFLOW_MODE

IEEE_CLASS
IEEE_VALUE
IEEE_IS_FINITE
IEEE_IS_NAN
IEEE_IS_NEGATIVE
IEEE_IS_NORMAL
IEEE_UNORDERED
IEEE_COPY_SIGN
IEEE_LOGB
IEEE_NEXT_AFTER
IEEE_REM
IEEE_RINT
IEEE_SCALB

!-------------------
! ISO_VARYING_STRING
!-------------------

VARYING_STRING          ! type

VAR_STR                 ! procedures
GET
PUT
PUT_LINE
INSERT
REPLACE
REMOVE
EXTRACT
SPLIT

!=====================================================================



谁来数数?

69

帖子

7

主题

0

精华

专家

F 币
320 元
贡献
224 点
板凳
 楼主| 发表于 2014-10-9 09:47:32 | 只看该作者
内部过程名是可以重新定义的,好像不能算在关键字里面。

以前知道有个stop,现在又发现了个error stop。

736

帖子

4

主题

0

精华

大师

农村外出务工人员

F 币
700 元
贡献
359 点

新人勋章爱心勋章水王勋章元老勋章热心勋章

地板
发表于 2014-10-9 09:54:26 | 只看该作者
关键字确实多啊。。。fortran 对符号的利用率不高,搞点什么功能都用单词、关键词。看 C 这些语言,就用了很多符号。

error stop 是干嘛的?与 stop 后面跟一个错误信息有啥区别?
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-12-23 22:22

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表