Debian Codegraph @

packages/seacas/applications/blot/cenlab.f

raw
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 CENLAB (LAB, NSNUM, SNUM, LMAX, RETLAB)
9 C=======================================================================
10
11 C --*** CENLAB *** (BLOT) Center label over number strings
12 C -- Written by Amy Gilkey - revised 02/06/85
13 C --
14 C --CENLAB centers the label over the number strings, enlarging either
15 C --either as needed.
16 C --
17 C --Parameters:
18 C -- LAB - IN - the left-justified label
19 C -- NSNUM - IN - the number of number strings
20 C -- SNUM - IN/OUT - the number strings, returned centered
21 C -- LMAX - IN/OUT - the input number string lengths, returned centered
22 C -- string lengths
23 C -- RETLAB - OUT - the centered label
24
25 CHARACTER*(*) RETLAB, LAB, SNUM(NSNUM)
26
27 CHARACTER*20 TMPSTR
28 CHARACTER*20 BLANKS
29
30 DATA BLANKS / ' ' /
31
32 LL = LENSTR (LAB)
33
34 I = INT (IABS(LMAX-LL) / 2)
35 IF (I .EQ. 0) THEN
36 RETLAB = LAB
37 ELSE IF (LL .LT. LMAX) THEN
38 RETLAB = BLANKS(:I) // LAB
39 ELSE
40 DO 100 J = 1, NSNUM
41 TMPSTR = SNUM(J)
42 SNUM(J) = BLANKS(:I) // TMPSTR
43 100 CONTINUE
44 END IF
45
46 LMAX = MAX (LMAX, LL)
47
48 RETURN
49 END