Last modified: Fri Feb 11 14:23:42 2005.
NAME:
StrUpCase
PURPOSE:
Function to convert an input string to upper case.
CATEGORY:
Utility
LANGUAGE:
Fortran-95
CALLING SEQUENCE:
Result = StrUpCase( String )
INPUT ARGUMENTS:
String: Character string to be converted to upper case.
UNITS: N/A
TYPE: CHARACTER( * )
DIMENSION: Scalar
ATTRIBUTES: INTENT( IN )
OPTIONAL INPUT ARGUMENTS:
None.
OUTPUT ARGUMENTS:
None.
OPTIONAL OUTPUT ARGUMENTS:
None.
FUNCTION RESULT:
Result: The input character string converted to upper case.
UNITS: N/A
TYPE: CHARACTER( LEN(String) )
DIMENSION: Scalar
CALLS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
EXAMPLE:
string = 'this is a string'
WRITE( *, '( a )' ) StrUpCase( string )
THIS IS A STRING
PROCEDURE:
Figure 3.5B, pg 80, "Upgrading to Fortran 90", by Cooper Redwine,
1995 Springer-Verlag, New York.
CREATION HISTORY:
Written by: Paul van Delst, CIMSS/SSEC 18-Oct-1999
paul.vandelst@ssec.wisc.edu
(See String_Utility.f90)
NAME:
StrLowCase
PURPOSE:
Function to convert an input string to lower case.
CATEGORY:
Utility
LANGUAGE:
Fortran-95
CALLING SEQUENCE:
Result = StrLowCase( String )
INPUT ARGUMENTS:
String: Character string to be converted to lower case.
UNITS: N/A
TYPE: CHARACTER( * )
DIMENSION: Scalar
ATTRIBUTES: INTENT( IN )
OPTIONAL INPUT ARGUMENTS:
None.
OUTPUT ARGUMENTS:
None.
OPTIONAL OUTPUT ARGUMENTS:
None.
FUNCTION RESULT:
Result: The input character string converted to lower case.
UNITS: N/A
TYPE: CHARACTER( LEN(String) )
DIMENSION: Scalar
CALLS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
EXAMPLE:
string = 'THIS IS A STRING'
WRITE( *, '( a )' ) StrLowCase( string )
this is a string
PROCEDURE:
Figure 3.5B, pg 80, "Upgrading to Fortran 90", by Cooper Redwine,
1995 Springer-Verlag, New York.
CREATION HISTORY:
Written by: Paul van Delst, CIMSS/SSEC 18-Oct-1999
paul.vandelst@ssec.wisc.edu
(See String_Utility.f90)
NAME:
StrCompress
PURPOSE:
Subroutine to return a copy of an input string with all whitespace
(spaces and tabs) removed.
CATEGORY:
Utility
LANGUAGE:
Fortran-95
CALLING SEQUENCE:
Result = StrCompress( String, & ! Input
n = n ) ! Optional Output
INPUT ARGUMENTS:
String: Character string to be compressed.
UNITS: N/A
TYPE: CHARACTER( * )
DIMENSION: Scalar
ATTRIBUTES: INTENT( IN )
OPTIONAL INPUT ARGUMENTS:
None.
OUTPUT ARGUMENTS:
None.
OPTIONAL OUTPUT ARGUMENTS:
n: Number of useful characters in output string
after compression. From character n+1 -> LEN( Input_String )
the output is padded with blanks.
UNITS: N/A
TYPE: INTEGER
DIMENSION: Scalar
ATTRIBUTES: INTENT( OUT ), OPTIONAL
FUNCTION RESULT:
Result: Input string with all whitespace removed before the
first non-whitespace character, and from in-between
non-whitespace characters.
UNITS: N/A
TYPE: CHARACTER( LEN(String) )
DIMENSION: Scalar
CALLS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
EXAMPLE:
Input_String = ' This is a string with spaces in it.'
Output_String = StrCompress( Input_String, n=n )
WRITE( *, '( a )' ) '>',Output_String( 1:n ),'<'
>Thisisastringwithspacesinit.<
or
WRITE( *, '( a )' ) '>',TRIM( Output_String ),'<'
>Thisisastringwithspacesinit.<
PROCEDURE:
Definitions of a space and a tab character are made for the
ASCII collating sequence. Each single character of the input
string is checked against these definitions using the IACHAR()
intrinsic. If the input string character DOES NOT correspond
to a space or tab, it is not copied to the output string.
Note that for input that ONLY has spaces or tabs BEFORE the first
useful character, the output of this function is the same as the
ADJUSTL() instrinsic.
CREATION HISTORY:
Written by: Paul van Delst, CIMSS/SSEC 18-Oct-1999
paul.vandelst@ssec.wisc.edu
(See String_Utility.f90)