-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjstlft.f
72 lines (72 loc) · 1.98 KB
/
jstlft.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
subroutine jstlft( string )
c
c-----CAMx v4.02 030709
c
c Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
c ENVIRON International Corporation
c
c-----------------------------------------------------------------------
c
c Description:
c Left justifies a string
c
c Arguments:
c Inputs/Outputs: (the string arguments serves as both input and
c output)
c string C string to left justify
c
c-----------------------------------------------------------------------
c LOG:
c-----------------------------------------------------------------------
c
c 08/10/98 -gmw- original development
c
c-----------------------------------------------------------------------
c Argument declaration:
c-----------------------------------------------------------------------
c
character*(*) string
c
c-----------------------------------------------------------------------
c Local variables:
c-----------------------------------------------------------------------
c
integer ibeg, i
c
c-----------------------------------------------------------------------
c Entry point:
c-----------------------------------------------------------------------
c
c ---- it may already be left-justified ---
c
if( string(1:1) .NE. ' ' ) goto 9999
c
c ---- find the first non-blank character ---
c
do 10 i=1,LEN( string )
if( string(i:i) .NE. ' ' ) then
ibeg = i
goto 111
endif
10 continue
c
c --- no non-blanks found, it's a blank string, nothing to do ----
c
goto 9999
c
c ---- move the string over, 2 char at a time ---
c
111 continue
do 20 i=1,LEN( string )-ibeg+1
string(i:i) = string(i+ibeg-1:i+ibeg-1)
string(i+ibeg-1:i+ibeg-1) = ' '
20 continue
goto 9999
c
c-----------------------------------------------------------------------
c Return point:
c-----------------------------------------------------------------------
c
9999 continue
return
end