Skip to content

Commit b2abaaf

Browse files
committed
Snapshot of scripts at time thesis is completed.
1 parent a22aa0e commit b2abaaf

15 files changed

+100
-38
lines changed

create_climos.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
CASE_NAMES="timestep_ctrl timestep_all_10s"
3+
CASE_NAMES="timestep_ctrl"
44
MONTHS="01 02"
55
INPUT_DIR=/p/lscratchh/santos36/timestep_monthly_avgs_lat_lon
66
OUTPUT_DIR=/p/lscratchh/santos36/timestep_monthly_avgs_lat_lon
@@ -10,7 +10,7 @@ for case_name in $CASE_NAMES; do
1010
for month in $MONTHS; do
1111
date
1212
echo "On month $month."
13-
ncra $INPUT_DIR/$case_name.00{02,03,04}-$month.nc $OUTPUT_DIR/${case_name}_${month}_climo.nc
13+
ncra $INPUT_DIR/$case_name.00{05,06,07}-$month.nc $OUTPUT_DIR/${case_name}_y04-y07_${month}_climo.nc
1414
done
1515
done
1616

@@ -21,20 +21,20 @@ for case_name in $CASE_NAMES; do
2121
for month in $MONTHS; do
2222
date
2323
echo "On month $month."
24-
ncra $INPUT_DIR/$case_name.00{01,02,03}-$month.nc $OUTPUT_DIR/${case_name}_${month}_climo.nc
24+
ncra $INPUT_DIR/$case_name.00{04,05,06}-$month.nc $OUTPUT_DIR/${case_name}_y04-y07_${month}_climo.nc
2525
done
2626
done
2727

2828
for case_name in $CASE_NAMES; do
2929
echo "On case $case_name"
3030
echo "Seasonal average DJF"
31-
ncra -w 31,31,28 $OUTPUT_DIR/${case_name}_{12,01,02}_climo.nc $OUTPUT_DIR/${case_name}_DJF_climo.nc
31+
ncra -w 31,31,28 $OUTPUT_DIR/${case_name}_y04-y07_{12,01,02}_climo.nc $OUTPUT_DIR/${case_name}_y04-y07_DJF_climo.nc
3232
echo "Seasonal average MAM"
33-
ncra -w 31,30,31 $OUTPUT_DIR/${case_name}_{03,04,05}_climo.nc $OUTPUT_DIR/${case_name}_MAM_climo.nc
33+
ncra -w 31,30,31 $OUTPUT_DIR/${case_name}_y04-y07_{03,04,05}_climo.nc $OUTPUT_DIR/${case_name}_y04-y07_MAM_climo.nc
3434
echo "Seasonal average JJA"
35-
ncra -w 30,31,31 $OUTPUT_DIR/${case_name}_{06,07,08}_climo.nc $OUTPUT_DIR/${case_name}_JJA_climo.nc
35+
ncra -w 30,31,31 $OUTPUT_DIR/${case_name}_y04-y07_{06,07,08}_climo.nc $OUTPUT_DIR/${case_name}_y04-y07_JJA_climo.nc
3636
echo "Seasonal average SON"
37-
ncra -w 30,31,30 $OUTPUT_DIR/${case_name}_{09,10,11}_climo.nc $OUTPUT_DIR/${case_name}_SON_climo.nc
37+
ncra -w 30,31,30 $OUTPUT_DIR/${case_name}_y04-y07_{09,10,11}_climo.nc $OUTPUT_DIR/${case_name}_y04-y07_SON_climo.nc
3838
echo "Annual average"
39-
ncra -w 31,28,31,30,31,30,31,31,30,31,30,31 $OUTPUT_DIR/${case_name}_{01,02,03,04,05,06,07,08,09,10,11,12}_climo.nc $OUTPUT_DIR/${case_name}_ANN_climo.nc
39+
ncra -w 31,28,31,30,31,30,31,31,30,31,30,31 $OUTPUT_DIR/${case_name}_y04-y07_{01,02,03,04,05,06,07,08,09,10,11,12}_climo.nc $OUTPUT_DIR/${case_name}_y04-y07_ANN_climo.nc
4040
done

create_daily_averages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
CASE_NAMES="timestep_all_10s timestep_CLUBB_10s timestep_CLUBB_MG2_10s timestep_MG2_10s timestep_dyn_10s timestep_CLUBB_MG2_60s"
3+
CASE_NAMES="timestep_CLUBB_MG2_Strang_60s"
44
DAYS="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"
55
OUTPUT_DIR=/p/lscratchh/santos36/timestep_daily_avgs
66

create_monthly_averages.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

3-
CASE_NAMES="timestep_all_10s"
4-
MONTHS="03 04 05 06 07 08 09 10 11 12"
3+
CASE_NAMES="timestep_ctrl"
4+
MONTHS="01"
55
OUTPUT_DIR=/p/lscratchh/santos36/timestep_monthly_avgs
66

77
for case_name in $CASE_NAMES; do
@@ -10,6 +10,6 @@ for case_name in $CASE_NAMES; do
1010
for month in $MONTHS; do
1111
date
1212
echo "On month $month."
13-
ncra $case_dir/$case_name.cam.h0.0002-$month-* $OUTPUT_DIR/$case_name.0002-$month.nc
13+
ncra $case_dir/$case_name.cam.h0.0007-$month-* $OUTPUT_DIR/$case_name.0007-$month.nc
1414
done
1515
done

create_precip_hourly.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
CASE_NAMES="timestep_all_10s"
3+
CASE_NAMES="timestep_ctrl"
44
MONTHS="03 04 05 06 07 08 09 10 11 12"
55
OUTPUT_DIR=/p/lscratchh/santos36/timestep_precip
66

