diff --git a/doc/index.rst b/doc/index.rst deleted file mode 100644 index 94902242..00000000 --- a/doc/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -Welcom to the SCM Workflow Users' Guide -======================================= - -.. toctree:: - :maxdepth: 2 - :numbered: - - Introduction - Running diff --git a/scripts/html/config_template.json b/docs/config_template.json similarity index 100% rename from scripts/html/config_template.json rename to docs/config_template.json diff --git a/scripts/html/generate_config.py b/docs/generate_config.py similarity index 90% rename from scripts/html/generate_config.py rename to docs/generate_config.py index e3ccf38e..b619e03e 100644 --- a/scripts/html/generate_config.py +++ b/docs/generate_config.py @@ -48,8 +48,8 @@ dt = d.split("_dt", 1)[1].split("_dti", 1)[0] dti = d.split("_dti", 1)[1] - dt_dti = f"{dt}_{dti}" - label = f"{dt}s / {dti}s" + dt_dti = f"dt{dt}_dti{dti}" + label = f"{dt} / {dti}" timesteps[dt_dti] = {"label": label} @@ -62,11 +62,11 @@ } config = { - "base_plot_dir": f"../../scm_plots/{PLOT_DIRNAME}", + "base_plot_dir": f"../scm_plots/{PLOT_DIRNAME}", "cases": cases } -config_path = os.path.join(SCRIPT_DIR,"config.json") +config_path = os.path.join(PLOT_ROOT,"config.json") with open(config_path, "w") as f: json.dump(config, f, indent=2) diff --git a/scripts/html/index.html b/docs/index.html similarity index 53% rename from scripts/html/index.html rename to docs/index.html index 6770f4e5..2d5a6b98 100644 --- a/scripts/html/index.html +++ b/docs/index.html @@ -13,10 +13,10 @@

SCM Viewer

Select Plot Configuration

- Tempo v3 - Thompson - Tempo vs Thomp - Dx Comparison +
+

Tempo v3

+

Comparison of TempoV3 and Thompson microphysics and their sensitivity for select (inner) timsteps.

+
diff --git a/scripts/html/style.css b/docs/style.css similarity index 75% rename from scripts/html/style.css rename to docs/style.css index 2666ccdf..186780a3 100644 --- a/scripts/html/style.css +++ b/docs/style.css @@ -136,3 +136,53 @@ img { max-width: 100%; } } +/* =============================== + Backlink + =============================== */ +#backLink { + color: white; + text-decoration: none; /* optional */ +} + +#backLink:visited { + color: white; +} + +#backLink:hover { + color: #dddddd; /* optional lighter shade on hover */ +} + +/* Card styling */ +.config-card { + background: #f4f4f4; + border: 1px solid #d0d0d0; + border-radius: 6px; + padding: 16px; + margin-bottom: 20px; +} + +.config-card h3 { + margin-top: 0; +} + +.config-card p { + margin-bottom: 15px; +} + +.config-title { + display: inline-block; + padding: 10px 18px; + background-color: #003366; + color: white; + text-decoration: none; + border-radius: 4px; + font-weight: bold; +} + +.config-title:hover { + background-color: #004c99; +} + +.config-title:visited { + color: white; +} diff --git a/doc/Introduction.rst b/docs/users_guide/Introduction.rst similarity index 100% rename from doc/Introduction.rst rename to docs/users_guide/Introduction.rst diff --git a/doc/Running.rst b/docs/users_guide/Running.rst similarity index 100% rename from doc/Running.rst rename to docs/users_guide/Running.rst diff --git a/doc/conf.py b/docs/users_guide/conf.py similarity index 100% rename from doc/conf.py rename to docs/users_guide/conf.py diff --git a/docs/users_guide/index.rst b/docs/users_guide/index.rst new file mode 100644 index 00000000..0c38fcd2 --- /dev/null +++ b/docs/users_guide/index.rst @@ -0,0 +1,9 @@ +Welcome to the SCM Workflow Users' Guide +======================================== + +.. toctree:: + :maxdepth: 2 + :numbered: + + Introduction + Running diff --git a/scripts/html/viewer.html b/docs/viewer.html similarity index 96% rename from scripts/html/viewer.html rename to docs/viewer.html index b7623719..3503f0c1 100644 --- a/scripts/html/viewer.html +++ b/docs/viewer.html @@ -34,7 +34,7 @@

Config Selection

- + @@ -85,7 +85,8 @@

SCM Case Comparison Viewer

const params = new URLSearchParams(window.location.search); const configName = params.get("config"); - const configPath = `../../scm_plots/${configName}/config.json`; + const configPath = `scm_plots/${configName}/config.json`; + console.log("configPath:", configPath); let CONFIG = {}; let CURRENT_CASE = null; @@ -259,7 +260,11 @@

SCM Case Comparison Viewer

