ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
suydam_kgs.f90
Go to the documentation of this file.
1 subroutine suydam_kgs(t, t0, cp, cq, ipsi)
2 !-----------------------------------------------------------------------
3 ! subroutine to evaluate the p and q coefficient, used in the suydam
4 ! routine.
5 ! note : the routine asumes that only values on grid points are
6 ! requested. no interpolation is done!
7 !-----------------------------------------------------------------------
8 
9  use itm_types
10  use mod_parameter
11  use mod_suydam
12 
13  implicit none
14 
15  integer(itm_i4), intent(in) :: ipsi
16  real(r8), intent(in) :: t, t0
17  real(r8), intent(out) :: cp, cq
18 
19  integer(itm_i4) :: jm, ijm
20  real(r8) :: dt, tm, frac
21  real(r8) :: cp0d, cp1d, cp2d, cq0d, cq1d
22 
23  dt = twopi / real(ncpq - 1)
24  tm = mod(mod(t, twopi) + twopi, twopi)
25 
26 !------ ncpq = 2 * nchi - 1 (ias=0) or ncpq = nchi + 1 (ias = 1)
27  jm = int((ncpq - 1) * tm / twopi) + 1
28  ijm = (ipsi - 1) * ncpq + jm
29  frac = (tm - (jm - 1) * dt) / dt
30 
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
36 
37  cp = cp0d + cp1d * (t - t0) + cp2d * (t - t0)**2
38  cq = cq0d + cq1d * (t - t0)
39 
40  return
41 
42 end subroutine suydam_kgs
subroutine suydam_kgs(t, t0, cp, cq, ipsi)
Definition: suydam_kgs.f90:1