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

Definition at line 13 of file modTimeInputs.f90.

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.

Definition at line 47 of file modTimeInputs.f90.

◆ 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

Definition at line 49 of file modTimeInputs.f90.

◆ 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

Definition at line 51 of file modTimeInputs.f90.

◆ 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)

Definition at line 53 of file modTimeInputs.f90.

◆ 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

Definition at line 55 of file modTimeInputs.f90.

Member Data Documentation

◆ built

logical timeinputs::timedata::built

Logical flag to check if object is initialized.

Definition at line 15 of file modTimeInputs.f90.

◆ dimdata

integer timeinputs::timedata::dimdata

Dimension of real data array.

Definition at line 17 of file modTimeInputs.f90.

◆ ndata

integer timeinputs::timedata::ndata

Number of data arrays.

Definition at line 19 of file modTimeInputs.f90.

◆ 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).

Definition at line 23 of file modTimeInputs.f90.

◆ tdtime

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

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

Definition at line 27 of file modTimeInputs.f90.

◆ nnonzeros

integer timeinputs::timedata::nnonzeros = 0

Number of current non-zeros values.

Definition at line 29 of file modTimeInputs.f90.

◆ tdactual

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

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

Definition at line 33 of file modTimeInputs.f90.

◆ val

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

Dimension (::dimdata) Scratch array for reading values.

Definition at line 36 of file modTimeInputs.f90.

◆ time

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

Time of evaluated ::tdactual.

Definition at line 38 of file modTimeInputs.f90.

◆ steadytd

logical timeinputs::timedata::steadytd

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

Definition at line 41 of file modTimeInputs.f90.

◆ steadytd_written

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

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

Definition at line 44 of file modTimeInputs.f90.


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