fix: improve modern diag manager performance (#1634)
[FMS.git] / test_fms / diag_manager / test_prepend_date.sh
blob13bbf7c77a1fd2db40e249535b91827d10da2f17
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 # Set common test settings.
23 . ../test-lib.sh
25 if [ -z "${skipflag}" ]; then
26 # create and enter directory for in/output files
27 output_dir
29 cat <<_EOF > diag_table.yaml
30 title: test_prepend_date
31 base_date: 1 1 1 0 0 0
32 diag_files:
33 - file_name: test_non_static
34 time_units: hours
35 unlimdim: time
36 freq: 1 hours
37 varlist:
38 - module: ocn_mod
39 var_name: var0
40 reduction: average
41 kind: r4
42 - file_name: test_static
43 time_units: hours
44 unlimdim: time
45 freq: -1 hours
46 varlist:
47 - module: ocn_mod
48 var_name: var2
49 reduction: none
50 kind: r4
51 _EOF
53 # remove any existing files that would result in false passes during checks
54 rm -f *.nc
55 my_test_count=1
56 printf "&diag_manager_nml \n use_modern_diag=.true. \n/" | cat > input.nml
57 test_expect_success "Running diag_manager and checking that the date was prepended correctly (test $my_test_count)" '
58 mpirun -n 1 ../test_prepend_date
61 cat <<_EOF > diag_table.yaml
62 title: test_prepend_date
63 base_date: 1 1 1 0 0 0
64 diag_files:
65 - file_name: test_non_static
66 time_units: hours
67 unlimdim: time
68 freq: 1 hours
69 varlist:
70 - module: ocn_mod
71 var_name: var0
72 reduction: average
73 kind: r4
74 - module: ocn_mod
75 var_name: var1
76 reduction: average
77 kind: r4
78 _EOF
80 printf "&diag_manager_nml \n use_modern_diag=.true. \n/ \n &test_prepend_date_nml \n pass_diag_time=.false. \n /" | cat > input.nml
82 test_expect_failure "Running diag_manager with fields that have a different start time (test $my_test_count)" '
83 mpirun -n 1 ../test_prepend_date
87 test_done