23 SUBROUTINE parstr(STR,TAGS,MTAG,NTAG,SEP,LIMIT80)
25 CHARACTER*(*) STR,TAGS(MTAG)
26 CHARACTER*128 BORT_STR1,BORT_STR2
28 LOGICAL SUBSTR,LIMIT80
35 IF( limit80 .AND. (lstr.GT.80) )
GOTO 900
42 IF( .NOT.substr .AND. (str(i:i).NE.sep) )
THEN
44 IF(ntag.GT.mtag)
GOTO 901
48 IF( substr .AND. (str(i:i).EQ.sep) ) nchr = 0
49 substr = str(i:i).NE.sep
53 IF(nchr.GT.ltag)
GOTO 902
54 tags(ntag)(nchr:nchr) = str(i:i)
63 900
WRITE(bort_str1,
'("BUFRLIB: PARSTR - INPUT STRING (",A,") HAS ")')
65 WRITE(bort_str2,
'(18X,"LENGTH (",I4,"), > LIMIT OF 80 CHAR.")')
67 CALL bort2(bort_str1,bort_str2)
68 901
WRITE(bort_str1,
'("BUFRLIB: PARSTR - INPUT STRING (",A,") '//
69 .
'CONTAINS",I4)') str,ntag
70 WRITE(bort_str2,
'(18X,"SUBSTRINGS, EXCEEDING THE LIMIT {",I4,'//
71 .
'" - THIRD (INPUT) ARGUMENT}")') mtag
72 CALL bort2(bort_str1,bort_str2)
73 902
WRITE(bort_str1,
'("BUFRLIB: PARSTR - INPUT STRING (",A,") ")') str
74 WRITE(bort_str2,
'(18X,"CONTAINS A PARSED SUBSTRING WITH LENGTH '//
75 .
'EXCEEDING THE MAXIMUM OF",I4," CHARACTERS")') ltag
76 CALL bort2(bort_str1,bort_str2)
subroutine bort2(STR1, STR2)
Log two error messages and abort application program.
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
Parse a string containing one or more substrings into an array of substrings.