Globals Library 1.0
Loading...
Searching...
No Matches
timeinputs Module Reference

Data Types

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

Functions/Subroutines

subroutine init_td (this, stderr, inputfdescr, dimdata, ndata, default_data)
 Static constructor for timeinputs::timedata
 
subroutine kill_td (this, lun)
 Static destructor for timeinputs::timedata
 
subroutine info_td (this, lun, nsample)
 Info procedure for timeinputs::timedata.
 
subroutine set_td (this, stderr, inputfdescr, time, endfile, info)
 Set (read if necessary) non-steady time data.
 
integer function eval_ninput (this)
 Compute number of non-zero elements of timedata::tdactual
 
subroutine, public write_steady (stderr, lun, ndata, data, fname)
 Write data array into file in the form of steady state data.
 
subroutine, public read_steady (stderr, ndata, data, open_file)
 Read data array from file in the form of steady state data.
 
subroutine, public write2file (lun_err, head_body_tail_whole, dimdata, ndata, data, time, fileout)
 Write data matrix into file in the form of steady state data.
 
subroutine, public writearray2file (lun_err, head_body_tail_whole, time, ndata, data, lun, fn)
 Write data array into file in the form of steady state data.
 
integer function eval_ninput_data (dimdata, ndata, data)
 Compute number of non-zero input data.
 
subroutine find_nonzeros (dimdata, ndata, data, nnz, indeces_nonzeros)
 Compute number and indices of non-zero input data.
 

Function/Subroutine Documentation

◆ init_td()

subroutine timeinputs::init_td ( 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_td()

subroutine timeinputs::kill_td ( class(timedata), intent(inout) this,
integer, intent(in) lun )
private

Static destructor for timeinputs::timedata


Parameters
[in]lununit number for error message output

◆ info_td()

subroutine timeinputs::info_td ( class(timedata), intent(in) this,
integer, intent(in) lun,
integer, intent(in) nsample )
private

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_td()

subroutine timeinputs::set_td ( 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 )
private

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)

Test if continue reading file

◆ eval_ninput()

integer function timeinputs::eval_ninput ( class(timedata), intent(in) this)
private

Compute number of non-zero elements of timedata::tdactual


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

◆ write_steady()

subroutine, public timeinputs::write_steady ( integer, intent(in) stderr,
integer, intent(in) lun,
integer, intent(in) ndata,
real(kind=double), dimension(ndata), intent(in) data,
character(len=*), intent(in), optional fname )

Write data array into file in the form of steady state data.


Output file has the form:

1, ndata
time 1.0e-30
ndata
1 data(1)
2 data(2)
...
ndata data(ndata)
time 1.0e+30
Parameters
[in]stderrunit number for error message
[in]lununit number for file in which data is written
[in]ndatalength of data array
[in]dataarray of data to be written
[in]fnamename of file where data is written (optional)

◆ read_steady()

subroutine, public timeinputs::read_steady ( integer, intent(in) stderr,
integer, intent(in) ndata,
real(kind=double), dimension(ndata), intent(inout) data,
type(file), intent(in) open_file )

Read data array from file in the form of steady state data.


Parameters
[in]stderrunit number for error message
[in]ndatadata length
[in,out]datadata to read (length ndata)
[in]open_filefile containing input data

◆ write2file()

subroutine, public timeinputs::write2file ( integer, intent(in) lun_err,
character(len=*), intent(in) head_body_tail_whole,
integer, intent(in) dimdata,
integer, intent(in) ndata,
real(kind=double), dimension(dimdata,ndata), intent(in) data,
real(kind=double), intent(in) time,
type(file), intent(in) fileout )

Write data matrix into file in the form of steady state data.


Parameters
[in]lun_errunit number for error message
[in]head_body_tail_wholewhat has to be written
  • head: write dimensions
  • body: write time and data
  • tail: close time
  • whole: write head, body and tail
[in]timetime of data
[in]dimdatafirst dimension of data
[in]ndatasecond dimension of data
[in]datadata to write
[in]fileoutfile where to write data

◆ writearray2file()

subroutine, public timeinputs::writearray2file ( integer, intent(in) lun_err,
character(len=*), intent(in) head_body_tail_whole,
real(kind=double), intent(in) time,
integer, intent(in) ndata,
real(kind=double), dimension(ndata), intent(in) data,
integer, intent(in) lun,
character(len=*), intent(in) fn )

Write data array into file in the form of steady state data.


Parameters
[in]lun_errunit number for error message
[in]head_body_tail_wholewhat has to be written
  • head: write dimensions
  • body: write time and data
  • tail: close time
  • whole: write head, body and tail
[in]timetime of data
[in]ndatasecond dimension of data
[in]datadata to write
[in]lununit number for output file
[in]fnoutput file name

◆ eval_ninput_data()

integer function timeinputs::eval_ninput_data ( integer, intent(in) dimdata,
integer, intent(in) ndata,
real(kind=double), dimension(dimdata,ndata), intent(in) data )
private

Compute number of non-zero input data.


Compute the number of columns of input variable data having non-zero norm.

Parameters
[in]dimdatanumber of columns of data
[in]ndatanumber of rows of data
[in]datainput data
Returns
(integer) number of non-zero input data

◆ find_nonzeros()

subroutine timeinputs::find_nonzeros ( integer, intent(in) dimdata,
integer, intent(in) ndata,
real(kind=double), dimension(dimdata,ndata), intent(in) data,
integer, intent(out) nnz,
integer, dimension(ndata), intent(inout) indeces_nonzeros )
private

Compute number and indices of non-zero input data.


Compute the number of columns of input variable data having zero norm and their indices.

Parameters
[in]dimdatanumber of columns of data
[in]ndatanumber of rows of data
[in]datainput data
[out]nnznumber of columns of data having non-zero norm
[in,out]indeces_nonzerosindices of columns of data having non-zero norm