3 #***********************************************************************
4 #* GNU Lesser General Public License
6 #* This file is part of the GFDL Flexible Modeling System (FMS).
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
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 # Copyright (c) 2019-2020 Ed Hartnett, Seth Underwood
24 # Set common test settings.
27 if [ -z "${skipflag}" ]; then
28 # create and enter directory for in/output files
31 cat <<_EOF > diag_table.yaml
33 base_date: 2 1 1 0 0 0
35 - file_name: test_none
42 output_name: var0_none
47 output_name: var1_none
52 output_name: var2_none
57 output_name: var3_none
62 output_name: var4_none
71 - file_name: test_none_regional
84 output_name: var3_none
91 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 0 \n/" |
cat > input.nml
92 test_expect_success
"Running diag_manager with "none
" reduction method (test $my_test_count)" '
93 mpirun -n 6 ../test_reduction_methods
95 test_expect_success
"Checking answers for the "none
" reduction method (test $my_test_count)" '
96 mpirun -n 1 ../check_time_none
99 my_test_count
=`expr $my_test_count + 1`
100 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n &test_reduction_methods_nml \n test_case = 0 \n mask_case = 1 \n \n/" |
cat > input.nml
101 test_expect_success
"Running diag_manager with "none
" reduction method, logical mask (test $my_test_count)" '
102 mpirun -n 6 ../test_reduction_methods
104 test_expect_success
"Checking answers for the "none
" reduction method, logical mask (test $my_test_count)" '
105 mpirun -n 1 ../check_time_none
108 my_test_count
=`expr $my_test_count + 1`
109 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n &test_reduction_methods_nml \n test_case = 0 \n mask_case = 2 \n \n/" |
cat > input.nml
110 test_expect_success
"Running diag_manager with "none
" reduction method, real mask (test $my_test_count)" '
111 mpirun -n 6 ../test_reduction_methods
113 test_expect_success
"Checking answers for the "none
" reduction method, real mask (test $my_test_count)" '
114 mpirun -n 1 ../check_time_none
117 export OMP_NUM_THREADS
=2
118 my_test_count
=`expr $my_test_count + 1`
119 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 1 \n \n/" |
cat > input.nml
120 test_expect_success
"Running diag_manager with "none
" reduction method with openmp (test $my_test_count)" '
121 mpirun -n 6 ../test_reduction_methods
123 test_expect_success
"Checking answers for the "none
" reduction method with openmp (test $my_test_count)" '
124 mpirun -n 1 ../check_time_none
127 my_test_count
=`expr $my_test_count + 1`
128 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 1 \n mask_case = 1 \n \n/" |
cat > input.nml
129 test_expect_success
"Running diag_manager with "none
" reduction method with openmp, logical mask (test $my_test_count)" '
130 mpirun -n 6 ../test_reduction_methods
132 test_expect_success
"Checking answers for the "none
" reduction method with openmp, logical mask (test $my_test_count)" '
133 mpirun -n 1 ../check_time_none
136 my_test_count
=`expr $my_test_count + 1`
137 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 1 \n mask_case = 2 \n \n/" |
cat > input.nml
138 test_expect_success
"Running diag_manager with "none
" reduction method with openmp, real mask (test $my_test_count)" '
139 mpirun -n 6 ../test_reduction_methods
141 test_expect_success
"Checking answers for the "none
" reduction method with openmp, real mask (test $my_test_count)" '
142 mpirun -n 1 ../check_time_none
144 export OMP_NUM_THREADS
=1
146 my_test_count
=`expr $my_test_count + 1`
147 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 2 \n \n/" |
cat > input.nml
148 test_expect_success
"Running diag_manager with "none
" reduction method with halo output (test $my_test_count)" '
149 mpirun -n 6 ../test_reduction_methods
151 test_expect_success
"Checking answers for the "none
" reduction method with halo output (test $my_test_count)" '
152 mpirun -n 1 ../check_time_none
155 my_test_count
=`expr $my_test_count + 1`
156 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 2 \n mask_case = 1 \n \n/" |
cat > input.nml
157 test_expect_success
"Running diag_manager with "none
" reduction method with halo output with logical mask (test $my_test_count)" '
158 mpirun -n 6 ../test_reduction_methods
160 test_expect_success
"Checking answers for the "none
" reduction method with halo output with logical mask (test $my_test_count)" '
161 mpirun -n 1 ../check_time_none
164 my_test_count
=`expr $my_test_count + 1`
165 printf "&diag_manager_nml \n use_modern_diag=.true. \n / \n&test_reduction_methods_nml \n test_case = 2 \n mask_case = 2 \n \n/" |
cat > input.nml
166 test_expect_success
"Running diag_manager with "none
" reduction method with halo output with real mask (test $my_test_count)" '
167 mpirun -n 6 ../test_reduction_methods
169 test_expect_success
"Checking answers for the "none
" reduction method with halo output with real mask (test $my_test_count)" '
170 mpirun -n 1 ../check_time_none
173 cat <<_EOF > diag_table.yaml
175 base_date: 2 1 1 0 0 0
177 - file_name: test_empty_file
183 my_test_count
=`expr $my_test_count + 1`
184 test_expect_success
"Testing diag manager that defined a diag file with no variables (test $my_test_count)" '
185 mpirun -n 6 ../test_reduction_methods
188 cat <<_EOF > diag_table.yaml
190 base_date: 2 1 1 0 0 0
192 - file_name: test_empty_file
196 - file_name: test_empty_file2
202 my_test_count
=`expr $my_test_count + 1`
203 test_expect_success
"Testing diag manager that defined 2 diag file with no variables (test $my_test_count)" '
204 mpirun -n 6 ../test_reduction_methods
206 cat <<_EOF > diag_table.yaml
208 base_date: 2 1 1 0 0 0
210 - file_name: test_unregistered_data
216 var_name: something_funny
221 my_test_count
=`expr $my_test_count + 1`
222 test_expect_success
"Testing diag manager where no variables were registered for a file (test $my_test_count)" '
223 mpirun -n 6 ../test_reduction_methods
226 cat <<_EOF > diag_table.yaml
228 base_date: 2 1 1 0 0 0
230 - file_name: test_send_data_never_called
241 my_test_count
=`expr $my_test_count + 1`
242 test_expect_success
"Testing diag manager where send data was never called for any fields in a file (test $my_test_count)" '
243 mpirun -n 6 ../test_reduction_methods