SUBROUTINE ST_RMBL ( string, outstr, length, iret ) C************************************************************************ C* ST_RMBL * C* * C* This subroutine removes spaces and tabs from a string. The input * C* and output strings may be the same variable. * C* * C* ST_RMBL ( STRING, OUTSTR, LENGTH, IRET ) * C* * C* Input parameters: * C* STRING CHAR* String * C* * C* Output parameters: * C* OUTSTR CHAR* String without blanks * C* LENGTH INTEGER Length of output string * C* IRET INTEGER Return code * C* 0 = normal return * C** * C* Log: * C* M. desJardins/GSFC 8/84 * C* M. desJardins/GSFC 6/88 Documentation * C* M. desJardins/NMC 3/92 Add temporary variable ttt * C* L. Sager/NCEP 2/96 Increased size of sss and ttt * C* D. Kidwell/NCEP 10/96 Ported to Cray * C* K. Brill/HPC 6/99 Assign character constants * C************************************************************************ CHARACTER*(*) string, outstr C* CHARACTER c*1, sss*160, ttt*160, CHSPAC*1, CHTAB*1 C----------------------------------------------------------------------- iret = 0 CHSPAC = CHAR (32) CHTAB = CHAR (9) length = 0 sss = string ttt = ' ' C C* Get length of input string. C CALL ST_LSTR ( sss, lens, iret ) C C* Check each character to see if it is a blank. C DO i = 1, lens c = sss (i:i) IF ( ( c .ne. CHSPAC ) .and. ( c .ne. CHTAB ) ) THEN length = length + 1 ttt ( length : length ) = c END IF END DO C* outstr = ttt C* RETURN END