Skip to content

Commit 7b5a283

Browse files
authored
Use historical aerosol data for 1849 and 2023 (#119)
This closes issue #116 again.
1 parent a25fb2c commit 7b5a283

File tree

7 files changed

+25
-33
lines changed

7 files changed

+25
-33
lines changed

CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_Bio_interpolate.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
load_cmip7_aerosol_biomass_list,
99
save_cmip7_aerosol_biomass,
1010
)
11-
from aerosol.cmip7_HI_aerosol import esm_hi_aerosol_save_dirpath
11+
from aerosol.cmip7_HI_aerosol import (
12+
CMIP7_HI_AEROSOL_BEG_YEAR,
13+
CMIP7_HI_AEROSOL_END_YEAR,
14+
esm_hi_aerosol_save_dirpath,
15+
)
1216
from cmip7_ancil_argparse import (
1317
common_parser,
1418
percent_parser,
1519
)
1620
from cmip7_ancil_common import cmip7_date_constraint_from_years
17-
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR
1821

1922

2023
def parse_args():
@@ -39,8 +42,8 @@ def load_cmip7_hi_aerosol_biomass(args, species):
3942
species,
4043
args.dataset_date_range_list,
4144
cmip7_date_constraint_from_years(
42-
CMIP7_HI_BEG_YEAR,
43-
CMIP7_HI_END_YEAR,
45+
CMIP7_HI_AEROSOL_BEG_YEAR,
46+
CMIP7_HI_AEROSOL_END_YEAR,
4447
),
4548
)
4649

@@ -51,8 +54,8 @@ def load_cmip7_hi_aerosol_biomass_percentage(args, species):
5154
species,
5255
args.percent_date_range,
5356
cmip7_date_constraint_from_years(
54-
CMIP7_HI_BEG_YEAR,
55-
CMIP7_HI_END_YEAR,
57+
CMIP7_HI_AEROSOL_BEG_YEAR,
58+
CMIP7_HI_AEROSOL_END_YEAR,
5659
),
5760
)
5861

CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_SO2_interpolate.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from ast import literal_eval
55

66
from aerosol.cmip7_HI_aerosol import (
7+
CMIP7_HI_AEROSOL_BEG_YEAR,
8+
CMIP7_HI_AEROSOL_END_YEAR,
79
esm_hi_aerosol_ancil_dirpath,
810
esm_hi_aerosol_save_dirpath,
911
)
@@ -16,11 +18,7 @@
1618
common_parser,
1719
dms_filename_parser,
1820
)
19-
from cmip7_HI import (
20-
CMIP7_HI_BEG_YEAR,
21-
CMIP7_HI_END_YEAR,
22-
fix_esm15_hi_ancil_date,
23-
)
21+
from cmip7_HI import fix_esm15_hi_ancil_date
2422

2523

2624
def parse_args():
@@ -43,8 +41,8 @@ def load_cmip7_hi_so2_aerosol_anthro(args, species):
4341
return load_cmip7_hi_aerosol_anthro(
4442
args,
4543
species,
46-
beg_year=CMIP7_HI_BEG_YEAR,
47-
end_year=CMIP7_HI_END_YEAR,
44+
beg_year=CMIP7_HI_AEROSOL_BEG_YEAR,
45+
end_year=CMIP7_HI_AEROSOL_END_YEAR,
4846
)
4947

5048

CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_aerosol.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from pathlib import Path
22

33
from cmip7_ancil_constants import ANCIL_TODAY
4+
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR
5+
6+
CMIP7_HI_AEROSOL_BEG_YEAR = CMIP7_HI_BEG_YEAR - 1
7+
CMIP7_HI_AEROSOL_END_YEAR = CMIP7_HI_END_YEAR + 1
48

59

610
def esm_hi_aerosol_ancil_dirpath(ancil_root_dirname):

CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_aerosol_anthro.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
cmip7_aerosol_anthro_interpolate,
66
load_cmip7_aerosol_anthro_list,
77
)
8-
from aerosol.cmip7_HI_aerosol import esm_hi_aerosol_save_dirpath
8+
from aerosol.cmip7_HI_aerosol import (
9+
CMIP7_HI_AEROSOL_BEG_YEAR,
10+
CMIP7_HI_AEROSOL_END_YEAR,
11+
esm_hi_aerosol_save_dirpath,
12+
)
913
from cmip7_ancil_argparse import common_parser
1014
from cmip7_ancil_common import cmip7_date_constraint_from_years
11-
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR
1215

1316

1417
def parse_args(species):
@@ -27,8 +30,8 @@ def parse_args(species):
2730
def load_cmip7_hi_aerosol_anthro(
2831
args,
2932
species,
30-
beg_year=CMIP7_HI_BEG_YEAR,
31-
end_year=CMIP7_HI_END_YEAR,
33+
beg_year=CMIP7_HI_AEROSOL_BEG_YEAR,
34+
end_year=CMIP7_HI_AEROSOL_END_YEAR,
3235
):
3336
return load_cmip7_aerosol_anthro_list(
3437
args,

CMIP7/esm1p6/atmosphere/aerosol/cmip7_SO2_interpolate.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from cmip7_ancil_common import (
1313
INTERPOLATION_SCHEME,
1414
esm_grid_mask_cube,
15-
extend_years,
1615
save_ancil,
1716
)
1817

@@ -99,11 +98,6 @@ def save_cmip7_so2_aerosol_anthro(
9998
# because high doesn't have it
10099
so2_low.remove_coord("sector")
101100

102-
# Extend the historical time series, if any,
103-
# by duplicating the first and last years
104-
so2_low = extend_years(so2_low)
105-
so2_high = extend_years(so2_high)
106-
107101
# Use the CMIP6 DMS
108102
cmip6_dms = dms_load_fn(args)
109103

CMIP7/esm1p6/atmosphere/aerosol/cmip7_aerosol_anthro.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from cmip7_ancil_common import (
1010
INTERPOLATION_SCHEME,
1111
esm_grid_mask_cube,
12-
extend_years,
1312
fix_coords,
1413
save_ancil,
1514
)
@@ -75,7 +74,4 @@ def cmip7_aerosol_anthro_interpolate(
7574
esm_cube.attributes["STASH"] = iris.fileformats.pp.STASH(
7675
model=1, section=0, item=stash_item
7776
)
78-
# Extend the historical time series, if any,
79-
# by duplicating the first and last years
80-
esm_cube = extend_years(esm_cube)
8177
save_ancil(esm_cube, save_dirpath, args.save_filename)

CMIP7/esm1p6/atmosphere/aerosol/cmip7_aerosol_biomass.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from cmip7_ancil_common import (
1212
INTERPOLATION_SCHEME,
1313
esm_grid_mask_cube,
14-
extend_years,
1514
save_ancil,
1615
set_coord_system,
1716
)
@@ -141,11 +140,6 @@ def save_cmip7_aerosol_biomass(args, load_pc_fn, load_fn, save_dirpath):
141140
model=1, section=0, item=131
142141
)
143142

144-
# Extend the historical time series, if any,
145-
# by duplicating the first and last years
146-
low_esm = extend_years(low_esm)
147-
high_esm = extend_years(high_esm)
148-
149143
save_ancil([low_esm, high_esm], save_dirpath, args.save_filename)
150144

151145
now = datetime.now()

0 commit comments

Comments
 (0)