MODgvec_ReadInTools Module

MODULE **READ IN TOOLS"

Readin routines for the input file


Uses

  • module~~modgvec_readintools~~UsesGraph module~modgvec_readintools MODgvec_ReadInTools module~modgvec_globals MODgvec_Globals module~modgvec_readintools->module~modgvec_globals iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env

Used by

  • module~~modgvec_readintools~~UsedByGraph module~modgvec_readintools MODgvec_ReadInTools proc~finalize Finalize proc~finalize->module~modgvec_readintools proc~get_imode get_iMode proc~get_imode->module~modgvec_readintools proc~hmap_axisnb_init hmap_axisNB_init proc~hmap_axisnb_init->module~modgvec_readintools proc~hmap_cyl_init hmap_cyl_init proc~hmap_cyl_init->module~modgvec_readintools proc~hmap_frenet_init hmap_frenet_init proc~hmap_frenet_init->module~modgvec_readintools proc~hmap_knot_init hmap_knot_init proc~hmap_knot_init->module~modgvec_readintools proc~init Init proc~init->module~modgvec_readintools proc~initanalyze InitAnalyze proc~initanalyze->module~modgvec_readintools proc~initmhd3d t_functional_mhd3d%InitMHD3D proc~initmhd3d->module~modgvec_readintools proc~initoutput InitOutput proc~initoutput->module~modgvec_readintools proc~initprofile InitProfile proc~initprofile->module~modgvec_readintools proc~initsolutionmhd3d t_functional_mhd3d%InitSolutionMHD3D proc~initsolutionmhd3d->module~modgvec_readintools proc~initvmec InitVMEC proc~initvmec->module~modgvec_readintools proc~rungvec rungvec proc~rungvec->module~modgvec_readintools program~gvec_post GVEC_POST program~gvec_post->module~modgvec_readintools

Variables

Type Visibility Attributes Name Initial
logical, public :: ReadInDone = .FALSE.
type(tString), private, POINTER :: FirstString

Interfaces

private interface GETSTR

  • private interface GETSTR()

    Arguments

    None

private interface CNTSTR

  • private interface CNTSTR()

    Arguments

    None

private interface GETINT

  • private interface GETINT()

    Arguments

    None

private interface GETREAL

  • private interface GETREAL()

    Arguments

    None

private interface GETLOGICAL

private interface GETINTARRAY

private interface GETREALARRAY

private interface IgnoredStrings

private interface FillStrings

private interface FindStr

  • private interface FindStr()

    Arguments

    None

private interface LowCase

  • private interface LowCase()

    Arguments

    None

private interface GetNewString

private interface DeleteString


Derived Types

type, private ::  tString

Components

Type Visibility Attributes Name Initial
character(len=MAXLEN), public :: Str

ONLY NVHPC COMPILER DOES NOT SEEM TO WORK WITH ALLOCATABLE CHARACTERS (SIGSEV!)

character(len=:), public, ALLOCATABLE :: Str
type(tString), public, POINTER :: NextStr
type(tString), public, POINTER :: PrevStr

Functions

public function GETSTR(Key, Proposal) result(GetStr)

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".

Arguments

Type IntentOptional 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)

Return Value character(len=512)

String read from setup file or initialized with default value

public function CNTSTR(Key, Proposal) result(CntStr)

Counts all occurances of string named "key" from inifile and store in "CNTSTR". If keyword "Key" is not found in ini file, the default value "Proposal" is used for "CNTSTR" (error if "Proposal" not given). Inifile was read in before and is stored as list of character strings starting with "FirstString".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

integer, intent(in), optional :: Proposal

Default values as integer

Return Value integer

Number of parameters named "Key" in inifile

public function GETINT(Key, Proposal, quiet_def_in) result(GetInt)

Read integer 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".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

integer, intent(in), optional :: Proposal

Default values as integer scalar

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

Return Value integer

Integer read from setup file or initialized with default value

public function GETREAL(Key, Proposal, quiet_def_in) result(GetReal)

Read real 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".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

real(kind=wp), intent(in), optional :: Proposal

Default values as real scalar

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

Return Value real(kind=wp)

Real read from setup file or initialized with default value

public function GETLOGICAL(Key, Proposal, quiet_def_in) result(GetLogical)

Read logical 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".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

logical, intent(in), optional :: Proposal

Default values as logical

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

Return Value logical

Logical read from setup file or initialized with default value

public function GETINTARRAY(Key, nIntegers, Proposal, quiet_def_in) result(GetIntArray)

Read array of "nIntegers" integer values named "Key" from ini file. If keyword "Key" is not found in setup file, the default values "Proposal" are used to create the array (error if "Proposal" not given). Setup file was read in before and is stored as list of character strings starting with "FirstString".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

integer, intent(in) :: nIntegers

