15 integer(itm_i4),
intent(in) :: ipsi
16 real(r8),
intent(in) :: t, t0
17 real(r8),
intent(out) :: cp, cq
19 integer(itm_i4) :: jm, ijm
20 real(r8) :: dt, tm, frac
21 real(r8) :: cp0d, cp1d, cp2d, cq0d, cq1d
23 dt = twopi /
real(ncpq - 1)
24 tm = mod(mod(t, twopi) + twopi, twopi)
27 jm = int((ncpq - 1) * tm / twopi) + 1
28 ijm = (ipsi - 1) * ncpq + jm
29 frac = (tm - (jm - 1) * dt) / dt
31 cp0d = cp0(ijm) + (cp0(ijm + 1) - cp0(ijm)) * frac
32 cp1d = cp1(ijm) + (cp1(ijm + 1) - cp1(ijm)) * frac
33 cp2d = cp2(ijm) + (cp2(ijm + 1) - cp2(ijm)) * frac
34 cq0d = cq0(ijm) + (cq0(ijm + 1) - cq0(ijm)) * frac
35 cq1d = cq1(ijm) + (cq1(ijm + 1) - cq1(ijm)) * frac
37 cp = cp0d + cp1d * (t - t0) + cp2d * (t - t0)**2
38 cq = cq0d + cq1d * (t - t0)
subroutine suydam_kgs(t, t0, cp, cq, ipsi)