Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / external / bufr / rjust.f
blob003d166fa800062997e0eea48076285285602f12
1 FUNCTION RJUST(STR)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: RJUST
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS FUNCTION RIGHT JUSTIFIES A CHARACTER STRING.
10 C PROGRAM HISTORY LOG:
11 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
12 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
13 C INTERDEPENDENCIES
14 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
15 C DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
16 C MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
17 C TERMINATES ABNORMALLY
19 C USAGE: RJUST (STR)
20 C INPUT ARGUMENT LIST:
21 C STR - CHARACTER*(*): STRING TO BE RIGHT-JUSTIFED
23 C OUTPUT ARGUMENT LIST:
24 C STR - CHARACTER*(*): RIGHT-JUSTIFIED STRING
25 C RJUST - REAL: ALWAYS RETURNED AS 0 (DUMMY)
27 C REMARKS:
28 C THIS ROUTINE CALLS: BORT
29 C THIS ROUTINE IS CALLED BY: SNTBBE UFBDMP UFDUMP VALX
30 C Normally not called by any application
31 C programs but it could be.
33 C ATTRIBUTES:
34 C LANGUAGE: FORTRAN 77
35 C MACHINE: PORTABLE TO ALL PLATFORMS
37 C$$$
39 CHARACTER*(*) STR
40 RJUST = 0.
41 IF(STR.EQ.' ') GOTO 100
42 LSTR = LEN(STR)
43 DO WHILE(STR(LSTR:LSTR).EQ.' ')
44 DO I=LSTR,2,-1
45 STR(I:I) = STR(I-1:I-1)
46 ENDDO
47 STR(1:1) = ' '
48 ENDDO
50 C EXIT
51 C ----
53 100 RETURN
54 END