-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherrmsg.f90
42 lines (37 loc) · 1.24 KB
/
errmsg.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
SUBROUTINE ERRMSG(CSTATS,CSUBRT,CMSGNM)
IMPLICIT NONE
! Arguments:
CHARACTER :: CMSGNM*(*), CSTATS*(*), CSUBRT*(*)
! Local variables:
INTEGER :: IOERR
!***********************************************************************
! Given:
! CSTATS = 'WARNING' or 'FATAL'
! CSUBRT = name of subroutine
! CMESGN = message
! Prints a warning message in a standardized way,
! and STOPs if CSTATS='FATAL'
! Copyright (C) 1993,1996,2004,2010 B.T. Draine and P.J. Flatau
! This code is covered by the GNU General Public License.
! History:
! 96.11.14 (PJF) Remove "getset" and hardwire "ioerr"
! 04.05.23 (BTD) cleanup
! 10.05.08 (BTD) modify output
! end history
!***********************************************************************
DATA IOERR/6/
IF(CSTATS=='FATAL')THEN
WRITE(IOERR,FMT=9000)CSUBRT
WRITE(IOERR,FMT=9010)CMSGNM
WRITE(IOERR,FMT=9020)
STOP
ELSEIF(CSTATS=='WARNING')THEN
WRITE(IOERR,FMT=9030)CSUBRT
WRITE(IOERR,FMT=9010)CMSGNM
ENDIF
RETURN
9000 FORMAT(/' >>>>> FATAL ERROR IN PROCEDURE: ',A)
9010 FORMAT(' >>>>> ',A)
9020 FORMAT(' >>>>> EXECUTION ABORTED ')
9030 FORMAT(/' >>>>> WARNING IN PROCEDURE: ',A)
END SUBROUTINE ERRMSG