1 | SUBROUTINE halte (cdtext) |
---|
2 | C**** |
---|
3 | C ***************************** |
---|
4 | C * OASIS ROUTINE - LEVEL C * |
---|
5 | C * ------------- ------- * |
---|
6 | C ***************************** |
---|
7 | C |
---|
8 | C**** *halte* - Abort the program |
---|
9 | C |
---|
10 | C Purpose: |
---|
11 | C ------- |
---|
12 | C Print an error message to standard output and abort the coupler |
---|
13 | C |
---|
14 | C** Interface: |
---|
15 | C --------- |
---|
16 | C *CALL* *halte (cdtext)* |
---|
17 | C |
---|
18 | C Input: |
---|
19 | C ----- |
---|
20 | C cdtext : character string to be printed |
---|
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 None |
---|
33 | C |
---|
34 | C Reference: |
---|
35 | C --------- |
---|
36 | C See OASIS 2.2 manual (1997) |
---|
37 | C |
---|
38 | C History: |
---|
39 | C ------- |
---|
40 | C Version Programmer Date Description |
---|
41 | C ------- ---------- ---- ----------- |
---|
42 | C 2.2 S. Valcke 97/11/18 created |
---|
43 | C 2.3 L. Terray 99/02/24 modified: X format for NEC |
---|
44 | C |
---|
45 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
46 | C |
---|
47 | C* ---------------------------- Include files --------------------------- |
---|
48 | C |
---|
49 | USE mod_unit |
---|
50 | USE mod_hardware |
---|
51 | #if defined use_comm_MPI1 || defined use_comm_MPI2 || !defined use_comm_MPI1 && !defined use_comm_MPI2 && !defined use_comm_SIPC && !defined use_comm_GMEM && !defined use_comm_PIPE && !defined use_comm_NONE |
---|
52 | USE mod_comclim |
---|
53 | #endif |
---|
54 | C |
---|
55 | C* ---------------------------- Argument declarations ---------------------- |
---|
56 | C |
---|
57 | CHARACTER*(*) cdtext |
---|
58 | C |
---|
59 | C* ---------------------------- Local declarations ---------------------- |
---|
60 | C |
---|
61 | CHARACTER cpbase |
---|
62 | CHARACTER*10 cprpt, cpdots |
---|
63 | CHARACTER*69 cline |
---|
64 | PARAMETER ( cpbase = '-' ) |
---|
65 | PARAMETER ( cprpt = '* ===>>> :' ) |
---|
66 | PARAMETER ( cpdots = ' ------ ' ) |
---|
67 | C |
---|
68 | C* ---------------------------- Poema verses ---------------------------- |
---|
69 | C |
---|
70 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
71 | C |
---|
72 | C* 1. Print text |
---|
73 | C ---------- |
---|
74 | C |
---|
75 | cline = ' ' |
---|
76 | ilen = len(cdtext) |
---|
77 | DO 110 jl = 1, ilen |
---|
78 | cline(jl:jl) = cpbase |
---|
79 | 110 CONTINUE |
---|
80 | WRITE(UNIT = nulou,FMT='(/,A,1X,A)') cpdots, cline |
---|
81 | WRITE(UNIT = nulou,FMT='(/,A,1X,A,/)') cprpt, cdtext |
---|
82 | WRITE(UNIT = nulou,FMT='(A,1X,A,/)')cpdots, cline |
---|
83 | C |
---|
84 | C |
---|
85 | C* 2. Close the coupler output |
---|
86 | C ------------------------ |
---|
87 | C |
---|
88 | CLOSE(nulou) |
---|
89 | C |
---|
90 | C |
---|
91 | C* 3. Abort the coupler |
---|
92 | C ----------------- |
---|
93 | C |
---|
94 | #if defined use_comm_MPI1 || defined use_comm_MPI2 |
---|
95 | IF (cchan .eq. 'MPI2' .or. cchan .EQ. 'MPI1' ) THEN |
---|
96 | CALL MPI_ABORT (mpi_comm, 0, ierror) |
---|
97 | IF (ierror /= CLIM_Ok) THEN |
---|
98 | WRITE (*,'(a)') ' MPI_ABORT failed' |
---|
99 | WRITE (*,'(a,i4)') ' Error = ', ierror |
---|
100 | CALL abort |
---|
101 | ENDIF |
---|
102 | ENDIF |
---|
103 | #endif |
---|
104 | #if defined use_comm_SIPC || defined use_comm_GMEM || defined use_comm_PIPE || defined use_comm_NONE |
---|
105 | CALL abort |
---|
106 | #endif |
---|
107 | RETURN |
---|
108 | END |
---|