16 integer(kind=kint),
intent(in) :: amp_id
17 real(kind=
kreal),
intent(in) :: time
18 real(kind=
kreal),
intent(inout) ::
value
20 integer(kind=kint) :: i, jj1, jj2, s1, s2
21 real(kind=
kreal) :: t_1, t_2
22 real(kind=
kreal) :: f_t, f_1, f_2
24 if( amp_id <= 0 .or. amp_id > amp%n_amp )
return
26 jj1 = amp%amp_index(amp_id-1)+1
27 jj2 = amp%amp_index(amp_id)
29 if(time >= amp%amp_table(jj2))
then
30 f_t = amp%amp_val(jj2)
31 else if(time <= amp%amp_table(jj1))
then
32 f_t = amp%amp_val(jj1)
35 if(time <= amp%amp_table(i))
then
42 t_2 = amp%amp_table(s2)
43 t_1 = amp%amp_table(s1)
46 if( t_2-t_1 <= 1.0d-20)
then
49 f_t = ((t_2*f_1 - t_1*f_2) + (f_2 - f_1)*time) / (t_2 - t_1)
subroutine hecmw_get_amplitude_value(amp, amp_id, time, value)
integer(kind=4), parameter kreal
integer(kind=kint), parameter hecmw_amp_typeval_relative