Programming/fortran2014. 6. 19. 22:34

FORTRAN 77 supports six data types:

LOGICAL            
boolean (true or false)
CHARACTER          character
INTEGER            integer
COMPLEX            single precision complex number 
REAL               single precision floating point number
DOUBLE PRECISION   double precision floating point number
 
[링크 : http://www.obliquity.com/computer/fortran/datatype.html


complex는 a+ib의 허수 표현으로 ()를 사용하지만 엄밀하게 배열은 아니라고 해야 하려나?
복소수 상수 complex constant이다. 이 때는 (real 또는 integer) 상수 한 쌍을 쉼표(comma)로 분리하고 괄호 (paranthese)로 둘러싸서 나타낸다.

      (2, -3)
      (1., 9.9E-1)
 
첫 번째 숫자는 실수부, 두번째 숫자는 허수부이다.
 
[링크 : http://seismic.yonsei.ac.kr/fortran/expressions.html] ]


문자열은 c가 그러하듯 character형 배열로 선언하면 된다.
Character Arrays

When a dummy argument is a character array the passed-length mechanism can be used in the same way as for a character variable. Every element of the dummy array has the length that was passed in from the actual argument.

For example, a subroutine designed to sort an array of character strings into ascending order might start with specification statements like these:

       SUBROUTINE SORT(NELS, NAMES) 
       INTEGER NELS 
       CHARACTER NAMES(NELS)*(*) 

Alternatively the actual argument can be a character variable or substring. In such cases it usually makes more sense not to use the passed-length mechanism. For example an actual argument declared:
CHARACTER*80 LINE
could be passed to a subroutine which declared it as an array of four 20-character elements:
       SUBROUTINE SPLIT(LINE) 
       CHARACTER LINE(4)*20 

Although this is valid Fortran, it is not a very satisfactory programming technique to use a procedure call to alter the shape of an item so radically.
 
[링크 : http://www.star.le.ac.uk/~cgp/prof77.html

'Programming > fortran' 카테고리의 다른 글

포트란77 문법 테스트  (0) 2014.06.19
fortran 첫 실행 >_<  (0) 2014.06.18
fortran 문법  (0) 2014.06.08
Posted by 구차니