| 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 |
c ====================================================================== |
| 9 |
c ====================================================================== |
| 10 |
c ====================================================================== |
| 11 |
|
| 12 |
c ROUTINE: pack |
| 13 |
|
| 14 |
c DESCRIPTION: Removes all spaces from an ASCII character |
| 15 |
c string and counts the number of remaining |
| 16 |
c non-space characters. |
| 17 |
|
| 18 |
c AUTHOR: John H. Glick |
| 19 |
c Sandia National Laboratories |
| 20 |
c Division 1511 |
| 21 |
|
| 22 |
c DATE: December 20, 1988 |
| 23 |
|
| 24 |
c TYPE OF SUBPROGRAM: subroutine |
| 25 |
|
| 26 |
c USAGE: call pack ( string, lstr ) |
| 27 |
|
| 28 |
c PARAMETERS: |
| 29 |
c character * (*) string ( INPUT/OUTPUT ) |
| 30 |
c string to be stripped of spaces. |
| 31 |
c integer lstr ( OUTPUT ) |
| 32 |
c number of non-space characters |
| 33 |
c remaining. |
| 34 |
|
| 35 |
c CALLS: none |
| 36 |
|
| 37 |
c GLOBAL VARIABLES REFERENCED: none |
| 38 |
|
| 39 |
c CALLING ROUTINE(S): getins (BLOT) |
| 40 |
c filhnd (BLOT) |
| 41 |
|
| 42 |
c SYSTEM DEPENDENCIES: none |
| 43 |
|
| 44 |
c ====================================================================== |
| 45 |
c ====================================================================== |
| 46 |
|
| 47 |
subroutine pack ( string, lstr ) |
| 48 |
|
| 49 |
c parameters |
| 50 |
|
| 51 |
character * (*) string |
| 52 |
integer lstr |
| 53 |
|
| 54 |
c declarations |
| 55 |
|
| 56 |
integer length, pt1, pt2 |
| 57 |
|
| 58 |
c ************************************************************* |
| 59 |
c ************************************************************* |
| 60 |
|
| 61 |
length = len(string) |
| 62 |
|
| 63 |
pt1 = 0 |
| 64 |
pt2 = 1 |
| 65 |
100 continue |
| 66 |
if ( string(pt2:pt2) .ne. ' ' ) then |
| 67 |
pt1 = pt1 + 1 |
| 68 |
string(pt1:pt1) = string(pt2:pt2) |
| 69 |
endif |
| 70 |
pt2 = pt2 + 1 |
| 71 |
if ( pt2 .le. length ) go to 100 |
| 72 |
lstr = pt1 |
| 73 |
|
| 74 |
c fill remainder of string with spaces |
| 75 |
|
| 76 |
do 110 i = lstr + 1, length |
| 77 |
string(i:i) = ' ' |
| 78 |
110 continue |
| 79 |
|
| 80 |
return |
| 81 |
end |