NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
capit.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 2002-05-14
3 
4 C> THIS SUBROUTINE CAPITALIZES A STRING OF CHARACTERS. THIS
5 C> ENABLES THE USE OF MIXED CASE IN THE UNIT SECTION OF THE ASCII
6 C> BUFR TABLES. AN EXAMPLE: A PROGRAM WHICH GENERATES AN ASCII BUFR
7 C> TABLE FROM THE "MASTER TABLE B" MIGHT END UP COPYING SOME UNITS
8 C> FIELDS IN MIXED OR LOWER CASE. IF THE UNITS ARE 'CODE TABLE' OR
9 C> 'FLAG TABLE' OR CERTAIN OTHER UNIT DESIGNATIONS, THE TABLE WILL BE
10 C> PARSED INCORRECTLY, AND THE DATA READ OR INCORRECTLY AS A RESULT.
11 C> THIS MAKES SURE ALL UNIT DESIGNATIONS ARE SEEN BY THE PARSER IN
12 C> UPPER CASE TO AVOID THESE TYPES OF PROBLEMS.
13 C>
14 C> PROGRAM HISTORY LOG:
15 C> 2002-05-14 J. WOOLLEN -- ORIGINAL AUTHOR
16 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
17 C> INTERDEPENDENCIES
18 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
19 C> DOCUMENTATION (INCLUDING HISTORY)
20 C> 2012-03-02 J. ATOR -- CHANGED NAME OF UPS ARRAY TO UPCS TO AVOID
21 C> NAMESPACE CONTENTION WITH NEW FUNCTION UPS
22 C>
23 C> USAGE: CALL CAPIT (STR)
24 C> INPUT ARGUMENT LIST:
25 C> STR - CHARACTER*(*): STRING POSSIBLY CONTAINING MIXED UPPER-
26 C> AND LOWER-CASE CHARACTERS
27 C>
28 C> OUTPUT ARGUMENT LIST:
29 C> STR - CHARACTER*(*): SAME STRING AS INPUT BUT NOW CONTAINING
30 C> ALL UPPER-CASE CHARACTERS
31 C>
32 C> REMARKS:
33 C> THIS ROUTINE CALLS: None
34 C> THIS ROUTINE IS CALLED BY: CMPMSG CODFLG ELEMDX STBFDX
35 C> STDMSG STRCPT
36 C> Normally not called by any application
37 C> programs but it could be.
38 C>
39  SUBROUTINE capit(STR)
40 
41 
42 
43  CHARACTER*(*) str
44  CHARACTER*26 upcs,lwcs
45  DATA upcs/'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
46  DATA lwcs/'abcdefghijklmnopqrstuvwxyz'/
47 
48  DO 20 i=1,len(str)
49  DO 10 j=1,26
50  IF(str(i:i).EQ.lwcs(j:j)) THEN
51  str(i:i) = upcs(j:j)
52  goto 20
53  ENDIF
54 10 CONTINUE
55 20 CONTINUE
56 
57  RETURN
58  END
subroutine capit(STR)
THIS SUBROUTINE CAPITALIZES A STRING OF CHARACTERS.
Definition: capit.f:39