Closed JiaweiZhuang closed 4 years ago
I think this feature would also help create many run directories at once, if ever anyone wants to do that. I took a first pass at this, off of GCHP 12.6.1. Instructions are in the createRunDir.sh header. Please give it a try and let me know what you think. https://github.com/geoschem/gchp/commit/380ed9b90f31094bab8f9e8463981e20c8b5284a
We are planning on putting this capability into 13.0.0.
@LiamBindle worked on something similar that will address this feature request. See GEOS-Chem PR https://github.com/geoschem/geos-chem/pull/459. We anticipate it going into GEOS-Chem 13.1 for use with both GEOS-Chem Classic and GCHP. I am therefore closing this feature request.
Problem
createRunDir.sh uses interactive questions. Although this is instructive for first-time users, it makes the installation process hard to automate. Automation is crucial in many scenarios: continuous integration (#36), creating new cloud images and containers, allowing Spack installation and Conda installation (geoschem/geos-chem#47). Spack has a thread on the difficulty of handling interactive questions: spack/spack#7983. In general, removing all interactive parts in the installation process will make any kinds of automatic deployments much easier.
So far I've been using a hacky script to automate the process of building GCHP. To handle the questions from
createRunDir.sh
, I simply pipe the answers to it:Each item corresponds to: input data path, simulation type (2 = standard), metfield type (1 = GEOSFP), rundir parent path, rundir name, whether to version-control rundir.
There are multiple problems with this:
printf
body is difficult to understand, as it only shows the answers, not the questions.gFTL
, so the new answer string should be changed to"$HOME/ExtData \n $HOME/gFTL/install ..."
config
file only answers part of the questions (file paths, but not simulation types), and the existence of this file will change the total number of questions asked.Suggestions
Ideally, the script will have strictly two modes: interactive and silent, and nothing in between (no partial answers, to avoid incomplete & stale config files)
The
config
file should describe all the questions including simulation types, etc. Then, the rundir creation is simply:The config file may be created manually, or generated by running the script interactively.
As a reference, Intel compilers also have an interactive installation process by default, but also supports Silent Installation.