I.f 3� $ P P subroutine zork(i)
integer i,j
inquire(4,recl=i,nextrec=j)
call foo(j)
end
I1.f �[� � 5 5 data i/o'12'/
j = o'13'
call foo(i,j,b'101')
end
I2.f Dc� � 9 9 function foo(x)
integer x
foo = alog10(float(x))
end
L.f Թ� Q j j logical b(3)
integer i
b(1) = .false.
b(2) = .true.
b(3) = .false.
write(*,*) (b(i), i = 1, 3)
end
a.f ]�� � 3 3 integer i3(3)
data i3/1,2,3/
write(*,*) i3
end
a1.f �<� 8 O O subroutine goo(a,n)
integer j, n
double precision a(n)
call foo(a(j))
end
a2.f �h� � . � subroutine goo(a,n)
integer j, n
double precision a(n)
common /zork/b
double precision b(4), be(4), c(4), ce(4)
equivalence (b(1), be(1)), (c(1),ce(1))
logical init(2), init1
real z(4)
data init/.true., .true./, init1/.false./
call foo(z(n), 23, init1, init, init(2), be(j), a(j), ce(j))
end
b.f s�� � � block data
common /zork/ a, b, c
double precision a(2)
integer b(2)
logical c
data a/1.d0, 2.d0/
data b/3, 4/
data c/.true./
end
b1.f =�� � call foo(o'1')
end
c.f �
� y y integer function c(n)
character*1 a(4)
data a/'a','b','c','d'/
c = ichar(a(n)) + ichar(a(n+1))
call zork(a(n))
end
c1.f &x� � B B subroutine foo(i,c)
character*1 c
integer i
i = ichar(c)
end
c2.f o�� � b b character*8 zork
data zork/'abcdefhj'/
n = ichar(zork(3:3))
call foo(n,ichar(zork(4:4)))
end
c3.f �9�
u � � character*1 c(10)
data c/'a','b','c','d','e','f','g','h','i','j'/
do 10 i = 1, 10
if (ichar(c(i)) .lt. ichar('e')) call foo(i)
10 continue
end
c4.f W]� 1 C C subroutine zork(a,b)
character*8 c
call foo(a,c)
b = a(c)
end
c5.f o]� � O O subroutine zork(a,b)
external a
character*8 c
call foo(a,c)
b = a(c)
end
c6.f �I�
� � character*72 buffer
read(*,'(A)') buffer
j = 1
do 10 i = 1, 72
if (buffer(i:i) .ne. ' ') j = i
10 continue
write(*, '(A)') buffer(1:j)
end
c7.f BO� � � � character*72 buffer
read(*,'(A)') buffer
j = 2
do 10 i = 1, 72
if (buffer(i:i) .ne. ' ') j = i+1
10 continue
write(*, '(A)') buffer(1:j-1)
end
c8.f �V� � � � subroutine foo(i,j)
character*72 b
integer j(*), k, L(2)
k = i
L(2) = k
call goo(b(1:i), b(2:i), b(1:i+1), b(1:j(2)), b(1:k), b(1:L(2)))
end
c9.f �n� >
� � common /zork/ a, b, c
double precision a(3), a1
integer b(4), b1
logical c(2), c1
equivalence (a(3), a1), (b(2), b1), (c(1), c1)
call foo(a,a1,b,b1,c,c1)
end
ca.f ��� A A integer function c(n,a)
character*1 a(4)
c = ichar(a(n))
end
cb.f �i� n � program main
�eCOMMON RVCN01,IVCN01,IVCN02,IACN11(20)
ivcn01 = 3
iacn11(13) = 23
call zork
end
subroutine zork
�=COMMON //RVCN01
rvcn01 = 4.2
call zap
end
subroutine zap
�HCOMMON RVDN01,IVCN01,IVCN02
ivcn02 = 77
call zot
end
subroutine zot
�RCOMMON RVCN01,IVCN01,IVCN02,IACN11
iacn11 = -49
call last
end
subroutine last
�fCOMMON RVCN01,IVCN01,IVCN02,IACN11(20)
write(*,*) rvcn01, ivcn01, ivcn02, iacn11(1), iacn11(13)
end
cb1.f �� R
� program main
�eCOMMON RVCN01,IVCN01,IVCN02,IACN11(20)
ivcn01 = 3
iacn11(13) = 23
call zork
end
subroutine last
��COMMON RVCN01,IVCN01,IVCN02,IACN11(20)
equivalence (ivcn01,k)
write(*,*) rvcn01, ivcn01, ivcn02, iacn11(1), iacn11(13),k
end
cb2.f <�� p h program main
�TCOMMON RVCN01,IVCN01,IVCN02,IACN11(20)
ivcn01 = 3
iacn11(13) = 23
call zork
end
cb3.f ��� � . program main
�eCOMMON RVCN01,IVCN01,IVCN02,IACN11(20)
ivcn01 = 3
iacn11(13) = 23
call zork
end
subroutine zork
�=COMMON //RVCN01
rvcn01 = 4.2
call zap
end
subroutine zap
�HCOMMON RVDN01,IVCN01,IVCN02
ivcn02 = 77
call zot
end
subroutine zot
�RCOMMON RVCN01,IVCN01,IVCN02,IACN11
iacn11 = -49
call last
end
subroutine last
�~COMMON RVCN01,IVCN01,IVCN02,IACN11(20)
write(*,*) rvcn01, ivcn01, ivcn02, iacn11(1), iacn11(13), iacn11(15)
end
block data
�BCOMMON RVCN01,IVCN01,IVCN02,IACN11(20)
data iacn11(15)/102/
end
cd.f q=� ; V V subroutine zork(i)
integer x
integer i(x)
common /com/ x
call zork(i(3), x)
end
cf.f �� � � �$CHARACTER*10 FUNCTION CF716(IVD001)
�>IF (IVD001 - 2) 70010, 70020, 70030
70010 CF716 = 'FIRST AID'
�"RETURN
70020 CF716 = 'SECONDRATE'
�"RETURN
70030 CF716 = 'THIRDCLASS'
�RETURN
�END
cx2.f GA� � j k j complex c(5,3)
c(3,2) = (2,2)
call foo(c)
end
subroutine foo(c)
complex c(5,3)
c(2,2) = (1,1)
end
d.f IJ� , A B A subroutine foo(f)
external f
character*32 f
call goo(f)
end
d1.f �J� � � � � subroutine foo(f)
external f
character*32 f, x
x = f(6)
call goo(f, x)
end
subroutine goo(f,x)
external f
character*(*) f, x
write(*,*) x, f(3)
end
d2.f ��� V ` a ` subroutine foo(j, k)
integer j, k
real r
do 10 r = goo(min(j,k)), 10
10 write(*,*) r
end
d3.f !�� � F G F character*3 zot
data r/4.2/
data zot/'abc'/
call foo(r, zot)
end
de.f �V� F �>SUBROUTINE SN707(IVD001,IVD002,IVD003,I2D001,I2D002,IVD004)
C
�;DIMENSION I2D001(IVD002/3:3,1:5),I2D002(1:2,1:IVD003**2)
C
�?IF (IVD001 - 1) 70010, 70010, 70020
70010 IVD004 = I2D001(1,5)
�4RETURN
70020 IVD004 = I2D002(1,4)
call foo(ivd003)
�RETURN
�END
doo.f B��! s + , + subroutine doo(n,x)
read(7,rec=n) x
end
e.f @n�"