FEDEM Solver  R8.0
Source code of the dynamics solver
Functions/Subroutines
inpututilities Module Reference

Module with functions and subroutines for parsing solver input files. More...

Functions/Subroutines

subroutine iucopytoscratch (itmp, chname, ierr)
 Copies a solver input file to a temporary scratch file. More...
 
subroutine iuwritetoscratch (itmp, chmodel, ierr)
 Writes an input file to a temporary scratch file. More...
 
character(len=len(string)) function, private iutoupper (string)
 Converts the text string to all uppercase. More...
 
integer function iugetnumberofentries (file, string, ierr)
 Counts number of entries of a text string in a solver input file. More...
 
logical function iusetposatfirstentry (file, string, ierr)
 Sets position at the first entry of a text string in a file. More...
 
logical function iusetposatnextentry (file, string, ierr)
 Sets position at the next entry of a text string in a file. More...
 
integer function iuchartoint (string, stringArray, ierr, startIndex)
 Searches for a text string in an array of strings. More...
 

Detailed Description

Module with functions and subroutines for parsing solver input files.

This module contains various utility subroutines and functions used for parsing solver input files based on the namelist Fortran90 feature.

Bjorn Haugen

Date
31 Sep 1999

Function/Subroutine Documentation

◆ iuchartoint()

integer function inpututilities::iuchartoint ( character(len=*), intent(in)  string,
character(len=*), dimension(:), intent(in)  stringArray,
integer, intent(inout), optional  ierr,
integer, intent(in), optional  startIndex 
)

Searches for a text string in an array of strings.

Parameters
[in]stringThe text string to search for
[in]stringArrayArray of text strings to search within
ierrError flag
[in]startIndexOptional offset for the returned array index
Returns
Index of the first occurence of the string

◆ iucopytoscratch()

subroutine inpututilities::iucopytoscratch ( integer, intent(in)  itmp,
character(len=*), intent(in)  chname,
integer, intent(out)  ierr 
)

Copies a solver input file to a temporary scratch file.

Parameters
[in]itmpFile unit number of the file to copy to
[in]chnameName of the solver input file to copy from
[out]ierrError flag

Any \r character at the end of each line is removed on UNIX.

Author
Knut Morten Okstad
Date
8 Jan 2002

◆ iugetnumberofentries()

integer function inpututilities::iugetnumberofentries ( integer, intent(in)  file,
character(len=*), intent(in)  string,
integer, intent(out)  ierr 
)

Counts number of entries of a text string in a solver input file.

Parameters
[in]fileFile unit number of the file to count entries in
[in]stringThe text string to count the number of entries of
[in]ierrError flag

◆ iusetposatfirstentry()

logical function inpututilities::iusetposatfirstentry ( integer, intent(in)  file,
character(len=*), intent(in)  string,
integer, intent(out), optional  ierr 
)

Sets position at the first entry of a text string in a file.

Parameters
[in]fileFile unit number of the file to set position for
[in]stringThe text string to find the file position for
ierrError flag
Returns
.true. if the string is found, otherwise .false.

◆ iusetposatnextentry()

logical function inpututilities::iusetposatnextentry ( integer, intent(in)  file,
character(len=*), intent(in)  string,
integer, intent(out), optional  ierr 
)

Sets position at the next entry of a text string in a file.

Parameters
[in]fileFile unit number of the file to set position for
[in]stringThe text string to find the file position for
ierrError flag
Returns
.true. if the string is found, otherwise .false.

◆ iutoupper()

character(len=len(string)) function, private inpututilities::iutoupper ( character(len=*), intent(in)  string)
private

Converts the text string to all uppercase.

◆ iuwritetoscratch()

subroutine inpututilities::iuwritetoscratch ( integer, intent(in)  itmp,
character(len=*), intent(in)  chmodel,
integer, intent(out)  ierr 
)

Writes an input file to a temporary scratch file.

Parameters
[in]itmpFile unit number of the file to write to
[in]chmodelCharacter string containing the solver model to write
[out]ierrError flag

This subroutine is used the model is passed to the solver through a long text string, and not via a solver input file. That is, when the actual solver input file has been parsed by some external process.

Author
Knut Morten Okstad
Date
12 Dec 2016