Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Add job documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreso committed Jul 6, 2020
1 parent 62fe955 commit b0a42d1
Show file tree
Hide file tree
Showing 18 changed files with 133 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

The :code:`CAREFUL_COPY_FILE` job will copy a file. If the :code:`<TO>`
argument has a directory component, that directory will be created.
This is an extension of the normal :code:`cp` command
which will *not* create directories in this way.
This job superseded an older version called :code:`CAREFULL_COPY`
and should be used instead.
5 changes: 5 additions & 0 deletions share/ert/forward-models/docs/description/COPY_DIRECTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The job copies the directory :code:`<FROM>` to the target :code:`<TO>`. If
:code:`<TO>` points to a non-existing directory structure, it will be
created first. If the :code:`<TO>` folder already exist it creates a new directory within the existing one.
E.g. :code:`COPY_DIRECTORY (<FROM>=foo, <TO>=bar)` creates :code:`bar/foo` if the directory
:code:`bar` already exists. If :code:`bar` does not exist it becomes a copy of :code:`foo`.
5 changes: 5 additions & 0 deletions share/ert/forward-models/docs/description/COPY_FILE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

The :code:`COPY_FILE` job will copy a file. If the :code:`<TO>`
argument has a directory component, that directory will be created.
This is an extension of the normal :code:`cp` command
which will *not* create directories in this way.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The :code:`DELETE_DIRECTORY` job will recursively remove a directory
and all the files in the directory. Like the :code:`DELETE_FILE` job
it will *only* delete files and directories which are owned by the
current user. If one delete operation fails the job will continue, but
unless all delete calls succeed (parts of) the directory structure
will remain.
6 changes: 6 additions & 0 deletions share/ert/forward-models/docs/description/DELETE_FILE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The :code:`DELETE_FILE` job will *only* remove files which are owned
by the current user, *even if* file system permissions would have
allowed the delete operation to proceed. The :code:`DELETE_FILE` will
*not* delete a directory, and if presented with a symbolic link it
will *only* delete the link, and not the target.

2 changes: 2 additions & 0 deletions share/ert/forward-models/docs/description/MAKE_DIRECTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Will create the directory :code:`<DIRECTORY>`, with all sub
directories.
2 changes: 2 additions & 0 deletions share/ert/forward-models/docs/description/MAKE_SYMLINK.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Will create a symbolic link with name :code:`<LINKNAME>` which points to
:code:`<TARGET>`. If :code:`<LINKNAME>` already exists, it will be updated.
3 changes: 3 additions & 0 deletions share/ert/forward-models/docs/description/MOVE_FILE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The :code:`MOVE_FILE` job will move file to target directory.
If file already exists, this job will move file to the target directory
and then replace the existing file.
1 change: 1 addition & 0 deletions share/ert/forward-models/docs/description/RMS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Forward model for running RMS batches
2 changes: 2 additions & 0 deletions share/ert/forward-models/docs/description/SYMLINK.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Will create a symbolic link with name :code:`<LINKNAME>` which points to
:code:`<TARGET>`. If :code:`<LINKNAME>` already exists, it will be updated.
3 changes: 3 additions & 0 deletions share/ert/forward-models/docs/description/TEMPLATE_RENDER.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Loads the data from each file (:code:`some/path/filename.xxx`) in :code:`INPUT_FILES`
and exposes it as the variable :code:`filename`. It then loads the Jinja2
template :code:`TEMPLATE_FILE` and dumps the rendered result to :code:`OUTPUT`.
3 changes: 3 additions & 0 deletions share/ert/forward-models/docs/examples/CAREFUL_COPY_FILE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. code-block:: bash
FORWARD_MODEL CAREFUL_COPY_FILE(<FROM>=file1, <TO>=path/to/directory/file1)
3 changes: 3 additions & 0 deletions share/ert/forward-models/docs/examples/COPY_FILE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. code-block:: bash
FORWARD_MODEL COPY_FILE(<FROM>=file1, <TO>=path/to/directory/file1)
9 changes: 9 additions & 0 deletions share/ert/forward-models/docs/examples/ECLIPSE100.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The version, number of cpu and whether or not to ignore errors can
be configured in the configuration file when adding the job, as such:

.. code-block:: bash
FORWARD_MODEL ECLIPSE100(<ECLBASE>, <VERSION>=xxxx, <OPTS>="--ignore-errors")
The :code:`OPTS` argument is optional and can be removed, thus running eclipse
without ignoring errors
9 changes: 9 additions & 0 deletions share/ert/forward-models/docs/examples/ECLIPSE300.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The version, number of cpu and whether or not to ignore errors can
be configured in the configuration file when adding the job, as such:

.. code-block:: bash
FORWARD_MODEL ECLIPSE300(<ECLBASE>, <VERSION>=xxxx, <OPTS>="--ignore-errors")
The :code:`OPTS` argument is optional and can be removed, thus running eclipse
without ignoring errors
10 changes: 10 additions & 0 deletions share/ert/forward-models/docs/examples/FLOW.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The version, number of cpu and whether or not to ignore errors can
be configured in the configuration file when adding the job, as such:

.. code-block:: bash
FORWARD_MODEL FLOW(<ECLBASE>, <VERSION>=xxxx, <OPTS>="--ignore-errors")
The :code:`OPTS` argument is optional and can be removed, thus running flow
without ignoring errors.

32 changes: 32 additions & 0 deletions share/ert/forward-models/docs/examples/RMS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Running the forward model
#########################

.. code-block:: bash
FORWARD_MODEL RMS(<IENS> <RMS_PROJECT> <RMS_WORKFLOW>)
RMS script documentation
########################

The script must be invoked with minimum three positional arguments:

Positional arguments:
IENS
Realization number
RMS_PROJECT
The RMS project we are running
RMS_WORKFLOW
The rms workflow we intend to run

Optional arguments:
-r, --run-path RUN_PATH
The directory which will be used as cwd when running
rms
-t, --target-file TARGET_FILE
name of file which should be created/updated by rms
-i, --import-path IMPORT_PATH
the prefix of all relative paths when rms is importing
-e, --export-path EXPORT_PATH
the prefix of all relative paths when rms is exporting
-v, --version VERSION
the prefix of all relative paths when rms is exporting
25 changes: 25 additions & 0 deletions share/ert/forward-models/docs/examples/TEMPLATE_RENDER.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Given an input file :code:`my_input.json`:

.. code-block:: json
{
"my_variable": "my_value"
}
And a template file :code:`tmpl.jinja`:

.. code-block:: bash
This is written in my file together with {{my_input.my_variable}}
This job will produce an output file:

.. code-block:: bash
This is written in my file together with my_value
By invoking the :code:`FORWARD_MODEL` as such:

.. code-block:: bash
FORWARD_MODEL TEMPLATE_RENDER(<INPUT_FILES>=my_input.json, <TEMPLATE_FILE>=tmpl.jinja, <OUTPUT_FILE>=output_file)

0 comments on commit b0a42d1

Please sign in to comment.