47 type(tdf_t),
allocatable :: f(:)
48 character(len=1024),
allocatable :: expression(:)
49 integer,
allocatable :: domain(:)
52 integer,
parameter,
public :: &
60 subroutine filter_init(steps, namespace, dt, filter)
61 integer,
intent(in) :: steps
62 type(namespace_t),
intent(in) :: namespace
63 real(real64),
intent(in) :: dt
64 type(filter_t),
intent(inout) :: filter
109 if (
parse_block(namespace,
'OCTFilter', blk) == 0)
then
117 filter%no_filters = no_f
118 safe_allocate(filter%f(1:no_f))
119 safe_allocate(filter%expression(1:no_f))
120 safe_allocate(filter%domain(1:no_f))
144 integer :: no_f, i, j, nfreqs
148 no_f = filter%no_filters
155 write(
message(1),
'(a,i2)')
"Info: Applying filter "
160 select case (filter%domain(i))
167 do j = nfreqs + 1, 2*nfreqs - 1
173 message(1) =
"...I don't know this filter type..."
186 type(
filter_t),
intent(inout) :: filter
188 integer :: i, ip, j, nfreqs
189 real(real64) :: f_re, f_im
190 complex(real64),
allocatable :: ff(:)
191 real(real64),
allocatable :: grid(:)
195 do i = 1, filter%no_filters
200 safe_allocate(grid(1:
tdf_nfreqs(filter%f(i))))
204 select case (filter%domain(i))
209 call parse_expression(f_re, f_im,
"w", real(grid(ip), real64), filter%expression(i))
210 ff(ip) = f_re +
m_zi*f_im
214 write(
message(1),
'(a)')
"Unknown choice of domain for filter."
215 write(
message(2),
'(a)')
"Choose: time or freq ."
224 do j = nfreqs + 1, 2*nfreqs - 1
228 safe_deallocate_a(ff)
229 safe_deallocate_a(grid)
240 type(
filter_t),
intent(in) :: filter
243 integer :: kk, iunit, i, max_iter
244 character(len=80) :: filename
245 real(real64),
allocatable :: wgrid(:)
249 if (filter%no_filters <= 0)
then
254 do kk = 1, filter%no_filters
255 write(filename,
'(a,i2.2)')
oct_dir//
'filter', kk
257 iunit =
io_open(filename, namespace, action=
'write')
258 safe_allocate(wgrid(1:max_iter/2+1))
260 do i = 1, max_iter/2+1
261 write(iunit,
'(3es30.16e4)') wgrid(i),
tdf(filter%f(kk), i)
263 safe_deallocate_a(wgrid)
274 type(
filter_t),
intent(inout) :: filter
279 if (filter%no_filters <= 0)
then
284 do i = 1, filter%no_filters
287 safe_deallocate_a(filter%f)
288 filter%no_filters = 0
289 safe_deallocate_a(filter%expression)
290 safe_deallocate_a(filter%domain)
299 type(
filter_t),
intent(in) :: filter
double sqrt(double __x) __attribute__((__nothrow__
integer, parameter, public filter_time
integer function, public filter_number(filter)
subroutine, public filter_init(steps, namespace, dt, filter)
subroutine, public filter_apply(f, filter)
subroutine, public filter_write(filter, namespace)
subroutine, public filter_end(filter)
subroutine build_filter(filter)
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
complex(real64), parameter, public m_z0
complex(real64), parameter, public m_zi
complex(real64), parameter, public m_z1
real(real64), parameter, public m_one
character(len= *), parameter, public oct_dir
subroutine, public io_close(iunit, grp)
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
subroutine, public conv_to_c_string(str)
converts to c string
subroutine, public tdf_numerical_to_fourier(f)
integer pure function, public tdf_nfreqs(f)
integer pure function, public tdf_niter(f)
subroutine, public tdf_end(f)
subroutine, public tdf_fourier_grid(f, wgrid)
subroutine, public tdf_init_numerical(f, niter, dt, omegamax, initval, rep)
subroutine, public tdf_fourier_to_numerical(f)