diff --git a/config_amwg_default_plots.yaml b/config_amwg_default_plots.yaml index ce22d562c..39a81ea58 100644 --- a/config_amwg_default_plots.yaml +++ b/config_amwg_default_plots.yaml @@ -303,6 +303,8 @@ diag_cvdp_info: # If mdtf_run: true, the MDTF will be set up and # run in background mode, likely completing after the ADF has completed. # +# WARNING: This currently only runs on CASPER (not derecho) +# # The variables required depend on the diagnostics (PODs) selected. # AMWG-developed PODS and their required variables: # (Note that PRECT can be computed from PRECC & PRECL) @@ -332,12 +334,6 @@ diag_mdtf_info: conda_env_root : ${mdtf_codebase_path}/miniconda2/envs.MDTFv3.1.20230412/ OBS_DATA_ROOT : ${mdtf_codebase_path}/obs_data - - - # Set to default for same as the ADF plot_location. Anything else here overrides that - OUTPUT_DIR : default - WORKING_DIR : default - # SET this to a writable dir. The ADF will place ts files here for the MDTF to read (adds the casename) MODEL_DATA_ROOT : ${diag_cam_climo.cam_ts_loc}/mdtf/inputdata/model diff --git a/config_cam_baseline_example.yaml b/config_cam_baseline_example.yaml index c7037a92e..015503270 100644 --- a/config_cam_baseline_example.yaml +++ b/config_cam_baseline_example.yaml @@ -388,6 +388,8 @@ diag_cvdp_info: # If mdtf_run: true, the MDTF will be set up and # run in background mode, likely completing after the ADF has completed. # +# WARNING: This currently only runs on CASPER (not derecho) +# # The variables required depend on the diagnostics (PODs) selected. # AMWG-developed PODS and their required variables: # (Note that PRECT can be computed from PRECC & PRECL) @@ -417,12 +419,6 @@ diag_mdtf_info: conda_env_root : ${mdtf_codebase_path}/miniconda2/envs.MDTFv3.1.20230412/ OBS_DATA_ROOT : ${mdtf_codebase_path}/obs_data - - - # Set to default for same as the ADF plot_location. Anything else here overrides that - OUTPUT_DIR : default - WORKING_DIR : default - # SET this to a writable dir. The ADF will place ts files here for the MDTF to read (adds the casename) MODEL_DATA_ROOT : ${diag_cam_climo.cam_ts_loc}/mdtf/inputdata/model @@ -510,7 +506,8 @@ diag_var_list: # # MDTF recommended variables -# - OMEGA +# - FLUT +# - OMEGA500 # - PRECT # - PS # - PSL diff --git a/lib/adf_diag.py b/lib/adf_diag.py index 27d7866f6..e37c6a6cd 100644 --- a/lib/adf_diag.py +++ b/lib/adf_diag.py @@ -1311,8 +1311,7 @@ def setup_run_mdtf(self): case_idx = 0 plot_path = os.path.join(self.plot_location[case_idx], "mdtf") for var in ["WORKING_DIR", "OUTPUT_DIR"]: - if mdtf_info[var] == "default": - mdtf_info[var] = plot_path + mdtf_info[var] = plot_path # # Write the input settings json file @@ -1401,7 +1400,7 @@ def move_tsfiles_for_mdtf(self, verbose): adf_file_list = glob.glob(adf_file_str) if len(adf_file_list) == 1: - if verbose > 2: + if verbose > 1: print(f"Copying ts file: {adf_file_list} to MDTF dir") elif len(adf_file_list) > 1: if verbose > 0: @@ -1409,7 +1408,7 @@ def move_tsfiles_for_mdtf(self, verbose): f"WARNING: found multiple timeseries files {adf_file_list}. Continuing with best guess; suggest cleaning up multiple dates in ts dir" ) else: - if verbose > 0: + if verbose > 1: print( f"WARNING: No files matching {case_name}.{hist_str}.{var} found in {adf_file_str}. Skipping" ) diff --git a/lib/adf_web.py b/lib/adf_web.py index f7b3e0d3d..ed21e655c 100644 --- a/lib/adf_web.py +++ b/lib/adf_web.py @@ -146,12 +146,27 @@ def __init__(self, config_file, debug=False): #Specify where CSS files will be stored: css_files_dir = website_dir / "templates" + #Add links to external packages (if applicable) + self.external_package_links = {} + + #MDTF puts directory under case[0] + if self.get_mdtf_info('mdtf_run'): + syear = self.climo_yrs["syears"] + eyear = self.climo_yrs["eyears"] + mdtf_path = f"../mdtf/MDTF_{case_name}" + mdtf_path += f"_{syear[0]}_{eyear[0]}" + self.external_package_links['MDTF'] = mdtf_path + #End if + #Add all relevant paths to dictionary for specific case: self.__case_web_paths[case_name] = {'website_dir': website_dir, 'img_pages_dir': img_pages_dir, 'assets_dir': assets_dir, 'table_pages_dir': table_pages_dir, 'css_files_dir': css_files_dir} + + + #End for #-------------------------------- @@ -171,6 +186,8 @@ def __init__(self, config_file, debug=False): 'css_files_dir': css_files_dir} #End if + + ######### # Create property needed to return "create_html" logical to user: @@ -691,6 +708,10 @@ def jinja_list(seas_list): if ptype not in avail_plot_types: avail_plot_types.append(plot_types) + + # External packages that can be run through ADF + avail_external_packages = {'MDTF':'mdtf_html_path', 'CVDP':'cvdp_html_path'} + #Construct index.html index_title = "AMP Diagnostics Prototype" index_tmpl = jinenv.get_template('template_index.html') @@ -700,7 +721,9 @@ def jinja_list(seas_list): case_yrs=case_yrs, baseline_yrs=baseline_yrs, plot_types=plot_types, - avail_plot_types=avail_plot_types) + avail_plot_types=avail_plot_types, + avail_external_packages=avail_external_packages, + external_package_links=self.external_package_links) #Write Mean diagnostics index HTML file: with open(index_html_file, 'w', encoding='utf-8') as ofil: @@ -759,4 +782,4 @@ def jinja_list(seas_list): print(" ...Webpages have been generated successfully.") #++++++++++++++++++++ #End Class definition -#++++++++++++++++++++ \ No newline at end of file +#++++++++++++++++++++ diff --git a/lib/website_templates/template_index.html b/lib/website_templates/template_index.html index 4b2659cf8..db49975e1 100644 --- a/lib/website_templates/template_index.html +++ b/lib/website_templates/template_index.html @@ -48,5 +48,23 @@

Plot Types

{% endfor %} +
+

External Diagnostic Packages

+
+ +
+ {% for avail_type in avail_external_packages %} + {% if avail_type in external_package_links.keys() %} + + {% else %} +
+ {{ avail_type }} +
+ {% endif %} + {% endfor %} +
+ - \ No newline at end of file +