| 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 RWQA (NTXT, NDB, C, QAINFO, *) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** RDQA *** (TXTEXO) Read QA and information records |
| 12 |
C -- Written by Amy Gilkey - revised 02/08/88 |
| 13 |
C -- |
| 14 |
C --RDQA reads the QA records and the information records. |
| 15 |
C -- |
| 16 |
C --Note that the number of QA records and information records to be read |
| 17 |
C --are read in this routine. |
| 18 |
C -- |
| 19 |
C --Parameters: |
| 20 |
C -- NTXT - IN - the text file |
| 21 |
C -- MAXQA - IN - the maximum number of QA records to store |
| 22 |
C -- MAXINF - IN - the number of information records to store |
| 23 |
C -- NQAREC - OUT - the number of QA records; <0 if not read |
| 24 |
C -- QAREC - OUT - the QA records containing: |
| 25 |
C -- (1) - the analysis code name |
| 26 |
C -- (2) - the analysis code QA descriptor |
| 27 |
C -- (3) - the analysis date |
| 28 |
C -- (4) - the analysis time |
| 29 |
C -- NINFO - OUT - the number of information records; <0 if not read |
| 30 |
C -- INFO - OUT - the information records |
| 31 |
C -- EXODUS - OUT - set false if GENESIS format, true if EXODUS so far |
| 32 |
C -- * - return statement if error encountered, including end-of-file; |
| 33 |
C -- NOT used if valid GENESIS file; message is printed |
| 34 |
C -- |
| 35 |
C --Database must be positioned at start of QA records upon entry; |
| 36 |
C --upon exit positioned at end of information records. |
| 37 |
|
| 38 |
include 'exodusII.inc' |
| 39 |
CHARACTER*1 C(*) |
| 40 |
CHARACTER*(MXSTLN) QAINFO(6) |
| 41 |
|
| 42 |
READ (NTXT, *, END=150, ERR=150) |
| 43 |
READ (NTXT, *, END=150, ERR=150) NQAREC |
| 44 |
|
| 45 |
nqarec = nqarec + 1 |
| 46 |
call mcrsrv('QAREC', kqarec, mxstln*4*nqarec) |
| 47 |
call mcstat (nerr, mem) |
| 48 |
if (nerr .ne. 0) then |
| 49 |
call memerr() |
| 50 |
return 1 |
| 51 |
end if |
| 52 |
|
| 53 |
call rwqa1(ntxt, ndb, nqarec, c(kqarec), qainfo, *190) |
| 54 |
|
| 55 |
call mcdel('QAREC') |
| 56 |
call mcstat (nerr, mem) |
| 57 |
if (nerr .ne. 0) then |
| 58 |
call memerr() |
| 59 |
return 1 |
| 60 |
end if |
| 61 |
|
| 62 |
READ (NTXT, *, END=170, ERR=170) |
| 63 |
READ (NTXT, *, END=170, ERR=170) NINFO |
| 64 |
|
| 65 |
call mcrsrv('INFO', kinfo, mxlnln*ninfo) |
| 66 |
call mcstat (nerr, mem) |
| 67 |
if (nerr .ne. 0) then |
| 68 |
call memerr() |
| 69 |
return 1 |
| 70 |
end if |
| 71 |
|
| 72 |
call rwinfo(ntxt, ndb, ninfo, c(kinfo), *190) |
| 73 |
|
| 74 |
call mcdel('INFO') |
| 75 |
call mcstat (nerr, mem) |
| 76 |
if (nerr .ne. 0) then |
| 77 |
call memerr() |
| 78 |
return 1 |
| 79 |
end if |
| 80 |
|
| 81 |
return |
| 82 |
150 CONTINUE |
| 83 |
CALL PRTERR ('FATAL', 'Reading NUMBER OF QA RECORDS') |
| 84 |
GOTO 190 |
| 85 |
170 CONTINUE |
| 86 |
CALL PRTERR ('FATAL', 'Reading NUMBER OF INFORMATION RECORDS') |
| 87 |
GOTO 190 |
| 88 |
190 continue |
| 89 |
return 1 |
| 90 |
end |
| 91 |
|
| 92 |
subroutine rwqa1(ntxt, ndb, nqarec, qarec, qainfo, *) |
| 93 |
include 'exodusII.inc' |
| 94 |
character*(mxstln) qarec(4,*) |
| 95 |
character*(mxstln) qainfo(6) |
| 96 |
character*32 stra |
| 97 |
|
| 98 |
DO 100 IQA = 1, NQAREC-1 |
| 99 |
READ (NTXT, '(A)', END=160, ERR=160) |
| 100 |
& (QAREC(I,IQA), I=1,4) |
| 101 |
100 CONTINUE |
| 102 |
|
| 103 |
C ... Add record for this code |
| 104 |
qarec(1,nqarec) = qainfo(1) |
| 105 |
qarec(2,nqarec) = qainfo(3) |
| 106 |
qarec(3,nqarec) = qainfo(5) |
| 107 |
qarec(4,nqarec) = qainfo(6) |
| 108 |
|
| 109 |
if (nqarec .gt. 0) then |
| 110 |
call expqa(ndb, nqarec, qarec, ierr) |
| 111 |
if (ierr .ne. 0) return 1 |
| 112 |
end if |
| 113 |
return |
| 114 |
160 CONTINUE |
| 115 |
CALL INTSTR (1, 0, IQA, STRA, LSTRA) |
| 116 |
CALL PRTERR ('FATAL', 'Reading QA RECORD ' // STRA(:LSTRA)) |
| 117 |
return 1 |
| 118 |
end |
| 119 |
|
| 120 |
subroutine rwinfo(ntxt, ndb, ninfo, info, *) |
| 121 |
include 'exodusII.inc' |
| 122 |
character*(mxlnln) info(*) |
| 123 |
character*32 stra |
| 124 |
|
| 125 |
if (ninfo .le. 0) return |
| 126 |
DO 120 I = 1, NINFO |
| 127 |
READ (NTXT, '(A)', END=180, ERR=180) INFO(I) |
| 128 |
120 CONTINUE |
| 129 |
|
| 130 |
call expinf(ndb, ninfo, info, ierr) |
| 131 |
if (ierr .ne. 0) return 1 |
| 132 |
return |
| 133 |
180 CONTINUE |
| 134 |
CALL INTSTR (1, 0, I, STRA, LSTRA) |
| 135 |
CALL PRTERR ('FATAL', |
| 136 |
& 'Reading INFORMATION RECORD ' // STRA(:LSTRA)) |
| 137 |
return 1 |
| 138 |
end |