Skip to content

Commit 33e3ed5

Browse files
authored
Merge pull request #736 from wxtim/feature.CYLC_SHARE_CYCLE_DIR
Updated docs about using ROSE_DATAC
2 parents 1bf6686 + eaae0cc commit 33e3ed5

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

src/reference/job-script-vars/var-list.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ CYLC_WORKFLOW_RUN_DIR # Location of the run directory in
2525
CYLC_WORKFLOW_HOST # Host running the workflow process
2626
CYLC_WORKFLOW_OWNER # User ID running the workflow process
2727

28-
CYLC_WORKFLOW_SHARE_DIR # Workflow (or task!) shared directory (see below)
28+
CYLC_WORKFLOW_SHARE_DIR # Workflow (or task!) shared directory
2929
CYLC_WORKFLOW_UUID # Workflow UUID string
30-
CYLC_WORKFLOW_WORK_DIR # Workflow work directory (see below)
30+
CYLC_WORKFLOW_WORK_DIR # Workflow work directory
3131

3232
CYLC_TASK_JOB # Job identifier expressed as
3333
# CYCLE-POINT/TASK-NAME/SUBMIT-NUMBER
@@ -54,6 +54,8 @@ CYLC_TASK_LOG_ROOT # The job script path
5454
# e.g. ~/cylc-run/foo/log/job/20110511T1800Z/t1/01/job
5555
CYLC_TASK_WORK_DIR # Location of task work directory (see below)
5656
# e.g. ~/cylc-run/foo/work/20110511T1800Z/t1
57+
CYLC_TASK_SHARE_CYCLE_DIR # The share/cycle/<cycle-point> directory
58+
# for this task.
5759

5860
CYLC_TASK_NAMESPACE_HIERARCHY # Linearised family namespace of the task,
5961
# e.g. root postproc t1

src/workflow-design-guide/general-principles.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -451,27 +451,30 @@ Primarily, for self-containment (see :ref:`Self-Contained Workflows`) shared IO
451451
paths should be under the *workflow share directory*, the location of which is
452452
passed to all tasks as ``$CYLC_WORKFLOW_SHARE_DIR``.
453453

454-
The ``rose task-env`` utility can provide additional environment
455-
variables that refer to static and cyclepoint-specific locations under the
456-
workflow share directory.
454+
The ``$CYLC_TASK_SHARE_CYCLE_DIR`` variable can be used to target
455+
cyclepoint-specific locations under the workflow share directory.
457456

458-
.. code-block:: cylc
457+
Sometimes it may be useful to refer to other cycles - to do this use
458+
``isodatetime``:
459459

460-
[runtime]
461-
[[my-task]]
462-
env-script = $(eval rose task-env -T P1D -T P2D)
460+
.. code-block:: bash
463461
464-
For a current cycle point of ``20170105`` this will make the following
465-
variables available to tasks:
462+
# Cylc task script
463+
CYCLE_POINT_MINUS_P1D=$(isodatetime "${CYLC_TASK_CYCLE_POINT} --offset -P1D)"
464+
SHARE_CYCLE_DIR_MINUS_P1D="${CYLC_WORKFLOW_SHARE_DIR}/cycle/${CYCLE_POINT_MINUS_P1D}"
465+
mkdir -p "${SHARE_CYCLE_DIR_MINUS_P1D}"
466+
echo "I believe in ..." > "${SHARE_CYCLE_DIR_MINUS_P1D}/somefile"
466467
467-
.. code-block:: bash
468+
See ``isodatetime --help`` for usage instructions.
469+
470+
.. versionadded:: 8.5.0
468471
469-
ROSE_DATA=$CYLC_WORKFLOW_SHARE_DIR/data
470-
ROSE_DATAC=$CYLC_WORKFLOW_SHARE_DIR/cycle/20170105
471-
ROSE_DATACP1D=$CYLC_WORKFLOW_SHARE_DIR/cycle/20170104
472-
ROSE_DATACP2D=$CYLC_WORKFLOW_SHARE_DIR/cycle/20170103
472+
``$CYLC_TASK_SHARE_CYCLE_DIR`` (used in combination with the ``isodatetime``
473+
command) is designed to
474+
provide a Cylc internal replacement for the use of ``rose task-env``
475+
to provide ``$ROSE_DATAC`` and derived variables.
473476
474-
Subdirectories of ``$ROSE_DATAC`` etc. should be agreed between
477+
Subdirectories of ``$CYLC_TASK_SHARE_CYCLE_DIR`` should be agreed between
475478
different sub-systems of the workflow; typically they are named for the
476479
file-generating tasks, and the file-consuming tasks should know to look there.
477480

0 commit comments

Comments
 (0)