-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a few local variables to template.cupid
These will eventually be populated from an env_?.xml file, but for now starting a list of variables we want the user to be able to set. Also added two minor updates: 1. unset PYTHONPATH to ensure we are only using conda-installed python packages 2. The API for the script to generate the ADF config file has been changed - we now point to the directory containing a CUPiD config file rather than the CUPiD example
- Loading branch information
1 parent
48d78fb
commit 4b2ac3b
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,47 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
|
||
# Batch system directives | ||
{{ batchdirectives }} | ||
|
||
# Set environment for CESM | ||
source .env_mach_specific.sh | ||
|
||
# Use cupid-infrastructure environment for running these scripts | ||
# Note: on derecho, the cesmdev module creates a python conflict | ||
# by setting $PYTHONPATH; since this is conda-based we | ||
# want an empty PYTHONPATH environment variable | ||
MACH=`./xmlquery --value MACH` | ||
unset PYTHONPATH | ||
conda activate cupid-infrastructure | ||
{{ srcroot }}/tools/CUPiD/helper_scripts/generate_cupid_config_for_cesm_case.py \ | ||
--cesm-root {{ SRCROOT }} | ||
|
||
cupid-timeseries | ||
cupid-diagnostics | ||
# Set variables that should eventually come from environment file | ||
CUPID_EXAMPLE=key_metrics | ||
RUN_CUPID_ANALYSIS=TRUE | ||
RUN_CUPID_TIMESERIES=TRUE | ||
|
||
if [ "${RUN_CUPID_ANALYSIS}" == "TRUE" ]; then | ||
# 1. Generate CUPiD config file | ||
{{ srcroot }}/tools/CUPiD/helper_scripts/generate_cupid_config_for_cesm_case.py \ | ||
--cesm-root {{ SRCROOT }} | ||
|
||
# 2. Generate ADF config file | ||
{{ srcroot }}/tools/CUPiD/helper_scripts/generate_adf_config_file.py \ | ||
--cesm-root {{ SRCROOT }} \ | ||
--cupid-config-loc ${PWD} \ | ||
--adf-template {{ SRCROOT }}/tools/CUPiD/externals/ADF/config_amwg_default_plots.yaml \ | ||
--out-file adf_config.yml | ||
|
||
# 3. Generate timeseries files and run ADF | ||
if [ "${RUN_CUPID_TIMESERIES}" == "TRUE" ]; then | ||
cupid-timeseries | ||
fi | ||
conda deactivate | ||
conda activate cupid-analysis | ||
{{ SRCROOT }}/tools/CUPiD/externals/ADF/run_adf_diag adf_config.yml | ||
|
||
# 4. Run CUPiD and build webpage | ||
conda deactivate | ||
conda activate cupid-infrastructure | ||
cupid-diagnostics | ||
cupid-webpage | ||
fi |