8 implicit none ;
private
11 public p1m_interpolation, p1m_boundary_extrapolation
27 subroutine p1m_interpolation( N, h, u, ppoly_E, ppoly_coef, h_neglect )
28 integer,
intent(in) :: n
29 real,
dimension(:),
intent(in) :: h
30 real,
dimension(:),
intent(in) :: u
31 real,
dimension(:,:),
intent(inout) :: ppoly_e
33 real,
dimension(:,:),
intent(inout) :: ppoly_coef
36 real,
optional,
intent(in) :: h_neglect
43 call bound_edge_values( n, h, u, ppoly_e, h_neglect )
47 call average_discontinuous_edge_values( n, ppoly_e )
55 ppoly_coef(k,1) = u0_l
56 ppoly_coef(k,2) = u0_r - u0_l
60 end subroutine p1m_interpolation
69 subroutine p1m_boundary_extrapolation( N, h, u, ppoly_E, ppoly_coef )
71 integer,
intent(in) :: n
72 real,
dimension(:),
intent(in) :: h
73 real,
dimension(:),
intent(in) :: u
74 real,
dimension(:,:),
intent(inout) :: ppoly_e
76 real,
dimension(:,:),
intent(inout) :: ppoly_coef
95 slope = 2.0 * ( u1 - u0 )
102 u0_r = u0 + 0.5 * slope
104 if ( (u1 - u0) * (ppoly_e(2,1) - u0_r) < 0.0 )
then
105 slope = 2.0 * ( ppoly_e(2,1) - u0 )
110 if ( h0 /= 0.0 )
then
111 ppoly_e(1,1) = u0 - 0.5 * slope
116 ppoly_coef(1,1) = ppoly_e(1,1)
117 ppoly_coef(1,2) = ppoly_e(1,2) - ppoly_e(1,1)
128 slope = 2.0 * ( u1 - u0 )
130 u0_l = u1 - 0.5 * slope
132 if ( (u1 - u0) * (u0_l - ppoly_e(n-1,2)) < 0.0 )
then
133 slope = 2.0 * ( u1 - ppoly_e(n-1,2) )
136 if ( h1 /= 0.0 )
then
137 ppoly_e(n,2) = u1 + 0.5 * slope
142 ppoly_coef(n,1) = ppoly_e(n,1)
143 ppoly_coef(n,2) = ppoly_e(n,2) - ppoly_e(n,1)
145 end subroutine p1m_boundary_extrapolation