Globals Library 1.0
Loading...
Searching...
No Matches
datasequence::dataseq Type Reference

Data structure to store time-sequence of real data. More...

Public Member Functions

procedure, pass, public init (this, lun_err, ndata, nsequence)
 Static constructor for datasequence::dataseq
 
procedure, pass, public kill (this, lun_err)
 Static destructor for datasequence::dataseq
 
procedure, pass, public fill (this, data, time)
 Add new data to the database.
 
procedure, pass, public lagrange_interpolation (this, time, interpolation, info)
 Lagrange interpolation in time of stored data.
 

Public Attributes

integer ndata
 Data size.
 
integer nsequence
 Number of time instants.
 
real(kind=double), dimension(:,:), allocatable datas
 Dimension (ndata,nsequence) Data stored.
 
real(kind=double), dimension(:), allocatable times
 Dimension (nsequence) Times for which data is stored.
 
integer istored
 Column index where last data has been stored.
 
integer nstored
 Number of non-empty columns of real data.
 

Detailed Description

Data structure to store time-sequence of real data.


Used to generate linear Lagrangian interpolations. Data are stored cyclicaly.

Example: Assume nsequence = 3. After init istored = 0. Using fill procedure we pass the data to be stored.

data1, time1 -> this%datas(:,1), this%time(1) istored = 1
data2, time2 -> this%datas(:,2), this%time(2) istored = 2
data3, time3 -> this%datas(:,3), this%time(3) istored = 3
data4, time4 -> this%datas(:,1), this%time(1) istored = 1
data5, time5 -> this%datas(:,2), this%time(2) istored = 2
data6, time6 -> this%datas(:,3), this%time(3) istored = 3

The integer istored says which is the last slot were data has been stored.

Member Function/Subroutine Documentation

◆ init()

procedure, pass, public datasequence::dataseq::init ( class(dataseq), intent(inout) this,
integer, intent(in) lun_err,
integer, intent(in) ndata,
integer, intent(in) nsequence )

Static constructor for datasequence::dataseq


Set variables dataseq::ndata and dataseq::nsequence and allocate variables dataseq::datas and dataseq::times.

Parameters
[in]lun_errinteger, unit number for error message
[in]ndatainteger, dimension data to store
[in]nsequenceinteger, number of time instants

◆ kill()

procedure, pass, public datasequence::dataseq::kill ( class(dataseq), intent(inout) this,
integer, intent(in) lun_err )

Static destructor for datasequence::dataseq


Deallocate variables dataseq::datas and dataseq::times

Parameters
[in]lun_errinteger, unit number for error message

◆ fill()

procedure, pass, public datasequence::dataseq::fill ( class(dataseq), intent(inout) this,
real(kind=double), dimension(this%ndata), intent(in) data,
real(kind=double), intent(in) time )

Add new data to the database.


Parameters
[in]datadata to add to database dataseq::datas
[in]timetime associated to new data

◆ lagrange_interpolation()

procedure, pass, public datasequence::dataseq::lagrange_interpolation ( class(dataseq), intent(in) this,
real(kind=double), intent(in) time,
real(kind=double), dimension(this%ndata), intent(inout) interpolation,
integer, intent(inout) info )

Lagrange interpolation in time of stored data.


Parameters
[in]timetime at which we want to compute new data
[in,out]interpolationvector of data at time timecomputed using Lagrange interpolation in time of data stored in dataseq::datas
[in,out]info-1: database is not full and interpolation not computed, 0 otherwise

Member Data Documentation

◆ ndata

integer datasequence::dataseq::ndata

Data size.

◆ nsequence

integer datasequence::dataseq::nsequence

Number of time instants.

◆ datas

real(kind=double), dimension(:,:), allocatable datasequence::dataseq::datas

Dimension (ndata,nsequence) Data stored.

◆ times

real(kind=double), dimension(:), allocatable datasequence::dataseq::times

Dimension (nsequence) Times for which data is stored.

◆ istored

integer datasequence::dataseq::istored

Column index where last data has been stored.

◆ nstored

integer datasequence::dataseq::nstored

Number of non-empty columns of real data.


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