source: CPL/oasis3/trunk/src/mod/oasis3/src/halte.F @ 1677

Last change on this file since 1677 was 1677, checked in by aclsce, 12 years ago

Imported oasis3 (tag ipslcm5a) from cvs server to svn server (igcmg project).

File size: 2.9 KB
Line 
1      SUBROUTINE halte (cdtext)
2C****
3C               *****************************
4C               * OASIS ROUTINE  -  LEVEL C *
5C               * -------------     ------- *
6C               *****************************
7C
8C**** *halte*  - Abort the program
9C
10C     Purpose:
11C     -------
12C     Print an error message to standard output and abort the coupler
13C
14C**   Interface:
15C     ---------
16C       *CALL*  *halte (cdtext)*
17C
18C     Input:
19C     -----
20C                cdtext   : character string to be printed
21C
22C     Output:
23C     ------
24C     None
25C
26C     Workspace:
27C     ---------
28C     None
29C
30C     Externals:
31C     ---------
32C     None
33C
34C     Reference:
35C     ---------
36C     See OASIS 2.2 manual (1997) 
37C
38C     History:
39C     -------
40C       Version   Programmer     Date      Description
41C       -------   ----------     ----      ----------- 
42C       2.2       S. Valcke      97/11/18  created
43C       2.3       L. Terray      99/02/24  modified: X format for NEC
44C
45C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46C
47C* ---------------------------- Include files ---------------------------
48C
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
54C
55C* ---------------------------- Argument declarations ----------------------
56C
57      CHARACTER*(*) cdtext
58C
59C* ---------------------------- Local declarations ----------------------
60C
61      CHARACTER cpbase
62      CHARACTER*10 cprpt, cpdots
63      CHARACTER*69 cline
64      PARAMETER ( cpbase = '-' )
65      PARAMETER ( cprpt = '* ===>>> :' )
66      PARAMETER ( cpdots = '  ------  ' )
67C
68C* ---------------------------- Poema verses ----------------------------
69C
70C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71C
72C*    1. Print text 
73C        ----------
74C
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
83C
84C
85C*    2. Close the coupler output
86C        ------------------------
87C
88          CLOSE(nulou)
89C
90C
91C*    3. Abort the coupler
92C        -----------------
93C
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
Note: See TracBrowser for help on using the repository browser.