|
10 | 10 |
|
11 | 11 | from e3sm_case_output import day_str |
12 | 12 |
|
13 | | -REF_CASE_NAME = "timestep_all_300s" |
14 | | -TEST_CASE_NAMES = ["timestep_CLUBB_MG2_10s", "timestep_all_60s"] |
15 | | -SHORT_TEST_CASE_NAMES = ["CLUBBMICRO10", "ALL60"] |
16 | 13 | OUTPUT_DIR = "/p/lustre2/santos36/timestep_precip/" |
17 | 14 |
|
18 | 15 | USE_PRESAER = False |
19 | | -TROPICS_ONLY = True |
| 16 | +TROPICS_ONLY = False |
20 | 17 |
|
21 | 18 | START_DAY = 3 |
22 | 19 | END_DAY = 15 |
23 | 20 |
|
24 | 21 | if USE_PRESAER: |
| 22 | + REF_CASE_NAME = "timestep_presaer_ctrl" |
| 23 | + TEST_CASE_NAMES = [ |
| 24 | + "timestep_presaer_ZM_10s", |
| 25 | + "timestep_presaer_CLUBB_MG2_10s", |
| 26 | + "timestep_presaer_CLUBB_MG2_10s_ZM_10s", |
| 27 | + "timestep_presaer_cld_10s", |
| 28 | + "timestep_presaer_all_10s", |
| 29 | + ] |
| 30 | + SHORT_TEST_CASE_NAMES = [ |
| 31 | + "ZM10PA", |
| 32 | + "CLUBBMICRO10PA", |
| 33 | + "CLUBBMICRO10ZM10PA", |
| 34 | + "CLD10PA", |
| 35 | + "ALL10PA", |
| 36 | + ] |
25 | 37 | STYLES = { |
26 | 38 | "CLUBBMICRO10PA": ('indigo', '-'), |
27 | 39 | "ALL10PA": ('dimgrey', '-'), |
|
30 | 42 | "CLD10PA": ('slateblue', '-'), |
31 | 43 | } |
32 | 44 | else: |
| 45 | + REF_CASE_NAME = "timestep_ctrl" |
| 46 | + TEST_CASE_NAMES = [ |
| 47 | + "timestep_dyn_10s", |
| 48 | + "timestep_CLUBB_10s", |
| 49 | + "timestep_MG2_10s", |
| 50 | + "timestep_CLUBB_10s_MG2_10s", |
| 51 | + "timestep_CLUBB_MG2_Strang", |
| 52 | + "timestep_CLUBB_MG2_Strang_60s", |
| 53 | + "timestep_CLUBB_MG2_60s", |
| 54 | + "timestep_CLUBB_MG2_10s", |
| 55 | + "timestep_all_10s", |
| 56 | + "timestep_all_60s", |
| 57 | + "timestep_all_300s", |
| 58 | + "timestep_all_rad_10s", |
| 59 | + ] |
| 60 | + SHORT_TEST_CASE_NAMES = [ |
| 61 | + "DYN10", |
| 62 | + "CLUBB10", |
| 63 | + "MICRO10", |
| 64 | + "CLUBB10MICRO10", |
| 65 | + "CLUBBMICROSTR", |
| 66 | + "CLUBBMICROSTR60", |
| 67 | + "CLUBBMICRO60", |
| 68 | + "CLUBBMICRO10", |
| 69 | + "ALL10", |
| 70 | + "ALL60", |
| 71 | + "ALL300", |
| 72 | + "ALLRAD10", |
| 73 | + ] |
33 | 74 | STYLES = { |
34 | 75 | "DYN10": ('y', '-'), |
35 | 76 | "CLUBB10": ('b', '-'), |
36 | 77 | "MICRO10": ('r', '-'), |
37 | 78 | "CLUBB10MICRO10": ('maroon', '-'), |
| 79 | + "CLUBBMICROSTR": ('m', '-'), |
| 80 | + "CLUBBMICROSTR60": ('m', '--'), |
38 | 81 | "CLUBBMICRO60": ('indigo', '--'), |
39 | 82 | "CLUBBMICRO10": ('indigo', '-'), |
40 | 83 | "ALL10": ('dimgrey', '-'), |
|
47 | 90 |
|
48 | 91 | suffix = '_d{}-d{}'.format(day_str(START_DAY), day_str(END_DAY)) |
49 | 92 |
|
| 93 | +if USE_PRESAER: |
| 94 | + suffix += '_presaer' |
50 | 95 | if TROPICS_ONLY: |
51 | 96 | suffix += '_tropics' |
52 | 97 |
|
|
59 | 104 | ncol = len(first_file.dimensions['ncol']) |
60 | 105 | nbins = len(first_file.dimensions['nbins']) |
61 | 106 | bin_lower_bounds = first_file['bin_lower_bounds'][:] |
| 107 | +bin_width = np.log(bin_lower_bounds[2] / bin_lower_bounds[1]) |
62 | 108 | lat = first_file['lat'][:] |
63 | 109 | lon = first_file['lon'][:] |
64 | 110 | area = first_file['area'][:] |
|
134 | 180 | linestyle=STYLES[SHORT_TEST_CASE_NAMES[i]][1]) |
135 | 181 | plt.title("Frequency distribution of precipitation (days {}-{})".format( |
136 | 182 | day_str(START_DAY), day_str(END_DAY))) |
137 | | - plt.xlabel("Precipitation amount (mm/day)") |
| 183 | + plt.xlabel("Precipitation intensity (mm/day)") |
138 | 184 | plt.ylabel("fraction") |
139 | 185 | plt.savefig("{}_freq{}.png".format(var, suffix)) |
140 | 186 | plt.close() |
141 | 187 |
|
142 | | - plt.semilogx(bin_lower_bounds[1:], ref_amount_avgs[var][1:], 'k') |
| 188 | + plt.semilogx(bin_lower_bounds[1:], ref_amount_avgs[var][1:] / bin_width, 'k') |
143 | 189 | for i in range(num_tests): |
144 | | - plt.semilogx(bin_lower_bounds[1:], test_amount_avgs[i][var][1:], |
| 190 | + plt.semilogx(bin_lower_bounds[1:], test_amount_avgs[i][var][1:] / bin_width, |
145 | 191 | color=STYLES[SHORT_TEST_CASE_NAMES[i]][0], |
146 | 192 | linestyle=STYLES[SHORT_TEST_CASE_NAMES[i]][1]) |
147 | 193 | plt.title("Amounts of precipitation (days {}-{})".format( |
148 | 194 | day_str(START_DAY), day_str(END_DAY))) |
149 | | - plt.xlabel("Precipitation amount (mm/day)") |
150 | | - plt.ylabel("Average amount (mm/day)") |
| 195 | + plt.xlabel("Precipitation intensity (mm/day)") |
| 196 | + plt.ylabel("Average precipitation amount (mm/day)") |
151 | 197 | plt.savefig("{}_amount{}.png".format(var, suffix)) |
152 | 198 | plt.close() |
0 commit comments