| 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 |
|
| 7 |
C======================================================================= |
| 8 |
subroutine chkerr (routine, caller, ierr) |
| 9 |
C======================================================================= |
| 10 |
character*(*) routine, caller |
| 11 |
include 'exodusII.inc' |
| 12 |
character*80 string, path |
| 13 |
character*40 errors(19) |
| 14 |
integer ierr |
| 15 |
integer idebug |
| 16 |
data errors / |
| 17 |
* 'Not a netcdf id', |
| 18 |
* 'Too many netcdfs open', |
| 19 |
* 'netcdf file exists && NCNOCLOB', |
| 20 |
* 'Invalid Argument', |
| 21 |
* 'Write to read only', |
| 22 |
* 'Operation not allowed in data mode', |
| 23 |
* 'Operation not allowed in define mode', |
| 24 |
* 'Coordinates out of Domain', |
| 25 |
* 'MAXNCDIMS exceeded', |
| 26 |
* 'String match to name in use', |
| 27 |
* 'Attribute not found', |
| 28 |
* 'MAXNCATTRS exceeded', |
| 29 |
* 'Not a netcdf data type', |
| 30 |
* 'Invalid dimension id', |
| 31 |
* 'NCUNLIMITED in the wrong index', |
| 32 |
* 'MAXNCVARS exceeded', |
| 33 |
* 'Variable not found', |
| 34 |
* 'Action prohibited on NCGLOBAL varid', |
| 35 |
* 'Not a netcdf file'/ |
| 36 |
|
| 37 |
idebug = 1 |
| 38 |
write (path, '(A,A2,A)') CALLER, '->', ROUTINE |
| 39 |
lp = lenstr(path) |
| 40 |
if (idebug .gt. 0 .and. ierr .gt. 0) |
| 41 |
* call prterr ('CMDSPEC', PATH(:LP)) |
| 42 |
|
| 43 |
if (ierr .eq. 0) then |
| 44 |
continue |
| 45 |
else if (ierr .eq. EXBFID) then |
| 46 |
write (string, '(A,A)') |
| 47 |
$ 'The EXODUS file ID is incorrect in ', path(:lp) |
| 48 |
call prterr ('FATAL', string) |
| 49 |
stop 'EXBFID' |
| 50 |
else if (ierr .eq. EXWARN) then |
| 51 |
write (string, '(A,A)') |
| 52 |
$ 'A non-fatal error occurred in ', path(:lp) |
| 53 |
call prterr ('WARNING', string) |
| 54 |
else |
| 55 |
if (ierr .le. 19) then |
| 56 |
l = lenstr(errors(ierr)) |
| 57 |
write (string, '(A,A,A)') errors(ierr)(:l), ' ', path(:lp) |
| 58 |
else |
| 59 |
write (string, '(A,A)') |
| 60 |
* 'Unknown Error ', path(:lp) |
| 61 |
end if |
| 62 |
call prterr ('WARNING', string) |
| 63 |
end if |
| 64 |
|
| 65 |
return |
| 66 |
end |