def parallel_mass_table(s, bmk_mon): ref = get_filepath(gcc_vs_gcc_refrstdir, col, bmk_mon) dev = get_filepath(gcc_vs_gcc_devrstdir, col, bmk_mon) bmk.make_benchmark_mass_tables(ref, gcc_vs_gcc_refstr, dev, gcc_vs_gcc_devstr, dst=gcc_vs_gcc_tablesdir, subdst=bmk_mon_yr_strs[s], label="at 01{}".format( bmk_mon_yr_strs[s]), overwrite=True, spcdb_dir=spcdb_dir)
def test_make_benchmark_mass_tables(): refdata = 'GCCData/RestartTest.nc4' refstr = 'GCC_Test_Data' devdata = 'GCCData/RestartTest.nc4' devstr = 'GCC_Test_Data' dst = './TestOutput/MassTables' correct_tables = [ './TestOutput/MassTables/CorrectGlobalMass_TropStrat.txt', './TestOutput/MassTables/CorrectGlobalMass_Trop.txt' ] outfilenames = [ './TestOutput/MassTables/GCC_Test_Data_GlobalMass_TropStrat.txt', './TestOutput/MassTables/GCC_Test_Data_GlobalMass_Trop.txt' ] bmk.make_benchmark_mass_tables(refdata, refstr, devdata, devstr, dst=dst, overwrite=True) for i in [0, 1]: if not os.path.exists(correct_tables[i]): copyfile(outfilenames[i], correct_tables[i]) assert filecmp.cmp(outfilenames[i], correct_tables[i]) == True
# Column AOD plots print('\n%%% Creating GCC vs. GCC column AOD plots %%%') bmk.make_benchmark_aod_plots(gcc_vs_gcc_refaod, gcc_vs_gcc_refstr, gcc_vs_gcc_devaod, gcc_vs_gcc_devstr, dst=gcc_vs_gcc_plotsdir, overwrite=True, sigdiff_files=gcc_vs_gcc_sigdiff) if mass_table: # Global mass tables print('\n%%% Creating GCC vs. GCC global mass tables %%%') bmk.make_benchmark_mass_tables(gcc_vs_gcc_refrst, gcc_vs_gcc_refstr, gcc_vs_gcc_devrst, gcc_vs_gcc_devstr, dst=gcc_vs_gcc_plotsdir, overwrite=True) if budget_table: # Budgets tables print('\n%%% Creating GCC vs. GCC budget tables %%%') bmk.make_benchmark_budget_tables(gcc_vs_gcc_devbgt, gcc_vs_gcc_devstr, dst=gcc_vs_gcc_plotsdir, interval=sec_per_month, overwrite=True) if OH_metrics: # Global mean OH, MCF Lifetime, CH4 Lifetime print('\n%%% Creating GCC vs. GCC OH metrics %%%')
#--------------------------------------------------------------- # GCC vs GCC global mass tables #--------------------------------------------------------------- if mass_table: print("\n%%% Creating GCC vs. GCC global mass tables %%%") # Diagnostic collection files to read col = "Restart" ref = get_filepath(gcc_vs_gcc_refrst, col, end_date) dev = get_filepath(gcc_vs_gcc_devrst, col, end_date) # Plot mass tables bmk.make_benchmark_mass_tables(ref, gcc_ref_version, dev, gcc_dev_version, dst=gcc_vs_gcc_tablesdir, overwrite=True, spcdb_dir=spcdb_dir) #--------------------------------------------------------------- # GCC vs GCC budgets tables #--------------------------------------------------------------- if ops_budget_table: print("\n%%% Creating GCC vs. GCC operations budget tables %%%") # Diagnostic collection files to read col = "Budget" ref = get_filepath(gcc_vs_gcc_refdir, col, gcc_date) dev = get_filepath(gcc_vs_gcc_devdir, col, gcc_date)