MONC
Functions/Subroutines
test_interpolation_mod Module Reference

Functions/Subroutines

subroutine test_piecewise_zero_nnodes
 
subroutine test_piecewise_zgrid_eq_zvals
 
subroutine test_interpolate_linear
 
subroutine test_no_interpolation
 

Function/Subroutine Documentation

◆ test_interpolate_linear()

subroutine test_interpolation_mod::test_interpolate_linear

Definition at line 51 of file test_interpolation.F90.

52 
53  real(kind=default_precision) :: zvals(2), vals(2)
54  integer :: i
55  real(kind=default_precision) :: z,f1,f2
56  character(12) :: extrapolate
57 
58  extrapolate = 'linear'
59  z = 0.0_default_precision
60  do i=1,2
61  vals(i)=50.0_default_precision
62  zvals(i)=11.0_default_precision
63  enddo
64  zvals(1) = 10.0_default_precision
65  call interpolate_point_linear_1d(zvals, vals, z, f1)
66  call interpolate_point_linear_1d(zvals, vals, z, f2, extrapolate)
67 
68  call assert_equals(f1, f2, "Test linear is used by default")
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_no_interpolation()

subroutine test_interpolation_mod::test_no_interpolation

Definition at line 72 of file test_interpolation.F90.

73 
74  real(kind=default_precision) :: zvals(2), vals(2)
75  integer :: i
76  real(kind=default_precision) :: z,f
77  character(12) :: extrapolate
78 
79  extrapolate = 'linear'
80  z = 0.0_default_precision
81  f = 7.0_default_precision
82  do i=1,2
83  vals(i)=50.0_default_precision
84  zvals(i)=11.0_default_precision
85  enddo
86  zvals(1) = 0.0_default_precision
87  call interpolate_point_linear_1d(zvals, vals, z, f)
88 
89 
90  call assert_equals(7.0_default_precision, f, "Test linear is used by default")
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_piecewise_zero_nnodes()

subroutine test_interpolation_mod::test_piecewise_zero_nnodes

Definition at line 12 of file test_interpolation.F90.

13 
14  real(kind=default_precision) :: zvals(0), vals(2)
15  real(kind=default_precision) :: zgrid(2)
16  real(kind=default_precision) :: field(2)
17  integer :: i
18  do i=1,2
19  vals(i)=10.0_default_precision
20  zgrid(i)=10.0_default_precision
21  field(i)=10.0_default_precision
22  enddo
23  call piecewise_linear_1d(zvals, vals, zgrid, field)
24 
25  do i=1,2
26  call assert_equals(10.0_default_precision, field(i), "Test no change in field")
27  enddo
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_piecewise_zgrid_eq_zvals()

subroutine test_interpolation_mod::test_piecewise_zgrid_eq_zvals

Definition at line 31 of file test_interpolation.F90.

32 
33  real(kind=default_precision) :: zvals(2), vals(2)
34  real(kind=default_precision) :: zgrid(2)
35  real(kind=default_precision) :: field(2)
36  integer :: i
37  zgrid(1) = 10.0_default_precision
38  zgrid(2) = 9.0_default_precision
39  do i=1,2
40  vals(i)=50.0_default_precision
41  zvals(i)=11.0_default_precision
42  enddo
43  zvals(1) = 10.0_default_precision
44  call piecewise_linear_1d(zvals, vals, zgrid, field)
45 
46  call assert_equals(50.0_default_precision, field(1), "Test field(k) = vals(nn-1) when (zgrid(k)=zvals(nn-1)")
47 
Here is the call graph for this function:
Here is the caller graph for this function:
datadefn_mod::default_precision
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17