Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop] Fix issue 555 (restore default behavior of EXPT_BASEDIR option) #562

Merged
merged 3 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/UsersGuide/source/ConfigWorkflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Directory Parameters
-----------------------

``EXPT_BASEDIR``: (Default: "")
The full path to the base directory in which the experiment directory (``EXPT_SUBDIR``) will be created. If this is not specified or if it is set to an empty string, it will default to ``${HOMEdir}/../expt_dirs``, where ``${HOMEdir}`` contains the full path to the ``ufs-srweather-app`` directory.
The full path to the base directory in which the experiment directory (``EXPT_SUBDIR``) will be created. If this is not specified or if it is set to an empty string, it will default to ``${HOMEdir}/../expt_dirs``, where ``${HOMEdir}`` contains the full path to the ``ufs-srweather-app`` directory. If set to a relative path, the provided path will be appended to the default value ``${HOMEdir}/../expt_dirs``. For example, if ``EXPT_BASEDIR=some/relative/path`` (i.e. a path that does not begin with ``/``), the value of ``EXPT_BASEDIR`` used by the workflow will be ``EXPT_BASEDIR=${HOMEdir}/../expt_dirs/some/relative/path``.

``EXPT_SUBDIR``: (Default: "")
The user-designated name of the experiment directory (*not* its full path). The full path to the experiment directory, which will be contained in the variable ``EXPTDIR``, will be:
Expand Down
5 changes: 3 additions & 2 deletions ush/config_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ workflow:
# EXPT_BASEDIR:
# The base directory in which the experiment directory will be created.
# If this is not specified or if it is set to an empty string, it will
# default to ${HOMEdir}/../expt_dirs.
# default to ${HOMEdir}/../expt_dirs. If set to a relative path, the
# path will be appended to the default value ${HOMEdir}/../expt_dirs
#
# EXPT_SUBDIR:
# The name that the experiment directory (without the full path) will
Expand All @@ -475,7 +476,7 @@ workflow:
EXPT_BASEDIR: '{{ workflow.EXPT_BASEDIR }}'
EXPT_SUBDIR: '{{ EXPT_SUBDIR }}'
EXEC_SUBDIR: "exec"
EXPTDIR: '{{ [EXPT_BASEDIR, EXPT_SUBDIR]|path_join }}'
EXPTDIR: ""
#
#-----------------------------------------------------------------------
#
Expand Down
4 changes: 1 addition & 3 deletions ush/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ def load_config_for_setup(ushdir, default_config, user_config):
if not (v is None or v == ""):
cfg_d[sect][k] = str_to_list(v)

for k, v in cfg_d["task_run_fcst"].items():
print(f"*** {k}: {v}")

# Mandatory variables *must* be set in the user's config or the machine file; the default value is invalid
mandatory = [
"EXPT_SUBDIR",
Expand Down Expand Up @@ -383,6 +380,7 @@ def setup(USHdir, user_config_fn="config.yaml"):
#

expt_subdir = workflow_config.get("EXPT_SUBDIR", "")
workflow_config["EXPTDIR"] = os.path.join(expt_basedir, expt_subdir)
exptdir = workflow_config["EXPTDIR"]
preexisting_dir_method = workflow_config.get("PREEXISTING_DIR_METHOD", "")
try:
Expand Down