Skip to content

Commit

Permalink
Add mass accumulation table to GCHP vs GCC and GCHP vs GCHP 1-mo benc…
Browse files Browse the repository at this point in the history
…hmark

This table is optional and is off by default.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
  • Loading branch information
lizziel committed May 16, 2023
1 parent 9472e0a commit 51b4e8b
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 50 deletions.
130 changes: 130 additions & 0 deletions benchmark/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,14 +619,24 @@ def run_benchmark_default(config):
refe = get_filepath(gcc_vs_gcc_refrst, "Restart", gcc_end_ref_date)
deve = get_filepath(gcc_vs_gcc_devrst, "Restart", gcc_end_dev_date)

# Get period strings
refs_str = np.datetime_as_string(gcc_ref_date, unit="s")
devs_str = np.datetime_as_string(gcc_dev_date, unit="s")
refe_str = np.datetime_as_string(gcc_end_ref_date, unit="s")
deve_str = np.datetime_as_string(gcc_end_dev_date, unit="s")
refperiod = refs_str + ' - ' + refe_str
devperiod = devs_str + ' - ' + deve_str

# Create tables
bmk.make_benchmark_mass_accumulation_tables(
refs,
refe,
config["data"]["ref"]["gcc"]["version"],
refperiod,
devs,
deve,
config["data"]["dev"]["gcc"]["version"],
devperiod,
overwrite=True,
dst=gcc_vs_gcc_tablesdir,
spcdb_dir=spcdb_dir,
Expand Down Expand Up @@ -983,6 +993,63 @@ def run_benchmark_default(config):
spcdb_dir=spcdb_dir,
)

# ==================================================================
# GCHP vs GCC global mass accumulation tables
# ==================================================================
if config["options"]["outputs"]["mass_accum_table"]:
print("\n%%% Creating GCHP vs. GCC mass accumulation tables %%%")

# Filepaths for start and end restart files
refs = get_filepath(
gchp_vs_gcc_refrst,
"Restart",
gcc_dev_date
)
devs = get_filepath(
gchp_vs_gcc_devrst,
"Restart",
gchp_dev_date,
is_gchp=True,
gchp_res=config["data"]["dev"]["gchp"]["resolution"],
gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"]
)
refe = get_filepath(
gchp_vs_gcc_refrst,
"Restart",
gcc_end_dev_date
)
deve = get_filepath(
gchp_vs_gcc_devrst,
"Restart",
gchp_end_dev_date,
is_gchp=True,
gchp_res=config["data"]["dev"]["gchp"]["resolution"],
gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"]
)

# Get period strings
refs_str = np.datetime_as_string(gcc_dev_date, unit="s")
devs_str = np.datetime_as_string(gchp_dev_date, unit="s")
refe_str = np.datetime_as_string(gcc_end_dev_date, unit="s")
deve_str = np.datetime_as_string(gchp_end_dev_date, unit="s")
refperiod = refs_str + ' - ' + refe_str
devperiod = devs_str + ' - ' + deve_str

# Create tables
bmk.make_benchmark_mass_accumulation_tables(
refs,
refe,
config["data"]["dev"]["gcc"]["version"],
refperiod,
devs,
deve,
config["data"]["dev"]["gchp"]["version"],
devperiod,
overwrite=True,
dst=gchp_vs_gcc_tablesdir,
spcdb_dir=spcdb_dir,
)

# ==================================================================
# GCHP vs GCC operations budgets tables
# ==================================================================
Expand Down Expand Up @@ -1366,6 +1433,69 @@ def run_benchmark_default(config):
spcdb_dir=spcdb_dir,
)

# ==================================================================
# GCHP vs GCHP global mass accumulation tables
# ==================================================================
if config["options"]["outputs"]["mass_accum_table"]:
print("\n%%% Creating GCHP vs. GCHP mass accumulation tables %%%")

# Filepaths for start and end restart files
refs = get_filepath(
gchp_vs_gchp_refrst,
"Restart",
gchp_ref_date,
is_gchp=True,
gchp_res=config["data"]["ref"]["gchp"]["resolution"],
gchp_is_pre_14_0=config["data"]["ref"]["gchp"]["is_pre_14.0"]
)
devs = get_filepath(
gchp_vs_gchp_devrst,
"Restart",
gchp_dev_date,
is_gchp=True,
gchp_res=config["data"]["dev"]["gchp"]["resolution"],
gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"]
)
refe = get_filepath(
gchp_vs_gchp_refrst,
"Restart",
gchp_end_ref_date,
is_gchp=True,
gchp_res=config["data"]["ref"]["gchp"]["resolution"],
gchp_is_pre_14_0=config["data"]["ref"]["gchp"]["is_pre_14.0"]
)
deve = get_filepath(
gchp_vs_gchp_devrst,
"Restart",
gchp_end_dev_date,
is_gchp=True,
gchp_res=config["data"]["dev"]["gchp"]["resolution"],
gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"]
)

# Get period strings
refs_str = np.datetime_as_string(gchp_ref_date, unit="s")
devs_str = np.datetime_as_string(gchp_dev_date, unit="s")
refe_str = np.datetime_as_string(gchp_end_ref_date, unit="s")
deve_str = np.datetime_as_string(gchp_end_dev_date, unit="s")
refperiod = refs_str + ' - ' + refe_str
devperiod = devs_str + ' - ' + deve_str

# Create tables
bmk.make_benchmark_mass_accumulation_tables(
refs,
refe,
config["data"]["ref"]["gchp"]["version"],
refperiod,
devs,
deve,
config["data"]["dev"]["gchp"]["version"],
devperiod,
overwrite=True,
dst=gchp_vs_gchp_tablesdir,
spcdb_dir=spcdb_dir,
)

# ==================================================================
# GCHP vs GCHP operations budgets tables
# ==================================================================
Expand Down
Loading

0 comments on commit 51b4e8b

Please sign in to comment.