|
3 | 3 | Due to the large amount of data required to run, this test will be run manually |
4 | 4 | on Anvil (rather than as part of the CI tests). |
5 | 5 |
|
| 6 | +This test should be run with the latest E3SM Diags tutorial code. |
| 7 | +
|
6 | 8 | Run the following first: |
7 | 9 | - srun --pty --nodes=1 --time=01:00:00 /bin/bash |
8 | 10 | - source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh |
9 | 11 | - Or: source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_anvil.sh |
10 | 12 | """ |
11 | 13 | import os |
12 | 14 |
|
13 | | -# This test should be run with the latest E3SM Diags tutorial code. |
14 | | -from examples.run_v2_6_0_all_sets_E3SM_machines import run_lcrc |
| 15 | +from e3sm_diags.parameter.annual_cycle_zonal_mean_parameter import ACzonalmeanParameter |
| 16 | +from e3sm_diags.parameter.area_mean_time_series_parameter import ( |
| 17 | + AreaMeanTimeSeriesParameter, |
| 18 | +) |
| 19 | +from e3sm_diags.parameter.arm_diags_parameter import ARMDiagsParameter |
| 20 | +from e3sm_diags.parameter.core_parameter import CoreParameter |
| 21 | +from e3sm_diags.parameter.diurnal_cycle_parameter import DiurnalCycleParameter |
| 22 | +from e3sm_diags.parameter.enso_diags_parameter import EnsoDiagsParameter |
| 23 | +from e3sm_diags.parameter.qbo_parameter import QboParameter |
| 24 | +from e3sm_diags.parameter.streamflow_parameter import StreamflowParameter |
| 25 | +from e3sm_diags.parameter.tc_analysis_parameter import TCAnalysisParameter |
| 26 | +from e3sm_diags.parameter.zonal_mean_2d_stratosphere_parameter import ( |
| 27 | + ZonalMean2dStratosphereParameter, |
| 28 | +) |
| 29 | +from e3sm_diags.run import runner |
15 | 30 | from tests.integration.utils import _compare_images |
16 | 31 |
|
17 | 32 |
|
@@ -39,3 +54,154 @@ def test_complete_run(self): |
39 | 54 | ) |
40 | 55 |
|
41 | 56 | assert len(mismatched_images) == 0 |
| 57 | + |
| 58 | + |
| 59 | +def run_lcrc(html_prefix): |
| 60 | + # Run the following first: |
| 61 | + # srun --pty --nodes=1 --time=01:00:00 /bin/bash |
| 62 | + # source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh |
| 63 | + # Or: source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_anvil.sh |
| 64 | + |
| 65 | + ref_data_prefix = "/lcrc/group/e3sm/public_html/diagnostics/observations/Atm" |
| 66 | + test_data_prefix = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis" |
| 67 | + # use highrequency grid box output at ARM sites from another simulation when the output is available |
| 68 | + test_data_prefix2 = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/postprocessed_e3sm_v2_data_for_e3sm_diags/20210719.PhaseII.F20TR-P3.NGD.ne30pg2.compy" |
| 69 | + |
| 70 | + d = dict() |
| 71 | + |
| 72 | + d["obs_climo"] = os.path.join(ref_data_prefix, "climatology/") |
| 73 | + d["test_climo"] = os.path.join(test_data_prefix, "climatology/rgr/") |
| 74 | + |
| 75 | + d["obs_ts"] = os.path.join(ref_data_prefix, "time-series/") |
| 76 | + d["test_ts"] = os.path.join(test_data_prefix, "time-series/rgr/") |
| 77 | + |
| 78 | + d["dc_obs_climo"] = os.path.join(ref_data_prefix, "climatology/") |
| 79 | + d["dc_test_climo"] = os.path.join(test_data_prefix, "diurnal_climatology/rgr") |
| 80 | + |
| 81 | + d["arm_obs"] = os.path.join(ref_data_prefix, "arm-diags-data/") |
| 82 | + d["arm_test"] = os.path.join(test_data_prefix2, "arm-diags-data/") |
| 83 | + |
| 84 | + d["tc_obs"] = os.path.join(ref_data_prefix, "tc-analysis/") |
| 85 | + d["tc_test"] = os.path.join(test_data_prefix, "tc-analysis/") |
| 86 | + |
| 87 | + return run_all_sets(html_prefix, d) |
| 88 | + |
| 89 | + |
| 90 | +def run_all_sets(html_prefix, d): |
| 91 | + param = CoreParameter() |
| 92 | + |
| 93 | + param.reference_data_path = d["obs_climo"] |
| 94 | + param.test_data_path = d["test_climo"] |
| 95 | + param.test_name = "20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis" |
| 96 | + param.seasons = [ |
| 97 | + "ANN", |
| 98 | + "JJA", |
| 99 | + ] # Default setting: seasons = ["ANN", "DJF", "MAM", "JJA", "SON"] |
| 100 | + |
| 101 | + param.results_dir = os.path.join(html_prefix, "v2_6_0_all_sets") |
| 102 | + param.multiprocessing = True |
| 103 | + param.num_workers = 5 |
| 104 | + |
| 105 | + # Set specific parameters for new sets |
| 106 | + enso_param = EnsoDiagsParameter() |
| 107 | + enso_param.reference_data_path = d["obs_ts"] |
| 108 | + enso_param.test_data_path = d["test_ts"] |
| 109 | + enso_param.test_name = "e3sm_v2" |
| 110 | + enso_param.test_start_yr = "0051" |
| 111 | + enso_param.test_end_yr = "0060" |
| 112 | + # Enso obs data range from year 1979 to 2016 |
| 113 | + enso_param.ref_start_yr = "2001" |
| 114 | + enso_param.ref_end_yr = "2010" |
| 115 | + |
| 116 | + qbo_param = QboParameter() |
| 117 | + qbo_param.reference_data_path = d["obs_ts"] |
| 118 | + qbo_param.test_data_path = d["test_ts"] |
| 119 | + qbo_param.test_name = "e3sm_v2" |
| 120 | + qbo_param.start_yr = "0051" |
| 121 | + qbo_param.end_yr = "0060" |
| 122 | + # Qbo obs data range from year 1979 to 2019 |
| 123 | + # Number of years of test and ref should match |
| 124 | + qbo_param.ref_start_yr = "2001" |
| 125 | + qbo_param.ref_end_yr = "2010" |
| 126 | + |
| 127 | + ts_param = AreaMeanTimeSeriesParameter() |
| 128 | + ts_param.reference_data_path = d["obs_ts"] |
| 129 | + ts_param.test_data_path = d["test_ts"] |
| 130 | + ts_param.test_name = "e3sm_v2" |
| 131 | + ts_param.start_yr = "0051" |
| 132 | + ts_param.end_yr = "0060" |
| 133 | + |
| 134 | + dc_param = DiurnalCycleParameter() |
| 135 | + dc_param.reference_data_path = d["dc_obs_climo"] |
| 136 | + dc_param.test_data_path = d["dc_test_climo"] |
| 137 | + dc_param.short_test_name = "e3sm_v2" |
| 138 | + # Plotting diurnal cycle amplitude on different scales. Default is True |
| 139 | + dc_param.normalize_test_amp = False |
| 140 | + |
| 141 | + streamflow_param = StreamflowParameter() |
| 142 | + streamflow_param.reference_data_path = d["obs_ts"] |
| 143 | + streamflow_param.test_data_path = d["test_ts"] |
| 144 | + streamflow_param.short_test_name = "e3sm_v2" |
| 145 | + streamflow_param.test_start_yr = "0051" |
| 146 | + streamflow_param.test_end_yr = "0060" |
| 147 | + # Streamflow gauge station data range from year 1986 to 1995 |
| 148 | + streamflow_param.ref_start_yr = "1986" |
| 149 | + streamflow_param.ref_end_yr = "1995" |
| 150 | + |
| 151 | + arm_param = ARMDiagsParameter() |
| 152 | + arm_param.reference_data_path = d["arm_obs"] |
| 153 | + arm_param.ref_name = "armdiags" |
| 154 | + arm_param.test_data_path = d["arm_test"] |
| 155 | + arm_param.test_name = "e3sm_v2" |
| 156 | + arm_param.test_start_yr = "1996" |
| 157 | + arm_param.test_end_yr = "2010" |
| 158 | + # For model vs obs, the ref start and end year can be any four digit strings for now, will use all available years form obs |
| 159 | + arm_param.ref_start_yr = "0001" |
| 160 | + arm_param.ref_end_yr = "0001" |
| 161 | + |
| 162 | + tc_param = TCAnalysisParameter() |
| 163 | + tc_param.reference_data_path = d["tc_obs"] |
| 164 | + tc_param.test_data_path = d["tc_test"] |
| 165 | + tc_param.short_test_name = "e3sm_v2" |
| 166 | + tc_param.test_start_yr = "0051" |
| 167 | + tc_param.test_end_yr = "0060" |
| 168 | + # For model vs obs, the ref start and end year can be any four digit strings for now, use all available years form obs by default |
| 169 | + tc_param.ref_start_yr = "1979" |
| 170 | + tc_param.ref_end_yr = "2018" |
| 171 | + |
| 172 | + ac_param = ACzonalmeanParameter() |
| 173 | + zm_param = ZonalMean2dStratosphereParameter() |
| 174 | + |
| 175 | + runner.sets_to_run = [ |
| 176 | + "lat_lon", |
| 177 | + "zonal_mean_xy", |
| 178 | + "zonal_mean_2d", |
| 179 | + "zonal_mean_2d_stratosphere", |
| 180 | + "polar", |
| 181 | + "cosp_histogram", |
| 182 | + "meridional_mean_2d", |
| 183 | + "annual_cycle_zonal_mean", |
| 184 | + "enso_diags", |
| 185 | + "qbo", |
| 186 | + "area_mean_time_series", |
| 187 | + "diurnal_cycle", |
| 188 | + "streamflow", |
| 189 | + "arm_diags", |
| 190 | + "tc_analysis", |
| 191 | + ] |
| 192 | + runner.run_diags( |
| 193 | + [ |
| 194 | + param, |
| 195 | + zm_param, |
| 196 | + ac_param, |
| 197 | + enso_param, |
| 198 | + qbo_param, |
| 199 | + ts_param, |
| 200 | + dc_param, |
| 201 | + streamflow_param, |
| 202 | + arm_param, |
| 203 | + tc_param, |
| 204 | + ] |
| 205 | + ) |
| 206 | + |
| 207 | + return param.results_dir |
0 commit comments