diff --git a/CIME/XML/env_batch.py b/CIME/XML/env_batch.py index f12db7e2f0f..93545a146a0 100644 --- a/CIME/XML/env_batch.py +++ b/CIME/XML/env_batch.py @@ -607,7 +607,6 @@ def _process_args(self, case, submit_arg_nodes, job, resolve=True): flag, name = self._get_argument(case, arg) except ValueError: continue - if self._batchtype == "cobalt" and job == "case.st_archive": if flag == "-n": name = "task_count" @@ -964,7 +963,17 @@ def _submit_single_job( return - submitargs = case.get_value("BATCH_COMMAND_FLAGS", subgroup=job) + submitargs = case.get_value("BATCH_COMMAND_FLAGS", subgroup=job, resolved=False) + + project = case.get_value("PROJECT", subgroup=job) + + if not project: + # If there is no project then we need to remove the project flag + # slurm defines --account only on machines that require it, so this strip isn't required + if batch_system == "pbs" or batch_system == "cobalt": + submitargs = submitargs.replace("-A", "") + elif batch_system == "lsf": + submitargs = submitargs.replace("-P", "") if dep_jobs is not None and len(dep_jobs) > 0: logger.debug("dependencies: {}".format(dep_jobs))