source: CPL/oasis3-mct/branches/OASIS3-MCT_5.0_branch/lib/mct/testunit/master.F90 @ 6331

Last change on this file since 6331 was 6331, checked in by aclsce, 17 months ago

Moved oasis-mct_5.0 in oasis3-mct/branches directory.

File size: 1.5 KB
Line 
1program main
2
3implicit none
4
5#include "mpif.h"
6
7integer ierr,myProc
8character(len=12) date1
9
10integer ui
11
12call MPI_INIT(ierr)
13call MPI_COMM_RANK(MPI_COMM_WORLD,myProc,ierr)
14
15call DATE_AND_TIME(date=date1)
16ui = 7
17
18if(myProc .eq. 0) call openIO(date1,ui,'AttrVect')
19call testAttrVect(myProc,ui)
20ui = ui+1
21
22call MPI_FINALIZE(ierr)
23
24
25end program
26
27subroutine outputTestStatus(ui, routine, testid, status)
28
29integer ui, testid
30
31character(*) routine, status
32
33character(len=96) output
34
35integer ok
36
37if (status == "PASS") then
38ok=1
39else if (status == "FAIL") then
40ok = 1
41else
42write(0,*) "WHAT HAPPENED? ", routine, testid
43endif
44
45write(ui,'(a,a,i1,a,a)')routine," <test ",testid,"> ... ",status
46
47end subroutine
48
49
50subroutine outputRoutineStatus(ui, routine, status)
51
52integer ui
53
54character(*) routine, status
55
56character(len=96) output
57
58integer ok
59
60if (status == "PASS") then
61ok=1
62else if (status == "FAIL") then
63ok = 1
64else
65write(0,*) "WHAT HAPPENED? ", routine
66endif
67
68write(ui,'(a,a,a)')routine," SUMMARY ... ",status
69
70end subroutine
71
72
73!####################################
74!
75! open io unit for log file
76!
77!####################################
78
79subroutine 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
100end subroutine
101
Note: See TracBrowser for help on using the repository browser.