| 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 GRCALN (STRING, LSTR) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** GRCALN *** (GRPLIB) Align software characters |
| 12 |
C -- Written by Amy Gilkey - revised 06/09/87 |
| 13 |
C -- |
| 14 |
C --GRCALN pads the text string with blanks to make numbers line up |
| 15 |
C --in software characters. It is known that all numbers, minus and |
| 16 |
C --period have the same character size. A space is half that size |
| 17 |
C --and is expanded to two spaces. |
| 18 |
C -- |
| 19 |
C --Parameters: |
| 20 |
C -- STRING - IN/OUT - the string to be aligned; maximum of 80 characters |
| 21 |
C -- with a maximum of 40 blanks before a number |
| 22 |
C -- LSTR - OUT - the output length of the string |
| 23 |
C -- |
| 24 |
C --Common Variables: |
| 25 |
C -- Uses ICURDV, SOFTCH of /GRPCOM/ |
| 26 |
|
| 27 |
C --Routines Called: |
| 28 |
C -- LENSTR - (STRLIB) Find string length |
| 29 |
|
| 30 |
include 'grpcom.blk' |
| 31 |
|
| 32 |
CHARACTER*(*) STRING |
| 33 |
|
| 34 |
CHARACTER*80 TMPSTR |
| 35 |
CHARACTER*40 BLANKS |
| 36 |
CHARACTER CH |
| 37 |
|
| 38 |
LSTR = LENSTR(STRING) |
| 39 |
|
| 40 |
IF (.NOT. SOFTCH(ICURDV)) RETURN |
| 41 |
|
| 42 |
INOBLK = 0 |
| 43 |
IBLK = INDEX (STRING, ' ') |
| 44 |
100 CONTINUE |
| 45 |
IF ((IBLK .GT. INOBLK) .AND. (IBLK .LE. LSTR)) THEN |
| 46 |
|
| 47 |
INOBLK = IBLK |
| 48 |
110 CONTINUE |
| 49 |
INOBLK = INOBLK + 1 |
| 50 |
IF (STRING(INOBLK:INOBLK) .EQ. ' ') GOTO 110 |
| 51 |
NBLK = INOBLK - IBLK |
| 52 |
|
| 53 |
CH = STRING(INOBLK:INOBLK) |
| 54 |
IF ((CH .EQ. '-') .OR. (CH .EQ. '.') |
| 55 |
& .OR. ((CH .GE. '0') .AND. (CH .LE. '9'))) THEN |
| 56 |
BLANKS = ' ' |
| 57 |
TMPSTR = STRING(INOBLK:LSTR) |
| 58 |
LSTR = LSTR + NBLK |
| 59 |
STRING(INOBLK:LSTR) = BLANKS(1:NBLK) // TMPSTR |
| 60 |
INOBLK = INOBLK + NBLK |
| 61 |
END IF |
| 62 |
|
| 63 |
IBLK = INDEX (STRING(INOBLK+1:), ' ') + INOBLK |
| 64 |
GOTO 100 |
| 65 |
END IF |
| 66 |
|
| 67 |
RETURN |
| 68 |
END |