if (!area || !timestep ) return null; - return `${caseName}_SCM_${suite}_area${area}_${timestep}`; + const match = timestep.match(/dt(\d+)s?_dti(\d+)s?/); + const dt = match[1]; + const dti = match[2]; + + return `${caseName}_SCM_${suite}_area${area}_dt${dt}s_dti${dti}s`; } function populateFigures(caseKey) { diff --git a/scripts/derecho_template b/scripts/derecho_template old mode 100755 new mode 100644 diff --git a/scripts/html/config.json b/scripts/html/config.json deleted file mode 100644 index a4ddc210..00000000 --- a/scripts/html/config.json +++ /dev/null @@ -1,580 +0,0 @@ -{ - "base_plot_dir": "../../scm_plots/plots_dtdiv2_comp", - "cases": { - "COMBLE": { - "label": "COMBLE", - "suites": { - "GFS_v17_p8_ugwpv1": { - "label": "GFS_v17_p8_ugwpv1" - }, - "GFS_v17_p8_ugwpv1_tempo": { - "label": "GFS_v17_p8_ugwpv1_tempo" - }, - "comp": { - "label": "Comparison" - } - }, - "areas": { - "12.04km": { - "label": "12.04km" - } - }, - "timesteps": { - "600_300": { "label": "600s / 300s" }, - "600_150": { "label": "600s / 150s" }, - "300_150": { "label": "300s / 150s" } - }, - "figures": { - "mean": { - "label": "Mean Profiles", - "files": { - "profiles_mean_T.png": "Temperature", - "profiles_mean_th.png": "Potential Temperature", - "profiles_mean_rh.png": "Relative Humidity", - "profiles_mean_qv.png": "Qv", - "profiles_mean_qi.png": "Qi", - "profiles_mean_qi_tot.png": " Total Qi (qi+qs+qg)", - "profiles_mean_qs.png": "Qs", - "profiles_mean_qg.png": "Qg", - "profiles_mean_ql.png": "Ql", - "profiles_mean_qr.png": "Qr", - "profiles_mean_qc.png": "Qc", - "profiles_mean_multi_effective_radius.png": "multi_effective_radius", - "profiles_mean_dT_dt_conv.png": "dTdt_conv", - "profiles_mean_dT_dt_deepconv.png": "dTdt_deepconv", - "profiles_mean_dT_dt_shalconv.png": "dTdt_shalconv", - "profiles_mean_dT_dt_lwrad.png": "dTdt_lwrad", - "profiles_mean_dT_dt_swrad.png": "dTdt_swrad", - "profiles_mean_dT_dt_micro.png": "dTdt_micro", - "profiles_mean_dT_dt_pbl.png": "dTdt_pbl", - "profiles_mean_dq_dt_deepconv.png": "dqdt_deepconv", - "profiles_mean_dq_dt_shalconv.png": "dqdt_shalconv", - "profiles_mean_dq_dt_micro.png": "dqdt_micro", - "profiles_mean_dq_dt_pbl.png": "dqdt_pbl", - "profiles_mean_rad_cloud_fraction.png": "rad_cloud_fraction", - "profiles_mean_rad_cloud_iwp.png": "rad_cloud_iwp", - "profiles_mean_rad_cloud_swp.png": "rad_cloud_swp", - "profiles_mean_rad_cloud_lwp.png": "rad_cloud_lwp", - "profiles_mean_rad_cloud_rwp.png": "rad_cloud_rwp", - "profiles_mean_multi_T_forcing.png": "multi_T_forcing", - "profiles_mean_multi_q_forcing.png": "multi_q_forcing", - "profiles_mean_multi_conv_tendencies.png": "multi_conv_tendencies", - "profiles_mean_multi_oz_tendencies.png": "multi_oz_tendencies", - "profiles_mean_multi_u_tendencies.png": "multi_u_tendencies", - "profiles_mean_multi_v_tendencies.png": "multi_v_tendencies", - "profiles_mean_multi_u_force_phys.png": "multi_u_force_phys", - "profiles_mean_multi_v_force_phys.png": "multi_v_force_phys" - } - }, - "bias": { - "label": "Bias Profiles", - "files": { - "profiles_bias_T.png": "Temperature", - "profiles_bias_th.png": "Potential Temperature", - "profiles_bias_rh.png": "Relative Humidity", - "profiles_bias_qv.png": "Qv", - "profiles_bias_qi.png": "Qi", - "profiles_bias_ql.png": "Ql" - } - }, - "ts": { - "label": "Timeseries", - "files": { - "time_series_lhf.png": "LHF", - "time_series_shf.png": "SHF", - "time_series_pwat.png": "PWAT", - "time_series_sfc_dwn_lw.png": "dwn_lw", - "time_series_sfc_dwn_sw.png": "dwn_sw", - "time_series_pres_s.png": "Sfc Pressure", - "time_series_T_s.png": "Sfc Temperature", - "time_series_tprcp_rate_accum.png": "Total Precip Rate Accum", - "time_series_tprcp_inst.png": "Instantaneous Total Precip Rate", - "time_series_multi_surface_prcp_inst.png": "Multi Instantaneous Total Precip", - "time_series_multi_surface_prcp_inst_par.png": "Multi Instantaneous Total Precip Partitions", - "time_series_multi_surface_prcp_accum.png": "Multi Total Precip Accum", - "time_series_multi_surface_prcp_rate_accum.png": "Multi Total Precip Rate Accum", - "time_series_multi_surface_sw_down.png": "Multi Downward Shortwave", - "time_series_multi_surface_sw_up.png": "Multi Upward Shortwave", - "time_series_multi_surface_lw.png": "Multi Longwave" - } - }, - "cont": { - "label": "Contours", - "files": { - "contour_T.png": "Temperature", - "contour_qv.png": "Qv", - "contour_qi.png": "Qi", - "contour_qi_tot.png": "Total Qi (qi+qs+qg)", - "contour_qs.png": "Qs", - "contour_qg.png": "Qg", - "contour_ql.png": "Ql", - "contour_qr.png": "Qr", - "contour_qc.png": "Qc", - "contour_u.png": "U-wind", - "contour_v.png": "V-wind" - } - } - } - }, - "MAGIC_LEG12A": { - "label": "MAGIC_LEG12A", - "suites": { - "GFS_v17_p8_ugwpv1": { - "label": "GFS_v17_p8_ugwpv1" - }, - "GFS_v17_p8_ugwpv1_tempo": { - "label": "GFS_v17_p8_ugwpv1_tempo" - }, - "comp": { - "label": "Comparison" - } - }, - "areas": { - "12.04km": { - "label": "12.04km" - } - }, - "timesteps": { - "600_300": { "label": "600s / 300s" }, - "600_150": { "label": "600s / 150s" }, - "300_150": { "label": "300s / 150s" } - }, - "figures": { - "mean": { - "label": "Mean Profiles", - "files": { - "profiles_mean_T.png": "Temperature", - "profiles_mean_th.png": "Potential Temperature", - "profiles_mean_rh.png": "Relative Humidity", - "profiles_mean_qv.png": "Qv", - "profiles_mean_qi.png": "Qi", - "profiles_mean_qi_tot.png": " Total Qi (qi+qs+qg)", - "profiles_mean_qs.png": "Qs", - "profiles_mean_qg.png": "Qg", - "profiles_mean_ql.png": "Ql", - "profiles_mean_qr.png": "Qr", - "profiles_mean_qc.png": "Qc", - "profiles_mean_multi_effective_radius.png": "multi_effective_radius", - "profiles_mean_dT_dt_conv.png": "dTdt_conv", - "profiles_mean_dT_dt_deepconv.png": "dTdt_deepconv", - "profiles_mean_dT_dt_shalconv.png": "dTdt_shalconv", - "profiles_mean_dT_dt_lwrad.png": "dTdt_lwrad", - "profiles_mean_dT_dt_swrad.png": "dTdt_swrad", - "profiles_mean_dT_dt_micro.png": "dTdt_micro", - "profiles_mean_dT_dt_pbl.png": "dTdt_pbl", - "profiles_mean_dq_dt_deepconv.png": "dqdt_deepconv", - "profiles_mean_dq_dt_shalconv.png": "dqdt_shalconv", - "profiles_mean_dq_dt_micro.png": "dqdt_micro", - "profiles_mean_dq_dt_pbl.png": "dqdt_pbl", - "profiles_mean_rad_cloud_fraction.png": "rad_cloud_fraction", - "profiles_mean_rad_cloud_iwp.png": "rad_cloud_iwp", - "profiles_mean_rad_cloud_swp.png": "rad_cloud_swp", - "profiles_mean_rad_cloud_lwp.png": "rad_cloud_lwp", - "profiles_mean_rad_cloud_rwp.png": "rad_cloud_rwp", - "profiles_mean_multi_T_forcing.png": "multi_T_forcing", - "profiles_mean_multi_q_forcing.png": "multi_q_forcing", - "profiles_mean_multi_conv_tendencies.png": "multi_conv_tendencies", - "profiles_mean_multi_oz_tendencies.png": "multi_oz_tendencies", - "profiles_mean_multi_u_tendencies.png": "multi_u_tendencies", - "profiles_mean_multi_v_tendencies.png": "multi_v_tendencies", - "profiles_mean_multi_u_force_phys.png": "multi_u_force_phys", - "profiles_mean_multi_v_force_phys.png": "multi_v_force_phys" - } - }, - "bias": { - "label": "Bias Profiles", - "files": { - "profiles_bias_T.png": "Temperature", - "profiles_bias_th.png": "Potential Temperature", - "profiles_bias_rh.png": "Relative Humidity", - "profiles_bias_qv.png": "Qv", - "profiles_bias_qi.png": "Qi", - "profiles_bias_ql.png": "Ql" - } - }, - "ts": { - "label": "Timeseries", - "files": { - "time_series_lhf.png": "LHF", - "time_series_shf.png": "SHF", - "time_series_pwat.png": "PWAT", - "time_series_sfc_dwn_lw.png": "dwn_lw", - "time_series_sfc_dwn_sw.png": "dwn_sw", - "time_series_pres_s.png": "Sfc Pressure", - "time_series_T_s.png": "Sfc Temperature", - "time_series_tprcp_rate_accum.png": "Total Precip Rate Accum", - "time_series_tprcp_inst.png": "Instantaneous Total Precip Rate", - "time_series_multi_surface_prcp_inst.png": "Multi Instantaneous Total Precip", - "time_series_multi_surface_prcp_inst_par.png": "Multi Instantaneous Total Precip Partitions", - "time_series_multi_surface_prcp_accum.png": "Multi Total Precip Accum", - "time_series_multi_surface_prcp_rate_accum.png": "Multi Total Precip Rate Accum", - "time_series_multi_surface_sw_down.png": "Multi Downward Shortwave", - "time_series_multi_surface_sw_up.png": "Multi Upward Shortwave", - "time_series_multi_surface_lw.png": "Multi Longwave" - } - }, - "cont": { - "label": "Contours", - "files": { - "contour_T.png": "Temperature", - "contour_qv.png": "Qv", - "contour_qi.png": "Qi", - "contour_qi_tot.png": "Total Qi (qi+qs+qg)", - "contour_qs.png": "Qs", - "contour_qg.png": "Qg", - "contour_ql.png": "Ql", - "contour_qr.png": "Qr", - "contour_qc.png": "Qc", - "contour_u.png": "U-wind", - "contour_v.png": "V-wind" - } - } - } - }, - "MAGIC_LEG15A": { - "label": "MAGIC_LEG15A", - "suites": { - "GFS_v17_p8_ugwpv1": { - "label": "GFS_v17_p8_ugwpv1" - }, - "GFS_v17_p8_ugwpv1_tempo": { - "label": "GFS_v17_p8_ugwpv1_tempo" - }, - "comp": { - "label": "Comparison" - } - }, - "areas": { - "12.04km": { - "label": "12.04km" - } - }, - "timesteps": { - "600_300": { "label": "600s / 300s" }, - "600_150": { "label": "600s / 150s" }, - "300_150": { "label": "300s / 150s" } - }, - "figures": { - "mean": { - "label": "Mean Profiles", - "files": { - "profiles_mean_T.png": "Temperature", - "profiles_mean_th.png": "Potential Temperature", - "profiles_mean_rh.png": "Relative Humidity", - "profiles_mean_qv.png": "Qv", - "profiles_mean_qi.png": "Qi", - "profiles_mean_qi_tot.png": " Total Qi (qi+qs+qg)", - "profiles_mean_qs.png": "Qs", - "profiles_mean_qg.png": "Qg", - "profiles_mean_ql.png": "Ql", - "profiles_mean_qr.png": "Qr", - "profiles_mean_qc.png": "Qc", - "profiles_mean_multi_effective_radius.png": "multi_effective_radius", - "profiles_mean_dT_dt_conv.png": "dTdt_conv", - "profiles_mean_dT_dt_deepconv.png": "dTdt_deepconv", - "profiles_mean_dT_dt_shalconv.png": "dTdt_shalconv", - "profiles_mean_dT_dt_lwrad.png": "dTdt_lwrad", - "profiles_mean_dT_dt_swrad.png": "dTdt_swrad", - "profiles_mean_dT_dt_micro.png": "dTdt_micro", - "profiles_mean_dT_dt_pbl.png": "dTdt_pbl", - "profiles_mean_dq_dt_deepconv.png": "dqdt_deepconv", - "profiles_mean_dq_dt_shalconv.png": "dqdt_shalconv", - "profiles_mean_dq_dt_micro.png": "dqdt_micro", - "profiles_mean_dq_dt_pbl.png": "dqdt_pbl", - "profiles_mean_rad_cloud_fraction.png": "rad_cloud_fraction", - "profiles_mean_rad_cloud_iwp.png": "rad_cloud_iwp", - "profiles_mean_rad_cloud_swp.png": "rad_cloud_swp", - "profiles_mean_rad_cloud_lwp.png": "rad_cloud_lwp", - "profiles_mean_rad_cloud_rwp.png": "rad_cloud_rwp", - "profiles_mean_multi_T_forcing.png": "multi_T_forcing", - "profiles_mean_multi_q_forcing.png": "multi_q_forcing", - "profiles_mean_multi_conv_tendencies.png": "multi_conv_tendencies", - "profiles_mean_multi_oz_tendencies.png": "multi_oz_tendencies", - "profiles_mean_multi_u_tendencies.png": "multi_u_tendencies", - "profiles_mean_multi_v_tendencies.png": "multi_v_tendencies", - "profiles_mean_multi_u_force_phys.png": "multi_u_force_phys", - "profiles_mean_multi_v_force_phys.png": "multi_v_force_phys" - } - }, - "bias": { - "label": "Bias Profiles", - "files": { - "profiles_bias_T.png": "Temperature", - "profiles_bias_th.png": "Potential Temperature", - "profiles_bias_rh.png": "Relative Humidity", - "profiles_bias_qv.png": "Qv", - "profiles_bias_qi.png": "Qi", - "profiles_bias_ql.png": "Ql" - } - }, - "ts": { - "label": "Timeseries", - "files": { - "time_series_lhf.png": "LHF", - "time_series_shf.png": "SHF", - "time_series_pwat.png": "PWAT", - "time_series_sfc_dwn_lw.png": "dwn_lw", - "time_series_sfc_dwn_sw.png": "dwn_sw", - "time_series_pres_s.png": "Sfc Pressure", - "time_series_T_s.png": "Sfc Temperature", - "time_series_tprcp_rate_accum.png": "Total Precip Rate Accum", - "time_series_tprcp_inst.png": "Instantaneous Total Precip Rate", - "time_series_multi_surface_prcp_inst.png": "Multi Instantaneous Total Precip", - "time_series_multi_surface_prcp_inst_par.png": "Multi Instantaneous Total Precip Partitions", - "time_series_multi_surface_prcp_accum.png": "Multi Total Precip Accum", - "time_series_multi_surface_prcp_rate_accum.png": "Multi Total Precip Rate Accum", - "time_series_multi_surface_sw_down.png": "Multi Downward Shortwave", - "time_series_multi_surface_sw_up.png": "Multi Upward Shortwave", - "time_series_multi_surface_lw.png": "Multi Longwave" - } - }, - "cont": { - "label": "Contours", - "files": { - "contour_T.png": "Temperature", - "contour_qv.png": "Qv", - "contour_qi.png": "Qi", - "contour_qi_tot.png": "Total Qi (qi+qs+qg)", - "contour_qs.png": "Qs", - "contour_qg.png": "Qg", - "contour_ql.png": "Ql", - "contour_qr.png": "Qr", - "contour_qc.png": "Qc", - "contour_u.png": "U-wind", - "contour_v.png": "V-wind" - } - } - } - }, - "MOSAiC-AMPS": { - "label": "MOSAiC-AMPS", - "suites": { - "GFS_v17_p8_ugwpv1": { - "label": "GFS_v17_p8_ugwpv1" - }, - "GFS_v17_p8_ugwpv1_tempo": { - "label": "GFS_v17_p8_ugwpv1_tempo" - }, - "comp": { - "label": "Comparison" - } - }, - "areas": { - "44.72km": { - "label": "44.72km" - } - }, - "timesteps": { - "600_300": { "label": "600s / 300s" }, - "600_150": { "label": "600s / 150s" }, - "300_150": { "label": "300s / 150s" } - }, - "figures": { - "mean": { - "label": "Mean Profiles", - "files": { - "profiles_mean_T.png": "Temperature", - "profiles_mean_th.png": "Potential Temperature", - "profiles_mean_rh.png": "Relative Humidity", - "profiles_mean_qv.png": "Qv", - "profiles_mean_qi.png": "Qi", - "profiles_mean_qi_tot.png": " Total Qi (qi+qs+qg)", - "profiles_mean_qs.png": "Qs", - "profiles_mean_qg.png": "Qg", - "profiles_mean_ql.png": "Ql", - "profiles_mean_qr.png": "Qr", - "profiles_mean_qc.png": "Qc", - "profiles_mean_multi_effective_radius.png": "multi_effective_radius", - "profiles_mean_dT_dt_conv.png": "dTdt_conv", - "profiles_mean_dT_dt_deepconv.png": "dTdt_deepconv", - "profiles_mean_dT_dt_shalconv.png": "dTdt_shalconv", - "profiles_mean_dT_dt_lwrad.png": "dTdt_lwrad", - "profiles_mean_dT_dt_swrad.png": "dTdt_swrad", - "profiles_mean_dT_dt_micro.png": "dTdt_micro", - "profiles_mean_dT_dt_pbl.png": "dTdt_pbl", - "profiles_mean_dq_dt_deepconv.png": "dqdt_deepconv", - "profiles_mean_dq_dt_shalconv.png": "dqdt_shalconv", - "profiles_mean_dq_dt_micro.png": "dqdt_micro", - "profiles_mean_dq_dt_pbl.png": "dqdt_pbl", - "profiles_mean_rad_cloud_fraction.png": "rad_cloud_fraction", - "profiles_mean_rad_cloud_iwp.png": "rad_cloud_iwp", - "profiles_mean_rad_cloud_swp.png": "rad_cloud_swp", - "profiles_mean_rad_cloud_lwp.png": "rad_cloud_lwp", - "profiles_mean_rad_cloud_rwp.png": "rad_cloud_rwp", - "profiles_mean_multi_T_forcing.png": "multi_T_forcing", - "profiles_mean_multi_q_forcing.png": "multi_q_forcing", - "profiles_mean_multi_conv_tendencies.png": "multi_conv_tendencies", - "profiles_mean_multi_oz_tendencies.png": "multi_oz_tendencies", - "profiles_mean_multi_u_tendencies.png": "multi_u_tendencies", - "profiles_mean_multi_v_tendencies.png": "multi_v_tendencies", - "profiles_mean_multi_u_force_phys.png": "multi_u_force_phys", - "profiles_mean_multi_v_force_phys.png": "multi_v_force_phys" - } - }, - "bias": { - "label": "Bias Profiles", - "files": { - "profiles_bias_T.png": "Temperature", - "profiles_bias_th.png": "Potential Temperature", - "profiles_bias_rh.png": "Relative Humidity", - "profiles_bias_qv.png": "Qv", - "profiles_bias_qi.png": "Qi", - "profiles_bias_ql.png": "Ql" - } - }, - "ts": { - "label": "Timeseries", - "files": { - "time_series_lhf.png": "LHF", - "time_series_shf.png": "SHF", - "time_series_pwat.png": "PWAT", - "time_series_sfc_dwn_lw.png": "dwn_lw", - "time_series_sfc_dwn_sw.png": "dwn_sw", - "time_series_pres_s.png": "Sfc Pressure", - "time_series_T_s.png": "Sfc Temperature", - "time_series_tprcp_rate_accum.png": "Total Precip Rate Accum", - "time_series_tprcp_inst.png": "Instantaneous Total Precip Rate", - "time_series_multi_surface_prcp_inst.png": "Multi Instantaneous Total Precip", - "time_series_multi_surface_prcp_inst_par.png": "Multi Instantaneous Total Precip Partitions", - "time_series_multi_surface_prcp_accum.png": "Multi Total Precip Accum", - "time_series_multi_surface_prcp_rate_accum.png": "Multi Total Precip Rate Accum", - "time_series_multi_surface_sw_down.png": "Multi Downward Shortwave", - "time_series_multi_surface_sw_up.png": "Multi Upward Shortwave", - "time_series_multi_surface_lw.png": "Multi Longwave" - } - }, - "cont": { - "label": "Contours", - "files": { - "contour_T.png": "Temperature", - "contour_qv.png": "Qv", - "contour_qi.png": "Qi", - "contour_qi_tot.png": "Total Qi (qi+qs+qg)", - "contour_qs.png": "Qs", - "contour_qg.png": "Qg", - "contour_ql.png": "Ql", - "contour_qr.png": "Qr", - "contour_qc.png": "Qc", - "contour_u.png": "U-wind", - "contour_v.png": "V-wind" - } - } - } - }, - "MPACE_REF": { - "label": "MPACE_REF", - "suites": { - "GFS_v17_p8_ugwpv1": { - "label": "GFS_v17_p8_ugwpv1" - }, - "GFS_v17_p8_ugwpv1_tempo": { - "label": "GFS_v17_p8_ugwpv1_tempo" - }, - "comp": { - "label": "Comparison" - } - }, - "areas": { - "12.04km": { - "label": "12.04km" - } - }, - "timesteps": { - "600_300": { "label": "600s / 300s" }, - "600_150": { "label": "600s / 150s" }, - "300_150": { "label": "300s / 150s" } - }, - "figures": { - "mean": { - "label": "Mean Profiles", - "files": { - "profiles_mean_T.png": "Temperature", - "profiles_mean_th.png": "Potential Temperature", - "profiles_mean_rh.png": "Relative Humidity", - "profiles_mean_qv.png": "Qv", - "profiles_mean_qi.png": "Qi", - "profiles_mean_qi_tot.png": " Total Qi (qi+qs+qg)", - "profiles_mean_qs.png": "Qs", - "profiles_mean_qg.png": "Qg", - "profiles_mean_ql.png": "Ql", - "profiles_mean_qr.png": "Qr", - "profiles_mean_qc.png": "Qc", - "profiles_mean_multi_effective_radius.png": "multi_effective_radius", - "profiles_mean_dT_dt_conv.png": "dTdt_conv", - "profiles_mean_dT_dt_deepconv.png": "dTdt_deepconv", - "profiles_mean_dT_dt_shalconv.png": "dTdt_shalconv", - "profiles_mean_dT_dt_lwrad.png": "dTdt_lwrad", - "profiles_mean_dT_dt_swrad.png": "dTdt_swrad", - "profiles_mean_dT_dt_micro.png": "dTdt_micro", - "profiles_mean_dT_dt_pbl.png": "dTdt_pbl", - "profiles_mean_dq_dt_deepconv.png": "dqdt_deepconv", - "profiles_mean_dq_dt_shalconv.png": "dqdt_shalconv", - "profiles_mean_dq_dt_micro.png": "dqdt_micro", - "profiles_mean_dq_dt_pbl.png": "dqdt_pbl", - "profiles_mean_rad_cloud_fraction.png": "rad_cloud_fraction", - "profiles_mean_rad_cloud_iwp.png": "rad_cloud_iwp", - "profiles_mean_rad_cloud_swp.png": "rad_cloud_swp", - "profiles_mean_rad_cloud_lwp.png": "rad_cloud_lwp", - "profiles_mean_rad_cloud_rwp.png": "rad_cloud_rwp", - "profiles_mean_multi_T_forcing.png": "multi_T_forcing", - "profiles_mean_multi_q_forcing.png": "multi_q_forcing", - "profiles_mean_multi_conv_tendencies.png": "multi_conv_tendencies", - "profiles_mean_multi_oz_tendencies.png": "multi_oz_tendencies", - "profiles_mean_multi_u_tendencies.png": "multi_u_tendencies", - "profiles_mean_multi_v_tendencies.png": "multi_v_tendencies", - "profiles_mean_multi_u_force_phys.png": "multi_u_force_phys", - "profiles_mean_multi_v_force_phys.png": "multi_v_force_phys" - } - }, - "bias": { - "label": "Bias Profiles", - "files": { - "profiles_bias_T.png": "Temperature", - "profiles_bias_th.png": "Potential Temperature", - "profiles_bias_rh.png": "Relative Humidity", - "profiles_bias_qv.png": "Qv", - "profiles_bias_qi.png": "Qi", - "profiles_bias_ql.png": "Ql" - } - }, - "ts": { - "label": "Timeseries", - "files": { - "time_series_lhf.png": "LHF", - "time_series_shf.png": "SHF", - "time_series_pwat.png": "PWAT", - "time_series_sfc_dwn_lw.png": "dwn_lw", - "time_series_sfc_dwn_sw.png": "dwn_sw", - "time_series_pres_s.png": "Sfc Pressure", - "time_series_T_s.png": "Sfc Temperature", - "time_series_tprcp_rate_accum.png": "Total Precip Rate Accum", - "time_series_tprcp_inst.png": "Instantaneous Total Precip Rate", - "time_series_multi_surface_prcp_inst.png": "Multi Instantaneous Total Precip", - "time_series_multi_surface_prcp_inst_par.png": "Multi Instantaneous Total Precip Partitions", - "time_series_multi_surface_prcp_accum.png": "Multi Total Precip Accum", - "time_series_multi_surface_prcp_rate_accum.png": "Multi Total Precip Rate Accum", - "time_series_multi_surface_sw_down.png": "Multi Downward Shortwave", - "time_series_multi_surface_sw_up.png": "Multi Upward Shortwave", - "time_series_multi_surface_lw.png": "Multi Longwave" - } - }, - "cont": { - "label": "Contours", - "files": { - "contour_T.png": "Temperature", - "contour_qv.png": "Qv", - "contour_qi.png": "Qi", - "contour_qi_tot.png": "Total Qi (qi+qs+qg)", - "contour_qs.png": "Qs", - "contour_qg.png": "Qg", - "contour_ql.png": "Ql", - "contour_qr.png": "Qr", - "contour_qc.png": "Qc", - "contour_u.png": "U-wind", - "contour_v.png": "V-wind" - } - } - } - } - } -} diff --git a/scripts/run_scm_workflow.sh b/scripts/run_scm_workflow.sh index d436faae..ceb9363e 100755 --- a/scripts/run_scm_workflow.sh +++ b/scripts/run_scm_workflow.sh @@ -2,10 +2,10 @@ # List of cases to test # Currently supported: twpice, MAGIC_LEG12A, MAGIC_LEG15A, MOSAiC-AMPS, MOSAiC-SS, COMBLE, MPACE_REF -CASE_LIST='MOSAiC-AMPS' +CASE_LIST='MAGIC_LEG15A' # List of suites to test -SUITE_LIST='SCM_GFS_v17_p8_ugwpv1' +SUITE_LIST='SCM_GFS_v17_p8_ugwpv1 SCM_GFS_v17_p8_ugwpv1_tempo' # List of column areas in m^2 # *If left empty, uses default in case config nml @@ -13,16 +13,16 @@ COLUMN_AREAS='' # List of time steps and respecitve inner timesteps and output frequencies TIME_STEPS=(600 300) -PHYSICS_TIME_STEPS=(300 150) +DT_INNER=(300 150) OUT_FREQS=(1 2) DIAG_FREQS=(1 2) # Platform (ursa/derecho) and compiler (intel/gnu) -PLATFORM='derecho' +PLATFORM='ursa' COMPILER='gnu' # Flag for type of SCM repo to use (github/local) -scm_type='github' +scm_type='local' # If using SMC Github repo, supply the url and branch GIT_URL='https://github.com/NCAR/ccpp-scm.git' @@ -33,7 +33,7 @@ scm_tag='test' local_scm_dir='/scratch3/BMC/gmtb/Tracy.Hertneky/phys_tne/FY25-26/ccpp-scm_tempov3' # Build switches -make_build='True' +make_build='False' build_32bit='False' # Run option to skip existing runs or not @@ -120,7 +120,8 @@ if [ $make_build == 'True' ]; then module purge MODULE_PATH="$SCM_DIR/scm/etc/modules" module use "$MODULE_PATH" - module load "${PLATFORM}_${COMPILER}" + #module load "${PLATFORM}_${COMPILER}" + module load "${PLATFORM}_${COMPILER}_spack_stack_1.9.1" sleep 2 cd $SCM_DIR/scm && mkdir bin && cd bin @@ -205,7 +206,8 @@ for scm_case in $CASE_LIST; do module purge MODULE_PATH="$SCM_DIR/scm/etc/modules" module use "$MODULE_PATH" - module load "${PLATFORM}_${COMPILER}" + #module load "${PLATFORM}_${COMPILER}" + module load "${PLATFORM}_${COMPILER}_spack_stack_1.9.1" sleep 5 # Build captions @@ -225,8 +227,8 @@ for scm_case in $CASE_LIST; do [[ "$v" != "$first" ]] && first="" && break done [[ -n "$first" ]] && caption+=(" dt: ${first}s") - first=${PHYSICS_TIME_STEPS[0]} - for v in "${PHYSICS_TIME_STEPS[@]}"; do + first=${DT_INNER[0]} + for v in "${DT_INNER[@]}"; do [[ "$v" != "$first" ]] && first="" && break done [[ -n "$first" ]] && caption+=(" dti: ${first}s") @@ -243,7 +245,7 @@ for scm_case in $CASE_LIST; do for ((n=0; n<${#TIME_STEPS[@]}; n++)); do timestep="${TIME_STEPS[n]}" - dti="${PHYSICS_TIME_STEPS[n]}" + dti="${DT_INNER[n]}" out_freq="${OUT_FREQS[n]}" diag_freq="${DIAG_FREQS[n]}" @@ -269,7 +271,7 @@ for scm_case in $CASE_LIST; do if [ "$dt_unique" -gt 1 ]; then label+=("dt${timestep}s") fi - dti_unique=$(printf "%s\n" "${PHYSICS_TIME_STEPS[@]}" | sort -u | wc -l) + dti_unique=$(printf "%s\n" "${DT_INNER[@]}" | sort -u | wc -l) if [ "$dti_unique" -gt 1 ]; then label+=("dti${dti}s") fi @@ -284,8 +286,8 @@ for scm_case in $CASE_LIST; do # Build the run command, appending CASE_DATA_DIR for DEPHY repo cases cd "$SCM_DIR/scm/bin" - cp ${SCRIPT_DIR}/run_scm.py . - RUN_COMMAND="./run_scm.py -c ${scm_case} -s ${suite} -dt ${timestep} --n_itt_out ${out_freq} --n_itt_diag ${diag_freq} --run_dir $SCM_DIR/scm/${run_dir} -v" + cp ${SCRIPT_DIR}/run_scm.py run_scm_wf.py + RUN_COMMAND="./run_scm_wf.py -c ${scm_case} -s ${suite} -dt ${timestep} --n_itt_out ${out_freq} --n_itt_diag ${diag_freq} --run_dir $SCM_DIR/scm/${run_dir} -v" echo $RUN_COMMAND if [ -n "${CASE_DATA_DIR}" ]; then RUN_COMMAND="${RUN_COMMAND} --case_data_dir ${CASE_DATA_DIR}" @@ -356,7 +358,7 @@ for scm_case in $CASE_LIST; do for ((n=0; n<${#TIME_STEPS[@]}; n++)); do column_dx=$(awk -v a="${column_area}" 'BEGIN { printf "%.2f", sqrt(a)/1000 }') timestep="${TIME_STEPS[n]}" - dti="${PHYSICS_TIME_STEPS[n]}" + dti="${DT_INNER[n]}" cp $SCM_DIR/scm/run_${scm_case}_${suite}_area${column_dx}km_dt${timestep}s_dti${dti}s/output_${scm_case}_${suite}/output.nc ${BASE_DIR}/scm_runs/${scm_tag}/${scm_case}/${suite}/area${column_dx}km_dt${timestep}s_dti${dti}s_output.nc cp $SCM_DIR/scm/run_${scm_case}_${suite}_area${column_dx}km_dt${timestep}s_dti${dti}s/output_${scm_case}_${suite}/${scm_case}_${suite}.nml ${BASE_DIR}/scm_runs/${scm_tag}/${scm_case}/${suite} done @@ -376,40 +378,43 @@ for scm_case in $CASE_LIST; do START_TIME="2013, 6, 8, 17, 45" END_TIME="2013, 6, 8, 21, 45" OBS_COMPARE='False' - TS_RESAMPLE='FALSE' + TS_RESAMPLE='False' elif [[ "$scm_case" == MAGIC_LEG15A ]]; then OBS_FILE="/scratch3/BMC/gmtb/Tracy.Hertneky/phys_tne/FY25-26/data/${scm_case}_obs.nc" START_TIME="2013, 7, 21, 0, 0" END_TIME="2013, 7, 24, 23, 59" - OBS_COMPARE='False' - TS_RESAMPLE='FALSE' + OBS_COMPARE='True' + TS_RESAMPLE='True' elif [[ "$scm_case" == twpice ]]; then OBS_FILE="${FIX_DATA_DIR}/raw_case_input/twp180iopsndgvarana_v2.1_C3.c1.20060117.000000.cdf" START_TIME="2006, 1, 20, 0" END_TIME="2006, 1, 23, 0" OBS_COMPARE='True' + TS_RESAMPLE='True' elif [[ "$scm_case" == MOSAiC-AMPS ]]; then OBS_FILE="${FIX_DATA_DIR}/raw_case_input/MOSAiC_31Oct20190Z_raw.nc" START_TIME="2019, 11, 1, 0" END_TIME="2019, 11, 2, 0" OBS_COMPARE='True' + TS_RESAMPLE='True' elif [[ "$scm_case" == MOSAiC-SS ]]; then OBS_FILE="${FIX_DATA_DIR}/raw_case_input/MOSAiC_2Mar20200Z_raw.nc" START_TIME="2020, 3, 4, 0" END_TIME="2020, 3, 5, 0" OBS_COMPARE='True' + TS_RESAMPLE='True' elif [[ "$scm_case" == COMBLE ]]; then OBS_FILE="" START_TIME="2020, 3, 13, 1" END_TIME="2020, 3, 13, 18" OBS_COMPARE='False' - TS_RESAMPLE='FALSE' + TS_RESAMPLE='False' elif [[ "$scm_case" == MPACE_REF ]]; then OBS_FILE="" START_TIME="2004, 10, 9, 17" END_TIME="2004, 10, 10, 17" OBS_COMPARE='False' - TS_RESAMPLE='FALSE' + TS_RESAMPLE='False' else OBS_FILE="" fi @@ -435,22 +440,22 @@ for scm_case in $CASE_LIST; do PLOT_TEMPLATE="${BASE_DIR}/scripts/plot_config_template.ini" # Create the plot config from the template - if [ ! -d ${BASE_DIR}/scm_plots ]; then - mkdir -p ${BASE_DIR}/scm_plots + if [ ! -d ${BASE_DIR}/docs/scm_plots ]; then + mkdir -p ${BASE_DIR}/docs/scm_plots fi - PLOT_CONFIG="${BASE_DIR}/scm_plots/${scm_case}.ini" + PLOT_CONFIG="${BASE_DIR}/docs/scm_plots/${scm_case}.ini" envsubst < "$PLOT_TEMPLATE" > "$PLOT_CONFIG" echo "Created plot config: $PLOT_CONFIG" # Move to the plot directory to run the plots - cd ${BASE_DIR}/scm_plots + cd ${BASE_DIR}/docs/scm_plots # Copy python plotting script to run directory - cp ${SCRIPT_DIR}/scm_analysis.py ${BASE_DIR}/scm_plots - cp ${SCRIPT_DIR}/scm_read_obs.py ${BASE_DIR}/scm_plots - cp ${SCRIPT_DIR}/scm_plotting_routines.py ${BASE_DIR}/scm_plots - cp $SCM_DIR/scm/etc/scripts/forcing_file_common.py ${BASE_DIR}/scm_plots - cp $SCM_DIR/scm/etc/scripts/configspec.ini ${BASE_DIR}/scm_plots + cp ${SCRIPT_DIR}/scm_analysis.py ${BASE_DIR}/docs/scm_plots + cp ${SCRIPT_DIR}/scm_read_obs.py ${BASE_DIR}/docs/scm_plots + cp ${SCRIPT_DIR}/scm_plotting_routines.py ${BASE_DIR}/docs/scm_plots + cp $SCM_DIR/scm/etc/scripts/forcing_file_common.py ${BASE_DIR}/docs/scm_plots + cp $SCM_DIR/scm/etc/scripts/configspec.ini ${BASE_DIR}/docs/scm_plots if [ $PLATFORM == 'derecho' ]; then module purge @@ -467,12 +472,12 @@ for scm_case in $CASE_LIST; do fi # Run the python plotting script - python ${BASE_DIR}/scm_plots/scm_analysis.py $PLOT_CONFIG + python ${BASE_DIR}/docs/scm_plots/scm_analysis.py $PLOT_CONFIG ######################################### # Setup github pages for displaying plots ######################################### - plot_path="${BASE_DIR}/scm_plots/${PLOT_DIR}" + plot_path="${BASE_DIR}/docs/scm_plots/${PLOT_DIR}" if [ ! -d ${plot_path} ]; then mkdir -p ${plot_path} fi @@ -480,4 +485,4 @@ for scm_case in $CASE_LIST; do done -python ${SCRIPT_DIR}/html/generate_config.py +python ${BASE_DIR}/docs/generate_config.py diff --git a/scripts/scm_analysis.py b/scripts/scm_analysis.py index 98296b0d..30e3e67c 100755 --- a/scripts/scm_analysis.py +++ b/scripts/scm_analysis.py @@ -1224,8 +1224,17 @@ def build_run_name(path): resample_string = str(int(data_delta_seconds)) + 's' obs_time_slice_series = pd.Series(obs_data_time_slice, index = obs_date_range) obs_time_slice_series_rs = obs_time_slice_series.resample(resample_string).mean() - - spr.plot_time_series_multi(time_h_slice, [data_time_slice], [scm_datasets_labels[i]], 'time (h)', label, ind_dir + '/time_series_' + plot_name + plot_ext, obs_time = time_h_slice, obs_values = obs_time_slice_series_rs[1::], line_type='color', color_index=i, conversion_factor=conversion_factor) + + #create obs time array from resample series (for plotting) + ref_time = pd.to_datetime('2013-07-20 17:30:00') + obs_time_rs_h_slice = ((obs_time_slice_series_rs.index - ref_time) / pd.Timedelta(hours=1)).to_numpy() + #obs_time_rs = pd.DataFrame(obs_time_slice_series_rs) + #obs_time_rs = obs_time_rs.columns + #obs_time_rs_delta = obs_time_rs - ref_time + #obs_time_rs_h_slice = obs_time_rs_delta / pd.Timedelta(hours=1) + #obs_time_rs_h_slice = obs_time_rs_h_slice.values + + spr.plot_time_series_multi(time_h_slice, [data_time_slice], [scm_datasets_labels[i]], 'time (h)', label, ind_dir + '/time_series_' + plot_name + plot_ext, obs_time = obs_time_rs_h_slice[1::], obs_values = obs_time_slice_series_rs[1::], line_type='color', color_index=i, conversion_factor=conversion_factor) else: obs_time_time_slice = obs_time_h[obs_time_slice_indices[j][0]:obs_time_slice_indices[j][1]] spr.plot_time_series_multi(time_h_slice, [data_time_slice], [scm_datasets_labels[i]], 'time (h)', label, ind_dir + '/time_series_' + plot_name + plot_ext, obs_time = obs_time_time_slice, obs_values = obs_data_time_slice, line_type='color', color_index=i, conversion_factor=conversion_factor) @@ -1732,10 +1741,20 @@ def build_run_name(path): #build list of resampled model datasets for this time slice obs_time_slice_series_rs = [] obs_time_slice_series = pd.Series(obs_data_time_slice, index = obs_date_range) - obs_time_slice_series_rs.append(obs_time_slice_series.resample(resample_string).mean()) + obs_time_slice_series_rs.append(obs_time_slice_series.resample(resample_string).mean()) + + #create obs time array from resample series (for plotting) + ref_time = pd.to_datetime('2013-07-20 17:30:00') + obs_time_rs = pd.DataFrame(obs_time_slice_series_rs) + obs_time_rs = obs_time_rs.columns + obs_time_rs_delta = obs_time_rs - ref_time + obs_time_rs_h_slice = obs_time_rs_delta / pd.Timedelta(hours=1) + obs_time_rs_h_slice = obs_time_rs_h_slice.values + obs_time_slice_series_rs = np.array(obs_time_slice_series_rs) + obs_time_slice_series_rs = obs_time_slice_series_rs[0,:] # removes first dimension with length of 1 - spr.plot_time_series_multi(time_h_slice, data_time_slice, scm_datasets_labels, 'time (h)', label, comp_dir + '/time_series_' + plot_name + plot_ext, obs_time = time_h_slice, obs_values = obs_time_slice_series_rs, line_type='color',skill_scores=skill_scores_val, conversion_factor=conversion_factor) + spr.plot_time_series_multi(time_h_slice, data_time_slice, scm_datasets_labels, 'time (h)', label, comp_dir + '/time_series_' + plot_name + plot_ext, obs_time = obs_time_rs_h_slice, obs_values = obs_time_slice_series_rs, line_type='color',skill_scores=skill_scores_val, conversion_factor=conversion_factor) else: obs_time_time_slice = obs_dict['time_h'][obs_dict['time_slice_indices'][j][0]:obs_dict['time_slice_indices'][j][1]] spr.plot_time_series_multi(time_h_slice, data_time_slice, scm_datasets_labels, 'time (h)', label, comp_dir + '/time_series_' + plot_name + plot_ext, obs_time = obs_time_time_slice, obs_values = obs_data_time_slice, line_type='color',skill_scores=skill_scores_val, conversion_factor=conversion_factor) @@ -1883,7 +1902,15 @@ def build_run_name(path): obs_time_slice_series_rs = obs_time_slice_series.resample(resample_string).mean() obs_data_time_slice_rs.append(obs_time_slice_series_rs) - spr.plot_time_series_multi(time_h_slice, data_list, time_series_multi[multiplot]['vars_labels'], 'time (h)', time_series_multi[multiplot]['y_label'], ind_dir + '/time_series_multi_' + multiplot + plot_ext, obs_time = time_h_slice, obs_values = obs_data_time_slice_rs, obs_label = time_series_multi[multiplot]['obs_var_label'], line_type='style', color_index=i, conversion_factor=conversion_factor) + #create obs time array from resample series (for plotting) + ref_time = pd.to_datetime('2013-07-20 17:30:00') + obs_time_rs = pd.DataFrame(obs_data_time_slice_rs) + obs_time_rs = obs_time_rs.columns + obs_time_rs_delta = obs_time_rs - ref_time + obs_time_rs_h_slice = obs_time_rs_delta / pd.Timedelta(hours=1) + obs_time_rs_h_slice = obs_time_rs_h_slice.values + + spr.plot_time_series_multi(time_h_slice, data_list, time_series_multi[multiplot]['vars_labels'], 'time (h)', time_series_multi[multiplot]['y_label'], ind_dir + '/time_series_multi_' + multiplot + plot_ext, obs_time = obs_time_rs_h_slice, obs_values = obs_data_time_slice_rs, obs_label = time_series_multi[multiplot]['obs_var_label'], line_type='style', color_index=i, conversion_factor=conversion_factor) else: obs_time_time_slice = obs_time_h[obs_time_slice_indices[j][0]:obs_time_slice_indices[j][1]] spr.plot_time_series_multi(time_h_slice, data_list_of_list, [time_series_multi[multiplot]['vars_labels'],scm_datasets_labels], 'time (h)', time_series_multi[multiplot]['y_label'], comp_dir + '/time_series_multi_' + multiplot + plot_ext, obs_time = obs_time_time_slice, obs_values = obs_data_time_slice, obs_label = time_series_multi[multiplot]['obs_var_label'], conversion_factor=conversion_factor)