| 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 WRSTEP (NTXT, ISTEP, NELBLK, TIME, |
| 9 |
& NVARGL, NVARNP, NVAREL, NUMNP, IDELB, NUMELB, ISEVOK, |
| 10 |
& VARGL, VARNP, VAREL, NGLDM, NNPDM, NELDM, IOERR) |
| 11 |
C======================================================================= |
| 12 |
|
| 13 |
C --*** WRSTEP *** (TXTEXO) Write database variables for one time step |
| 14 |
C -- Written by Amy Gilkey - revised 03/02/88 |
| 15 |
C -- Modified for ExodusIIv2 database format |
| 16 |
C -- |
| 17 |
C --WRSTEP writes the database history, global, nodal, and element variables |
| 18 |
C --for one time step. |
| 19 |
C -- |
| 20 |
C --Parameters: |
| 21 |
C -- NTXT - IN - the text file |
| 22 |
C -- ISTEP - IN - the time step number |
| 23 |
C -- NELBLK - IN - the number of element blocks |
| 24 |
C -- TIME - IN - the time step time |
| 25 |
C -- NVARGL - IN - the number of global variables |
| 26 |
C -- NVARNP - IN - the number of nodal variables |
| 27 |
C -- NVAREL - IN - the number of element variables |
| 28 |
C -- NUMNP - IN - the number of nodes |
| 29 |
C -- IDELB - IN - element block ID's |
| 30 |
C -- NUMELB - IN - the number of elements per block |
| 31 |
C -- ISEVOK - IN - the element block variable truth table; |
| 32 |
C -- variable i of block j exists iff ISEVOK(j,i) |
| 33 |
C -- VARGL - IN - the global variables for the time step |
| 34 |
C -- VARNP - IN - the nodal variables for the time step |
| 35 |
C -- VAREL - IN - the element variables for the time step |
| 36 |
C -- NGLDM - IN - dimension of global variable array |
| 37 |
C -- NNPDM - IN - dimension of nodal variable array |
| 38 |
C -- NELDM - IN - dimension of element variable array |
| 39 |
C -- IOERR - IN/OUT - I/O error flag |
| 40 |
|
| 41 |
INTEGER NTXT, ISTEP, NELBLK |
| 42 |
REAL TIME |
| 43 |
INTEGER NVARGL, NVARNP, NVAREL, NUMNP |
| 44 |
INTEGER IDELB(*) |
| 45 |
INTEGER NUMELB(*) |
| 46 |
LOGICAL ISEVOK(NELBLK,*) |
| 47 |
REAL VARGL(NGLDM) |
| 48 |
REAL VARNP(NUMNP,NNPDM) |
| 49 |
REAL VAREL(*) |
| 50 |
INTEGER IOERR |
| 51 |
|
| 52 |
C --Write step time |
| 53 |
WRITE (NTXT, '(A, I10)') '! Time step', ISTEP |
| 54 |
WRITE (NTXT, '(1pe16.7, 16X,A)') TIME, '! Time step time value' |
| 55 |
|
| 56 |
IF ((NVARGL+NVARNP+NVAREL) .GT. 0) THEN |
| 57 |
|
| 58 |
C --Write global variables |
| 59 |
IF (NVARGL .GT. 0) THEN |
| 60 |
WRITE (NTXT, '(A)') '! Global variables' |
| 61 |
WRITE (NTXT, 10010) (VARGL(I), I=1,NVARGL) |
| 62 |
END IF |
| 63 |
|
| 64 |
IF (NVARNP .GT. 0) THEN |
| 65 |
WRITE (NTXT, '(A)') '! Nodal variables' |
| 66 |
DO 100 INP = 1, NUMNP |
| 67 |
WRITE (NTXT, 10010) (VARNP(INP,I), I=1,NVARNP) |
| 68 |
100 CONTINUE |
| 69 |
END IF |
| 70 |
|
| 71 |
C --Write element variables |
| 72 |
|
| 73 |
IF (NVAREL .GT. 0) THEN |
| 74 |
WRITE (NTXT, '(A)') '! Element variables' |
| 75 |
IEL0 = 0 |
| 76 |
DO 120 IELB = 1, NELBLK |
| 77 |
NELPB = NUMELB(IELB) |
| 78 |
WRITE (NTXT, '(A, I3)') '! Element Block ', IELB |
| 79 |
WRITE (NTXT, '(A, I9)') |
| 80 |
& '! Number of elements ', NELPB |
| 81 |
DO 110 N = 1, NELPB |
| 82 |
C This is a really ugly index.I cannot seem to simplify |
| 83 |
C this anymore. |
| 84 |
C The element variables are read in DBISTE with the |
| 85 |
C EXGEV call. IELO is the total number of elements in the |
| 86 |
C previous element block. N if the index for the number |
| 87 |
C of elements in the current element block. |
| 88 |
WRITE (NTXT, 10010) |
| 89 |
& (VAREL(IEL0+N+((I-1)*NELPB)), I=1,NVAREL) |
| 90 |
110 CONTINUE |
| 91 |
IEL0 = IEL0 + NELPB*NVAREL |
| 92 |
120 CONTINUE |
| 93 |
END IF |
| 94 |
|
| 95 |
END IF |
| 96 |
10010 FORMAT (5(1pE16.7)) |
| 97 |
|
| 98 |
RETURN |
| 99 |
END |