COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cerrorMsg.f
Go to the documentation of this file.
1 ! printout error message on error out.
2 !
3  subroutine cerrormsg(msg, needrtn)
4  implicit none
5 #include "Zmanagerp.h"
6 
7  external cblkmanager
8 
9  character*(*) msg ! input. message to be printed
10  integer needrtn ! input. 0 --> stop 9999,else control is returned
11  integer klena
12  real(8):: dummy
13 
14  if(klena(msg) .ge. 1) then
15  write(errorout, '(a)') msg(1:klena(msg))
16  endif
17  if(needrtn .eq. 0) then
18 #if defined (PCLinuxIFC64) || (PCLinuxIFC) || (MacIFC)
19  call tracebackqq()
20 #endif
21  call cbacktrace(dummy)
22  endif
23  end
24  subroutine cbacktrace(a, b, c)
25 ! This is to print back trace information
26 ! when some error is detected by the user
27 ! and the user want to see the routine names
28 ! before the error is detected. (compilation
29 ! with backtrace mode is needed)
30 ! the calling program should not contain
31 ! good "a b c". but may be better to be
32 ! call cbactTrace(dummy)
33 !
34  implicit none
35  real(8),intent(out)::a, b, c(1000000)
36 
37  c(:) = 0.
38  b = 100.
39  a = 100.
40  end
41 
42 
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cbacktrace(a, b, c)
Definition: cerrorMsg.f:25