Line | |
---|
1 | program check |
---|
2 | |
---|
3 | implicit none |
---|
4 | |
---|
5 | real(kind=8), parameter :: tol = 1.e-9 |
---|
6 | real(kind=8) :: x, y |
---|
7 | integer :: ios1, ios2 |
---|
8 | integer :: irc |
---|
9 | integer :: nl = 0 |
---|
10 | |
---|
11 | open(10,file='temp1',form='formatted',status='old') |
---|
12 | open(11,file='temp2',form='formatted',status='old') |
---|
13 | |
---|
14 | irc = 0 |
---|
15 | |
---|
16 | do |
---|
17 | |
---|
18 | nl = nl + 1 |
---|
19 | |
---|
20 | read(10,*,iostat=ios1) x |
---|
21 | read(11,*,iostat=ios2) y |
---|
22 | |
---|
23 | if (ios1 /= 0 .and. ios2 /= 0) then |
---|
24 | exit |
---|
25 | else if (ios1 /= 0 .xor. ios2 /= 0) then |
---|
26 | irc = 1 |
---|
27 | exit |
---|
28 | ! Mizture de test relatif et de test absolu |
---|
29 | else if ( abs(x-y) <= max(tol*(abs(x)+abs(y)),tol) ) then |
---|
30 | continue |
---|
31 | else |
---|
32 | irc = 1 |
---|
33 | exit |
---|
34 | end if |
---|
35 | |
---|
36 | end do |
---|
37 | |
---|
38 | if (irc == 0) then |
---|
39 | print *,'Test OK' |
---|
40 | else |
---|
41 | print *,'Problemes ligne', nl |
---|
42 | stop 1 |
---|
43 | end if |
---|
44 | |
---|
45 | end program check |
---|
Note: See
TracBrowser
for help on using the repository browser.