feat: mixed precision for axis_utils2, horiz_interp, sat_vapor_pressure, and fms_mod...
[FMS.git] / test_fms / horiz_interp / test_horiz_interp2.sh
blob485be882fd35444a6afcaa2db0cfd5509671c51c
1 #!/bin/sh
3 #***********************************************************************
4 #* GNU Lesser General Public License
5 #*
6 #* This file is part of the GFDL Flexible Modeling System (FMS).
7 #*
8 #* FMS is free software: you can redistribute it and/or modify it under
9 #* the terms of the GNU Lesser General Public License as published by
10 #* the Free Software Foundation, either version 3 of the License, or (at
11 #* your option) any later version.
13 #* FMS is distributed in the hope that it will be useful, but WITHOUT
14 #* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 #* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #* for more details.
18 #* You should have received a copy of the GNU Lesser General Public
19 #* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
20 #***********************************************************************
22 # This is part of the GFDL FMS package. This is a shell script to
23 # execute tests in the test_fms/horiz_interp directory.
25 # Ed Hartnett 11/29/19
26 # Ryan Mulhall 01/23
28 # Set common test settings.
29 . ../test-lib.sh
31 # Create file for test.
32 cat <<_EOF > input.nml
33 &test_horiz_interp_nml
34 test_conserve = .true.
35 ni_src = 360
36 nj_src = 180
37 ni_dst = 144
38 nj_dst = 72
40 _EOF
42 test_expect_success "conservative method with real kind=4" '
43 mpirun -n 2 ./test_horiz_interp_r8
46 test_expect_success "conservative method with real kind=8" '
47 mpirun -n 2 ./test_horiz_interp_r4
50 cat <<_EOF > input.nml
51 &test_horiz_interp_nml
52 test_conserve = .true.
53 test_solo = .true.
54 ni_src = 360
55 nj_src = 180
56 ni_dst = 144
57 nj_dst = 72
59 _EOF
61 test_expect_success "conservative method solo wrappers with real kind=4" '
62 mpirun -n 2 ./test_horiz_interp_r8
65 test_expect_success "conservative method solo wrappers with real kind=8" '
66 mpirun -n 2 ./test_horiz_interp_r4
69 cat <<_EOF > input.nml
70 &test_horiz_interp_nml
71 test_bicubic= .true.
72 ni_src = 360
73 nj_src = 180
74 ni_dst = 144
75 nj_dst = 72
77 _EOF
79 test_expect_success "bicubic method with real kind=4" '
80 mpirun -n 2 ./test_horiz_interp_r4
82 test_expect_success "bicubic method with real kind=8" '
83 mpirun -n 2 ./test_horiz_interp_r8
86 cat <<_EOF > input.nml
87 &test_horiz_interp_nml
88 test_bicubic= .true.
89 test_solo = .true.
90 ni_src = 360
91 nj_src = 180
92 ni_dst = 144
93 nj_dst = 72
95 _EOF
97 test_expect_success "bicubic method solo wrappers with real kind=4" '
98 mpirun -n 2 ./test_horiz_interp_r4
100 test_expect_success "bicubic method solo wrappers with real kind=8" '
101 mpirun -n 2 ./test_horiz_interp_r8
104 cat <<_EOF > input.nml
105 &test_horiz_interp_nml
106 test_bilinear= .true.
107 ni_src = 360
108 nj_src = 180
109 ni_dst = 144
110 nj_dst = 72
112 _EOF
114 test_expect_success "bilinear method with real kind=4" '
115 mpirun -n 2 ./test_horiz_interp_r4
117 test_expect_success "bilinear method with real kind=8" '
118 mpirun -n 2 ./test_horiz_interp_r8
121 cat <<_EOF > input.nml
122 &test_horiz_interp_nml
123 test_bilinear= .true.
124 test_solo = .true.
125 ni_src = 360
126 nj_src = 180
127 ni_dst = 144
128 nj_dst = 72
130 _EOF
132 test_expect_success "bilinear method solo wrapper with real kind=4" '
133 mpirun -n 2 ./test_horiz_interp_r4
135 test_expect_success "bilinear method solo wrapper with real kind=8" '
136 mpirun -n 2 ./test_horiz_interp_r8
139 # the spherical module has a namelist with an option for the search algorithm used
140 cat <<_EOF > input.nml
141 &test_horiz_interp_nml
142 test_spherical= .true.
143 ni_src = 360
144 nj_src = 180
145 ni_dst = 12
146 nj_dst = 6
149 &horiz_interp_sherical_nml
150 search_method = "radial search"
152 _EOF
154 test_expect_success "spherical method (radial search) with real kind=4" '
155 mpirun -n 2 ./test_horiz_interp_r4
157 test_expect_success "spherical method (radial search) with real kind=8" '
158 mpirun -n 2 ./test_horiz_interp_r8
161 cat <<_EOF > input.nml
162 &test_horiz_interp_nml
163 test_spherical= .true.
164 ni_src = 360
165 nj_src = 180
166 ni_dst = 12
167 nj_dst = 6
170 &horiz_interp_sherical_nml
171 search_method = "full search"
173 _EOF
175 test_expect_success "spherical method (full search) with real kind=4" '
176 mpirun -n 2 ./test_horiz_interp_r4
178 test_expect_success "spherical method (full search) with real kind=8" '
179 mpirun -n 2 ./test_horiz_interp_r8
182 cat <<_EOF > input.nml
183 &test_horiz_interp_nml
184 test_spherical= .true.
185 test_solo= .true.
186 ni_src = 360
187 nj_src = 180
188 ni_dst = 12
189 nj_dst = 6
191 _EOF
193 test_expect_success "spherical method solo wrappers with real kind=4" '
194 mpirun -n 2 ./test_horiz_interp_r4
196 test_expect_success "spherical method solo wrappers with real kind=8" '
197 mpirun -n 2 ./test_horiz_interp_r8
200 cat <<_EOF > input.nml
201 &test_horiz_interp_nml
202 test_assign= .true.
203 ni_src = 360
204 nj_src = 180
205 ni_dst = 12
206 nj_dst = 6
208 _EOF
210 test_expect_success "assignment overloads with real kind=4" '
211 mpirun -n 2 ./test_horiz_interp_r4
213 test_expect_success "assignment overloads with real kind=8" '
214 mpirun -n 2 ./test_horiz_interp_r8
217 test_done