libsim Versione 7.2.0

◆ word_split()

integer function, public word_split ( character(len=*), intent(in)  input_string,
integer, dimension(:), optional, pointer  word_start,
integer, dimension(:), optional, pointer  word_end,
character(len=1), optional  sep 
)

Split a line into words at a predefined character (default blank).

Returns the number of words in input_string. If pointers word_start and word_end are provided, they are allocated with nword elements and set to the indices of initial and final character of every word in input_string. Groups of contiguous separation characters are treated as a single separator character.

Parametri
[in]input_stringstring to be scanned
word_startindices of first character of each word in input_string, allocated here, must be deallocated by the user
word_endindices of last character of each word in input_string, allocated here, must be deallocated by the user
sepoptional word separator character, if not provided, a blank space is assumed

Definizione alla linea 916 del file char_utilities.F90.

917
918END FUNCTION line_split_get_line
919
920
926FUNCTION default_columns() RESULT(cols)
927INTEGER :: cols
928
929INTEGER, PARAMETER :: defaultcols = 80 ! default of the defaults
930INTEGER, PARAMETER :: maxcols = 256 ! maximum value
931CHARACTER(len=10) :: ccols
932
933cols = defaultcols
934CALL getenv('COLUMNS', ccols)
935IF (ccols == '') RETURN
936
937READ(ccols, '(I10)', err=100) cols
938cols = min(cols, maxcols)
939IF (cols <= 0) cols = defaultcols
940RETURN
941
942100 cols = defaultcols ! error in reading the value
943
944END FUNCTION default_columns
945
946
948FUNCTION suffixname ( Input_String ) RESULT ( Output_String )
949! -- Argument and result
950CHARACTER( * ), INTENT( IN ) :: Input_String
951CHARACTER( LEN( Input_String ) ) :: Output_String
952! -- Local variables
953INTEGER :: i
954
955output_string=""
956i = index(input_string,".",back=.true.)
957if (i > 0 .and. i < len(input_string)) output_string= input_string(i+1:)
958
959END FUNCTION suffixname
960
961
968ELEMENTAL FUNCTION wash_char(in, goodchar, badchar) RESULT(char)
969CHARACTER(len=*),INTENT(in) :: in
970CHARACTER(len=*),INTENT(in),OPTIONAL :: badchar
971CHARACTER(len=*),INTENT(in),OPTIONAL :: goodchar
972integer,allocatable :: igoodchar(:)
973integer,allocatable :: ibadchar(:)
974
975CHARACTER(len=len(in)) :: char,charr,charrr
976INTEGER :: i,ia,nchar
977
Index method.

Generated with Doxygen.