@@ -11,9 +11,9 @@ present cycle using::
11
11
cylc cyclepoint --offset-hours=-3
12
12
13
13
The `isodatetime `_ command provides functionality
14
- beyond ``cylc cyclepoint ``. Rose also provides the :envvar: ` ROSE_DATAC ` environment
15
- variable which provides an easy way to get the path of the `` share/cycle ``
16
- directory.
14
+ beyond ``cylc cyclepoint ``. Cylc also provides the `` CYLC_TASK_SHARE_CYCLE_DIR ``
15
+ environment variable which provides an easy way to get the path of the
16
+ `` share/cycle/<point> `` directory.
17
17
18
18
19
19
The ``isodatetime `` Command
@@ -72,6 +72,11 @@ which allows you to use the special ``ref`` argument:
72
72
The ``ROSE_DATAC `` Environment Variable
73
73
---------------------------------------
74
74
75
+ .. note ::
76
+
77
+ From Cylc 8.5.0 the variable ``CYLC_TASK_SHARE_CYCLE_DIR `` should be preferred
78
+ to ``ROSE_DATAC ``.
79
+
75
80
There are two locations where task output is likely to be located:
76
81
77
82
The work directory
@@ -96,22 +101,28 @@ The share directory
96
101
<run directory>/share/cycle/<cycle>
97
102
98
103
These are called the ``share/cycle `` directories.
99
-
100
- The path to the root of the share directory is provided by the
101
- ``CYLC_WORKFLOW_SHARE_DIR `` environment variable so the path to the cycle
102
- subdirectory would be::
104
+ ``CYLC_TASK_SHARE_CYCLE_DIR `` provides the path to::
103
105
104
106
"$CYLC_WORKFLOW_SHARE_DIR/cycle/$CYLC_TASK_CYCLE_POINT"
105
107
106
- The :ref: `command-rose-task-env ` command provides the environment variable
107
- :envvar: `ROSE_DATAC ` which is a more convenient way to obtain the path of the
108
- ``share/cycle `` directory.
109
108
110
109
To get the path to a previous (or a future) ``share/cycle `` directory we can
111
- provide an offset to :ref: `command-rose-task-env ` e.g::
110
+ provide an offset to isodatetime:
111
+
112
+ .. code-block :: bash
113
+
114
+ isodatetime " ${CYLC_TASK_CYCLE_POINT} --offset -P1D
115
+
116
+ Which can be used to provide custom offset directory locations:
117
+
118
+ .. code-block:: bash
119
+
120
+ # Cylc task script
121
+ CYCLE_POINT_MINUS_P1D=$( isodatetime " ${CYLC_TASK_CYCLE_POINT} --offset -P1D)"
112
122
113
- rose task-env --cycle-offset=PT1H
123
+ TODAYS_DATA=" ${CYLC_WORKFLOW_SHARE_DIR} /cycle/${CYLC_TASK_CYCLE_POINT} /output.data"
124
+ YESTERDAYS_DATA=" ${CYLC_WORKFLOW_SHARE_DIR} /cycle/${CYCLE_POINT_MINUS_P1D} /output.data"
114
125
115
- The path is then made available as the `` ROSE_DATACPT1H `` environment variable.
126
+ # Do something with "${YESTERDAYS_DATA}" and "${TODAYS_DATA}"
116
127
117
128
.. TODO - Write a short practical using ROSE_DATAC and isodatetime.
0 commit comments