diff --git a/mcluster_script.sh b/mcluster_script.sh index b8e9f2b618708a987015b4a94c52c9a1c3f4da65..5c14a5b6daee6b0bce8236a5589f86f63c53c16e 100755 --- a/mcluster_script.sh +++ b/mcluster_script.sh @@ -2,33 +2,40 @@ ##### # Script to execute mcluster to set up inital settings for a cluster. -# Useage: run the script. 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 +# 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 -MCLUSTER_CONFIG_DIR='/vol/ph/astro_code/dhendriks/work_dir/mcluster' +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="-C0 -o" +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 -DIR="test" -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 +# 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 $MCLUSTER_EXECUTABLE $MCLUSTER_COMMANDS $MCLUSTER_CONFIG_DIR/$NAME_RUN | tee $MCLUSTER_CONFIG_DIR/$NAME_RUN.summary @@ -43,4 +50,8 @@ 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 +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