Source code for pycif.plugins.models.template.io.inputs.make_auxiliary
from ......utils import path
from logging import debug
[docs]
def make_auxiliary(self, ddi, runsubdir,
do_simu=True, mode="fwd",
**kwargs):
"""
Initialize every file or information needed by the model to run, excluding
data that are initialized through the function ``native2inputs``.
This includes name lists for Fortran, configuration files, etc.
Every basic files related to the model should be first initialized in
``self.workdir/model`` at the initialization step in the function ``compile``.
Hereafter, files are link/copied to ``runsubdir`` from the reference ones in
``self.workdir/model``
Note:
For configuration files, one should follow the following basic rules:
- paths expected by the model should always point to the current
``runsubdir``; thus the executable should be linked or copied in
``runsubdir``; in addition, every extra file should be link with a
fixed name and the corresponding name should be given in the
name-list or configuration file.
- as many model parameters should be easily modified through the yaml
configuration file; however, for some reasons, it may be
preferable to limit the possibilities for pyCIF by keeping
some parameters fixed; this question is up to the developer
implementing one model
Args:
self: the model plugin
ddi (datetime.datetime): the start data identifying
the present simulation period
runsubdir (str): path to the current sub-simulation work directory
do_simu (bool): if False, the simulation does not need to be run,
hence, in principle, no auxiliary data needs to be initialized
mode (str): the running mode to compute
"""
# Do nothing if only_outputs = True
if self.only_outputs:
debug("Doing nothing in make_auxiliary as only_outputs is True.")
return
# Otherwise initialize auxiliary info
debug("Initializing auxiliary information for the model {}/{} "
"with parameters: \n"
" self: {}\n"
" ddi: {}\n"
" runsubdir: {}\n"
" do_simu: {}\n"
" mode: {}\n".format(self.plugin.name, self.plugin.version,
self, ddi, runsubdir, do_simu, mode))