Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Interpolate CMIP7 HI BC emissions to ESM1.6 grid
from aerosol.cmip7_HI_aerosol_anthro import (
from .cmip7_HI_aerosol_anthro import (
cmip7_hi_aerosol_anthro_interpolate,
parse_args,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
from argparse import ArgumentParser
from ast import literal_eval

from aerosol.cmip7_aerosol_biomass import (
from ..cmip7_ancil_argparse import (
common_parser,
percent_parser,
)
from ..cmip7_ancil_common import cmip7_date_constraint_from_years
from .cmip7_aerosol_biomass import (
load_cmip7_aerosol_biomass,
load_cmip7_aerosol_biomass_list,
save_cmip7_aerosol_biomass,
)
from aerosol.cmip7_HI_aerosol import (
from .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


def parse_args():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Interpolate CMIP7 HI OCFF emissions to ESM1.6 grid
from aerosol.cmip7_HI_aerosol_anthro import (
from .cmip7_HI_aerosol_anthro import (
cmip7_hi_aerosol_anthro_interpolate,
parse_args,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
from argparse import ArgumentParser
from ast import literal_eval

from aerosol.cmip7_HI_aerosol import (
from ..cmip7_ancil_argparse import (
common_parser,
dms_filename_parser,
)
from ..cmip7_HI import fix_esm15_hi_ancil_date
from .cmip7_HI_aerosol import (
CMIP7_HI_AEROSOL_BEG_YEAR,
CMIP7_HI_AEROSOL_END_YEAR,
esm_hi_aerosol_ancil_dirpath,
esm_hi_aerosol_save_dirpath,
)
from aerosol.cmip7_HI_aerosol_anthro import load_cmip7_hi_aerosol_anthro
from aerosol.cmip7_SO2_interpolate import (
from .cmip7_HI_aerosol_anthro import (
load_cmip7_hi_aerosol_anthro,
)
from .cmip7_SO2_interpolate import (
load_dms,
save_cmip7_so2_aerosol_anthro,
)
from cmip7_ancil_argparse import (
common_parser,
dms_filename_parser,
)
from cmip7_HI import fix_esm15_hi_ancil_date


def parse_args():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

from cmip7_ancil_constants import ANCIL_TODAY
from cmip7_HI import CMIP7_HI_BEG_YEAR, CMIP7_HI_END_YEAR
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from argparse import ArgumentParser
from ast import literal_eval

from aerosol.cmip7_aerosol_anthro import (
from ..cmip7_ancil_argparse import common_parser
from ..cmip7_ancil_common import cmip7_date_constraint_from_years
from .cmip7_aerosol_anthro import (
cmip7_aerosol_anthro_interpolate,
load_cmip7_aerosol_anthro_list,
)
from aerosol.cmip7_HI_aerosol import (
from .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


def parse_args(species):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Interpolate CMIP7 PI BC emissions to ESM1-6 grid
from aerosol.cmip7_PI_aerosol_anthro import (
from .cmip7_PI_aerosol_anthro import (
cmip7_pi_aerosol_anthro_interpolate,
parse_args,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from argparse import ArgumentParser

from aerosol.cmip7_aerosol_biomass import (
from ..cmip7_ancil_argparse import common_parser, percent_parser
from ..cmip7_PI import cmip7_pi_date_constraint
from .cmip7_aerosol_biomass import (
load_cmip7_aerosol_biomass,
save_cmip7_aerosol_biomass,
)
from aerosol.cmip7_PI_aerosol import esm_pi_aerosol_save_dirpath
from cmip7_ancil_argparse import common_parser, percent_parser
from cmip7_PI import cmip7_pi_date_constraint
from .cmip7_PI_aerosol import esm_pi_aerosol_save_dirpath


def parse_args():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Interpolate CMIP7 PI OCFF emissions to ESM1-6 grid
from aerosol.cmip7_PI_aerosol_anthro import (
from .cmip7_PI_aerosol_anthro import (
cmip7_pi_aerosol_anthro_interpolate,
parse_args,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

from argparse import ArgumentParser

from aerosol.cmip7_PI_aerosol import (
from ..cmip7_ancil_argparse import (
common_parser,
dms_filename_parser,
)
from ..cmip7_PI import fix_esm15_pi_ancil_date
from .cmip7_PI_aerosol import (
esm_pi_aerosol_ancil_dirpath,
esm_pi_aerosol_save_dirpath,
)
from aerosol.cmip7_PI_aerosol_anthro import load_cmip7_pi_aerosol_anthro
from aerosol.cmip7_SO2_interpolate import (
from .cmip7_PI_aerosol_anthro import (
load_cmip7_pi_aerosol_anthro,
)
from .cmip7_SO2_interpolate import (
load_dms,
save_cmip7_so2_aerosol_anthro,
)
from cmip7_ancil_argparse import common_parser, dms_filename_parser
from cmip7_PI import fix_esm15_pi_ancil_date


def parse_args():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from cmip7_ancil_constants import ANCIL_TODAY
from ..cmip7_ancil_constants import ANCIL_TODAY


def esm_pi_aerosol_ancil_dirpath(ancil_root_dirname):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from argparse import ArgumentParser

from aerosol.cmip7_aerosol_anthro import (
from ..cmip7_ancil_argparse import common_parser
from ..cmip7_PI import cmip7_pi_date_constraint
from .cmip7_aerosol_anthro import (
cmip7_aerosol_anthro_interpolate,
load_cmip7_aerosol_anthro,
)
from aerosol.cmip7_PI_aerosol import esm_pi_aerosol_save_dirpath
from cmip7_ancil_argparse import common_parser
from cmip7_PI import cmip7_pi_date_constraint
from .cmip7_PI_aerosol import esm_pi_aerosol_save_dirpath


def parse_args(species):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
import iris
import netCDF4
import numpy as np
from aerosol.cmip7_aerosol_anthro import cmip7_aerosol_anthro_filepath
from aerosol.cmip7_aerosol_common import zero_poles
from cmip7_ancil_common import (

from ..cmip7_ancil_common import (
INTERPOLATION_SCHEME,
esm_grid_mask_cube,
save_ancil,
)
from .cmip7_aerosol_anthro import (
cmip7_aerosol_anthro_filepath,
)
from .cmip7_aerosol_common import zero_poles

DMS_NAME_CONSTRAINT = iris.Constraint(
name="tendency_of_atmosphere_mass_content_of_"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
from pathlib import Path

import iris
from aerosol.cmip7_aerosol_common import (
load_cmip7_aerosol,
load_cmip7_aerosol_list,
zero_poles,
)
from cmip7_ancil_common import (

from ..cmip7_ancil_common import (
INTERPOLATION_SCHEME,
esm_grid_mask_cube,
fix_coords,
save_ancil,
)
from .cmip7_aerosol_common import (
load_cmip7_aerosol,
load_cmip7_aerosol_list,
zero_poles,
)


def cmip7_aerosol_anthro_rootpath(args):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
from pathlib import Path

import iris
from aerosol.cmip7_aerosol_common import (
load_cmip7_aerosol,
load_cmip7_aerosol_list,
zero_poles,
)
from cmip7_ancil_common import (

from ..cmip7_ancil_common import (
INTERPOLATION_SCHEME,
esm_grid_mask_cube,
save_ancil,
set_coord_system,
)
from .cmip7_aerosol_common import (
load_cmip7_aerosol,
load_cmip7_aerosol_list,
zero_poles,
)


def cmip7_aerosol_biomass_rootpath(args):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from pathlib import Path

import mule
from cmip7_ancil_constants import ANCIL_TODAY, UM_VERSION
from cmip7_PI import CMIP7_PI_YEAR

from .cmip7_ancil_constants import ANCIL_TODAY, UM_VERSION
from .cmip7_PI import CMIP7_PI_YEAR

CMIP7_HI_BEG_YEAR = CMIP7_PI_YEAR
CMIP7_HI_END_YEAR = 2022
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import calendar

import mule
from cmip7_ancil_common import cmip7_date_constraint_from_years
from cmip7_ancil_constants import UM_VERSION

from .cmip7_ancil_common import cmip7_date_constraint_from_years
from .cmip7_ancil_constants import UM_VERSION

CMIP7_PI_YEAR = 1850
DAYS_IN_CMIP7_PI_YEAR = 365.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import iris
import mule
import numpy as np
from cmip7_ancil_constants import UM_VERSION

from .cmip7_ancil_constants import UM_VERSION

INTERPOLATION_SCHEME = iris.analysis.AreaWeighted(mdtol=0.5)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import f90nml
import iris
import numpy as np
from cmip7_ancil_argparse import dataset_parser, path_parser
from cmip7_HI import (

from ..cmip7_ancil_argparse import dataset_parser, path_parser
from ..cmip7_HI import (
CMIP7_HI_BEG_YEAR,
CMIP7_HI_END_YEAR,
CMIP7_HI_NBR_YEARS,
)
from ghg.cmip7_ghg import (
from .cmip7_ghg import (
GHG_MOLAR_MASS,
cmip7_ghg_dirpath,
cmip7_ghg_filename,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

import f90nml
import iris
from cmip7_ancil_argparse import dataset_parser, path_parser
from cmip7_PI import CMIP7_PI_YEAR
from ghg.cmip7_ghg import (

from ..cmip7_ancil_argparse import dataset_parser, path_parser
from ..cmip7_PI import CMIP7_PI_YEAR
from .cmip7_ghg import (
GHG_MOLAR_MASS,
cmip7_ghg_dirpath,
cmip7_ghg_filename,
Expand Down
20 changes: 20 additions & 0 deletions CMIP7/esm1p6_ancil/nitrogen/cmip7_HI_nitrogen_generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from argparse import ArgumentParser

from ..cmip7_ancil_argparse import common_parser


def parse_args():
parser = ArgumentParser(
parents=[common_parser()],
prog="cmip7_HI_nitrogen_generate",
description=(
"Generate input files from CMIP7 historical nitrogen forcings"
),
)
parser.add_argument("--dataset-date-range-list")
parser.add_argument("--save-filename")
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
Loading
Loading