Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / external / bufr / jstchr.f
blob79a448e8a4600ac4a6372846c936695007c708e1
1 SUBROUTINE JSTCHR(STR,IRET)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: JSTCHR
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE LEFT-JUSTIFIES (I.E. REMOVES ALL LEADING
9 C BLANKS FROM) A CHARACTER STRING.
11 C PROGRAM HISTORY LOG:
12 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR (ENTRY POINT IN JSTIFY)
13 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
14 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
15 C ROUTINE "BORT" (IN PARENT ROUTINE JSTIFY)
16 C 2002-05-14 J. WOOLLEN -- CHANGED FROM AN ENTRY POINT TO INCREASE
17 C PORTABILITY TO OTHER PLATFORMS (JSTIFY WAS
18 C THEN REMOVED BECAUSE IT WAS JUST A DUMMY
19 C ROUTINE WITH ENTRIES)
20 C 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
21 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
22 C INTERDEPENDENCIES
23 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
24 C DOCUMENTATION; OUTPUTS MORE COMPLETE
25 C DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
26 C ABNORMALLY
27 C 2007-01-19 J. ATOR -- RESTRUCTURED AND ADDED IRET ARGUMENT
29 C USAGE: CALL JSTCHR (STR, IRET)
30 C INPUT ARGUMENT LIST:
31 C STR - CHARACTER*(*): STRING
33 C OUTPUT ARGUMENT LIST:
34 C STR - CHARACTER*(*): COPY OF INPUT STR WITH LEADING BLANKS
35 C REMOVED
36 C IRET - INTEGER: RETURN CODE:
37 C 0 = normal return
38 C -1 = input string was empty (i.e. all blanks)
40 C REMARKS:
41 C THIS ROUTINE CALLS: None
42 C THIS ROUTINE IS CALLED BY: ELEMDX IGETFXY SNTBBE
43 C Normally not called by any application
44 C programs but it could be.
46 C ATTRIBUTES:
47 C LANGUAGE: FORTRAN 77
48 C MACHINE: PORTABLE TO ALL PLATFORMS
50 C$$$
52 CHARACTER*(*) STR
54 C-----------------------------------------------------------------------
55 C-----------------------------------------------------------------------
57 IF(STR.EQ.' ') THEN
58 IRET = -1
59 ELSE
60 IRET = 0
61 LSTR = LEN(STR)
62 DO WHILE(STR(1:1).EQ.' ')
63 STR = STR(2:LSTR)
64 ENDDO
65 ENDIF
67 RETURN
68 END