V3FIT
util_bcherm1.f
1  subroutine util_bcherm1(fherm,idimx1,
2  > jbcxa,jbcxb,
3  > zbcxa,zbcxb,
4  > x1)
5 
6 C... insert BCs as needed for Hermite interpolation setup
7 
8  implicit NONE
9 
10  integer :: idimx1 ! array dimensions
11  real :: fherm(0:1,idimx1)
12 
13  integer :: jbcxa,jbcxb ! x BC controls
14  real :: zbcxa ! x(1) BC data
15  real :: zbcxb ! x(idimx1) BC data
16 
17  real :: x1(idimx1)
18 
19 C-------------------------------------------------------------
20  integer :: ix
21  real :: zdx
22 C-------------------------------------------------------------
23 
24  if((jbcxa.eq.1).or.(jbcxb.eq.1)) then
25 
26  if(jbcxa.eq.1) then
27  fherm(1,1)=zbcxa
28  else
29  zdx = x1(2)-x1(1)
30  fherm(1,1)=(fherm(0,2)-fherm(0,1))/zdx
31  endif
32 
33  if(jbcxb.eq.1) then
34  fherm(1,idimx1)=zbcxb
35  else
36  zdx = x1(idimx1)-x1(idimx1-1)
37  fherm(1,idimx1)=(fherm(0,idimx1)-fherm(0,idimx1-1))/zdx
38  endif
39 
40  endif
41 
42  end subroutine util_bcherm1