Globals Library 1.0
Loading...
Searching...
No Matches
timeinputs::timedata Type Reference

Data structure containing values of a variable possibly depending on time (e.g., forcing function) More...

Public Member Functions

procedure, pass, public init (this, stderr, inputfdescr, dimdata, ndata, default_data)
 Static constructor for timeinputs::timedata
 
procedure, pass, public kill (this, lun)
 Static destructor for timeinputs::timedata
 
procedure, pass, public info (this, lun, nsample)
 Info procedure for timeinputs::timedata
 
procedure, pass, public set (this, stderr, inputfdescr, time, endfile, info)
 Set (read if necessary) non-steady time data.
 
procedure, pass, public eval_ninput (this)
 Compute number of non zero elements of tdactual
 

Public Attributes

logical built
 Logical flag to check if object is initialized.
 
integer dimdata
 Dimension of real data array.
 
integer ndata
 Number of data arrays.
 
real(kind=double), dimension(:,:,:), allocatable tdval
 Dimension (dimdata,ndata,2). Input values. If data is steady state, then tdval(:,:,1) == tdval(:,:,2)
 
real(kind=double), dimension(:), allocatable tdtime
 Dimension (2) Time values. If data is steady state, then tdtime(2) = huge
 
integer nnonzeros = 0
 Number of current non-zeros values.
 
real(kind=double), dimension(:,:), allocatable tdactual
 Dimension (dimdata,ndata). Actual values. If data is steady state, then tdactual = tdval(:,:,1)
 
real(kind=double), dimension(:), allocatable val
 Dimension (dimdata) Scratch array for reading values.
 
real(kind=doubletime
 Time of evaluated tdactual
 
logical steadytd
 .true. if data do not depend on time, .false. if data depend on time
 
logical steadytd_written = .false.
 .true. if closing time has been written, .false. if closing time has not been written
 

Detailed Description

Data structure containing values of a variable possibly depending on time (e.g., forcing function)

Member Function/Subroutine Documentation

◆ init()

procedure, pass, public timeinputs::timedata::init ( class(timedata), intent(out) this,
integer, intent(in) stderr,
type(file), intent(in) inputfdescr,
integer, intent(in), optional dimdata,
integer, intent(in), optional ndata,
real(kind=double), dimension(:), intent(in), optional default_data )

Static constructor for timeinputs::timedata


Read data from input file or from input vector.

Input file for steady state data must be written in the form

dimdata ndata
time: time1
nnonzeros
1 data1, ..., data_dimdata
2 data1, ..., data_dimdata
...
nonzeros data1, ..., data_dimdata

If input data depend on time, the input file must be in the form:

dimdata ndata
time: time1
nnonzeros
1 data1, ..., data_dimdata
2 data1, ..., data_dimdata
...
nonzeros data1, ..., data_dimdata
time: time2
nnonzeros
1 data1, ..., data_dimdata
2 data1, ..., data_dimdata
...
nonzeros data1, ..., data_dimdata

Steady state input data can also be given using the input vector default_data. In this case:

k = (j-1)*this%dimdata + i
this%tdactual(i,j) = default_data(k)
Parameters
[in]stderrunit number for error message
[in]InputFdescrfile for input data. If file does not exist, default_data must be given.
[in]dimdatavalaue to be assigned to timedata::dimdata. Optional if file is provided, otherwise must be given.
[in]ndatavalue to be assigned to timedata::ndata. Optional if file is provided, otherwise must be given.
[in]default_datasteady state input data. This variable is required only if input file does not exist.

◆ kill()

procedure, pass, public timeinputs::timedata::kill ( class(timedata), intent(inout) this,
integer, intent(in) lun )

Static destructor for timeinputs::timedata


Parameters
[in]lununit number for error message output

◆ info()

procedure, pass, public timeinputs::timedata::info ( class(timedata), intent(in) this,
integer, intent(in) lun,
integer, intent(in) nsample )

Info procedure for timeinputs::timedata


Print the first nsample non-zero terms of timedata::tdval(:,:.1), timedata::tdactual(:,:) and timedata::tdval(:,:,2).

Parameters
[in]lununit number for error message output.
[in]nsamplenumber of first non-zero samples to be printed

◆ set()

procedure, pass, public timeinputs::timedata::set ( class(timedata), intent(inout) this,
integer, intent(in) stderr,
type(file), intent(in) inputfdescr,
real(kind=double), intent(in) time,
logical, intent(inout) endfile,
integer, intent(inout), optional info )

Set (read if necessary) non-steady time data.


If timedata::steadytd = .true., do nothing. Set the value of timedata::tdactual using a linear interpolation in time of the values in timedata::tdval.

Parameters
[in]stderrunit number for error message
[in]InputFdescrinput file for reading data
[in]timetime for the computation of timedata::tdactual
[in,out]endfile.true. if end of file is reached
[in,out]infoerror code (optional)

◆ eval_ninput()

procedure, pass, public timeinputs::timedata::eval_ninput ( class(timedata), intent(in) this)

Compute number of non zero elements of tdactual


Returns
(integer) number of non-zero elements of timedata::tdactual

Member Data Documentation

◆ built

logical timeinputs::timedata::built

Logical flag to check if object is initialized.

◆ dimdata

integer timeinputs::timedata::dimdata

Dimension of real data array.

◆ ndata

integer timeinputs::timedata::ndata

Number of data arrays.

◆ tdval

real(kind=double), dimension(:,:,:), allocatable timeinputs::timedata::tdval

Dimension (dimdata,ndata,2). Input values. If data is steady state, then tdval(:,:,1) == tdval(:,:,2)

◆ tdtime

real(kind=double), dimension(:), allocatable timeinputs::timedata::tdtime

Dimension (2) Time values. If data is steady state, then tdtime(2) = huge

◆ nnonzeros

integer timeinputs::timedata::nnonzeros = 0

Number of current non-zeros values.

◆ tdactual

real(kind=double), dimension(:,:), allocatable timeinputs::timedata::tdactual

Dimension (dimdata,ndata). Actual values. If data is steady state, then tdactual = tdval(:,:,1)

◆ val

real(kind=double), dimension(:), allocatable timeinputs::timedata::val

Dimension (dimdata) Scratch array for reading values.

◆ time

real(kind=double) timeinputs::timedata::time

Time of evaluated tdactual

◆ steadytd

logical timeinputs::timedata::steadytd

.true. if data do not depend on time, .false. if data depend on time

◆ steadytd_written

logical timeinputs::timedata::steadytd_written = .false.

.true. if closing time has been written, .false. if closing time has not been written


The documentation for this type was generated from the following file: