24 real(kind=double),
allocatable :: tdactual(:, :)
26 real(kind=double) :: time
32 logical :: steadytd_written = .false.
35 procedure,
public, pass :: init =>
init_td
37 procedure,
public, pass :: kill =>
kill_td
39 procedure,
public, pass :: info =>
info_td
41 procedure,
public, pass :: write2dat =>
write_td
61 subroutine init_td(this, stderr, dimdata, Ndata)
63 class(
tdout),
intent(out) :: this
64 integer,
intent(in) :: stderr
65 integer,
intent(in) :: dimdata
66 integer,
intent(in) :: Ndata
73 this%dimdata = dimdata
76 allocate (this%TDactual(dimdata, ndata), stat=res)
78 ' type TDOut member TDactual (array)', res)
81 this%steadyTD = .false.
94 class(
tdout),
intent(inout) :: this
95 integer,
intent(in) :: lun
101 deallocate (this%TDactual, stat=res)
103 'type TDOut var TDactual')
117 class(
tdout),
intent(in) :: this
118 integer,
intent(in) :: lun
119 integer,
intent(in) :: nsample
122 real(kind=double) :: dnrm2
125 write (lun, *)
' Info: TDOut structure definition:'
126 write (lun, *)
'dimension data', this%dimdata
127 write (lun, *)
'ndata ', this%ndata
129 if (this%steadyTD)
write (lun, *)
' Steady state'
130 if (.not. this%steadyTD)
write (lun, *)
' Not in steady state'
132 write (lun, *)
' Actual val '
135 do while ((i .lt. this%ndata) .and. (j .lt. nsample))
137 if (dnrm2(this%dimdata, this%TDactual(:, i), 1) .ne. zero)
then
139 write (lun,
'(5(i5,e11.3))') i, (this%TDactual(k, i), k=1, this%dimdata)
158 class(
tdout),
intent(inout) :: this
159 integer,
intent(in) :: lun
161 integer :: i, k, ninput
162 real(kind=double) :: dnrm2
166 if (.not. this%steadyTD_written)
then
167 ninput = this%eval_ninput()
168 write (lun,
'(a4,1pe15.6)')
'time', this%time
169 write (lun, *) ninput
171 if (dnrm2(this%dimdata, this%TDactual(:, i), 1) > small)
then
172 write (lun, *) i, (this%TDactual(k, i), k=1, this%dimdata)
177 if (this%steadyTD)
then
178 write (lun,
'(a4,1pe15.6)')
'time', huge
179 this%steadyTD_written = .true.
192 class(
tdout),
intent(inout) :: this
193 integer,
intent(in) :: lun
195 write (lun,
'(a4,1pe15.6)')
'time', this%time
208 class(
tdout),
intent(in) :: this
212 real(kind=double) :: dnrm2
217 if (dnrm2(this%dimdata, this%TDactual(:, i), 1) > small)
then
integer, parameter err_alloc
Error allocation failed.
integer, parameter err_dealloc
Error deallocation failed.
logical function ioerr(lun, errno, call_proc, add_msg, add_int)
Handle and write alert I/O warnings and errors.
subroutine kill_td(this, lun)
Static destructor for timeoutputs::tdout.
subroutine init_td(this, stderr, dimdata, ndata)
Static constructor for timeoutputs::tdout.
subroutine info_td(this, lun, nsample)
Info procedure for timeoutputs::tdout.
integer function eval_ninput(this)
Compute number of data arrays (columns of tdout::tdactual) having non-zero norm.
subroutine write_end_time(this, lun)
Write variable tdout::time.
subroutine write_td(this, lun)
Write non-zero content of tdout::tdactual for non steady state data.
Data structure containing values of a variable possibly depending on time (e.g., forcing function).