program laplace real dimension 15 15 V1 real dimension 15 15 V2 do 15

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
program laplace
real, dimension(15,15) :: V1
real, dimension(15,15) :: V2
do I=1,15
do J=1,15
V1(I,J) = 1000*random(L)
end do
end do
do I=1,15
V1(1,I)=0.0
end do
do I=1,15
V1(I,1) = 0.0
end do
do I=1,15
V1(15,I)=0.0
end do
do I=1,15
V1(I,15)=100.0
end do
10 do I=2,14
do J=2,14
V1(I,J) = (V1(I-1,J)+V1(I+1,J)+V1(I,J-1)+V1(I,J+1))/4
Vold(I,J)=V1(I,J)
if(V1(I,J)-Vold(I,J)/Vold(i,J) .GT. 0.01) THEN
GO TO 10
ELSE IF (i==14 .AND. j==14)
go to 50
end do
end do
! do i=2,14
! do J=2,14
! if(V1(I,J)-Vold(I,J)/Vold(i,J) .GT. 0.01) THEN
! GO TO 10
! ELSE IF (i==14 .AND. j==14)
!
! go to 50
! end if
! end do
!end do
50 do i=1,15
write(*,'(1X,100G14.5)') (V1(i,j),j=1,15)
end do
end program laplace
function random(L)
integer :: L
L = mod(1366*L+150889,714025)
Random=Real(L)/Real(7142024)
return
end