Skip to content
Snippets Groups Projects
Commit 6f534877 authored by David Hendriks's avatar David Hendriks
Browse files

minor changes to mcluster script. almost deleted imrans whole filesystem..

parent 650b41ae
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment