Read string named "key" from setup file and store in "GETINT". If keyword "Key" is not found in ini file, the default value "Proposal" is used for "GETINT" (error if "Proposal" not given). Ini file was read in before and is stored as list of character strings starting with "FirstString".
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | Key |
Search for this keyword in ini file |
||
| character(len=*), | intent(in), | optional | :: | Proposal |
Default values as character string (as in ini file) |
String read from setup file or initialized with default value
FUNCTION GETSTR(Key,Proposal) ! MODULES IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES CHARACTER(LEN=*),INTENT(IN) :: Key !! Search for this keyword in ini file CHARACTER(LEN=*),OPTIONAL,INTENT(IN) :: Proposal !! Default values as character string (as in ini file) !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES CHARACTER(LEN=512) :: GetStr !! String read from setup file or initialized with default value !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES CHARACTER(LEN=8) :: DefMsg !=================================================================================================================================== IF (PRESENT(Proposal)) THEN CALL FindStr(Key,GetStr,DefMsg,Proposal) ELSE CALL FindStr(Key,GetStr,DefMsg) END IF SWRITE(UNIT_StdOut,'(a3,a30,a3,a33,a3,a7,a3)')' | ',TRIM(Key),' | ', TRIM(GetStr),' | ',TRIM(DefMsg),' | ' END FUNCTION GETSTR