pmc_spec_file Namespace Reference

Reading formatted text input. More...


Classes

struct  spec_file_t
 An input file with extra data for printing messages. More...

Functions

subroutine spec_file_die_msg (code, file, msg)
 Exit with an error message containing filename and line number.
subroutine spec_file_open (filename, file)
 Open a spec file for reading.
subroutine spec_file_close (file)
 Close a spec file.
subroutine spec_file_read_line_raw (file, line, eof)
 Read a single line from a spec file, signaling if we have hit EOF.
subroutine spec_file_read_next_data_line (file, line, eof)
 Read the next line from the spec file that contains useful data (stripping comments and blank lines).
subroutine spec_file_read_line (file, line, eof)
 Read a spec_line from the spec_file.
subroutine spec_file_read_line_no_eof (file, line)
 Read a spec_line from the spec_file. This will always succeed or error out, so should only be called if we know there should be a valid line coming.
subroutine spec_file_read_line_list (file, max_lines, line_list)
 Read a list of spec_lines from a file, stopping at max_lines or EOF, whichever comes first.
subroutine spec_file_read_line_array (file, max_lines, line_array)
 Read an array of spec_lines from a file, stopping at max_lines or EOF. All lines must have the same number of elements.
subroutine spec_file_check_line_name (file, line, name)
 Check that the name of the line data is as given.
subroutine spec_file_check_name (file, name, read_name)
 Checks that the read_name is the same as name.
subroutine spec_file_check_line_length (file, line, length)
 Check that the length of the line data is as given.
subroutine spec_file_check_read_iostat (file, ios, type)
 Check the IOSTAT and error if it is bad.
integer spec_file_string_to_integer (file, string)
 Convert a string to an integer.
real *8 spec_file_string_to_real (file, string)
 Convert a string to an real.
logical spec_file_string_to_logical (file, string)
 Convert a string to an logical.
subroutine spec_file_read_integer (file, name, var)
 Read an integer from a spec file that must have the given name.
subroutine spec_file_read_real (file, name, var)
 Read a real number from a spec file that must have the given name.
subroutine spec_file_read_logical (file, name, var)
 Read a logical from a spec file that must have a given name.
subroutine spec_file_read_string (file, name, var)
 Read a string from a spec file that must have a given name.
subroutine spec_file_read_complex (file, name, var)
 Read a complex number from a spec file that must have the given name.
subroutine spec_file_read_real_named_array (file, max_lines, names, vals)
 Read an array of named lines with real data. All lines must have the same number of data elements.
subroutine spec_file_read_timed_real_array (file, line_name, name, times, vals)
 Read an a time-indexed array of real data.

Variables

integer, parameter SPEC_FILE_MAX_LIST_LINES = 1000
 Maximum number of lines in an array.


Detailed Description

Reading formatted text input.

Function Documentation

subroutine pmc_spec_file::spec_file_check_line_length ( type(spec_file_t),intent(in)  file,
type(spec_line_t),intent(in)  line,
integer,intent(in)  length 
)

Check that the length of the line data is as given.

Parameters:
file  Spec file.
line  Spec line.
length  Expected data length.

subroutine pmc_spec_file::spec_file_check_line_name ( type(spec_file_t),intent(in)  file,
type(spec_line_t),intent(in)  line,
character(len=*),intent(in)  name 
)

Check that the name of the line data is as given.

Parameters:
file  Spec file.
line  Spec line.
name  Expected line name.

subroutine pmc_spec_file::spec_file_check_name ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  name,
character(len=*),intent(in)  read_name 
)

Checks that the read_name is the same as name.

Parameters:
file  Spec file.
name  Name that we should have.
read_name  Name that we do have.

subroutine pmc_spec_file::spec_file_check_read_iostat ( type(spec_file_t),intent(in)  file,
integer,intent(in)  ios,
character(len=*),intent(in)  type 
)

Check the IOSTAT and error if it is bad.

Parameters:
file  Spec file.
ios  Iostat result.
type  Type being read during error.

subroutine pmc_spec_file::spec_file_close ( type(spec_file_t),intent(in)  file  ) 

Close a spec file.

Parameters:
file  Spec file.

subroutine pmc_spec_file::spec_file_die_msg ( integer,intent(in)  code,
type(spec_file_t),intent(in)  file,
character(len=*),intent(in)  msg 
)

Exit with an error message containing filename and line number.

Parameters:
code  Failure status code.
file  Spec file.
msg  Error message.

subroutine pmc_spec_file::spec_file_open ( character(len=*),intent(in)  filename,
type(spec_file_t),intent(out)  file 
)

Open a spec file for reading.

Parameters:
filename  Name of file to open.
file  Spec file.

subroutine pmc_spec_file::spec_file_read_complex ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  name,
complex*16,intent(out)  var 
)

Read a complex number from a spec file that must have the given name.

Parameters:
file  Spec file.
name  Name.
var  Variable to store data.

