3 use fruit
, only : assert_equals, assert_not_equals, &
14 real(kind=DEFAULT_PRECISION) :: zvals(0), vals(2)
15 real(kind=DEFAULT_PRECISION) :: zgrid(2)
16 real(kind=DEFAULT_PRECISION) :: field(2)
19 vals(i)=10.0_default_precision
20 zgrid(i)=10.0_default_precision
21 field(i)=10.0_default_precision
26 call assert_equals(10.0_default_precision, field(i),
"Test no change in field")
33 real(kind=DEFAULT_PRECISION) :: zvals(2), vals(2)
34 real(kind=DEFAULT_PRECISION) :: zgrid(2)
35 real(kind=DEFAULT_PRECISION) :: field(2)
37 zgrid(1) = 10.0_default_precision
38 zgrid(2) = 9.0_default_precision
40 vals(i)=50.0_default_precision
41 zvals(i)=11.0_default_precision
43 zvals(1) = 10.0_default_precision
46 call assert_equals(50.0_default_precision, field(1),
"Test field(k) = vals(nn-1) when (zgrid(k)=zvals(nn-1)")
53 real(kind=DEFAULT_PRECISION) :: zvals(2), vals(2)
55 real(kind=DEFAULT_PRECISION) :: z,f1,f2
56 character(12) :: extrapolate
58 extrapolate =
'linear' 59 z = 0.0_default_precision
61 vals(i)=50.0_default_precision
62 zvals(i)=11.0_default_precision
64 zvals(1) = 10.0_default_precision
68 call assert_equals(f1, f2,
"Test linear is used by default")
74 real(kind=DEFAULT_PRECISION) :: zvals(2), vals(2)
76 real(kind=DEFAULT_PRECISION) :: z,f
77 character(12) :: extrapolate
79 extrapolate =
'linear' 80 z = 0.0_default_precision
81 f = 7.0_default_precision
83 vals(i)=50.0_default_precision
84 zvals(i)=11.0_default_precision
86 zvals(1) = 0.0_default_precision
90 call assert_equals(7.0_default_precision, f,
"Test linear is used by default")
100 use fruit
, only : init_fruit, run_test_case, fruit_summary
subroutine test_interpolate_linear
subroutine test_piecewise_zero_nnodes
subroutine interpolate_point_linear_1d(zvals, vals, z, f, extrapolate)
Does a simple 1d linear interpolation to a point.
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Contains common definitions for the data and datatypes used by MONC.
subroutine test_piecewise_zgrid_eq_zvals
subroutine piecewise_linear_1d(zvals, vals, zgrid, field)
Does a simple 1d piecewise linear interpolation.
real(kind=default_precision) function, public random(idum)
returns a scalar random number, the initial seed idum must be negative usage: idum = -k !(set idum < ...
program test_interpolation_driver
subroutine test_no_interpolation