2 #***********************************************************************
3 #* GNU Lesser General Public License
5 #* This file is part of the GFDL Flexible Modeling System (FMS).
7 #* FMS is free software: you can redistribute it and/or modify it under
8 #* the terms of the GNU Lesser General Public License as published by
9 #* the Free Software Foundation, either version 3 of the License, or (at
10 #* your option) any later version.
12 #* FMS is distributed in the hope that it will be useful, but WITHOUT
13 #* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 #* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 #* You should have received a copy of the GNU Lesser General Public
18 #* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
19 #***********************************************************************
20 # This is part of the GFDL FMS package. This is a shell script to
21 # execute tests in the test_fms/coupler directory.
23 # Ed Hartnett 11/26/19
24 # Uriel Ramirez 07/22/20
26 # Set common test settings.
33 cat <<_EOF > diag_table
37 "coupler_types_bc2", 1, "days", 1, "days", "time"
38 "coupler_types_bc1", 1, "days", 1, "days", "time"
40 "test_coupler_types", "bc1_var2d_1", "bc1_variable_2d_1_min", "coupler_types_bc1", "all", "min", "none", 2
41 "test_coupler_types", "bc1_var2d_2", "bc1_variable_2d_2_max", "coupler_types_bc1", "all", "max", "none", 2
42 "test_coupler_types", "bc1_var3d_1", "bc1_variable_3d_1", "coupler_types_bc1", "all", "rms", "none", 2
43 "test_coupler_types", "bc1_var3d_2", "bc1_variable_3d_2", "coupler_types_bc1", "all", "avg", "none", 2
44 "test_coupler_types", "bc2_var2d_1", "bc2_variable_2d_1_min", "coupler_types_bc2", "all", "min", "none", 2
45 "test_coupler_types", "bc2_var2d_2", "bc2_variable_2d_2_max", "coupler_types_bc2", "all", "max", "none", 2
46 "test_coupler_types", "bc2_var3d_1", "bc2_variable_3d_1", "coupler_types_bc2", "all", "rms", "none", 2
47 "test_coupler_types", "bc2_var3d_2", "bc2_variable_3d_2", "coupler_types_bc2", "all", "avg", "none", 2
49 # we'll just make both in case compiled with yaml support
50 cat <<_EOF > diag_table.yaml
52 base_date: 1 1 1 0 0 0
54 - file_name: coupler_types_bc2
60 - module: test_coupler_types
62 output_name: bc1_variable_2d_1_min
64 - module: test_coupler_types
66 output_name: bc1_variable_2d_2_max
68 - module: test_coupler_types
70 output_name: bc1_variable_3d_1
72 - module: test_coupler_types
74 output_name: bc1_variable_3d_2
76 - file_name: coupler_types_bc1
82 - module: test_coupler_types
84 output_name: bc2_variable_2d_1_min
86 - module: test_coupler_types
88 output_name: bc2_variable_2d_2_max
90 - module: test_coupler_types
92 output_name: bc2_variable_3d_1
94 - module: test_coupler_types
96 output_name: bc2_variable_3d_2
100 cat <<_EOF > data_table
101 "ATM", "bc1_var2d_1", "bc1_variable_2d_1_min", "coupler_types_bc1.nc", .false., 300.0
108 test_expect_success
"coupler types interfaces (r4_kind)" '
109 mpirun -n 4 ./test_coupler_types_r4
112 test_expect_success
"coupler types interfaces (r8_kind)" '
113 mpirun -n 4 ./test_coupler_types_r8
116 # delete lines from the table to make sure we see the difference in the send_data return status
117 sed -i '8,12{d}' diag_table
118 sed -i '10,13{d}' diag_table.yaml
119 sed -i '18,25{d}' diag_table.yaml
120 cat <<_EOF > input.nml
121 &test_coupler_types_nml
122 fail_return_status=.true.
127 test_expect_success
"coupler types interfaces - check send_data return vals (r4_kind)" '
128 mpirun -n 4 ./test_coupler_types_r4
131 test_expect_success
"coupler types interfaces - check send_data return vals (r8_kind)" '
132 mpirun -n 4 ./test_coupler_types_r8
137 test_expect_success
"coupler register restart 2D(r4_kind)" '
138 mpirun -n 1 ./test_coupler_2d_r4
140 test_expect_success
"coupler register restart 2D(r8_kind)" '
141 mpirun -n 1 ./test_coupler_2d_r8
144 test_expect_success
"coupler register restart 3D (r4_kind)" '
145 mpirun -n 1 ./test_coupler_3d_r4
148 test_expect_success
"coupler register restart 3D (r8_kind)" '
149 mpirun -n 1 ./test_coupler_3d_r8
152 test_expect_success
"test atmos_ocean_fluxes (r4_kind)" '
153 mpirun -n 1 ./test_atmos_ocean_fluxes_r4
156 test_expect_success
"test atmos_ocean_fluxes (r8_kind)" '
157 mpirun -n 1 ./test_atmos_ocean_fluxes_r8