Character string manipulation methods. More...
Public Member Functions | |
integer function, public | oasis_string_countchar (str, char, rc) |
Count number of occurances of a single character in a string. More... | |
character(len=len(str)) function, public | oasis_string_toupper (str) |
Convert the input string to upper-case. More... | |
character(len=len(str)) function, public | oasis_string_tolower (str) |
Convert the input string to lower-case. More... | |
character(len=len(str)) function, public | oasis_string_getparentdir (str) |
Get the parent directory pathname. More... | |
integer function, public | oasis_string_lastindex (string, substr, rc) |
Get the index of the last occurance of a substring within a string. More... | |
integer function, public | oasis_string_endindex (string, substr, rc) |
Get the ending index of the first occurance of a substring within string. More... | |
subroutine, public | oasis_string_leftalign (str, rc) |
Remove leading white space. More... | |
subroutine, public | oasis_string_alphanum (str, rc) |
Remove all non alpha numeric characters from string. More... | |
subroutine, public | oasis_string_betweentags (string, startTag, endTag, substr, rc) |
Get the substring found between the start and end strings. More... | |
subroutine, public | oasis_string_parsecftunit (string, unit, bdate, bsec, rc) |
Parse CF time unit into a delta string name and a base time in yyyymmdd. More... | |
subroutine, public | oasis_string_clean (string, rc) |
Clean a string, set it to blank. More... | |
logical function, public | oasis_string_listisvalid (list, rc) |
Determine whether string is a valid list. More... | |
subroutine, public | oasis_string_listgetname (list, k, name, rc) |
Get name of k-th field in list. More... | |
subroutine, public | oasis_string_listintersect (list1, list2, listout, rc) |
Get intersection of two fields lists, write into third list. More... | |
subroutine, public | oasis_string_listunion (list1, list2, listout, rc) |
Get union of two fields lists, write into third list. More... | |
subroutine, public | oasis_string_listmerge (list1, list2, listout, rc) |
Merge two lists into a third list. More... | |
subroutine, public | oasis_string_listappend (list, listadd, rc) |
Append one list to another. More... | |
subroutine, public | oasis_string_listprepend (listadd, list, rc) |
Prepend one list to another. More... | |
integer function, public | oasis_string_listgetindexf (string, fldStr) |
Get the index of a field in a list. More... | |
subroutine, public | oasis_string_listgetindex (string, fldStr, kFld, print, rc) |
Get the index of a field in a string. More... | |
integer function, public | oasis_string_listgetnum (str) |
return number of fields in string list More... | |
subroutine, public | oasis_string_listsetdel (cflag) |
Set field delimeter character in lists. More... | |
subroutine, public | oasis_string_listgetdel (del) |
Get field delimeter character in lists. More... | |
subroutine, public | oasis_string_setabort (flag) |
Set local oasis_string abort flag, true = abort, false = print and continue. More... | |
subroutine, public | oasis_string_setdebug (iFlag) |
Set local oasis_string debug level, 0 = production. More... | |
Private Member Functions | |
subroutine | oasis_string_abort (string) |
Supports aborts in the string module. More... | |
Private Attributes | |
character(len=1), save | listdel = ":" |
character(len=2), save | listdel2 = "::" |
logical, save | doabort = .true. |
integer(ip_i4_p), save | debug = 0 |
Character string manipulation methods.
These methods work generally on character strings, but also, more particularly on lists. A list is a character string that contains substrings separated by a delimeter. That delimeter can be set by the user but the default is ":". Colon delimeted lists are used in OASIS and MCT mainly to instantiate a list of fields, such as "temperature:humidity:zonal_velocity:meridiona_velocity".
Definition at line 27 of file mod_oasis_string.F90.
|
private |
Supports aborts in the string module.
[in] | string | error string |
Definition at line 1679 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_alphanum | ( | character(*), intent(inout) | str, |
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Remove all non alpha numeric characters from string.
[in,out] | str | input and output string |
[out] | rc | return code |
Definition at line 451 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_betweentags | ( | character(*), intent(in) | string, |
character(*), intent(in) | startTag, | ||
character(*), intent(in) | endTag, | ||
character(*), intent(out) | substr, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get the substring found between the start and end strings.
[in] | string | input string to search |
[in] | starttag | start string |
[in] | endtag | end string |
[out] | substr | output sub-string between tags |
[out] | rc | return code |
Definition at line 507 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_clean | ( | character(*), intent(inout) | string, |
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Clean a string, set it to blank.
[in,out] | string | string |
[out] | rc | return code |
Definition at line 749 of file mod_oasis_string.F90.
integer function, public mod_oasis_string::oasis_string_countchar | ( | character(*), intent(in) | str, |
character(1), intent(in) | char, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Count number of occurances of a single character in a string.
[in] | str | string to search |
[in] | char | char to search for |
[out] | rc | return code |
Definition at line 102 of file mod_oasis_string.F90.
integer function, public mod_oasis_string::oasis_string_endindex | ( | character(*), intent(in) | string, |
character(*), intent(in) | substr, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get the ending index of the first occurance of a substring within string.
[in] | string | string to search |
[in] | substr | sub-string to search for |
[out] | rc | return code |
Definition at line 338 of file mod_oasis_string.F90.
character(len=len(str)) function, public mod_oasis_string::oasis_string_getparentdir | ( | character(len=*), intent(in) | str | ) |
Get the parent directory pathname.
[in] | str | input string |
Definition at line 245 of file mod_oasis_string.F90.
integer function, public mod_oasis_string::oasis_string_lastindex | ( | character(*), intent(in) | string, |
character(*), intent(in) | substr, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get the index of the last occurance of a substring within a string.
[in] | string | input string to search |
[in] | substr | sub-string to search for |
[out] | rc | return code |
Definition at line 293 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_leftalign | ( | character(*), intent(inout) | str, |
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Remove leading white space.
[in,out] | str | input and returned string |
[out] | rc | return code |
Definition at line 397 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listappend | ( | character(*), intent(inout) | list, |
character(*), intent(in) | listadd, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Append one list to another.
[in,out] | list | input and output list |
[in] | listadd | list to append |
[out] | rc | return code |
Definition at line 1140 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listgetdel | ( | character(*), intent(out) | del | ) |
Get field delimeter character in lists.
[out] | del | field delimeter |
Definition at line 1562 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listgetindex | ( | character(*), intent(in) | string, |
character(*), intent(in) | fldStr, | ||
integer(ip_i4_p), intent(out) | kFld, | ||
logical, intent(in), optional | print, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get the index of a field in a string.
[in] | string | input list |
[in] | fldstr | name of field |
[out] | kfld | index of field in list |
[in] | print switch | |
[out] | rc | return code |
Definition at line 1312 of file mod_oasis_string.F90.
integer function, public mod_oasis_string::oasis_string_listgetindexf | ( | character(*), intent(in) | string, |
character(*), intent(in) | fldStr | ||
) |
Get the index of a field in a list.
[in] | string | input string |
[in] | fldstr | name of field |
Definition at line 1269 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listgetname | ( | character(*), intent(in) | list, |
integer(ip_i4_p), intent(in) | k, | ||
character(*), intent(out) | name, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get name of k-th field in list.
[in] | list | input list |
[in] | k | index of field |
[out] | name | k-th name in list |
[out] | rc | return code |
Definition at line 860 of file mod_oasis_string.F90.
integer function, public mod_oasis_string::oasis_string_listgetnum | ( | character(*), intent(in) | str | ) |
return number of fields in string list
[in] | str | input list |
Definition at line 1474 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listintersect | ( | character(*), intent(in) | list1, |
character(*), intent(in) | list2, | ||
character(*), intent(out) | listout, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get intersection of two fields lists, write into third list.
[in] | list1 | input list 1 |
[in] | list2 | input list 2 |
[out] | listout | output list |
[out] | rc | return code |
Definition at line 946 of file mod_oasis_string.F90.
logical function, public mod_oasis_string::oasis_string_listisvalid | ( | character(*), intent(in) | list, |
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Determine whether string is a valid list.
[in] | list | list/string |
[out] | rc | return code |
Definition at line 794 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listmerge | ( | character(*), intent(in) | list1, |
character(*), intent(in) | list2, | ||
character(*), intent(out) | listout, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Merge two lists into a third list.
[in] | list1 | input list 1 |
[in] | list2 | input list 2 |
[out] | listout | output list |
[out] | rc | return code |
Definition at line 1073 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listprepend | ( | character(*), intent(in) | listadd, |
character(*), intent(inout) | list, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Prepend one list to another.
Definition at line 1205 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listsetdel | ( | character(len=1), intent(in) | cflag | ) |
Set field delimeter character in lists.
[in] | cflag | field delimeter |
Definition at line 1520 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_listunion | ( | character(*), intent(in) | list1, |
character(*), intent(in) | list2, | ||
character(*), intent(out) | listout, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Get union of two fields lists, write into third list.
[in] | list1 | input list 1 |
[in] | list2 | input list 2 |
[out] | listout | output list 3 |
[out] | rc | return code |
Definition at line 1004 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_parsecftunit | ( | character(*), intent(in) | string, |
character(*), intent(out) | unit, | ||
integer(ip_i4_p), intent(out) | bdate, | ||
real(ip_r8_p), intent(out) | bsec, | ||
integer(ip_i4_p), intent(out), optional | rc | ||
) |
Parse CF time unit into a delta string name and a base time in yyyymmdd.
[in] | string | string to search |
[out] | unit | delta time unit |
[out] | bdate | base date yyyymmdd |
[out] | bsec | base seconds |
[out] | rc | return code |
Definition at line 604 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_setabort | ( | logical, intent(in) | flag | ) |
Set local oasis_string abort flag, true = abort, false = print and continue.
[in] | flag | abort flag |
Definition at line 1598 of file mod_oasis_string.F90.
subroutine, public mod_oasis_string::oasis_string_setdebug | ( | integer(ip_i4_p), intent(in) | iFlag | ) |
Set local oasis_string debug level, 0 = production.
[in] | iflag | requested debug level |
Definition at line 1646 of file mod_oasis_string.F90.
character(len=len(str)) function, public mod_oasis_string::oasis_string_tolower | ( | character(len=*), intent(in) | str | ) |
Convert the input string to lower-case.
[in] | str | input string to convert to lower case |
Definition at line 198 of file mod_oasis_string.F90.
character(len=len(str)) function, public mod_oasis_string::oasis_string_toupper | ( | character(len=*), intent(in) | str | ) |
Convert the input string to upper-case.
[in] | str | input string to convert to upper case |
Definition at line 151 of file mod_oasis_string.F90.
|
private |
Definition at line 83 of file mod_oasis_string.F90.
|
private |
Definition at line 82 of file mod_oasis_string.F90.
|
private |
Definition at line 80 of file mod_oasis_string.F90.
|
private |
Definition at line 81 of file mod_oasis_string.F90.