NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
rjust.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS FUNCTION RIGHT JUSTIFIES A CHARACTER STRING.
5 C>
6 C> PROGRAM HISTORY LOG:
7 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
8 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
9 C> INTERDEPENDENCIES
10 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
11 C> DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
12 C> MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
13 C> TERMINATES ABNORMALLY
14 C>
15 C> USAGE: RJUST (STR)
16 C> INPUT ARGUMENT LIST:
17 C> STR - CHARACTER*(*): STRING TO BE RIGHT-JUSTIFED
18 C>
19 C> OUTPUT ARGUMENT LIST:
20 C> STR - CHARACTER*(*): RIGHT-JUSTIFIED STRING
21 C> RJUST - REAL: ALWAYS RETURNED AS 0 (DUMMY)
22 C>
23 C> REMARKS:
24 C> THIS ROUTINE CALLS: BORT
25 C> THIS ROUTINE IS CALLED BY: SNTBBE UFBDMP UFDUMP VALX
26 C> Normally not called by any application
27 C> programs but it could be.
28 C>
29  FUNCTION rjust(STR)
30 
31 
32 
33  CHARACTER*(*) str
34  rjust = 0.
35  IF(str.EQ.' ') goto 100
36  lstr = len(str)
37  DO WHILE(str(lstr:lstr).EQ.' ')
38  DO i=lstr,2,-1
39  str(i:i) = str(i-1:i-1)
40  ENDDO
41  str(1:1) = ' '
42  ENDDO
43 
44 C EXIT
45 C ----
46 
47 100 RETURN
48  END
function rjust(STR)
THIS FUNCTION RIGHT JUSTIFIES A CHARACTER STRING.
Definition: rjust.f:29