diff --git a/docs/source/setup.rst b/docs/source/setup.rst index 0916033cbd..1f94610f65 100644 --- a/docs/source/setup.rst +++ b/docs/source/setup.rst @@ -35,7 +35,7 @@ The following command examples include variables for reference but users should cd workflow ./setup_expt.py gfs forecast-only --idate $IDATE --edate $EDATE [--app $APP] [--start $START] [--interval $INTERVAL_GFS] [--resdetatmos $RESDETATMOS] [--resdetocean $RESDETOCEAN] - [--pslot $PSLOT] [--configdir $CONFIGDIR] [--comroot $COMROOT] [--expdir $EXPDIR] + [--pslot $PSLOT] [--configdir $CONFIGDIR] [--comroot $COMROOT] [--expdir $EXPDIR] [--account $ACCOUNT] where: @@ -61,6 +61,7 @@ where: * ``$INTERVAL_GFS`` is the forecast interval in hours [default: 6] * ``$COMROOT`` is the path to your experiment output directory. Your ``ROTDIR`` (rotating com directory) will be created using ``COMROOT`` and ``PSLOT``. [default: $HOME (but do not use default due to limited space in home directories normally, provide a path to a larger scratch space)] * ``$EXPDIR`` is the path to your experiment directory where your configs will be placed and where you will find your workflow monitoring files (i.e. rocoto database and xml file). DO NOT include PSLOT folder at end of path, it will be built for you. [default: $HOME] + * ``$ACCOUNT`` is the HPC (i.e. slurm or PBS) account to use for the experiment. [default: $HPC_ACCOUNT; if $HPC_ACCOUNT is not set, then the default in the host file (workflow/hosts/.yaml) will be used] Examples: diff --git a/workflow/generate_workflows.sh b/workflow/generate_workflows.sh index 6a4cb9910a..c98fa3028a 100755 --- a/workflow/generate_workflows.sh +++ b/workflow/generate_workflows.sh @@ -145,6 +145,7 @@ while [[ $# -gt 0 && "$1" != "--" ]]; do t) _tag="_${OPTARG}" ;; v) _verbose=true ;; V) _very_verbose=true && _verbose=true && _verbose_flag="-v" ;; + A) _set_account=true && _hpc_account="${OPTARG}" ;; d) _debug=true && _very_verbose=true && _verbose=true && _verbose_flag="-v" && PS4='${LINENO}: ' ;; h) _usage && exit 0 ;; :) diff --git a/workflow/setup_expt.py b/workflow/setup_expt.py index 27da4943d3..574dc0d91a 100755 --- a/workflow/setup_expt.py +++ b/workflow/setup_expt.py @@ -235,6 +235,7 @@ def _common_args(parser): parser.add_argument('--idate', help='starting date of experiment, initial conditions must exist!', required=True, type=lambda dd: to_datetime(dd)) parser.add_argument('--edate', help='end date experiment', required=False, type=lambda dd: to_datetime(dd)) + parser.add_argument('--account', help='HPC account to use; default is host-dependent', required=False, default=os.getenv('HPC_ACCOUNT')) parser.add_argument('--interval', help='frequency of forecast (in hours); must be a multiple of 6', type=_validate_interval, required=False, default=6) parser.add_argument('--icsdir', help='full path to user initial condition directory', type=str, required=False, default='') parser.add_argument('--overwrite', help='overwrite previously created experiment (if it exists)', @@ -407,6 +408,10 @@ def main(*argv): validate_user_request(host, user_inputs) + # Update the default host account if the user supplied one + if user_inputs.account is not None: + host.info.ACCOUNT = user_inputs.account + # Determine ocean resolution if not provided if user_inputs.resdetocean <= 0: user_inputs.resdetocean = get_ocean_resolution(user_inputs.resdetatmos)