Skip to content

Commit

Permalink
Add a few local variables to template.cupid
Browse files Browse the repository at this point in the history
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
mnlevy1981 committed Dec 20, 2024
1 parent 48d78fb commit 4b2ac3b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
1 change: 1 addition & 0 deletions machines/config_workflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<workflow_jobs id="case.cupid" prepend="default">
<job name="case.cupid">
<template>template.cupid</template>
<hidden>false</hidden>
<dependency>case.st_archive</dependency>
<prereq>1</prereq>
<runtime_parameters MACH="derecho">
Expand Down
45 changes: 40 additions & 5 deletions machines/template.cupid
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

0 comments on commit 4b2ac3b

Please sign in to comment.