source: CIVL/mods/dev.civl.abc/examples/fortran/f77_standard/explicit_constants.f

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.1 KB
Line 
1c Fortran 77 Standard Sec. 4, data types and constants
2c 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
15c$ civl assert(i .eq. ipos .and. -(i+ipos) .eq. ineg)
16
17 r = 12.34
18 rneg = -12.34
19 rexp = 12.34e-2
20c$ civl assert(r .EQ. -rneg .and. r/100 .eq. rexp)
21
22 d = 12.34
23 dneg = -12.34
24 dexp = -12.34d3
25c$ 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)
33c$ civl assert(zreal .eq. ydbl .and. zint .eq. yint .and. zmix .eq. ymid)
34c$ civl assert(ymix .eq. yint .and. zmix .eq. complex(12,12))
35
36 lt = .truE.
37 lf = .FaLSE.
38c$ civl assert(.not. lt .eqv. lf)
39
40 c = 'abcd'
41c$ civl assert(c .eq. 'abcd')
42
43 end program
Note: See TracBrowser for help on using the repository browser.