Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_Bio_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
load_cmip7_aerosol_biomass_list,
save_cmip7_aerosol_biomass,
)
from aerosol.cmip7_HI_aerosol import esm_hi_aerosol_save_dirpath
from aerosol.cmip7_HI_aerosol import (
CMIP7_HI_AEROSOL_BEG_YEAR,
CMIP7_HI_AEROSOL_END_YEAR,
esm_hi_aerosol_save_dirpath,
)
from cmip7_ancil_argparse import (
common_parser,
percent_parser,
)
from cmip7_ancil_common import cmip7_date_constraint_from_years
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR


def parse_args():
Expand All @@ -39,8 +42,8 @@ def load_cmip7_hi_aerosol_biomass(args, species):
species,
args.dataset_date_range_list,
cmip7_date_constraint_from_years(
CMIP7_HI_BEG_YEAR,
CMIP7_HI_END_YEAR,
CMIP7_HI_AEROSOL_BEG_YEAR,
CMIP7_HI_AEROSOL_END_YEAR,
),
)

Expand All @@ -51,8 +54,8 @@ def load_cmip7_hi_aerosol_biomass_percentage(args, species):
species,
args.percent_date_range,
cmip7_date_constraint_from_years(
CMIP7_HI_BEG_YEAR,
CMIP7_HI_END_YEAR,
CMIP7_HI_AEROSOL_BEG_YEAR,
CMIP7_HI_AEROSOL_END_YEAR,
),
)

Expand Down
12 changes: 5 additions & 7 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_SO2_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from ast import literal_eval

from aerosol.cmip7_HI_aerosol import (
CMIP7_HI_AEROSOL_BEG_YEAR,
CMIP7_HI_AEROSOL_END_YEAR,
esm_hi_aerosol_ancil_dirpath,
esm_hi_aerosol_save_dirpath,
)
Expand All @@ -16,11 +18,7 @@
common_parser,
dms_filename_parser,
)
from cmip7_HI import (
CMIP7_HI_BEG_YEAR,
CMIP7_HI_END_YEAR,
fix_esm15_hi_ancil_date,
)
from cmip7_HI import fix_esm15_hi_ancil_date


def parse_args():
Expand All @@ -43,8 +41,8 @@ def load_cmip7_hi_so2_aerosol_anthro(args, species):
return load_cmip7_hi_aerosol_anthro(
args,
species,
beg_year=CMIP7_HI_BEG_YEAR,
end_year=CMIP7_HI_END_YEAR,
beg_year=CMIP7_HI_AEROSOL_BEG_YEAR,
end_year=CMIP7_HI_AEROSOL_END_YEAR,
)


Expand Down
4 changes: 4 additions & 0 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_aerosol.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from pathlib import Path

from cmip7_ancil_constants import ANCIL_TODAY
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR

CMIP7_HI_AEROSOL_BEG_YEAR = CMIP7_HI_BEG_YEAR - 1
CMIP7_HI_AEROSOL_END_YEAR = CMIP7_HI_END_YEAR + 1


def esm_hi_aerosol_ancil_dirpath(ancil_root_dirname):
Expand Down
11 changes: 7 additions & 4 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_HI_aerosol_anthro.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
cmip7_aerosol_anthro_interpolate,
load_cmip7_aerosol_anthro_list,
)
from aerosol.cmip7_HI_aerosol import esm_hi_aerosol_save_dirpath
from aerosol.cmip7_HI_aerosol import (
CMIP7_HI_AEROSOL_BEG_YEAR,
CMIP7_HI_AEROSOL_END_YEAR,
esm_hi_aerosol_save_dirpath,
)
from cmip7_ancil_argparse import common_parser
from cmip7_ancil_common import cmip7_date_constraint_from_years
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR


def parse_args(species):
Expand All @@ -27,8 +30,8 @@ def parse_args(species):
def load_cmip7_hi_aerosol_anthro(
args,
species,
beg_year=CMIP7_HI_BEG_YEAR,
end_year=CMIP7_HI_END_YEAR,
beg_year=CMIP7_HI_AEROSOL_BEG_YEAR,
end_year=CMIP7_HI_AEROSOL_END_YEAR,
):
return load_cmip7_aerosol_anthro_list(
args,
Expand Down
6 changes: 0 additions & 6 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_SO2_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from cmip7_ancil_common import (
INTERPOLATION_SCHEME,
esm_grid_mask_cube,
extend_years,
save_ancil,
)

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

# Extend the historical time series, if any,
# by duplicating the first and last years
so2_low = extend_years(so2_low)
so2_high = extend_years(so2_high)

# Use the CMIP6 DMS
cmip6_dms = dms_load_fn(args)

Expand Down
4 changes: 0 additions & 4 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_aerosol_anthro.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from cmip7_ancil_common import (
INTERPOLATION_SCHEME,
esm_grid_mask_cube,
extend_years,
fix_coords,
save_ancil,
)
Expand Down Expand Up @@ -75,7 +74,4 @@ def cmip7_aerosol_anthro_interpolate(
esm_cube.attributes["STASH"] = iris.fileformats.pp.STASH(
model=1, section=0, item=stash_item
)
# Extend the historical time series, if any,
# by duplicating the first and last years
esm_cube = extend_years(esm_cube)
save_ancil(esm_cube, save_dirpath, args.save_filename)
6 changes: 0 additions & 6 deletions CMIP7/esm1p6/atmosphere/aerosol/cmip7_aerosol_biomass.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from cmip7_ancil_common import (
INTERPOLATION_SCHEME,
esm_grid_mask_cube,
extend_years,
save_ancil,
set_coord_system,
)
Expand Down Expand Up @@ -141,11 +140,6 @@ def save_cmip7_aerosol_biomass(args, load_pc_fn, load_fn, save_dirpath):
model=1, section=0, item=131
)

# Extend the historical time series, if any,
# by duplicating the first and last years
low_esm = extend_years(low_esm)
high_esm = extend_years(high_esm)

save_ancil([low_esm, high_esm], save_dirpath, args.save_filename)

now = datetime.now()
Expand Down
Loading