diff --git a/mcluster_script.sh b/mcluster_script.sh index 5c14a5b6daee6b0bce8236a5589f86f63c53c16e..59492ca441367d615c0eb81d2a18a6d21b35b659 100755 --- a/mcluster_script.sh +++ b/mcluster_script.sh @@ -2,39 +2,31 @@ ##### # Script to execute mcluster to set up inital settings for a cluster. -# Useage: run the script from anywhere . Change the values of NAME_RUN, MCLUSTER_COMMANDS and TARGET_DIR to your liking. After running this script you can use the output to feed it to nbody6 +# Useage: run the script from anywhere . Change the values of NAME_RUN, MCLUSTER_COMMANDS and TARGET_DIR to your liking. After running this script you can use the output to feed it to nbody6. +# Input: name of run # 17-05-2019 changing the target directory to the directory that this script is being executed from - - - ###### -# TODO: -# Check if dir exists. - # Dont change these settings + +# Check if a name is supplied +if [ $# -gt 0 ]; then + NAME_RUN=$1 +else + NAME_RUN="default" +fi +echo "Name run: $NAME_RUN" + MCLUSTER_CONFIG_DIR=$PWD #MCLUSTER_CONFIG_DIR='/vol/ph/astro_code/dhendriks/work_dir/mcluster' MCLUSTER_EXECUTABLE='/vol/ph/astro_code/dhendriks/mcluster/mcluster' - # Change these settings TARGET_DIR=$MCLUSTER_CONFIG_DIR -NAME_RUN='test' # Store settings for mcluster in here. MCLUSTER_COMMANDS="-C5 -N 1000 -R 0.8 -P 3 -W 3.0 -f 1 -b 0.5 -o" - -# Check if dir is empty: if not: empty it -# if [ "$(ls -A $TARGET_DIR)" ]; then -# echo "Take action $TARGET_DIR is not Empty" -# echo "Deleting content:" -# rm $TARGET_DIR/* -# else -# echo "$TARGET_DIR is Empty" -# fi - echo "Writing files to $MCLUSTER_CONFIG_DIR" # Execute mcluster cmd @@ -52,6 +44,6 @@ if [ -f "$MCLUSTER_CONFIG_DIR/$NAME_RUN.input.fort.12" ]; then mv -f $MCLUSTER_CONFIG_DIR/$NAME_RUN.input.fort.12 $MCLUSTER_CONFIG_DIR/fort.12 fi -# if [ -f "$MCLUSTER_CONFIG_DIR/$NAME_RUN.input.fort.12" ]; then -# mv -f $MCLUSTER_CONFIG_DIR/$NAME_RUN.input.fort.12 $MCLUSTER_CONFIG_DIR/fort.12 -# fi \ No newline at end of file +if [ -f "$MCLUSTER_CONFIG_DIR/$NAME_RUN.dat.10" ]; then + mv -f $MCLUSTER_CONFIG_DIR/$NAME_RUN.dat.10 $MCLUSTER_CONFIG_DIR/dat.10 +fi \ No newline at end of file