Repository: ESMCI/cime

Issue:
"workflow-case" language is confusing since the word "case" has a special meaning in CIME
This is to strongly advocate for not using the word "case" to describe a set of workflow tasks.  "Case" already has a special meaning in CIME, i.e., an instance of a model configuration.  Overloading this word to also refer to a workflow will cause confusion for the user.  We are still early enough where this change can be made with relatively little fallout, so I'm advocating that we do this ASAP.

Specifically, in the XML, the attribute "case" should not be used - instead something like "id" or "name" could be used to describe a workflow.  In addition, on the create_newcase command, "--workflow-case" should be changed to simply "--workflow"  or maybe "--workflow-id"


Discussion:

Resolving patch:
diff --git a/scripts/lib/CIME/XML/workflow.py b/scripts/lib/CIME/XML/workflow.py
--- a/scripts/lib/CIME/XML/workflow.py
+++ b/scripts/lib/CIME/XML/workflow.py
@@ -31,9 +31,9 @@ def __init__(self, infile=None, files=None):
         if os.path.exists(infile):
             GenericXML.read(self, infile)
 
-    def get_workflow_jobs(self, machine, workflow_case="default"):
+    def get_workflow_jobs(self, machine, workflowid="default"):
         """
-        Return a list of jobs with the first element the name of the case script
+        Return a list of jobs with the first element the name of the script
         and the second a dict of qualifiers for the job
         """
         jobs = []
@@ -41,8 +41,8 @@ def get_workflow_jobs(self, machine, workflow_case="default"):
         findmore = True
         prepend = False
         while findmore:
-            bnode = self.get_optional_child("workflow_jobs", attributes={"case":workflow_case})
-            expect(bnode,"No workflow_case {} found in file {}".format(workflow_case, self.filename))
+            bnode = self.get_optional_child("workflow_jobs", attributes={"id":workflowid})
+            expect(bnode,"No workflow {} found in file {}".format(workflowid, self.filename))
             if prepend:
                 bnodes = [bnode] + bnodes
             else:
@@ -50,10 +50,10 @@ def get_workflow_jobs(self, machine, workflow_case="default"):
             prepend = False
             workflow_attribs = self.attrib(bnode)
             if "prepend" in workflow_attribs:
-                workflow_case = workflow_attribs["prepend"]
+                workflowid = workflow_attribs["prepend"]
                 prepend = True
             elif "append" in workflow_attribs:
-                workflow_case = workflow_attribs["append"]
+                workflowid = workflow_attribs["append"]
             else:
                 findmore = False
         for bnode in bnodes:
diff --git a/scripts/lib/CIME/case/case.py b/scripts/lib/CIME/case/case.py
--- a/scripts/lib/CIME/case/case.py
+++ b/scripts/lib/CIME/case/case.py
@@ -761,7 +761,7 @@ def configure(self, compset_name, grid_name, machine_name=None,
                   multi_driver=False, ninst=1, test=False,
                   walltime=None, queue=None, output_root=None,
                   run_unsupported=False, answer=None,
-                  input_dir=None, driver=None, workflow_case="default"):
+                  input_dir=None, driver=None, workflowid="default"):
 
         expect(check_name(compset_name, additional_chars='.'), "Invalid compset name {}".format(compset_name))
 
@@ -944,7 +944,7 @@ def configure(self, compset_name, grid_name, machine_name=None,
         logger.info("Batch_system_type is {}".format(batch_system_type))
         batch = Batch(batch_system=batch_system_type, machine=machine_name, files=files)
         workflow = Workflow(files=files)
-        bjobs = workflow.get_workflow_jobs(machine=machine_name, workflow_case=workflow_case)
+        bjobs = workflow.get_workflow_jobs(machine=machine_name, workflowid=workflowid)
         env_workflow = self.get_env("workflow")
 
         env_batch.set_batch_system(batch, batch_system_type=batch_system_type)
@@ -1429,7 +1429,7 @@ def create(self, casename, srcroot, compset_name, grid_name,
                multi_driver=False, ninst=1, test=False,
                walltime=None, queue=None, output_root=None,
                run_unsupported=False, answer=None,
-               input_dir=None, driver=None, workflow_case="default"):
+               input_dir=None, driver=None, workflowid="default"):
         try:
             # Set values for env_case.xml
             self.set_lookup_value("CASE", os.path.basename(casename))
@@ -1445,7 +1445,7 @@ def create(self, casename, srcroot, compset_name, grid_name,
                            walltime=walltime, queue=queue,
                            output_root=output_root,
                            run_unsupported=run_unsupported, answer=answer,
-                           input_dir=input_dir, driver=driver, workflow_case=workflow_case)
+                           input_dir=input_dir, driver=driver, workflowid=workflowid)
 
             self.create_caseroot()
 


Test patch: