diff --git a/CIME/XML/env_batch.py b/CIME/XML/env_batch.py index 93545a146a0..9cf4136b539 100644 --- a/CIME/XML/env_batch.py +++ b/CIME/XML/env_batch.py @@ -969,11 +969,14 @@ def _submit_single_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": + if ( + batch_system == "pbs" or batch_system == "cobalt" + ) and " -A " in submitargs: submitargs = submitargs.replace("-A", "") - elif batch_system == "lsf": + elif batch_system == "lsf" and " -P " in submitargs: submitargs = submitargs.replace("-P", "") + elif batch_system == "slurm" and " --account " in submitargs: + submitargs = submitargs.replace("--account", "") if dep_jobs is not None and len(dep_jobs) > 0: logger.debug("dependencies: {}".format(dep_jobs))