1 subroutine arclength(fr, mfm, theta, dtc, wr, ws)
17 integer(itm_i4),
intent(in) :: mfm
18 real(r8),
dimension(mfm + 2),
intent(in) :: fr
19 real(r8),
dimension(4),
intent(in) :: wr, ws
21 real(r8),
dimension(np),
intent(out) :: theta, dtc
23 integer(itm_i4),
parameter :: npts = 512
25 real(r8),
dimension(npts) :: xl, dxl
27 real(r8) :: dl, dr, tk, rr
29 integer(itm_i4) :: i, j, k, m
34 ti1 = (j - 1) / dble(npts - 1) * (ias + 1) * pi
35 ti2 = j / dble(npts - 1) * (ias + 1) * pi
39 tk = ti1 + (ti2 - ti1) * (wr(k) + 1._r8) / 2._r8
43 rr = rr + fr(2 * m - 1) * cos((m - 1) * tk) + fr(2 * m) &
45 dr = dr - (m - 1) * fr(2 * m - 1) * sin((m - 1) * tk) &
46 + (m - 1) * fr(2 * m) * cos((m - 1) * tk)
48 dl = dl + sqrt(rr * rr + dr * dr) * ws(k)
50 xl(j + 1) = xl(j) + dl * (ias + 1) / (2._r8 * pi * (npts - 1))
54 rr = rr + fr(2 * m - 1) * cos((m - 1) * ti2) + fr(2 * m) &
55 * sin((m - 1._r8) * ti2)
56 dr = dr - (m - 1) * fr(2 * m - 1) * sin((m - 1) * ti2) &
57 + (m - 1) * fr(2 * m) * cos((m - 1) * ti2)
59 dxl(j + 1) = sqrt(rr * rr + dr * dr)
66 rr = rr + fr(2 * m - 1) * cos((m - 1) * ti2) + fr(2 * m) &
68 dr = dr - (m - 1) * fr(2 * m- 1 ) * sin((m - 1) * ti2) &
69 + (m - 1) * fr(2 * m) * cos((m - 1) * ti2)
71 dxl(1) = sqrt(rr * rr + dr * dr)
74 theta(np) = (ias + 1) * pi
75 dtc(1) = 1._r8 / (dxl(1) * (ias + 1) * pi / xl(npts))
76 dtc(np) = 1._r8 / (dxl(npts) * (ias + 1) * pi / xl(npts))
79 chil = (j - 1) / dble(np - 1) * xl(npts)
80 do while ((chil > xl(i)) .and. (i < npts))
84 theta(j) = (dble(i - 1) + (chil - xl(i)) / (xl(i + 1) &
85 - xl(i))) / dble(npts - 1) * (ias + 1) * pi
86 dct = ((chil - xl(i)) / (xl(i + 1) - xl(i)) * (dxl(i + 1) &
87 - dxl(i)) + dxl(i)) * (ias + 1) * pi / xl(npts)
subroutine arclength(fr, mfm, theta, dtc, wr, ws)