main
| Line | |
|---|
| 1 | c Fortran 77 Standard Sec. 4, data types and constants
|
|---|
| 2 | c Declaring and setting a variable of each of F77's types.
|
|---|
| 3 | program p
|
|---|
| 4 | implicit none
|
|---|
| 5 | integer i, ipos, ineg
|
|---|
| 6 | real r, rneg, rexp
|
|---|
| 7 | double precision d, dneg, dexp
|
|---|
| 8 | complex zreal, zint, zmix
|
|---|
| 9 | double complex ydbl, yint, ymix
|
|---|
| 10 | logical lt, lf
|
|---|
| 11 | character c*4
|
|---|
| 12 | i = 12
|
|---|
| 13 | ipos = +12
|
|---|
| 14 | ineg = -24
|
|---|
| 15 | c$ civl assert(i .eq. ipos .and. -(i+ipos) .eq. ineg)
|
|---|
| 16 |
|
|---|
| 17 | r = 12.34
|
|---|
| 18 | rneg = -12.34
|
|---|
| 19 | rexp = 12.34e-2
|
|---|
| 20 | c$ civl assert(r .EQ. -rneg .and. r/100 .eq. rexp)
|
|---|
| 21 |
|
|---|
| 22 | d = 12.34
|
|---|
| 23 | dneg = -12.34
|
|---|
| 24 | dexp = -12.34d3
|
|---|
| 25 | c$ civl assert(-d .EQ. dneg .and. d*1000 .eq. -rexp)
|
|---|
| 26 |
|
|---|
| 27 | zreal = (12.34, -12.34e2)
|
|---|
| 28 | zint = (12, -12)
|
|---|
| 29 | zmix = (12, 12.0)
|
|---|
| 30 | ydbl = (12.34, -12.34d2)
|
|---|
| 31 | yint = (12, -12)
|
|---|
| 32 | ymix = (12, 12.0)
|
|---|
| 33 | c$ civl assert(zreal .eq. ydbl .and. zint .eq. yint .and. zmix .eq. ymid)
|
|---|
| 34 | c$ civl assert(ymix .eq. yint .and. zmix .eq. complex(12,12))
|
|---|
| 35 |
|
|---|
| 36 | lt = .truE.
|
|---|
| 37 | lf = .FaLSE.
|
|---|
| 38 | c$ civl assert(.not. lt .eqv. lf)
|
|---|
| 39 |
|
|---|
| 40 | c = 'abcd'
|
|---|
| 41 | c$ civl assert(c .eq. 'abcd')
|
|---|
| 42 |
|
|---|
| 43 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.