subroutine pmc_spec_file::spec_file_read_integer ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  name,
integer,intent(out)  var 
)

Read an integer from a spec file that must have the given name.

Parameters:
file  Spec file.
name  Name.
var  Variable to store data.

subroutine pmc_spec_file::spec_file_read_line ( type(spec_file_t),intent(inout)  file,
type(spec_line_t),intent(inout)  line,
logical,intent(out)  eof 
)

Read a spec_line from the spec_file.

Parameters:
file  Spec file.
line  Spec line.
eof  True if EOF encountered.

subroutine pmc_spec_file::spec_file_read_line_array ( type(spec_file_t),intent(inout)  file,
integer,intent(in)  max_lines,
type(spec_line_t),dimension(:),pointer  line_array 
)

Read an array of spec_lines from a file, stopping at max_lines or EOF. All lines must have the same number of elements.

Parameters:
file  Spec file.
max_lines  Max lines to read (0 = no max).
line_array  Array of spec_lines,.

subroutine pmc_spec_file::spec_file_read_line_list ( type(spec_file_t),intent(inout)  file,
integer,intent(in)  max_lines,
type(spec_line_t),dimension(:),pointer  line_list 
)

Read a list of spec_lines from a file, stopping at max_lines or EOF, whichever comes first.

Parameters:
file  Spec file.
max_lines  Max lines to read (0 = no max).
line_list  List of spec_lines.

subroutine pmc_spec_file::spec_file_read_line_no_eof ( type(spec_file_t),intent(inout)  file,
type(spec_line_t),intent(out)  line 
)

Read a spec_line from the spec_file. This will always succeed or error out, so should only be called if we know there should be a valid line coming.

Parameters:
file  Spec file.
line  Spec line.

subroutine pmc_spec_file::spec_file_read_line_raw ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(out)  line,
logical,intent(out)  eof 
)

Read a single line from a spec file, signaling if we have hit EOF.

Parameters:
file  Spec file.
line  Complete line read.
eof  True if at EOF.

subroutine pmc_spec_file::spec_file_read_logical ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  name,
logical,intent(out)  var 
)

Read a logical from a spec file that must have a given name.

Parameters:
file  Spec file.
name  Name.
var  Variable to store data.

subroutine pmc_spec_file::spec_file_read_next_data_line ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(out)  line,
logical,intent(out)  eof 
)

Read the next line from the spec file that contains useful data (stripping comments and blank lines).

Parameters:
file  Spec file.
line  Complete line read.
eof  True if EOF encountered.

subroutine pmc_spec_file::spec_file_read_real ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  name,
real*8,intent(out)  var 
)

Read a real number from a spec file that must have the given name.

Parameters:
file  Spec file.
name  Name.
var  Variable to store data.

subroutine pmc_spec_file::spec_file_read_real_named_array ( type(spec_file_t),intent(inout)  file,
integer,intent(in)  max_lines,
character(len=SPEC_LINE_MAX_VAR_LEN),dimension(:),pointer  names,
real*8,dimension(:,:),pointer  vals 
)

Read an array of named lines with real data. All lines must have the same number of data elements.

Parameters:
file  Spec file.
max_lines  Max lines to read (0 = no max).
names  Names of lines.
vals  Data values.

subroutine pmc_spec_file::spec_file_read_string ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  name,
character(len=*),intent(out)  var 
)

Read a string from a spec file that must have a given name.

Parameters:
file  Spec file.
name  Name.
var  Variable to store data.

subroutine pmc_spec_file::spec_file_read_timed_real_array ( type(spec_file_t),intent(inout)  file,
character(len=*),intent(in)  line_name,
character(len=*),intent(in)  name,
real*8,dimension(:),pointer  times,
real*8,dimension(:),pointer  vals 
)

Read an a time-indexed array of real data.

Parameters:
file  Spec file.
line_name  Name of line for filename.
name  Variable name.
times  Names of lines.
vals  Data values.

integer pmc_spec_file::spec_file_string_to_integer ( type(spec_file_t),intent(in)  file,
character(len=*),intent(in)  string 
)

Convert a string to an integer.

Parameters:
file  Spec file.
string  String to convert.

logical pmc_spec_file::spec_file_string_to_logical ( type(spec_file_t),intent(in)  file,
character(len=*),intent(in)  string 
)

Convert a string to an logical.

Parameters:
file  Spec file.
string  String to convert.

real*8 pmc_spec_file::spec_file_string_to_real ( type(spec_file_t),intent(in)  file,
character(len=*),intent(in)  string 
)

Convert a string to an real.

Parameters:
file  Spec file.
string  String to convert.


Variable Documentation

integer,parameter pmc_spec_file::SPEC_FILE_MAX_LIST_LINES = 1000

Maximum number of lines in an array.


Generated on Mon Jun 15 15:56:23 2009 for PartMC by  doxygen 1.5.6