1 | SUBROUTINE chksgc |
---|
2 | C**** |
---|
3 | C ***************************** |
---|
4 | C * OASIS ROUTINE - LEVEL C * |
---|
5 | C * ------------- ------- * |
---|
6 | C ***************************** |
---|
7 | C |
---|
8 | C**** *chksgc* - Initialize signal handling |
---|
9 | C |
---|
10 | C Purpose: |
---|
11 | C ------- |
---|
12 | C Initialize signal handling related to fork stuff and fpe trapping |
---|
13 | C |
---|
14 | C** Interface: |
---|
15 | C --------- |
---|
16 | C *CALL* *chksgc* |
---|
17 | C |
---|
18 | C Input: |
---|
19 | C ----- |
---|
20 | C None |
---|
21 | C |
---|
22 | C Output: |
---|
23 | C ------ |
---|
24 | C None |
---|
25 | C |
---|
26 | C Workspace: |
---|
27 | C --------- |
---|
28 | C None |
---|
29 | C |
---|
30 | C Externals: |
---|
31 | C --------- |
---|
32 | C fsigctl, signal, ferror, getfpe |
---|
33 | C |
---|
34 | C Reference: |
---|
35 | C --------- |
---|
36 | C See OASIS manual (1997) |
---|
37 | C |
---|
38 | C History: |
---|
39 | C ------- |
---|
40 | C Version Programmer Date Description |
---|
41 | C ------- ---------- ---- ----------- |
---|
42 | C 2.2 L. Terray 97/12/24 created |
---|
43 | C 2.3 S. Valcke 99/04/30 added: printing levels |
---|
44 | C 2.3 L. Terray 99/09/15 added: GMEM branch |
---|
45 | C 2.5 S. Valcke 2K/09/04 Remove cmach |
---|
46 | C |
---|
47 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
48 | C |
---|
49 | C* ---------------------------- Include files --------------------------- |
---|
50 | C |
---|
51 | USE mod_unit |
---|
52 | USE mod_hardware |
---|
53 | USE mod_printing |
---|
54 | C |
---|
55 | C* ---------------------------- External declarations ------------------- |
---|
56 | C |
---|
57 | EXTERNAL ferror, getfpe |
---|
58 | C |
---|
59 | C* ---------------------------- Poema verses ---------------------------- |
---|
60 | C |
---|
61 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
62 | C |
---|
63 | C |
---|
64 | C* 1. Initialization |
---|
65 | C -------------- |
---|
66 | C |
---|
67 | IF (nlogprt .GE. 2) THEN |
---|
68 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
69 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
70 | WRITE (UNIT = nulou,FMT = *) |
---|
71 | $ ' ROUTINE chksgc - Level C' |
---|
72 | WRITE (UNIT = nulou,FMT = *) |
---|
73 | $ ' ************** *******' |
---|
74 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
75 | WRITE (UNIT = nulou,FMT = *) ' Initialize signal handling ' |
---|
76 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
77 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
78 | ENDIF |
---|
79 | C |
---|
80 | C |
---|
81 | C* 2. Signal handling initialization |
---|
82 | C ------------------------------ |
---|
83 | C 1- Insure proper termination in case of child process death |
---|
84 | C 2- Catch floating point error within OASIS |
---|
85 | C |
---|
86 | C* Case PIPE-CRAY |
---|
87 | C |
---|
88 | #ifdef use_comm_PIPE |
---|
89 | CALL fsigctl ('REGISTER', 'SIGCLD', ferror) |
---|
90 | CALL fsigctl ('REGISTER', 'SIGFPE', getfpe) |
---|
91 | C |
---|
92 | C* Case SIPC,GMEM-IEEE |
---|
93 | C |
---|
94 | #elif defined use_comm_SIPC || defined use_comm_GMEM |
---|
95 | CALL fpecatch |
---|
96 | |
---|
97 | C |
---|
98 | C* Child process death trapping only for SIPC (taken care thru MPI for GMEM) |
---|
99 | C |
---|
100 | #ifdef use_comm_SIPC |
---|
101 | CALL cldcatch |
---|
102 | #endif |
---|
103 | C |
---|
104 | C* Others |
---|
105 | C |
---|
106 | #else |
---|
107 | IF (nlogprt .GE. 2) THEN |
---|
108 | WRITE (UNIT = nulou,FMT = *) |
---|
109 | $ ' CLIM or exotic cases ===>>> No signal handling' |
---|
110 | ENDIF |
---|
111 | #endif |
---|
112 | C |
---|
113 | C |
---|
114 | C* 3. End of routine |
---|
115 | C -------------- |
---|
116 | C |
---|
117 | IF (nlogprt .GE. 2) THEN |
---|
118 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
119 | WRITE (UNIT = nulou,FMT = *) |
---|
120 | $ ' --------- End of routine chksgc ---------' |
---|
121 | CALL FLUSH (nulou) |
---|
122 | ENDIF |
---|
123 | RETURN |
---|
124 | END |
---|