Globals Library 1.0
|
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=double) | time |
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 | |
Data structure containing values of a variable possibly depending on time (e.g., forcing function)
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
If input data depend on time, the input file must be in the form:
Steady state input data can also be given using the input vector default_data
. In this case:
[in] | stderr | unit number for error message |
[in] | InputFdescr | file for input data. If file does not exist, default_data must be given. |
[in] | dimdata | valaue to be assigned to timedata::dimdata . Optional if file is provided, otherwise must be given. |
[in] | ndata | value to be assigned to timedata::ndata . Optional if file is provided, otherwise must be given. |
[in] | default_data | steady state input data. This variable is required only if input file does not exist. |
procedure, pass, public timeinputs::timedata::kill | ( | class(timedata), intent(inout) | this, |
integer, intent(in) | lun ) |
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)
.
[in] | lun | unit number for error message output. |
[in] | nsample | number of first non-zero samples to be printed |
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
.
[in] | stderr | unit number for error message |
[in] | InputFdescr | input file for reading data |
[in] | time | time for the computation of timedata::tdactual |
[in,out] | endfile | .true. if end of file is reached |
[in,out] | info | error code (optional) |
procedure, pass, public timeinputs::timedata::eval_ninput | ( | class(timedata), intent(in) | this | ) |
Compute number of non zero elements of tdactual
timedata::tdactual
logical timeinputs::timedata::built |
Logical flag to check if object is initialized.
integer timeinputs::timedata::dimdata |
Dimension of real data array.
integer timeinputs::timedata::ndata |
Number of data arrays.
real(kind=double), dimension(:,:,:), allocatable timeinputs::timedata::tdval |
Dimension (dimdata
,ndata
,2). Input values. If data is steady state, then tdval(:,:,1) == tdval(:,:,2)
real(kind=double), dimension(:), allocatable timeinputs::timedata::tdtime |
integer timeinputs::timedata::nnonzeros = 0 |
Number of current non-zeros values.
real(kind=double), dimension(:,:), allocatable timeinputs::timedata::tdactual |
Dimension (dimdata
,ndata
). Actual values. If data is steady state, then tdactual = tdval(:,:,1)
real(kind=double), dimension(:), allocatable timeinputs::timedata::val |
Dimension (dimdata
) Scratch array for reading values.
logical timeinputs::timedata::steadytd |
.true.
if data do not depend on time, .false.
if data depend on time
logical timeinputs::timedata::steadytd_written = .false. |
.true.
if closing time has been written, .false.
if closing time has not been written