Number of values in array

integer, intent(in), optional :: Proposal(:)

Default values as integer array

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

Return Value integer, (nIntegers)

Integer array read from setup file or initialized with default values

public function GETREALARRAY(Key, nReals, Proposal, quiet_def_in) result(GetRealArray)

Read array of "nReals" real values named "Key" from ini file. If keyword "Key" is not found in setup file, the default values "Proposal" are used to create the array (error if "Proposal" not given). Setup file was read in before and is stored as list of character strings starting with "FirstString".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

integer, intent(in) :: nReals

Number of values in array

real(kind=wp), intent(in), optional :: Proposal(:)

Default values as real array

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

Return Value real(kind=wp), (nReals)

Real array read from setup file or initialized with default values

public pure function remove_blanks(str_in) result(str_out)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str_in

Return Value character(len=LEN)

public pure function replace(str_in, find, rep) result(str_out)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str_in
character(len=*), intent(in) :: find
character(len=*), intent(in) :: rep

Return Value character(len=LEN)

private function count_sep(str_in, separator) result(n_sep)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str_in
character(len=1), intent(in) :: separator

Return Value integer


Subroutines

public subroutine GETINTALLOCARRAY(Key, GetIntArray, nIntegers, Proposal, quiet_def_in)

Allocate and read integer array of unknown length "nIntegers" integer values named "Key" from ini file. If keyword "Key" is not found in setup file, the default values "Proposal" are used to create the array (error if "Proposal" not given). Setup file was read in before and is stored as list of character strings starting with "FirstString".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

integer, ALLOCATABLE :: GetIntArray(:)

Integer array read from setup file or initialized with default values

integer, intent(out) :: nIntegers

Number of values in array

integer, intent(in), optional :: Proposal(:)

Default values as integer array

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

public subroutine GETREALALLOCARRAY(Key, GetRealArray, nReals, Proposal, quiet_def_in)

Read array of "nReals" real values named "Key" from ini file. If keyword "Key" is not found in setup file, the default values "Proposal" are used to create the array (error if "Proposal" not given). Setup file was read in before and is stored as list of character strings starting with "FirstString".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

real(kind=wp), ALLOCATABLE :: GetRealArray(:)

Real array read from setup file or initialized with default values

integer, intent(out) :: nReals

Number of values in array

real(kind=wp), intent(in), optional :: Proposal(:)

Default values as real array

logical, intent(in), optional :: quiet_def_in

flag to be quiet if DEFAULT is taken

public subroutine IgnoredStrings()

Prints out remaining strings in list after read-in is complete

Arguments

None

public subroutine FinalizeReadIn()

Reset global variables

Arguments

None

public subroutine FillStrings(IniFile)

Read ini file and put each line in a string object. All string objects are connected to a list of string objects starting with "firstString". MUST BE CALLED IN THE VERY BEGINNING OF THE PROGRAM!

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: IniFile

Name of ini file to be read in

private subroutine GetNewString(Str)

Create and initialize new string object.

Arguments

Type IntentOptional Attributes Name
type(tString), intent(inout), POINTER :: Str

New string

private subroutine DeleteString(Str)

Remove string "Str" from list of strings witFirstString,h first element "DirstString" and delete string.

Arguments

Type IntentOptional Attributes Name
type(tString), intent(inout), POINTER :: Str

String to delete

private subroutine FindStr(Key, Str, DefMsg, Proposal)

Find parameter string containing keyword "Key" in list of strings starting with "FirstString" and return string "Str" without keyword. If keyword is not found in list of strings, return default values "Proposal" (error if not given). Ini file was read in before and is stored as list of character strings starting with "FirstString".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Key

Search for this keyword in ini file

character(len=*), intent(out) :: Str

Parameter string without keyword

character(len=8), intent(inout) :: DefMsg

Default message = keyword not found, return default parameters (if available)

character(len=*), intent(in), optional :: Proposal

Default values as character string (as in ini file)

private subroutine LowCase(Str1, Str2)

Transform upper case letters in "Str1" into lower case letters, result is "Str2", but only up the the equal sign.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: Str1

Input string

character(len=*), intent(out) :: Str2

Output string, lower case letters only

private subroutine ConvertToProposalStr(ProposalStr, LogScalar, intScalar, realScalar, intarr, realarr)

Get logical, integer, real, integer array or real array and transform it to string in the proposal format

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: ProposalStr
logical, intent(in), optional :: LogScalar
integer, intent(in), optional :: intScalar
real(kind=wp), intent(in), optional :: realScalar
integer, intent(in), optional :: intarr(:)
real(kind=wp), intent(in), optional :: realarr(:)

public subroutine split(str_in, bStr, separator)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str_in
character(len=*), intent(out) :: bStr
character(len=1), intent(in) :: separator