plot_compare_2D_vars.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def inverse(a):
5555
E3SMCaseOutput("timestep_MG2_10s", "MICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
5656
E3SMCaseOutput("timestep_CLUBB_10s", "CLUBB10", DAILY_FILE_LOC, START_DAY, END_DAY),
5757
E3SMCaseOutput("timestep_CLUBB_10s_MG2_10s", "CLUBB10MICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
58+
E3SMCaseOutput("timestep_CLUBB_MG2_Strang", "CLUBBMICROSTR", DAILY_FILE_LOC, START_DAY, END_DAY),
59+
E3SMCaseOutput("timestep_CLUBB_MG2_Strang_60s", "CLUBBMICROSTR60", DAILY_FILE_LOC, START_DAY, END_DAY),
5860
E3SMCaseOutput("timestep_CLUBB_MG2_10s", "CLUBBMICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
5961
E3SMCaseOutput("timestep_CLUBB_MG2_60s", "CLUBBMICRO60", DAILY_FILE_LOC, START_DAY, END_DAY),
6062
E3SMCaseOutput("timestep_ZM_10s", "ZM10", DAILY_FILE_LOC, START_DAY, END_DAY),

plot_compare_2D_vars_monthly.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def inverse(a):
2222
a = np.arcsin(a)
2323
return np.rad2deg(a)
2424

25-
START_YEAR = 1
26-
START_MONTH = 3
25+
START_YEAR = 3
26+
START_MONTH = 12
2727
END_YEAR = 4
2828
END_MONTH = 2
2929

plot_compare_3D_zonal_avg_daily.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def inverse(a):
2323

2424
DAILY_FILE_LOC="/p/lscratchh/santos36/timestep_daily_avgs_lat_lon"
2525

26-
USE_PRESAER = True
26+
USE_PRESAER = False
2727

2828
days = list(range(START_DAY, END_DAY+1))
2929
ndays = len(days)
@@ -51,6 +51,8 @@ def inverse(a):
5151
E3SMCaseOutput("timestep_MG2_10s", "MICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
5252
E3SMCaseOutput("timestep_CLUBB_10s", "CLUBB10", DAILY_FILE_LOC, START_DAY, END_DAY),
5353
E3SMCaseOutput("timestep_CLUBB_10s_MG2_10s", "CLUBB10MICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
54+
E3SMCaseOutput("timestep_CLUBB_MG2_Strang", "CLUBBMICROSTR", DAILY_FILE_LOC, START_DAY, END_DAY),
55+
E3SMCaseOutput("timestep_CLUBB_MG2_Strang_60s", "CLUBBMICROSTR60", DAILY_FILE_LOC, START_DAY, END_DAY),
5456
E3SMCaseOutput("timestep_CLUBB_MG2_10s", "CLUBBMICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
5557
E3SMCaseOutput("timestep_CLUBB_MG2_60s", "CLUBBMICRO60", DAILY_FILE_LOC, START_DAY, END_DAY),
5658
E3SMCaseOutput("timestep_ZM_10s", "ZM10", DAILY_FILE_LOC, START_DAY, END_DAY),

plot_daily_means.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
E3SMCaseOutput("timestep_dyn_10s", "DYN10", DAILY_FILE_LOC, START_DAY, END_DAY),
6363
E3SMCaseOutput("timestep_CLUBB_10s", "CLUBB10", DAILY_FILE_LOC, START_DAY, END_DAY),
6464
E3SMCaseOutput("timestep_CLUBB_10s_MG2_10s", "CLUBB10MICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
65+
E3SMCaseOutput("timestep_CLUBB_MG2_Strang", "CLUBBMICROSTR", DAILY_FILE_LOC, START_DAY, END_DAY),
66+
E3SMCaseOutput("timestep_CLUBB_MG2_Strang_60s", "CLUBBMICROSTR60", DAILY_FILE_LOC, START_DAY, END_DAY),
6567
E3SMCaseOutput("timestep_MG2_10s", "MICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
6668
E3SMCaseOutput("timestep_CLUBB_MG2_60s", "CLUBBMICRO60", DAILY_FILE_LOC, START_DAY, END_DAY),
6769
E3SMCaseOutput("timestep_CLUBB_MG2_10s", "CLUBBMICRO10", DAILY_FILE_LOC, START_DAY, END_DAY),
@@ -77,6 +79,8 @@
7779
"CLUBB10": ('b', '-'),
7880
"MICRO10": ('r', '-'),
7981
"CLUBB10MICRO10": ('maroon', '-'),
82+
"CLUBBMICROSTR": ('m', '-'),
83+
"CLUBBMICROSTR60": ('m', '--'),
8084
"CLUBBMICRO60": ('indigo', '--'),
8185
"CLUBBMICRO10": ('indigo', '-'),
8286
"ALL10": ('dimgrey', '-'),

plot_precip_freq.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
ncol = len(first_file.dimensions['ncol'])
5353
nbins = len(first_file.dimensions['nbins'])
5454
bin_lower_bounds = first_file['bin_lower_bounds'][:]
55+
bin_width = np.log(bin_lower_bounds[2] / bin_lower_bounds[1])
5556
lat = first_file['lat'][:]
5657
lon = first_file['lon'][:]
5758
area = first_file['area'][:]
@@ -128,17 +129,17 @@
128129
plt.title("Frequency distribution of precipitation ({}/{}-{}/{})".format(
129130
day_str(START_MONTH), day_str(START_YEAR),
130131
day_str(END_MONTH), day_str(END_YEAR)))
131-
plt.xlabel("Precipitation amount (mm/day)")
132+
plt.xlabel("Precipitation intensity (mm/day)")
132133
plt.ylabel("fraction")
133134
plt.savefig("{}_freq{}.png".format(var, suffix))
134135
plt.close()
135136

136-
plt.semilogx(bin_lower_bounds[1:], ref_amount_avgs[var][1:], 'k')
137-
plt.semilogx(bin_lower_bounds[1:], test_amount_avgs[var][1:], 'r')
137+
plt.semilogx(bin_lower_bounds[1:], ref_amount_avgs[var][1:] / bin_width, 'k')
138+
plt.semilogx(bin_lower_bounds[1:], test_amount_avgs[var][1:] / bin_width, 'r')
138139
plt.title("Amounts of precipitation ({}/{}-{}/{})".format(
139140
day_str(START_MONTH), day_str(START_YEAR),
140141
day_str(END_MONTH), day_str(END_YEAR)))
141-
plt.xlabel("Precipitation amount (mm/day)")
142-
plt.ylabel("Average amount (mm/day)")
142+
plt.xlabel("Precipitation intensity (mm/day)")
143+
plt.ylabel("Average precipitation amount (mm/day)")
143144
plt.savefig("{}_amount{}.png".format(var, suffix))
144145
plt.close()

plot_precip_freq_daily.py

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,30 @@
1010

1111
from e3sm_case_output import day_str
1212

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"]
1613
OUTPUT_DIR = "/p/lustre2/santos36/timestep_precip/"
1714

1815
USE_PRESAER = False
19-
TROPICS_ONLY = True
16+
TROPICS_ONLY = False
2017

2118
START_DAY = 3
2219
END_DAY = 15
2320

2421
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+
]
2537
STYLES = {
2638
"CLUBBMICRO10PA": ('indigo', '-'),
2739
"ALL10PA": ('dimgrey', '-'),
@@ -30,11 +42,42 @@
3042
"CLD10PA": ('slateblue', '-'),
3143
}
3244
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+
]
3374
STYLES = {
3475
"DYN10": ('y', '-'),
3576
"CLUBB10": ('b', '-'),
3677
"MICRO10": ('r', '-'),
3778
"CLUBB10MICRO10": ('maroon', '-'),
79+
"CLUBBMICROSTR": ('m', '-'),
80+
"CLUBBMICROSTR60": ('m', '--'),
3881
"CLUBBMICRO60": ('indigo', '--'),
3982
"CLUBBMICRO10": ('indigo', '-'),
4083
"ALL10": ('dimgrey', '-'),
@@ -47,6 +90,8 @@
4790

4891
suffix = '_d{}-d{}'.format(day_str(START_DAY), day_str(END_DAY))
4992

93+
if USE_PRESAER:
94+
suffix += '_presaer'
5095
if TROPICS_ONLY:
5196
suffix += '_tropics'
5297

@@ -59,6 +104,7 @@
59104
ncol = len(first_file.dimensions['ncol'])
60105
nbins = len(first_file.dimensions['nbins'])
61106
bin_lower_bounds = first_file['bin_lower_bounds'][:]
107+
bin_width = np.log(bin_lower_bounds[2] / bin_lower_bounds[1])
62108
lat = first_file['lat'][:]
63109
lon = first_file['lon'][:]
64110
area = first_file['area'][:]
@@ -134,19 +180,19 @@
134180
linestyle=STYLES[SHORT_TEST_CASE_NAMES[i]][1])
135181
plt.title("Frequency distribution of precipitation (days {}-{})".format(
136182
day_str(START_DAY), day_str(END_DAY)))
137-
plt.xlabel("Precipitation amount (mm/day)")
183+
plt.xlabel("Precipitation intensity (mm/day)")
138184
plt.ylabel("fraction")
139185
plt.savefig("{}_freq{}.png".format(var, suffix))
140186
plt.close()
141187

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')
143189
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,
145191
color=STYLES[SHORT_TEST_CASE_NAMES[i]][0],
146192
linestyle=STYLES[SHORT_TEST_CASE_NAMES[i]][1])
147193
plt.title("Amounts of precipitation (days {}-{})".format(
148194
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)")
151197
plt.savefig("{}_amount{}.png".format(var, suffix))
152198
plt.close()

0 commit comments

Comments
 (0)