61     real(kind=
rp) :: time_end
 
 
   83    integer, 
intent(in), 
optional :: size
 
   84    real(kind=
rp), 
intent(in) :: time_end
 
   85    character(len=LOG_SIZE) :: log_buf
 
   90    if (
present(size)) 
then 
   96    allocate(this%output_list(n))
 
   97    allocate(this%controllers(n))
 
  100       this%output_list(i)%ptr => null()
 
  105    this%time_end = time_end
 
 
  113    if (
allocated(this%output_list)) 
then 
  114       deallocate(this%output_list)
 
  116    if (
allocated(this%controllers)) 
then 
  117       deallocate(this%controllers)
 
 
  133    class(
output_t), 
intent(inout), 
target :: out
 
  134    real(kind=
rp), 
intent(in) :: write_par
 
  135    character(len=*), 
intent(in) :: write_control
 
  138    character(len=LOG_SIZE) :: log_buf
 
  140    class(*), 
pointer :: ft
 
  142    if (this%n .ge. this%size) 
then 
  143       allocate(tmp(this%size * 2))
 
  144       tmp(1:this%size) = this%output_list
 
  145       call move_alloc(tmp, this%output_list)
 
  147       allocate(tmp_ctrl(this%size * 2))
 
  148       tmp_ctrl(1:this%size) = this%controllers
 
  149       call move_alloc(tmp_ctrl, this%controllers)
 
  151       this%size = this%size * 2
 
  156    this%output_list(this%n)%ptr => out
 
  158    if (trim(write_control) .eq. 
"org") 
then 
  159       this%controllers(n) = this%controllers(1)
 
  161       call this%controllers(n)%init(this%time_end, write_control, write_par)
 
  165    call neko_log%section(
'Adding write output')
 
  166    call neko_log%message(
'File name        : '// &
 
  167          trim(this%output_list(this%n)%ptr%file_%file_type%fname))
 
  168    call neko_log%message(
'Write control    : '//trim(write_control))
 
  171    select type (ft => out%file_%file_type)
 
  173       if (ft%dp_precision) 
then 
  174          call neko_log%message(
'Output precision : double')
 
  176          call neko_log%message(
'Output precision : single')
 
  180   if (trim(write_control) .eq. 
'simulationtime') 
then 
  181       write(log_buf, 
'(A,ES13.6)') 
'Writes per time unit (Freq.): ', &
 
  182             this%controllers(n)%frequency
 
  184       write(log_buf, 
'(A,ES13.6)') 
'Time between writes: ', &
 
  185          this%controllers(n)%time_interval
 
  187    else if (trim(write_control) .eq. 
'nsamples') 
then 
  188       write(log_buf, 
'(A,I13)') 
'Total samples: ',  int(write_par)
 
  190       write(log_buf, 
'(A,ES13.6)') 
'Writes per time unit (Freq.): ',  &
 
  191             this%controllers(n)%frequency
 
  193       write(log_buf, 
'(A,ES13.6)') 
'Time between writes: ', &
 
  194          this%controllers(n)%time_interval
 
  196    else if (trim(write_control) .eq. 
'tsteps') 
then 
  197       write(log_buf, 
'(A,I13)') 
'Time step interval: ',  int(write_par)
 
  199    else if (trim(write_control) .eq. 
'org') 
then 
  200       write(log_buf, 
'(A)') &
 
  201             'Write control not set, defaulting to first output settings' 
 
  215    real(kind=
rp), 
intent(in) :: t
 
  216    integer, 
intent(in) :: tstep
 
  217    logical, 
intent(in), 
optional :: ifforce
 
  218    real(kind=
dp) :: sample_start_time, sample_end_time
 
  219    real(kind=
dp) :: sample_time
 
  220    character(len=LOG_SIZE) :: log_buf
 
  222    logical :: force, write_output, write_output_test
 
  224    if (
present(ifforce)) 
then 
  233    sample_start_time = mpi_wtime()
 
  235    write_output = .false.
 
  240    select type (samp => this)
 
  243          if (this%controllers(i)%check(t, tstep, force)) 
then 
  244             write_output = .true.
 
  250    if (write_output) 
then 
  251       call neko_log%section(
'Writer output ')
 
  258    select type (samp => this)
 
  261          if (this%controllers(i)%check(t, tstep, force)) 
then 
  262             call neko_log%message(
'File name     : '// &
 
  263                  trim(samp%output_list(i)%ptr%file_%file_type%fname))
 
  265             write(log_buf, 
'(A,I6)') 
'Output number :', &
 
  266                  int(this%controllers(i)%nexecutions)
 
  269             call samp%output_list(i)%ptr%sample(t)
 
  271             call this%controllers(i)%register_execution()
 
  275       call neko_error(
'Invalid output_controller output list')
 
  279    sample_end_time = mpi_wtime()
 
  281    sample_time = sample_end_time - sample_start_time
 
  282    if (write_output) 
then 
  283       write(log_buf, 
'(A16,1x,F10.6,A,F9.6)') 
'Writing at time:', t, &
 
  284            ' Output time (s): ', sample_time
 
 
  295    real(kind=
rp), 
intent(in) :: t
 
  296    integer :: i, nexecutions
 
  300       if (this%controllers(i)%nsteps .eq. 0) 
then 
  301          nexecutions = int(t / this%controllers(i)%time_interval) + 1
 
  302          this%controllers(i)%nexecutions = nexecutions
 
  304          call this%output_list(i)%ptr%set_counter(nexecutions)
 
  305          call this%output_list(i)%ptr%set_start_counter(nexecutions)
 
 
  315    integer, 
intent(in) :: counter
 
  319       this%controllers(i)%nexecutions = counter
 
  320       call this%output_list(i)%ptr%set_counter(counter)
 
  321       call this%output_list(i)%ptr%set_start_counter(counter)
 
 
type(mpi_comm) neko_comm
MPI communicator.
 
type(log_t), public neko_log
Global log stream.
 
integer, parameter, public log_size
 
integer, parameter, public dp
 
integer, parameter, public rp
Global precision used in computations.
 
Implements output_controller_t
 
subroutine output_controller_free(this)
Destructor.
 
subroutine output_controller_add(this, out, write_par, write_control)
Add an output out to the controller.
 
subroutine output_controller_init(this, time_end, size)
Constructor.
 
subroutine output_controller_set_counter(this, t)
Set write counter based on time (after restart)
 
subroutine output_controller_execute(this, t, tstep, ifforce)
Query each of the controllers whether it is time to write, and if so, do so for the corresponding out...
 
subroutine output_controller_set_write_count(this, counter)
Set write counter (after restart) explicitly.
 
subroutine, public profiler_start_region(name, region_id)
Started a named (name) profiler region.
 
subroutine, public profiler_end_region(name, region_id)
End the most recently started profiler region.
 
Contains the time_based_controller_t type.
 
Interface for NEKTON fld files.
 
Wrapper around an output_t pointer.
 
Abstract type defining an output type.
 
Centralized controller for a list of outputs.
 
A utility type for determening whether an action should be executed based on the current time value....