From 52edf2a1c6517d83dec70b10736e1fe180b85506 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 20 May 2024 15:58:16 +0000 Subject: [PATCH 01/23] Update SCM RTs for CCPP v7 release --- test/rt_test_cases.py | 96 ++++++++++++++++++++---------------- test/rt_test_cases_nvidia.py | 10 ++-- 2 files changed, 58 insertions(+), 48 deletions(-) diff --git a/test/rt_test_cases.py b/test/rt_test_cases.py index d9145a1b3..7c52f88b5 100644 --- a/test/rt_test_cases.py +++ b/test/rt_test_cases.py @@ -1,47 +1,57 @@ run_list = [\ #---------------------------------------------------------------------------------------------------------------------------------------------- - # CCPP-SCM v6 supported suites + # Supported suites for CCPP Version 7 release + #---------------------------------------------------------------------------------------------------------------------------------------------- + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_HR3"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_WoFS_v0"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RRFS_v1"}, \ + {"case": "twpice", "suite": "SCM_GFS_v17_HR3"}, \ + {"case": "twpice", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ + {"case": "twpice", "suite": "SCM_GFS_v16"}, \ + {"case": "twpice", "suite": "SCM_WoFS_v0"}, \ + {"case": "twpice", "suite": "SCM_RRFS_v1"}, \ + {"case": "bomex", "suite": "SCM_GFS_v17_HR3"}, \ + {"case": "bomex", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ + {"case": "bomex", "suite": "SCM_GFS_v16"}, \ + {"case": "bomex", "suite": "SCM_WoFS_v0"}, \ + {"case": "bomex", "suite": "SCM_RRFS_v1"}, \ + {"case": "astex", "suite": "SCM_GFS_v17_HR3"}, \ + {"case": "astex", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ + {"case": "astex", "suite": "SCM_GFS_v16"}, \ + {"case": "astex", "suite": "SCM_WoFS_v0"}, \ + {"case": "astex", "suite": "SCM_RRFS_v1"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_HR3"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v16"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_WoFS_v0"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_RRFS_v1"}, \ #---------------------------------------------------------------------------------------------------------------------------------------------- - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16"}, \ - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8"}, \ - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_HRRR"}, \ - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RRFS_v1beta"}, \ - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RAP"}, \ - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_WoFS_v0"}, \ - {"case": "twpice", "suite": "SCM_GFS_v16"}, \ - {"case": "twpice", "suite": "SCM_GFS_v17_p8"}, \ - {"case": "twpice", "suite": "SCM_HRRR"}, \ - {"case": "twpice", "suite": "SCM_RRFS_v1beta"}, \ - {"case": "twpice", "suite": "SCM_RAP"}, \ - {"case": "twpice", "suite": "SCM_WoFS_v0"}, \ - {"case": "bomex", "suite": "SCM_GFS_v16"}, \ - {"case": "bomex", "suite": "SCM_GFS_v17_p8"}, \ - {"case": "bomex", "suite": "SCM_HRRR"}, \ - {"case": "bomex", "suite": "SCM_RRFS_v1beta"}, \ - {"case": "bomex", "suite": "SCM_RAP"}, \ - {"case": "bomex", "suite": "SCM_WoFS_v0"}, \ - {"case": "astex", "suite": "SCM_GFS_v16"}, \ - {"case": "astex", "suite": "SCM_GFS_v17_p8"}, \ - {"case": "astex", "suite": "SCM_HRRR"}, \ - {"case": "astex", "suite": "SCM_RRFS_v1beta"}, \ - {"case": "astex", "suite": "SCM_RAP"}, \ - {"case": "astex", "suite": "SCM_WoFS_v0"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_GFS_v16"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_p8"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_HRRR"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_RRFS_v1beta"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_RAP"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_WoFS_v0"}, \ - #--------------------------------------------------------------------------------------------------------------------------------------------------- # Unsupported suites (w/ supported cases) - #--------------------------------------------------------------------------------------------------------------------------------------------------- - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v15p2"}, \ - {"case": "twpice", "suite": "SCM_GFS_v15p2"}, \ - {"case": "bomex", "suite": "SCM_GFS_v15p2"}, \ - {"case": "astex", "suite": "SCM_GFS_v15p2"}, \ - {"case": "LASSO_2016051812", "suite": "SCM_GFS_v15p2"}]#, \ -# {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8_RRTMGP", "namelist": "input_GFS_v17_p8_RRTMGP.nml", "tracer": "tracers_GFS_v17_p8.txt"},\ -# {"case": "twpice", "suite": "SCM_GFS_v17_p8_RRTMGP", "namelist": "input_GFS_v17_p8_RRTMGP.nml", "tracer": "tracers_GFS_v17_p8.txt"},\ -# {"case": "bomex", "suite": "SCM_GFS_v17_p8_RRTMGP", "namelist": "input_GFS_v17_p8_RRTMGP.nml", "tracer": "tracers_GFS_v17_p8.txt"},\ -# {"case": "astex", "suite": "SCM_GFS_v17_p8_RRTMGP", "namelist": "input_GFS_v17_p8_RRTMGP.nml", "tracer": "tracers_GFS_v17_p8.txt"},\ -# {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_p8_RRTMGP", "namelist": "input_GFS_v17_p8_RRTMGP.nml", "tracer": "tracers_GFS_v17_p8.txt"}] + #---------------------------------------------------------------------------------------------------------------------------------------------- + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_HRRR"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RRFS_v1beta"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RAP"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v15p2"}, \ + {"case": "twpice", "suite": "SCM_GFS_v17_p8"}, \ + {"case": "twpice", "suite": "SCM_HRRR"}, \ + {"case": "twpice", "suite": "SCM_RRFS_v1beta"}, \ + {"case": "twpice", "suite": "SCM_RAP"}, \ + {"case": "twpice", "suite": "SCM_GFS_v15p2"}, \ + {"case": "bomex", "suite": "SCM_GFS_v17_p8"}, \ + {"case": "bomex", "suite": "SCM_HRRR"}, \ + {"case": "bomex", "suite": "SCM_RRFS_v1beta"}, \ + {"case": "bomex", "suite": "SCM_RAP"}, \ + {"case": "bomex", "suite": "SCM_GFS_v15p2"}, \ + {"case": "astex", "suite": "SCM_GFS_v17_p8"}, \ + {"case": "astex", "suite": "SCM_HRRR"}, \ + {"case": "astex", "suite": "SCM_RRFS_v1beta"}, \ + {"case": "astex", "suite": "SCM_RAP"}, \ + {"case": "astex", "suite": "SCM_GFS_v15p2"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_p8"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_HRRR"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_RRFS_v1beta"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_RAP"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v15p2"}] diff --git a/test/rt_test_cases_nvidia.py b/test/rt_test_cases_nvidia.py index a19c81ba9..14473306c 100644 --- a/test/rt_test_cases_nvidia.py +++ b/test/rt_test_cases_nvidia.py @@ -1,9 +1,9 @@ run_list = [\ #---------------------------------------------------------------------------------------------------------------------------------------------- - # CCPP-SCM v6 supported suites + # CCPP-SCM suites for use with Nvidia compilers #---------------------------------------------------------------------------------------------------------------------------------------------- - {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RAP"}, \ - {"case": "twpice", "suite": "SCM_RAP"}, \ - {"case": "bomex", "suite": "SCM_RAP"}, \ - {"case": "astex", "suite": "SCM_RAP"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_RAP"}, \ + {"case": "twpice", "suite": "SCM_RAP"}, \ + {"case": "bomex", "suite": "SCM_RAP"}, \ + {"case": "astex", "suite": "SCM_RAP"}, \ {"case": "LASSO_2016051812", "suite": "SCM_RAP"}] From 5fb29d4d2f7ae990883eb3abe735c3e914d902bc Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 15:44:36 +0000 Subject: [PATCH 02/23] Added plotting step to SCM RT Baseline comparison in CI --- test/cmp_rt2bl.py | 177 ++++++++++++++++++++++++++++++++++++++++++ test/rt_test_cases.py | 2 +- 2 files changed, 178 insertions(+), 1 deletion(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 683e511db..02eedaeeb 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -10,6 +10,9 @@ from rt_test_cases import run_list from os.path import exists import argparse +from netCDF4 import Dataset +import numpy as np +import matplotlib.pyplot as plt # parser = argparse.ArgumentParser() @@ -17,6 +20,7 @@ parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output') parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines') +# def parse_args(): args = parser.parse_args() build_type = args.build_type @@ -25,6 +29,155 @@ def parse_args(): return (build_type,dir_rt,dir_bl) +# +def plot_results(file_BL,file_RT): + # List of SCM output fields to plot (This everything) + vars2plot = ["time_inst","time_diag","time_swrad","time_lwrad","time_rad","pres", \ + "pres_i","sigma","sigma_i","pres_s","qv","T","u","v","ql","qi","qc", \ + "qv_force_tend","T_force_tend","u_force_tend","v_force_tend","w_ls", \ + "u_g","v_g","dT_dt_rad_forc","h_advec_thil","h_advec_qt", \ + "v_advec_thil","v_advec_qt","T_s","lhf","shf","tprcp_inst", \ + "tprcp_rate_inst","t2m","q2m","ustar","tsfc","tau_u","tau_v","upd_mf", \ + "dwn_mf","det_mf","sfc_up_lw_land","sfc_up_lw_ice","sfc_up_lw_water", \ + "sfc_up_sw_dir_nir","sfc_up_sw_dif_nir","sfc_up_sw_dir_vis", \ + "sfc_up_sw_dif_vis","sfc_dwn_sw_dir_nir","sfc_dwn_sw_dif_nir", \ + "sfc_dwn_sw_dir_vis","sfc_dwn_sw_dif_vis","mp_prcp_inst", \ + "dcnv_prcp_inst","scnv_prcp_inst","pwat","dT_dt_lwrad","dT_dt_swrad", \ + "dT_dt_pbl","dT_dt_deepconv","dT_dt_shalconv","dT_dt_micro", \ + "dT_dt_ogwd","dT_dt_cgwd","dT_dt_phys","dT_dt_nonphys","dq_dt_pbl", \ + "dq_dt_deepconv","dq_dt_shalconv","dq_dt_micro","dq_dt_phys", \ + "dq_dt_nonphys","doz_dt_pbl","doz_dt_prodloss","doz_dt_oz","doz_dt_T", \ + "doz_dt_ovhd","doz_dt_phys","doz_dt_nonphys","du_dt_pbl","du_dt_ogwd", \ + "du_dt_deepconv","du_dt_cgwd","du_dt_shalconv","du_dt_phys", \ + "du_dt_nonphys","dv_dt_pbl","dv_dt_ogwd","dv_dt_deepconv","dv_dt_cgwd", \ + "dv_dt_shalconv","dv_dt_phys","dv_dt_nonphys","sfc_dwn_sw","sfc_up_sw", \ + "sfc_net_sw","sfc_dwn_lw","gflux","u10m","v10m","hpbl","tprcp_accum", \ + "ice_accum","snow_accum","graupel_accum","conv_prcp_accum", \ + "tprcp_rate_accum","ice_rate_accum","snow_rate_accum", \ + "graupel_rate_accum","conv_prcp_rate_accum","max_cloud_fraction", \ + "toa_total_albedo","vert_int_lwp_mp","vert_int_iwp_mp", \ + "vert_int_lwp_cf","vert_int_iwp_cf"] + + # Open SCM datasets + SCM_BL = Dataset(file_BL) + SCM_RT = Dataset(file_RT) + + plot_files = [] + for var in SCM_BL.variables.keys(): + if (var in vars2plot): + # Handle temporal axis. + # There are 4 different dimensions in the SCM output, identified by the suffix "_dim". + # Here the suffix is stripped and used to identify the temporal dimenesion (index 0 in netcdf file) + timeD = SCM_BL[var].dimensions[0] + timeD = timeD[0:len(timeD)-4] + x1 = SCM_BL[timeD][:].squeeze()/3600. #seconds -> hours + x2 = SCM_RT[timeD][:].squeeze()/3600. #seconds - >hours + # Is this a 2D (time, x) variable? (Really 1D since x=1 in SCM) + is2D = False + if (len(SCM_BL[var].dimensions)==2): + is2D = True + # endif + # one/two-dimensional variables + if (len(SCM_BL[var].shape) != 3): + print("Creating 1D field",var) + if (is2D): + y1 = SCM_BL[var][:,0].squeeze() + y2 = SCM_RT[var][:,0].squeeze() + else: + y1 = SCM_BL[var][:] + y2 = SCM_RT[var][:] + # endif + plt_range = [np.min(SCM_BL[var]),np.max(SCM_BL[var])] + plt_ranged = [-1*abs(np.max(SCM_BL[var])),abs(np.max(SCM_BL[var]))] + + # Make figure + fig = plt.figure(figsize=(13,10)) + # Baselines and SCM RTs on same plot + plt.subplot(2,1,1) + plt.title(SCM_BL[var].description) + plt.plot(x1, y1, color='blue') + plt.plot(x2, y2, color='black') + plt.ylim(plt_range) + plt.ylabel('('+SCM_BL[var].units+')') + plt.xlabel('(hours)') + # Difference (Baseline-SCMRT) + plt.subplot(2,1,2) + plt.title("Difference (blue - black)") + plt.plot(x1, y1 - y2, color='red') + plt.plot(x1, np.zeros(len(x1)), color='grey',linestyle='dashed') + plt.ylim(plt_ranged) + plt.ylabel('('+SCM_RT[var].units+')') + plt.xlabel('(hours)') + # + fileOUT = 'scm.' + var +'.png' + plt.savefig(fileOUT) + # + plot_files.append(fileOUT) + # three-dimensional variables + elif len(SCM_BL[var].shape) == 3: + z1 = np.transpose(SCM_BL[var][:,:,0]).squeeze() + z2 = np.transpose(SCM_RT[var][:,:,0]).squeeze() + + # vertical axis + y1 = SCM_BL["pres"][0,:].squeeze()*0.01 + y2 = SCM_RT["pres"][0,:].squeeze()*0.01 + nlev = SCM_BL[var][:,:,0].shape[1] + # Layer (nlev) quantities are the default, so check for case where we have an + # interface (nlev+1) variable to plot. + if (SCM_BL[var][:,:,0].shape[1] > len(y1)): + y1 = SCM_BL["pres_i"][0,:].squeeze()*0.01 + y2 = SCM_RT["pres_i"][0,:].squeeze()*0.01 + # endif + + # Comppute differences and determine valid plot range(s). + dz = z1-z2 + if np.count_nonzero(dz) > 0: + clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) + clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) + else: + clev = 0 + clevd = 0 + # end if + + # Finally, make figure. + fig = plt.figure(figsize=(13,10)) + # Baselines + plt.subplot(3,1,1) + plt.title(SCM_BL[var].description, fontsize=12) + plt.contourf(x1, y1, z1, clev, cmap='YlGnBu') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # SCM RTs + plt.subplot(3,1,2) + plt.contourf(x2, y2, z2, clev, cmap='YlGnBu') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + plt.xlabel('(hours)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # Only plot differences if they exist. + if np.count_nonzero(dz) > 0: + plt.subplot(3,1,3) + plt.title("Difference (top - middle)", fontsize=8) + plt.contourf(x2, y2, dz, clevd, cmap='bwr') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + plt.xlabel('(hours)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # end if (no differences exist) + fileOUT = 'scm.' + var +'.png' + plt.savefig(fileOUT) + # + plot_files.append(fileOUT) + # end if (fields exist?) + # end if (field requested?) + # end for (fields in file) + + return(plot_files) + # def main(): # @@ -43,12 +196,35 @@ def main(): error_count = error_count + 1 else: print("Output for "+run["case"]+"_"+run["suite"]+ " is IDENTICAL to baseline") + # end if + + # Create plots between RTs and baselines + plot_files = plot_results(file_rt,file_bl) + + # Setup output directories for plots. + result = os.system("mkdir -p scm_rt_out/"+run["case"]+"/"+run["suite"]) + + # Archive plots. + com = "mv" + for plot_file in plot_files: + com = com + " " + plot_file + # end if + com = com + " scm_rt_out/" + run["case"] + "/" + run["suite"] + result = os.system(com) else: if not exists(file_rt): print("Output for "+run["case"]+"_"+run["suite"]+ " is MISSING from output") + # end if if not exists(file_bl): print("Output for "+run["case"]+"_"+run["suite"]+ " is MISSING from baseline") + # end if error_count = error_count + 1 + # end if + # end for + + # Bundle all plots into tarball for artifact in github action. + com = 'tar -cvf scm_rt_plots.tar scm_rt_out/*' + result = os.system(com) # if error_count == 0: @@ -56,6 +232,7 @@ def main(): else: print("ALL TESTS PASSED, BUT OUTPUT DIFFERS FROM BASELINE.") #1/0 + # end if # if __name__ == '__main__': diff --git a/test/rt_test_cases.py b/test/rt_test_cases.py index 7c52f88b5..0a2bd76d0 100644 --- a/test/rt_test_cases.py +++ b/test/rt_test_cases.py @@ -21,7 +21,7 @@ {"case": "astex", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ {"case": "astex", "suite": "SCM_GFS_v16"}, \ {"case": "astex", "suite": "SCM_WoFS_v0"}, \ - {"case": "astex", "suite": "SCM_RRFS_v1"}, \ + {"case": "astex", "suite": "SCM_RRFS_v1"}, \ {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_HR3"}, \ {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_HR3_RRTMGP"}, \ {"case": "LASSO_2016051812", "suite": "SCM_GFS_v16"}, \ From b0181248a4d0406ebf1abe40f39fb5056a2aded6 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 15:57:33 +0000 Subject: [PATCH 03/23] Omission from previous commit --- test/cmp_rt2bl.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 02eedaeeb..7884a5dfa 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -79,7 +79,6 @@ def plot_results(file_BL,file_RT): # endif # one/two-dimensional variables if (len(SCM_BL[var].shape) != 3): - print("Creating 1D field",var) if (is2D): y1 = SCM_BL[var][:,0].squeeze() y2 = SCM_RT[var][:,0].squeeze() @@ -131,11 +130,10 @@ def plot_results(file_BL,file_RT): # Comppute differences and determine valid plot range(s). dz = z1-z2 + clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) if np.count_nonzero(dz) > 0: - clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) else: - clev = 0 clevd = 0 # end if From fbd9cc9afb5ffef6a5992f750c90a62a019b0e73 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 16:03:36 +0000 Subject: [PATCH 04/23] Update CI script to updload plots as Github artifact --- .github/workflows/ci_run_scm_rts.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index d58a10cdd..0ff29ea49 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -195,6 +195,12 @@ jobs: cd ${SCM_ROOT}/test ./cmp_rt2bl.py --build_type ${{matrix.build-type}} --dir_rt ${dir_rt} --dir_bl ${dir_bl} + - name: Upload plots of SCM Baselines/RTs as GitHub Artifact. + uses: actions/upload-artifact@v2 + with: + name: rt-plots-${{matrix.build-type}} + path: /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out + - name: Upload SCM RTs as GitHub Artifact uses: actions/upload-artifact@v2 with: From be613ebe85742f937593e93a0bdd1cbcd2ee5ab2 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 16:27:36 +0000 Subject: [PATCH 05/23] Update CI script --- .github/workflows/ci_run_scm_rts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index 0ff29ea49..936e9f421 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -1,6 +1,6 @@ name: CI test to build and run SCM regression tests -on: [pull_request, workflow_dispatch] +on: [push,pull_request, workflow_dispatch] jobs: run_scm_rts: From 31c68d722e2e0aa08e5cf8928255d5d6214f8bfc Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 16:31:51 +0000 Subject: [PATCH 06/23] Update CI script --- .github/workflows/ci_run_scm_rts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index 936e9f421..0531feb96 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -1,6 +1,6 @@ name: CI test to build and run SCM regression tests -on: [push,pull_request, workflow_dispatch] +on: [pull_request, workflow_dispatch] jobs: run_scm_rts: @@ -21,8 +21,8 @@ jobs: sp_ROOT: /home/runner/NCEPLIBS-sp w3emc_ROOT: /home/runner/myw3emc SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm - suites: SCM_GFS_v15p2,SCM_GFS_v16,SCM_GFS_v17_p8,SCM_HRRR,SCM_RRFS_v1beta,SCM_RAP,SCM_WoFS_v0 - suites_ps: SCM_GFS_v15p2_ps,SCM_GFS_v16_ps,SCM_GFS_v17_p8_ps,SCM_HRRR_ps,SCM_RRFS_v1beta_ps,SCM_RAP_ps,SCM_WoFS_v0_ps + suites: SCM_GFS_v15p2,SCM_GFS_v16,SCM_GFS_v17_p8,SCM_HRRR,SCM_RRFS_v1beta,SCM_RAP,SCM_WoFS_v0,SCM_RRFS_v1,SCM_GFS_v17_HR3,SCM_GFS_v17_HR3_RRTMGP + suites_ps: SCM_GFS_v15p2_ps,SCM_GFS_v16_ps,SCM_GFS_v17_p8_ps,SCM_HRRR_ps,SCM_RRFS_v1beta_ps,SCM_RAP_ps,SCM_WoFS_v0_ps,SCM_RRFS_v1_ps,SCM_GFS_v17_HR3_ps,SCM_GFS_v17_HR3_RRTMGP_ps dir_rt: /home/runner/work/ccpp-scm/ccpp-scm/test/artifact-${{matrix.build-type}} dir_bl: /home/runner/work/ccpp-scm/ccpp-scm/test/BL-${{matrix.build-type}} From 7d77c366489081d8f2cf41ee5ab24387044a5ad8 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 16:32:59 +0000 Subject: [PATCH 07/23] Update CI script --- .github/workflows/ci_run_scm_rts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index 0531feb96..14b4a94f0 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -199,7 +199,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: rt-plots-${{matrix.build-type}} - path: /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out + path: /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out - name: Upload SCM RTs as GitHub Artifact uses: actions/upload-artifact@v2 From 230fb358bfcc1d27ebdcccd0c1bdd8097b493f5c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 16:50:00 +0000 Subject: [PATCH 08/23] Update CI script --- .github/workflows/ci_run_scm_rts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index 14b4a94f0..932d911da 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -51,7 +51,7 @@ jobs: - name: Install NetCDF Python libraries run: | - conda install --yes -c conda-forge h5py>=3.4 netCDF4 f90nml + conda install --yes -c conda-forge h5py>=3.4 netCDF4 f90nml matplotlib - name: Update system packages run: sudo apt-get update From bf5ab1db12ea7fd315d454c5f2e8f36f5d015ec7 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 17:12:30 +0000 Subject: [PATCH 09/23] Update CI script --- test/ci_util.py | 10 ++++++++-- test/cmp_rt2bl.py | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/ci_util.py b/test/ci_util.py index 55d494259..07baebeee 100755 --- a/test/ci_util.py +++ b/test/ci_util.py @@ -26,6 +26,7 @@ def main(): (build_type) = parse_args() # + errmsgs=[] for run in run_list: case_tag = run["case"]+"_"+run["suite"] file_out = "../scm/run/" + "output_"+case_tag+"/output.nc" @@ -33,8 +34,13 @@ def main(): os.system("mkdir -p artifact-"+build_type+"/"+case_tag+"/") os.system("cp " + file_out + " artifact-"+build_type+"/"+case_tag+"/output.nc") else: - print("FAIL: Could not copy output for baseline generation") - exit() + errmsgs.append("Could not copy output for baseline generation "+ case_tag) + # end if + # end for + + for errmsg in errmsgs: + print(errmsg) + # end for if __name__ == '__main__': main() diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 7884a5dfa..7c799de26 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -220,10 +220,6 @@ def main(): # end if # end for - # Bundle all plots into tarball for artifact in github action. - com = 'tar -cvf scm_rt_plots.tar scm_rt_out/*' - result = os.system(com) - # if error_count == 0: print("ALL TESTS PASSED, OUTPUT IS IDENTICAL.") From a302d5aef92b2851d6a39d2a61df94573fef9020 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 17:26:18 +0000 Subject: [PATCH 10/23] Update CI script --- test/cmp_rt2bl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 7c799de26..67fe3e6c4 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -130,6 +130,9 @@ def plot_results(file_BL,file_RT): # Comppute differences and determine valid plot range(s). dz = z1-z2 + print("np.min(z1): ",np.min(z1)) + print("np.max(z1): ",np.max(z1)) + print("step: ",(np.max(z1)-np.min(z1))*0.05) clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) if np.count_nonzero(dz) > 0: clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) From 824dfa631ae41880e383aa6b3d1041e57ff63669 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 18:07:49 +0000 Subject: [PATCH 11/23] Update CI script --- test/cmp_rt2bl.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 67fe3e6c4..f178902e2 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -133,10 +133,15 @@ def plot_results(file_BL,file_RT): print("np.min(z1): ",np.min(z1)) print("np.max(z1): ",np.max(z1)) print("step: ",(np.max(z1)-np.min(z1))*0.05) - clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) - if np.count_nonzero(dz) > 0: - clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) + if np.min(z1) != np.max(z1): + clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) + if np.count_nonzero(dz) > 0: + clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) + else: + clevd = 0 + # end if else: + clev = 0 clevd = 0 # end if From 659f1f017668b9548eaf3d35048e760bde03250a Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 19:00:40 +0000 Subject: [PATCH 12/23] Update CI script --- test/cmp_rt2bl.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index f178902e2..6a0241c2b 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -88,7 +88,12 @@ def plot_results(file_BL,file_RT): # endif plt_range = [np.min(SCM_BL[var]),np.max(SCM_BL[var])] plt_ranged = [-1*abs(np.max(SCM_BL[var])),abs(np.max(SCM_BL[var]))] - + print("var: ",var) + print("x1: ",x1) + print("x2: ",x2) + print("y1: ",y1) + print("y2: ",y2) + # Make figure fig = plt.figure(figsize=(13,10)) # Baselines and SCM RTs on same plot @@ -103,7 +108,7 @@ def plot_results(file_BL,file_RT): plt.subplot(2,1,2) plt.title("Difference (blue - black)") plt.plot(x1, y1 - y2, color='red') - plt.plot(x1, np.zeros(len(x1)), color='grey',linestyle='dashed') + plt.plot(x1, np.zeros(len(y1)), color='grey',linestyle='dashed') plt.ylim(plt_ranged) plt.ylabel('('+SCM_RT[var].units+')') plt.xlabel('(hours)') @@ -130,9 +135,6 @@ def plot_results(file_BL,file_RT): # Comppute differences and determine valid plot range(s). dz = z1-z2 - print("np.min(z1): ",np.min(z1)) - print("np.max(z1): ",np.max(z1)) - print("step: ",(np.max(z1)-np.min(z1))*0.05) if np.min(z1) != np.max(z1): clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) if np.count_nonzero(dz) > 0: From e4ebc56c39badf94a21b4d7db46f5191af58a98c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 19:16:52 +0000 Subject: [PATCH 13/23] Update CI script --- test/cmp_rt2bl.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 6a0241c2b..dce37c19c 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -86,13 +86,6 @@ def plot_results(file_BL,file_RT): y1 = SCM_BL[var][:] y2 = SCM_RT[var][:] # endif - plt_range = [np.min(SCM_BL[var]),np.max(SCM_BL[var])] - plt_ranged = [-1*abs(np.max(SCM_BL[var])),abs(np.max(SCM_BL[var]))] - print("var: ",var) - print("x1: ",x1) - print("x2: ",x2) - print("y1: ",y1) - print("y2: ",y2) # Make figure fig = plt.figure(figsize=(13,10)) @@ -101,7 +94,6 @@ def plot_results(file_BL,file_RT): plt.title(SCM_BL[var].description) plt.plot(x1, y1, color='blue') plt.plot(x2, y2, color='black') - plt.ylim(plt_range) plt.ylabel('('+SCM_BL[var].units+')') plt.xlabel('(hours)') # Difference (Baseline-SCMRT) @@ -109,7 +101,6 @@ def plot_results(file_BL,file_RT): plt.title("Difference (blue - black)") plt.plot(x1, y1 - y2, color='red') plt.plot(x1, np.zeros(len(y1)), color='grey',linestyle='dashed') - plt.ylim(plt_ranged) plt.ylabel('('+SCM_RT[var].units+')') plt.xlabel('(hours)') # From 266895fe9b911d0f392258a0d7bbb0a9fcdf9f0b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 19:37:34 +0000 Subject: [PATCH 14/23] Update CI script --- test/cmp_rt2bl.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index dce37c19c..ad6a88ef4 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -143,6 +143,11 @@ def plot_results(file_BL,file_RT): # Baselines plt.subplot(3,1,1) plt.title(SCM_BL[var].description, fontsize=12) + print("var: ",var) + print("x1: ",x1) + print("y1: ",y1) + print("z1: ",z1) + plt.contourf(x1, y1, z1, clev, cmap='YlGnBu') plt.ylim(1000,200) plt.ylabel('(Pa)') From 34e92982a54d9bc2f3ea942c87c80de8ba95f01f Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 19:49:29 +0000 Subject: [PATCH 15/23] Update CI script --- test/cmp_rt2bl.py | 67 ++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index ad6a88ef4..a48b20efc 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -139,46 +139,43 @@ def plot_results(file_BL,file_RT): # end if # Finally, make figure. - fig = plt.figure(figsize=(13,10)) - # Baselines - plt.subplot(3,1,1) - plt.title(SCM_BL[var].description, fontsize=12) - print("var: ",var) - print("x1: ",x1) - print("y1: ",y1) - print("z1: ",z1) - - plt.contourf(x1, y1, z1, clev, cmap='YlGnBu') - plt.ylim(1000,200) - plt.ylabel('(Pa)') - cbr = plt.colorbar() - cbr.set_label('('+SCM_RT[var].units+')') - # SCM RTs - plt.subplot(3,1,2) - plt.contourf(x2, y2, z2, clev, cmap='YlGnBu') - plt.ylim(1000,200) - plt.ylabel('(Pa)') - plt.xlabel('(hours)') - cbr = plt.colorbar() - cbr.set_label('('+SCM_RT[var].units+')') - # Only plot differences if they exist. - if np.count_nonzero(dz) > 0: - plt.subplot(3,1,3) - plt.title("Difference (top - middle)", fontsize=8) - plt.contourf(x2, y2, dz, clevd, cmap='bwr') + if (len(x1) > 1): + fig = plt.figure(figsize=(13,10)) + # Baselines + plt.subplot(3,1,1) + plt.title(SCM_BL[var].description, fontsize=12) + plt.contourf(x1, y1, z1, clev, cmap='YlGnBu') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # SCM RTs + plt.subplot(3,1,2) + plt.contourf(x2, y2, z2, clev, cmap='YlGnBu') plt.ylim(1000,200) plt.ylabel('(Pa)') plt.xlabel('(hours)') cbr = plt.colorbar() cbr.set_label('('+SCM_RT[var].units+')') - # end if (no differences exist) - fileOUT = 'scm.' + var +'.png' - plt.savefig(fileOUT) - # - plot_files.append(fileOUT) - # end if (fields exist?) - # end if (field requested?) - # end for (fields in file) + # Only plot differences if they exist. + if np.count_nonzero(dz) > 0: + plt.subplot(3,1,3) + plt.title("Difference (top - middle)", fontsize=8) + plt.contourf(x2, y2, dz, clevd, cmap='bwr') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + plt.xlabel('(hours)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # end if (no differences exist) + fileOUT = 'scm.' + var +'.png' + plt.savefig(fileOUT) + # + plot_files.append(fileOUT) + # end if (Have enought pts to plot?) + # end if (fields exist?) + # end if (field requested?) + # end for (fields in file) return(plot_files) From 769905119a1cf9fd32c1938dd99380833d9c3688 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 21:19:46 +0000 Subject: [PATCH 16/23] Update CI script --- test/cmp_rt2bl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index a48b20efc..c966fd425 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -139,7 +139,7 @@ def plot_results(file_BL,file_RT): # end if # Finally, make figure. - if (len(x1) > 1): + if (np.size(x1) > 1): fig = plt.figure(figsize=(13,10)) # Baselines plt.subplot(3,1,1) From d7772b30fee243d3b3eba9346e76d4d66a7d4d60 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 21:32:32 +0000 Subject: [PATCH 17/23] Update CI script --- test/cmp_rt2bl.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index c966fd425..9caebc392 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -88,26 +88,27 @@ def plot_results(file_BL,file_RT): # endif # Make figure - fig = plt.figure(figsize=(13,10)) - # Baselines and SCM RTs on same plot - plt.subplot(2,1,1) - plt.title(SCM_BL[var].description) - plt.plot(x1, y1, color='blue') - plt.plot(x2, y2, color='black') - plt.ylabel('('+SCM_BL[var].units+')') - plt.xlabel('(hours)') - # Difference (Baseline-SCMRT) - plt.subplot(2,1,2) - plt.title("Difference (blue - black)") - plt.plot(x1, y1 - y2, color='red') - plt.plot(x1, np.zeros(len(y1)), color='grey',linestyle='dashed') - plt.ylabel('('+SCM_RT[var].units+')') - plt.xlabel('(hours)') - # - fileOUT = 'scm.' + var +'.png' - plt.savefig(fileOUT) - # - plot_files.append(fileOUT) + if (np.size(x1) > 1): + fig = plt.figure(figsize=(13,10)) + # Baselines and SCM RTs on same plot + plt.subplot(2,1,1) + plt.title(SCM_BL[var].description) + plt.plot(x1, y1, color='blue') + plt.plot(x2, y2, color='black') + plt.ylabel('('+SCM_BL[var].units+')') + plt.xlabel('(hours)') + # Difference (Baseline-SCMRT) + plt.subplot(2,1,2) + plt.title("Difference (blue - black)") + plt.plot(x1, y1 - y2, color='red') + plt.plot(x1, np.zeros(len(y1)), color='grey',linestyle='dashed') + plt.ylabel('('+SCM_RT[var].units+')') + plt.xlabel('(hours)') + # + fileOUT = 'scm.' + var +'.png' + plt.savefig(fileOUT) + # + plot_files.append(fileOUT) # three-dimensional variables elif len(SCM_BL[var].shape) == 3: z1 = np.transpose(SCM_BL[var][:,:,0]).squeeze() From b6fb86ecfc3321c3a430bc085b521dcb88b2a7b8 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 21:47:52 +0000 Subject: [PATCH 18/23] Update CI script --- test/cmp_rt2bl.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 9caebc392..36722403b 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -127,17 +127,17 @@ def plot_results(file_BL,file_RT): # Comppute differences and determine valid plot range(s). dz = z1-z2 - if np.min(z1) != np.max(z1): - clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) - if np.count_nonzero(dz) > 0: - clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) - else: - clevd = 0 - # end if - else: - clev = 0 - clevd = 0 - # end if + #if np.min(z1) != np.max(z1): + # clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) + # if np.count_nonzero(dz) > 0: + # clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) + # else: + # clevd = 0 + # # end if + #else: + # clev = 0 + # clevd = 0 + ## end if # Finally, make figure. if (np.size(x1) > 1): @@ -145,14 +145,14 @@ def plot_results(file_BL,file_RT): # Baselines plt.subplot(3,1,1) plt.title(SCM_BL[var].description, fontsize=12) - plt.contourf(x1, y1, z1, clev, cmap='YlGnBu') + plt.contourf(x1, y1, z1, 20, cmap='YlGnBu') plt.ylim(1000,200) plt.ylabel('(Pa)') cbr = plt.colorbar() cbr.set_label('('+SCM_RT[var].units+')') # SCM RTs plt.subplot(3,1,2) - plt.contourf(x2, y2, z2, clev, cmap='YlGnBu') + plt.contourf(x2, y2, z2, 20, cmap='YlGnBu') plt.ylim(1000,200) plt.ylabel('(Pa)') plt.xlabel('(hours)') @@ -162,7 +162,7 @@ def plot_results(file_BL,file_RT): if np.count_nonzero(dz) > 0: plt.subplot(3,1,3) plt.title("Difference (top - middle)", fontsize=8) - plt.contourf(x2, y2, dz, clevd, cmap='bwr') + plt.contourf(x2, y2, dz, 20, cmap='bwr') plt.ylim(1000,200) plt.ylabel('(Pa)') plt.xlabel('(hours)') From cf36f6191d85cc9c5e3d7787c364d841c6c0c578 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 21 May 2024 22:18:42 +0000 Subject: [PATCH 19/23] Update CI script --- test/cmp_rt2bl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 36722403b..0b8354d31 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -57,7 +57,13 @@ def plot_results(file_BL,file_RT): "graupel_rate_accum","conv_prcp_rate_accum","max_cloud_fraction", \ "toa_total_albedo","vert_int_lwp_mp","vert_int_iwp_mp", \ "vert_int_lwp_cf","vert_int_iwp_cf"] - + # Use subset of available SCM output for plots. + vars2plot = ["qv","T","u","v","ql","qi","qc","sfc_dwn_sw","sfc_up_sw", \ + "sfc_net_sw","sfc_dwn_lw", "u10m","v10m","hpbl","gflux", \ + "qv_force_tend","T_force_tend","u_force_tend","v_force_tend","w_ls", \ + "u_g","v_g","dT_dt_rad_forc","h_advec_thil","h_advec_qt", \ + "v_advec_thil","v_advec_qt","T_s","lhf","shf","tprcp_inst", \ + "tprcp_rate_inst","t2m","q2m","ustar","tsfc","tau_u","tau_v"] # Open SCM datasets SCM_BL = Dataset(file_BL) SCM_RT = Dataset(file_RT) From bd8ff34d2de3064634fbf700ce5beb42376ec958 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 22 May 2024 15:39:10 +0000 Subject: [PATCH 20/23] Add script to fetch aerosol data to workflow --- .github/workflows/ci_run_scm_rts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index 932d911da..cdab62983 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -150,6 +150,7 @@ jobs: cd ${SCM_ROOT} ./contrib/get_all_static_data.sh ./contrib/get_thompson_tables.sh + ./contrib/get_aerosol_climo.sh - name: Configure build with CMake (Release) if: contains(matrix.build-type, 'Release') From e5a3413ce5ccbc212ae815bfac3345c19032a0ea Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 22 May 2024 15:54:07 +0000 Subject: [PATCH 21/23] Bug fix in supported suites --- scm/src/suite_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm/src/suite_info.py b/scm/src/suite_info.py index 69b0b0a73..5564287f2 100755 --- a/scm/src/suite_info.py +++ b/scm/src/suite_info.py @@ -45,7 +45,7 @@ def timestep(self, value): suite_list.append(suite('SCM_GFS_v16', 'tracers_GFS_v16.txt', 'input_GFS_v16.nml', 600.0, 1800.0, True )) suite_list.append(suite('SCM_GFS_v17_p8', 'tracers_GFS_v17_p8.txt', 'input_GFS_v17_p8.nml', 600.0, 600.0, True )) suite_list.append(suite('SCM_GFS_v17_HR3', 'tracers_GFS_v17_HR3.txt', 'input_GFS_v17_HR3.nml', 600.0, 600.0, True )) -suite_list.append(suite('SCM_GFS_v17_HR3_RRTMGP','tracers_GFS_v17_p8.txt', 'input_GFS_v17_HR3_RRTMGP.nml', 600.0, 600.0, True )) +suite_list.append(suite('SCM_GFS_v17_HR3_RRTMGP','tracers_GFS_v17_HR3.txt', 'input_GFS_v17_HR3_RRTMGP.nml', 600.0, 600.0, True )) suite_list.append(suite('SCM_RAP', 'tracers_RAP.txt', 'input_RAP.nml', 600.0, 600.0 , True )) suite_list.append(suite('SCM_RRFS_v1', 'tracers_RRFS_v1.txt', 'input_RRFS_v1.nml', 600.0, 600.0 , True )) suite_list.append(suite('SCM_RRFS_v1beta', 'tracers_RRFS_v1beta.txt', 'input_RRFS_v1beta.nml', 600.0, 600.0 , True )) From 1a48be5054402290a57a82ab6c81c45e601b607b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 22 May 2024 22:19:54 +0000 Subject: [PATCH 22/23] Updated CI. generalized plotting --- .github/workflows/ci_run_scm_rts.yml | 2 +- test/cmp_rt2bl.py | 211 ++++----------------------- test/plot_scm_out.py | 182 +++++++++++++++++++++++ 3 files changed, 211 insertions(+), 184 deletions(-) create mode 100755 test/plot_scm_out.py diff --git a/.github/workflows/ci_run_scm_rts.yml b/.github/workflows/ci_run_scm_rts.yml index cdab62983..f4096681d 100644 --- a/.github/workflows/ci_run_scm_rts.yml +++ b/.github/workflows/ci_run_scm_rts.yml @@ -194,7 +194,7 @@ jobs: - name: Compare SCM RT output to baselines run: | cd ${SCM_ROOT}/test - ./cmp_rt2bl.py --build_type ${{matrix.build-type}} --dir_rt ${dir_rt} --dir_bl ${dir_bl} + ./cmp_rt2bl.py --dir_rt ${dir_rt} --dir_bl ${dir_bl} - name: Upload plots of SCM Baselines/RTs as GitHub Artifact. uses: actions/upload-artifact@v2 diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index 0b8354d31..91dcb27d5 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -10,186 +10,26 @@ from rt_test_cases import run_list from os.path import exists import argparse -from netCDF4 import Dataset -import numpy as np -import matplotlib.pyplot as plt +from plot_scm_out import plot_results # parser = argparse.ArgumentParser() -parser.add_argument('-b', '--build_type', help='SCM build type') -parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output') -parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines') +parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output') +parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines') +parser.add_argument('-plt', '--do_plot', help='If true, create plots of SCM RT output', action='store_true') # def parse_args(): - args = parser.parse_args() - build_type = args.build_type - dir_rt = args.dir_rt - dir_bl = args.dir_bl - - return (build_type,dir_rt,dir_bl) - -# -def plot_results(file_BL,file_RT): - # List of SCM output fields to plot (This everything) - vars2plot = ["time_inst","time_diag","time_swrad","time_lwrad","time_rad","pres", \ - "pres_i","sigma","sigma_i","pres_s","qv","T","u","v","ql","qi","qc", \ - "qv_force_tend","T_force_tend","u_force_tend","v_force_tend","w_ls", \ - "u_g","v_g","dT_dt_rad_forc","h_advec_thil","h_advec_qt", \ - "v_advec_thil","v_advec_qt","T_s","lhf","shf","tprcp_inst", \ - "tprcp_rate_inst","t2m","q2m","ustar","tsfc","tau_u","tau_v","upd_mf", \ - "dwn_mf","det_mf","sfc_up_lw_land","sfc_up_lw_ice","sfc_up_lw_water", \ - "sfc_up_sw_dir_nir","sfc_up_sw_dif_nir","sfc_up_sw_dir_vis", \ - "sfc_up_sw_dif_vis","sfc_dwn_sw_dir_nir","sfc_dwn_sw_dif_nir", \ - "sfc_dwn_sw_dir_vis","sfc_dwn_sw_dif_vis","mp_prcp_inst", \ - "dcnv_prcp_inst","scnv_prcp_inst","pwat","dT_dt_lwrad","dT_dt_swrad", \ - "dT_dt_pbl","dT_dt_deepconv","dT_dt_shalconv","dT_dt_micro", \ - "dT_dt_ogwd","dT_dt_cgwd","dT_dt_phys","dT_dt_nonphys","dq_dt_pbl", \ - "dq_dt_deepconv","dq_dt_shalconv","dq_dt_micro","dq_dt_phys", \ - "dq_dt_nonphys","doz_dt_pbl","doz_dt_prodloss","doz_dt_oz","doz_dt_T", \ - "doz_dt_ovhd","doz_dt_phys","doz_dt_nonphys","du_dt_pbl","du_dt_ogwd", \ - "du_dt_deepconv","du_dt_cgwd","du_dt_shalconv","du_dt_phys", \ - "du_dt_nonphys","dv_dt_pbl","dv_dt_ogwd","dv_dt_deepconv","dv_dt_cgwd", \ - "dv_dt_shalconv","dv_dt_phys","dv_dt_nonphys","sfc_dwn_sw","sfc_up_sw", \ - "sfc_net_sw","sfc_dwn_lw","gflux","u10m","v10m","hpbl","tprcp_accum", \ - "ice_accum","snow_accum","graupel_accum","conv_prcp_accum", \ - "tprcp_rate_accum","ice_rate_accum","snow_rate_accum", \ - "graupel_rate_accum","conv_prcp_rate_accum","max_cloud_fraction", \ - "toa_total_albedo","vert_int_lwp_mp","vert_int_iwp_mp", \ - "vert_int_lwp_cf","vert_int_iwp_cf"] - # Use subset of available SCM output for plots. - vars2plot = ["qv","T","u","v","ql","qi","qc","sfc_dwn_sw","sfc_up_sw", \ - "sfc_net_sw","sfc_dwn_lw", "u10m","v10m","hpbl","gflux", \ - "qv_force_tend","T_force_tend","u_force_tend","v_force_tend","w_ls", \ - "u_g","v_g","dT_dt_rad_forc","h_advec_thil","h_advec_qt", \ - "v_advec_thil","v_advec_qt","T_s","lhf","shf","tprcp_inst", \ - "tprcp_rate_inst","t2m","q2m","ustar","tsfc","tau_u","tau_v"] - # Open SCM datasets - SCM_BL = Dataset(file_BL) - SCM_RT = Dataset(file_RT) - - plot_files = [] - for var in SCM_BL.variables.keys(): - if (var in vars2plot): - # Handle temporal axis. - # There are 4 different dimensions in the SCM output, identified by the suffix "_dim". - # Here the suffix is stripped and used to identify the temporal dimenesion (index 0 in netcdf file) - timeD = SCM_BL[var].dimensions[0] - timeD = timeD[0:len(timeD)-4] - x1 = SCM_BL[timeD][:].squeeze()/3600. #seconds -> hours - x2 = SCM_RT[timeD][:].squeeze()/3600. #seconds - >hours - # Is this a 2D (time, x) variable? (Really 1D since x=1 in SCM) - is2D = False - if (len(SCM_BL[var].dimensions)==2): - is2D = True - # endif - # one/two-dimensional variables - if (len(SCM_BL[var].shape) != 3): - if (is2D): - y1 = SCM_BL[var][:,0].squeeze() - y2 = SCM_RT[var][:,0].squeeze() - else: - y1 = SCM_BL[var][:] - y2 = SCM_RT[var][:] - # endif - - # Make figure - if (np.size(x1) > 1): - fig = plt.figure(figsize=(13,10)) - # Baselines and SCM RTs on same plot - plt.subplot(2,1,1) - plt.title(SCM_BL[var].description) - plt.plot(x1, y1, color='blue') - plt.plot(x2, y2, color='black') - plt.ylabel('('+SCM_BL[var].units+')') - plt.xlabel('(hours)') - # Difference (Baseline-SCMRT) - plt.subplot(2,1,2) - plt.title("Difference (blue - black)") - plt.plot(x1, y1 - y2, color='red') - plt.plot(x1, np.zeros(len(y1)), color='grey',linestyle='dashed') - plt.ylabel('('+SCM_RT[var].units+')') - plt.xlabel('(hours)') - # - fileOUT = 'scm.' + var +'.png' - plt.savefig(fileOUT) - # - plot_files.append(fileOUT) - # three-dimensional variables - elif len(SCM_BL[var].shape) == 3: - z1 = np.transpose(SCM_BL[var][:,:,0]).squeeze() - z2 = np.transpose(SCM_RT[var][:,:,0]).squeeze() - - # vertical axis - y1 = SCM_BL["pres"][0,:].squeeze()*0.01 - y2 = SCM_RT["pres"][0,:].squeeze()*0.01 - nlev = SCM_BL[var][:,:,0].shape[1] - # Layer (nlev) quantities are the default, so check for case where we have an - # interface (nlev+1) variable to plot. - if (SCM_BL[var][:,:,0].shape[1] > len(y1)): - y1 = SCM_BL["pres_i"][0,:].squeeze()*0.01 - y2 = SCM_RT["pres_i"][0,:].squeeze()*0.01 - # endif - - # Comppute differences and determine valid plot range(s). - dz = z1-z2 - #if np.min(z1) != np.max(z1): - # clev = np.arange(np.min(z1),np.max(z1),(np.max(z1)-np.min(z1))*0.05) - # if np.count_nonzero(dz) > 0: - # clevd = np.arange(np.min(dz),np.max(dz),(np.max(dz)-np.min(dz))*0.05) - # else: - # clevd = 0 - # # end if - #else: - # clev = 0 - # clevd = 0 - ## end if - - # Finally, make figure. - if (np.size(x1) > 1): - fig = plt.figure(figsize=(13,10)) - # Baselines - plt.subplot(3,1,1) - plt.title(SCM_BL[var].description, fontsize=12) - plt.contourf(x1, y1, z1, 20, cmap='YlGnBu') - plt.ylim(1000,200) - plt.ylabel('(Pa)') - cbr = plt.colorbar() - cbr.set_label('('+SCM_RT[var].units+')') - # SCM RTs - plt.subplot(3,1,2) - plt.contourf(x2, y2, z2, 20, cmap='YlGnBu') - plt.ylim(1000,200) - plt.ylabel('(Pa)') - plt.xlabel('(hours)') - cbr = plt.colorbar() - cbr.set_label('('+SCM_RT[var].units+')') - # Only plot differences if they exist. - if np.count_nonzero(dz) > 0: - plt.subplot(3,1,3) - plt.title("Difference (top - middle)", fontsize=8) - plt.contourf(x2, y2, dz, 20, cmap='bwr') - plt.ylim(1000,200) - plt.ylabel('(Pa)') - plt.xlabel('(hours)') - cbr = plt.colorbar() - cbr.set_label('('+SCM_RT[var].units+')') - # end if (no differences exist) - fileOUT = 'scm.' + var +'.png' - plt.savefig(fileOUT) - # - plot_files.append(fileOUT) - # end if (Have enought pts to plot?) - # end if (fields exist?) - # end if (field requested?) - # end for (fields in file) - - return(plot_files) + args = parser.parse_args() + dir_rt = args.dir_rt + dir_bl = args.dir_bl + do_plot = args.do_plot + return (dir_rt, dir_bl, do_plot) # def main(): # - (build_type, dir_rt, dir_bl) = parse_args() + (dir_rt, dir_bl, do_plot) = parse_args() # error_count = 0 @@ -200,25 +40,27 @@ def main(): com = "cmp "+file_rt+" "+file_bl+" > logfile.txt" result = os.system(com) if (result != 0): - print("Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline") + print("Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline. Difference plots will be created") error_count = error_count + 1 else: print("Output for "+run["case"]+"_"+run["suite"]+ " is IDENTICAL to baseline") # end if - # Create plots between RTs and baselines - plot_files = plot_results(file_rt,file_bl) - - # Setup output directories for plots. - result = os.system("mkdir -p scm_rt_out/"+run["case"]+"/"+run["suite"]) - - # Archive plots. - com = "mv" - for plot_file in plot_files: - com = com + " " + plot_file + # Create plots between RTs and baselines (only if differences exist) + if (result != 0): + plot_files = plot_results(file_rt, file_bl, do_plot) + + # Setup output directories for plots. + result = os.system("mkdir -p scm_rt_out/"+run["case"]+"/"+run["suite"]) + + # Archive plots. + com = "mv" + for plot_file in plot_files: + com = com + " " + plot_file + # end if + com = com + " scm_rt_out/" + run["case"] + "/" + run["suite"] + result = os.system(com) # end if - com = com + " scm_rt_out/" + run["case"] + "/" + run["suite"] - result = os.system(com) else: if not exists(file_rt): print("Output for "+run["case"]+"_"+run["suite"]+ " is MISSING from output") @@ -230,6 +72,9 @@ def main(): # end if # end for + # Create tarball with plots. + result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*') + # if error_count == 0: print("ALL TESTS PASSED, OUTPUT IS IDENTICAL.") diff --git a/test/plot_scm_out.py b/test/plot_scm_out.py new file mode 100755 index 000000000..4ade445eb --- /dev/null +++ b/test/plot_scm_out.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python + +############################################################################## +# +# This script compares SCM RT output to baselines. +# +############################################################################## +import os +import sys +from rt_test_cases_testing import run_list +from os.path import exists +import argparse +from netCDF4 import Dataset +import numpy as np +import matplotlib.pyplot as plt +# +def plot_results(file_BL, file_RT, plot_RT_only): + # List of SCM output fields to plot (This is everything) + vars2plot = ["time_inst","time_diag","time_swrad","time_lwrad","time_rad","pres", \ + "pres_i","sigma","sigma_i","pres_s","qv","T","u","v","ql","qi","qc", \ + "qv_force_tend","T_force_tend","u_force_tend","v_force_tend","w_ls", \ + "u_g","v_g","dT_dt_rad_forc","h_advec_thil","h_advec_qt", \ + "v_advec_thil","v_advec_qt","T_s","lhf","shf","tprcp_inst", \ + "tprcp_rate_inst","t2m","q2m","ustar","tsfc","tau_u","tau_v","upd_mf", \ + "dwn_mf","det_mf","sfc_up_lw_land","sfc_up_lw_ice","sfc_up_lw_water", \ + "sfc_up_sw_dir_nir","sfc_up_sw_dif_nir","sfc_up_sw_dir_vis", \ + "sfc_up_sw_dif_vis","sfc_dwn_sw_dir_nir","sfc_dwn_sw_dif_nir", \ + "sfc_dwn_sw_dir_vis","sfc_dwn_sw_dif_vis","mp_prcp_inst", \ + "dcnv_prcp_inst","scnv_prcp_inst","pwat","dT_dt_lwrad","dT_dt_swrad", \ + "dT_dt_pbl","dT_dt_deepconv","dT_dt_shalconv","dT_dt_micro", \ + "dT_dt_ogwd","dT_dt_cgwd","dT_dt_phys","dT_dt_nonphys","dq_dt_pbl", \ + "dq_dt_deepconv","dq_dt_shalconv","dq_dt_micro","dq_dt_phys", \ + "dq_dt_nonphys","doz_dt_pbl","doz_dt_prodloss","doz_dt_oz","doz_dt_T", \ + "doz_dt_ovhd","doz_dt_phys","doz_dt_nonphys","du_dt_pbl","du_dt_ogwd", \ + "du_dt_deepconv","du_dt_cgwd","du_dt_shalconv","du_dt_phys", \ + "du_dt_nonphys","dv_dt_pbl","dv_dt_ogwd","dv_dt_deepconv","dv_dt_cgwd", \ + "dv_dt_shalconv","dv_dt_phys","dv_dt_nonphys","sfc_dwn_sw","sfc_up_sw", \ + "sfc_net_sw","sfc_dwn_lw","gflux","u10m","v10m","hpbl","tprcp_accum", \ + "ice_accum","snow_accum","graupel_accum","conv_prcp_accum", \ + "tprcp_rate_accum","ice_rate_accum","snow_rate_accum", \ + "graupel_rate_accum","conv_prcp_rate_accum","max_cloud_fraction", \ + "toa_total_albedo","vert_int_lwp_mp","vert_int_iwp_mp", \ + "vert_int_lwp_cf","vert_int_iwp_cf"] + # Use subset of available SCM output for plots. + vars2plot = ["qv","T","u","v","ql","qi","qc","sfc_dwn_sw","sfc_up_sw", \ + "sfc_net_sw","sfc_dwn_lw", "u10m","v10m","hpbl","gflux", \ + "qv_force_tend","T_force_tend","u_force_tend","v_force_tend","w_ls", \ + "u_g","v_g","dT_dt_rad_forc","h_advec_thil","h_advec_qt", \ + "v_advec_thil","v_advec_qt","T_s","lhf","shf","tprcp_inst", \ + "tprcp_rate_inst","t2m","q2m","ustar","tsfc","tau_u","tau_v"] + + # Open SCM datasets + SCM_BL = Dataset(file_BL) + SCM_RT = Dataset(file_RT) + + plot_diff = True + if plot_RT_only: + plot_diff = False + # end if + + plot_files = [] + for var in SCM_BL.variables.keys(): + if (var in vars2plot): + # Handle temporal axis. + # There are 4 different dimensions in the SCM output, identified by the suffix "_dim". + # Here the suffix is stripped and used to identify the temporal dimenesion (index 0 in netcdf file) + timeD = SCM_BL[var].dimensions[0] + timeD = timeD[0:len(timeD)-4] + x1 = SCM_BL[timeD][:].squeeze()/3600. #seconds -> hours + x2 = SCM_RT[timeD][:].squeeze()/3600. #seconds - >hours + # Is this a 2D (time, x) variable? (Really 1D since x=1 in SCM) + is2D = False + if (len(SCM_BL[var].dimensions)==2): + is2D = True + # endif + # one/two-dimensional variables + if (len(SCM_BL[var].shape) != 3): + if (is2D): + y1 = SCM_BL[var][:,0].squeeze() + y2 = SCM_RT[var][:,0].squeeze() + else: + y1 = SCM_BL[var][:] + y2 = SCM_RT[var][:] + # endif + + # Make figure + if (np.size(x1) > 1): + fig = plt.figure(figsize=(13,10)) + # Baselines and SCM RTs on same plot + if plot_diff: + plt.subplot(2,1,1) + # end if + plt.title(SCM_BL[var].description) + if plot_RT_only: + plt.plot(x1, y1, color='blue') + else: + plt.plot(x1, y1, color='blue') + plt.plot(x2, y2, color='black') + # end if + plt.ylabel('('+SCM_BL[var].units+')') + plt.xlabel('(hours)') + + # Difference (Baseline-SCMRT) + if plot_diff: + plt.subplot(2,1,2) + plt.title("Difference (blue - black)") + plt.plot(x1, y1 - y2, color='red') + plt.plot(x1, np.zeros(len(y1)), color='grey',linestyle='dashed') + plt.ylabel('('+SCM_RT[var].units+')') + plt.xlabel('(hours)') + # + fileOUT = 'scm.' + var +'.png' + plt.savefig(fileOUT) + # + plot_files.append(fileOUT) + # three-dimensional variables + elif len(SCM_BL[var].shape) == 3: + z1 = np.transpose(SCM_BL[var][:,:,0]).squeeze() + z2 = np.transpose(SCM_RT[var][:,:,0]).squeeze() + + # vertical axis + y1 = SCM_BL["pres"][0,:].squeeze()*0.01 + y2 = SCM_RT["pres"][0,:].squeeze()*0.01 + nlev = SCM_BL[var][:,:,0].shape[1] + # Layer (nlev) quantities are the default, so check for case where we have an + # interface (nlev+1) variable to plot. + if (SCM_BL[var][:,:,0].shape[1] > len(y1)): + y1 = SCM_BL["pres_i"][0,:].squeeze()*0.01 + y2 = SCM_RT["pres_i"][0,:].squeeze()*0.01 + # endif + + # Comppute differences and determine valid plot range(s). + dz = z1-z2 + + # Finally, make figure. + if (np.size(x1) > 1): + fig = plt.figure(figsize=(13,10)) + if plot_RT_only: + plt.contourf(x2, y2, z2, 20, cmap='YlGnBu') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + plt.xlabel('(hours)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + else: + # Baselines + plt.subplot(3,1,1) + plt.title(SCM_BL[var].description, fontsize=12) + plt.contourf(x1, y1, z1, 20, cmap='YlGnBu') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # SCM RTs + plt.subplot(3,1,2) + plt.contourf(x2, y2, z2, 20, cmap='YlGnBu') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + plt.xlabel('(hours)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # Only plot differences if they exist. + if np.count_nonzero(dz) > 0: + plt.subplot(3,1,3) + plt.title("Difference (top - middle)", fontsize=8) + plt.contourf(x2, y2, dz, 20, cmap='bwr') + plt.ylim(1000,200) + plt.ylabel('(Pa)') + plt.xlabel('(hours)') + cbr = plt.colorbar() + cbr.set_label('('+SCM_RT[var].units+')') + # end if (no differences exist) + fileOUT = 'scm.' + var +'.png' + plt.savefig(fileOUT) + # + plot_files.append(fileOUT) + # end if (Have enought pts to plot?) + # end if (fields exist?) + # end if (field requested?) + # end for (fields in file) + + return(plot_files) From bc615f0c5394b9a7e3425ed4330db3d177b1cac8 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 23 May 2024 15:35:59 +0000 Subject: [PATCH 23/23] Fix to CI script --- test/plot_scm_out.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/plot_scm_out.py b/test/plot_scm_out.py index 4ade445eb..7641e80f9 100755 --- a/test/plot_scm_out.py +++ b/test/plot_scm_out.py @@ -5,11 +5,6 @@ # This script compares SCM RT output to baselines. # ############################################################################## -import os -import sys -from rt_test_cases_testing import run_list -from os.path import exists -import argparse from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt