1 | #!/bin/bash |
---|
2 | |
---|
3 | #input FP exec |
---|
4 | test_dir=$1 |
---|
5 | base_dir=$2 |
---|
6 | FP_exec=$3 |
---|
7 | options_default=../options |
---|
8 | |
---|
9 | #echo FP_exec=$FP_exec |
---|
10 | #echo $FLEXOUT_TMP |
---|
11 | |
---|
12 | #suffix=$(date "+%y-%m-%d_%H%M%S") |
---|
13 | #test_tmp=${FLEXOUT_TMP}${base_dir}${test_dir} |
---|
14 | test_tmp=${base_dir}${test_dir} |
---|
15 | #_${suffix} |
---|
16 | |
---|
17 | #current_dir=$(pwd) |
---|
18 | if [[ -d "$test_tmp" ]] ; then |
---|
19 | echo $test_tmp already exists |
---|
20 | else |
---|
21 | echo create test in $test_tmp |
---|
22 | mkdir $test_tmp |
---|
23 | fi |
---|
24 | |
---|
25 | #copy default optios |
---|
26 | echo copy default options from $options_default |
---|
27 | cp -r $options_default $test_tmp/options |
---|
28 | |
---|
29 | #override default options |
---|
30 | if [[ -d "$test_dir/options" ]] && [[ "$(ls -A ${test_dir}/options)" ]]; then |
---|
31 | cp -r ${test_dir}/options/* $test_tmp/options/ |
---|
32 | echo copy specific options for this test from ${test_dir}/options |
---|
33 | fi |
---|
34 | |
---|
35 | # copy paths form repo source exec tmp dir |
---|
36 | echo copy ${test_dir}/pathnames |
---|
37 | cp ${test_dir}/pathnames $test_tmp |
---|
38 | |
---|
39 | # make output dir locally |
---|
40 | if [[ -d "$test_tmp/output" ]]; then |
---|
41 | echo $test_tmp/output already exists |
---|
42 | else |
---|
43 | mkdir ${test_tmp}/output |
---|
44 | echo create ${test_tmp}/output |
---|
45 | fi |
---|
46 | |
---|
47 | if [[ -L "${test_tmp}/flexpartnoresm" ]]; then |
---|
48 | rm ${test_tmp}/flexpartnoresm |
---|
49 | echo remove existing link ${test_tmp}/flexpartnoresm |
---|
50 | fi |
---|
51 | ln -s $FP_exec ${test_tmp}/flexpartnoresm |
---|
52 | echo link $FP_exec to ${test_tmp}/flexpartnoresm |
---|
53 | |
---|
54 | echo $test_dir is ready to run |
---|
55 | echo |
---|
56 | #cd $test_tmp |
---|
57 | #echo $(pwd) |
---|
58 | #echo $FP_exec |
---|
59 | #echo run $FP_exec '; stdout to out.log' |
---|
60 | #$FP_exec &> out.log # both out and err |
---|
61 | |
---|
62 | |
---|
63 | |
---|