diff --git a/importexp b/importexp index a9f8ff4a5891f09ac104d445e1d6ab1e7102b5a0..46639d160a7bab43b7c5e6efc592eaf5f8d44ade 100755 --- a/importexp +++ b/importexp @@ -12,10 +12,11 @@ DEBUG=false RESTART= #% endhelp -while getopts b:B:d:D:e:Ehis:t:c:r:x OPTOPT +while getopts a:b:B:d:D:e:Ehis:t:c:r:x OPTOPT do case $OPTOPT in #% help + a) ADD_RUN_ROUTINES=$OPTARG ;; b) BUILD_SUBDIR=$OPTARG ;; B) BUILD_DIR=$OPTARG ;; d) DATA_BASE_DIR=$OPTARG ;; @@ -110,6 +111,7 @@ s:^(\s*)(\$\{START\}|srun):\1exit # \2: [ "$OLD_BUILD_DIR" ] && SUBST_BUILD_DIR="s:$OLD_BUILD_DIR:$BUILD_DIR:" [ "$OLD_MODEL_DIR" ] && SUBST_MODEL_DIR="s:$OLD_MODEL_DIR:$MODEL_BASE_DIR:" [ "$OLD_basedir" ] && SUBST_basedir="s:$OLD_basedir:$MODEL_BASE_DIR:" + [ "${ADD_RUN_ROUTINES-}" ] && SUBST_add_run_routines="s:^.*add_run_routines:. ${ADD_RUN_ROUTINES}:" EXEC_SHELL=$(perl -ne '/^\#!\s*(\/\S+)/x and print($1); exit' $RUN_SCRIPT) case $EXEC_SHELL in @@ -140,6 +142,7 @@ cd '$WORK_DIR' '${SUBST_BUILD_DIR-}' '${SUBST_MODEL_DIR-}' '${SUBST_basedir-}' + '"${SUBST_add_run_routines-}"' s/^\s*make_and_change_to_experiment_dir/: &/ ' "$RUN_SCRIPT" > $RUN_FILE