| 1 |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
C======================================================================= |
| 7 |
subroutine chkerr (routine, caller, ierr) |
| 8 |
C======================================================================= |
| 9 |
C Modified 9/13/95 for EXODUSIIV2 API calls |
| 10 |
|
| 11 |
C This subroutine should be called after an EXODUSIIV2 subroutine has |
| 12 |
C been invoked. The arguments of this subroutine are as follows: |
| 13 |
C routine - IN - The exodusIIv2 subroutine |
| 14 |
C caller - IN - The subroutine invoking the exodusII call |
| 15 |
C ierr - IN - The error code returned from the exodusII call |
| 16 |
|
| 17 |
include 'exodusII.inc' |
| 18 |
|
| 19 |
character*6 routine |
| 20 |
CHARACTER*8 caller |
| 21 |
character*(512) string, path, msg |
| 22 |
integer ierr |
| 23 |
|
| 24 |
C No error occurred |
| 25 |
if (ierr .eq. EXOK) RETURN |
| 26 |
|
| 27 |
write (path, '(A,A2,A)') CALLER(:LENSTR(CALLER)), '->', |
| 28 |
& ROUTINE(:LENSTR(ROUTINE)) |
| 29 |
lp = lenstr(path) |
| 30 |
|
| 31 |
if (ierr .eq. EXWARN) then |
| 32 |
write (string, '(A,A)')'ExodusII V2 WARNING in ', path(:lp) |
| 33 |
call prterr('WARNING', string) |
| 34 |
RETURN |
| 35 |
else if (ierr .lt. EXOK) then |
| 36 |
write (string, '(A)')'ExodusII V2 ERROR' |
| 37 |
call prterr('ERROR', string) |
| 38 |
end if |
| 39 |
|
| 40 |
if (ierr .eq. EXFATL) then |
| 41 |
write (msg, '(A,A)') |
| 42 |
& 'A Fatal error occurred in ', path(:lp) |
| 43 |
else if (ierr .eq. EXMEMF) then |
| 44 |
write (msg, '(A,A)') |
| 45 |
& 'Memory allocation failure flag in ', path(:lp) |
| 46 |
else if (ierr .eq. EXBFMD) then |
| 47 |
write (msg, '(A,A)') |
| 48 |
& 'Bad file mode in ', path(:lp) |
| 49 |
else if (ierr .eq. EXBFID) then |
| 50 |
write (msg, '(A,A)') |
| 51 |
& 'BAD file ID in ', path(:lp) |
| 52 |
else if (ierr .eq. EXBTID) then |
| 53 |
write (msg, '(A,A)') |
| 54 |
& 'Property table lookup failed in ', path(:lp) |
| 55 |
else if (ierr .eq. EXBPRM) then |
| 56 |
write (msg, '(A,A)') |
| 57 |
& 'Bad parameter passed in ', path(:lp) |
| 58 |
else |
| 59 |
write (msg, '(A,A,A,I4)') |
| 60 |
& 'Unknown Error in ', path(:lp), ': IERR = ',ierr |
| 61 |
end if |
| 62 |
|
| 63 |
call prterr ('ERROR', msg) |
| 64 |
|
| 65 |
return |
| 66 |
end |