Skip to content
Snippets Groups Projects
Commit 0ea6ba92 authored by ALEXANDER Peter's avatar ALEXANDER Peter
Browse files

Change to create scenario to specific common properties file on command line

parent 6e88fe9b
No related branches found
No related tags found
No related merge requests found
......@@ -7,18 +7,45 @@
common_prop_file=/exports/csce/eddie/geos/groups/LURG/models/PLUM/output/common_properties
output_dir=/exports/csce/eddie/geos/groups/LURG/models/PLUM/output
filename="/exports/csce/eddie/geos/groups/LURG/models/PLUM/$1"
overwrite=0
if [[ $* == *-O* ]]; then overwrite=1
else overwrite=0
for arg in "$@"
do
case $arg in
-O|-o)
overwrite=1
shift # Remove argument name from processing
;;
-C|-c)
common_prop_file="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
*)
[[ ! -z $1 ]] && file="$1"
shift # Remove argument value from processing
;;
esac
done
echo scenariofile=$file, common_prop_file=$common_prop_file, overwrite=$overwrite
echo
# not keen on the way this directory is fixed but for backward compatiblity will not change it
filename="/exports/csce/eddie/geos/groups/LURG/models/PLUM/$file"
if [ ! -f "$filename" ]; then
echo "File for scenario data $filename does not exist."
echo "Need to specify scenario table file correctly. Stopping!"
exit -1
fi
if [ "$#" -lt 1 ]; then
echo "Need to specify scenario table file"
exit
if [ ! -f "$common_prop_file" ]; then
echo "Common properties file $common_prop_file does not exist."
echo "Need to specify with -c or use default. Stopping!"
exit -1
fi
echo "Generating scenarios into $output_dir"
while read -r datarow
......@@ -84,4 +111,4 @@ if [[ $* == *-s* ]]; then
R < /exports/csce/eddie/geos/groups/LURG/models/PLUM/plumv2/scripts/createShockFiles.R --no-save --args $1 $endYear
else
echo "Not running R shock script"
fi
\ No newline at end of file
fi
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