From 91b6ae6354453e44e63ce8e8c2487716fc68c4d4 Mon Sep 17 00:00:00 2001
From: Wouter Peters <wouter.peters@wur.nl>
Date: Tue, 11 Jun 2013 11:32:15 +0000
Subject: [PATCH] the start_ctdas script now makes a new folder and first
 copies all python files to it

---
 start_ctdas.sh | 24 +++++++++++++++++-------
 template.jb    |  6 +++---
 template.rc    |  2 +-
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/start_ctdas.sh b/start_ctdas.sh
index 7ed92e21..c5dcea93 100755
--- a/start_ctdas.sh
+++ b/start_ctdas.sh
@@ -1,14 +1,24 @@
 #! /bin/sh 
 
-echo "New project to be started with name $1"
-echo "Copying jb file, py file, and rc-file"
-sed -e "s/template/$1/g" template.jb > $1.jb
-sed -e "s/template/$1/g" template.py > $1.py
-sed -e "s/template/$1/g" template.rc > $1.rc
+echo "New project to be started in folder $1"
+echo "               ...........with name $2"
 
-chmod u+x $1.jb
+rootdir=$1/$2
+rundir=$1/$2/exec
+
+mkdir -p ${rundir}
+rsync -auvz * ${rundir}/
+cd ${rundir}
+
+echo "Creating jb file, py file, and rc-file"
+sed -e "s/template/$2/g" template.jb > $2.jb
+sed -e "s/template/$2/g" template.py > $2.py
+sed -e "s/template/$2/g" template.rc > $2.rc
+
+chmod u+x $2.jb
 
 echo "************* NOW USE ****************"
-ls -lrta $1.*
+ls -lrta $2.*
 echo "**************************************"
+echo "after cd ${rundir}"
 
diff --git a/template.jb b/template.jb
index c15b2573..e7c508ba 100755
--- a/template.jb
+++ b/template.jb
@@ -10,6 +10,6 @@
 
 
 echo ########################
-module load tm5/mpi
-module load ctdas
-python template.py rc=template.rc $1 
+module load intel/latest/tm5
+module load python/2.6
+/opt/local/bin/python template.py rc=template.rc $1 >& template.log &
diff --git a/template.rc b/template.rc
index 0366fa30..10678a5d 100644
--- a/template.rc
+++ b/template.rc
@@ -5,7 +5,7 @@ time.start          : 2005-01-01 00:00:00
 time.finish         : 2011-01-01 00:00:00
 time.cycle          : 10
 time.nlag           : 3
-dir.da_run          : /archive/peters/template
+dir.da_run          : templaterundir
 
 
 ! Info on the DA system used
-- 
GitLab