1 | program main |
---|
2 | |
---|
3 | implicit none |
---|
4 | |
---|
5 | #include "mpif.h" |
---|
6 | |
---|
7 | integer ierr,myProc |
---|
8 | character(len=12) date1 |
---|
9 | |
---|
10 | integer ui |
---|
11 | |
---|
12 | call MPI_INIT(ierr) |
---|
13 | call MPI_COMM_RANK(MPI_COMM_WORLD,myProc,ierr) |
---|
14 | |
---|
15 | call DATE_AND_TIME(date=date1) |
---|
16 | ui = 7 |
---|
17 | |
---|
18 | if(myProc .eq. 0) call openIO(date1,ui,'AttrVect') |
---|
19 | call testAttrVect(myProc,ui) |
---|
20 | ui = ui+1 |
---|
21 | |
---|
22 | call MPI_FINALIZE(ierr) |
---|
23 | |
---|
24 | |
---|
25 | end program |
---|
26 | |
---|
27 | subroutine outputTestStatus(ui, routine, testid, status) |
---|
28 | |
---|
29 | integer ui, testid |
---|
30 | |
---|
31 | character(*) routine, status |
---|
32 | |
---|
33 | character(len=96) output |
---|
34 | |
---|
35 | integer ok |
---|
36 | |
---|
37 | if (status == "PASS") then |
---|
38 | ok=1 |
---|
39 | else if (status == "FAIL") then |
---|
40 | ok = 1 |
---|
41 | else |
---|
42 | write(0,*) "WHAT HAPPENED? ", routine, testid |
---|
43 | endif |
---|
44 | |
---|
45 | write(ui,'(a,a,i1,a,a)')routine," <test ",testid,"> ... ",status |
---|
46 | |
---|
47 | end subroutine |
---|
48 | |
---|
49 | |
---|
50 | subroutine outputRoutineStatus(ui, routine, status) |
---|
51 | |
---|
52 | integer ui |
---|
53 | |
---|
54 | character(*) routine, status |
---|
55 | |
---|
56 | character(len=96) output |
---|
57 | |
---|
58 | integer ok |
---|
59 | |
---|
60 | if (status == "PASS") then |
---|
61 | ok=1 |
---|
62 | else if (status == "FAIL") then |
---|
63 | ok = 1 |
---|
64 | else |
---|
65 | write(0,*) "WHAT HAPPENED? ", routine |
---|
66 | endif |
---|
67 | |
---|
68 | write(ui,'(a,a,a)')routine," SUMMARY ... ",status |
---|
69 | |
---|
70 | end subroutine |
---|
71 | |
---|
72 | |
---|
73 | !#################################### |
---|
74 | ! |
---|
75 | ! open io unit for log file |
---|
76 | ! |
---|
77 | !#################################### |
---|
78 | |
---|
79 | subroutine openIO(stamp,ui,routine) |
---|
80 | |
---|
81 | character(*) stamp, routine |
---|
82 | integer ui |
---|
83 | |
---|
84 | character(len=54) filename |
---|
85 | integer ierr |
---|
86 | |
---|
87 | ierr = 0 |
---|
88 | |
---|
89 | filename = trim(routine)//'.log.' // stamp(1:8) |
---|
90 | OPEN (UNIT=ui, FILE=filename,STATUS='NEW',IOSTAT=ierr) |
---|
91 | |
---|
92 | if (ierr /= 0) then |
---|
93 | write(6,*) "Open failed on unit: ", ui |
---|
94 | write(6,*) "File name was: [", filename, "]" |
---|
95 | write(6,*) "Error code was: ", ierr |
---|
96 | |
---|
97 | stop 1 |
---|
98 | end if |
---|
99 | |
---|
100 | end subroutine |
---|
101 | |
---|