[988b0bd] | 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 | |
---|
[fa1548b] | 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 |
---|
[988b0bd] | 24 | |
---|
| 25 | #copy default optios |
---|
[fa1548b] | 26 | echo copy default options from $options_default |
---|
[988b0bd] | 27 | cp -r $options_default $test_tmp/options |
---|
[fa1548b] | 28 | |
---|
[988b0bd] | 29 | #override default options |
---|
[fa1548b] | 30 | if [[ -d "$test_dir/options" ]] && [[ "$(ls -A ${test_dir}/options)" ]]; then |
---|
[988b0bd] | 31 | cp -r ${test_dir}/options/* $test_tmp/options/ |
---|
[fa1548b] | 32 | echo copy specific options for this test from ${test_dir}/options |
---|
[988b0bd] | 33 | fi |
---|
[fa1548b] | 34 | |
---|
[988b0bd] | 35 | # copy paths form repo source exec tmp dir |
---|
[fa1548b] | 36 | echo copy ${test_dir}/pathnames |
---|
[988b0bd] | 37 | cp ${test_dir}/pathnames $test_tmp |
---|
[fa1548b] | 38 | |
---|
[988b0bd] | 39 | # make output dir locally |
---|
[fa1548b] | 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 |
---|
[988b0bd] | 51 | ln -s $FP_exec ${test_tmp}/flexpartnoresm |
---|
[fa1548b] | 52 | echo link $FP_exec to ${test_tmp}/flexpartnoresm |
---|
[988b0bd] | 53 | |
---|
[fa1548b] | 54 | echo $test_dir is ready to run |
---|
| 55 | echo |
---|
[988b0bd] | 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 | |
---|