Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 5080)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 5081)
@@ -213,4 +213,8 @@
 fi
 #}}}
+#create softlink to startup {{{1
+cd $ISSM_DIR/test/NightlyRun/
+ln -s $ISSM_DIR/startup.m .
+#}}}
 #Create nightlylog directory and nightly.log {{{1
 #put installation elapsed time in nightly.log
@@ -229,9 +233,61 @@
 END
 #}}}
+#check NUMCPUS_RUN options {{{1
+if [ "$NUMCPUS_RUN" = "" ]
+then
+	echo "NUMCPUS_RUN option not found, defaulting to NUMCPUS_RUN = 1"
+	NUMCPUS_RUN=1
+fi
+#}}}
 
 #Run tests
-#Call run.sh script{{{1
-cd $ISSM_DIR/cron/
-./run.sh $1
+#Launch all tests on different cpus {{{1
+for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+do
+	#Launch matlab and the nightly run script
+	cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
+	warning off %necessary to avoid a nightly.log of several Go for parallel runs
+	try,
+	cd $ISSM_DIR/test/NightlyRun
+	startup;
+	$(if [ "$NROPTIONS" = ""  ]
+	then
+		echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+	else
+		echo "runme($NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+	fi
+	)
+	catch me,
+		%An error occured, get report and exit
+		directory=strsplit(pwd,'/');
+		message=getReport(me)
+		fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
+		fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
+		fprintf(fid,'%s',message);
+		fclose(fid);
+	end
+	exit
+EOF
+
+	#Start run from nightlylog directory
+	cd $ISSM_DIR/nightlylog/
+
+	#Start test
+	MATLAB_VERSION="7.6" #7.2,7.4,7.6 and 7.8
+	/usr/local/pkgs/matlab-$MATLAB_VERSION/bin/matlab  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
+done
+
+#wait until matlab closes
+wait
+#}}}
+#concatenate all reports {{{1
+mv matlab_log1.log  matlab_log.log
+for (( i=2;i<=$NUMCPUS_RUN;i++ ))
+do
+	cat matlab_log.log matlab_log$i.log > matlab_log.log.bak
+	mv matlab_log.log.bak matlab_log.log
+	rm matlab_log$i.log
+
+done
 #}}}
 #Complete nightly.log {{{1
Index: sm/trunk/cron/run.sh
===================================================================
--- /issm/trunk/cron/run.sh	(revision 5080)
+++ 	(revision )
@@ -1,77 +1,0 @@
-#!/bin/bash
-
-#prepare runs
-#get configs {{{1
-if [ $# -ne 1 ];
-then
-	#no config file specified: exit
-	echo "no config file specified. Exiting..."
-	exit 1
-fi
-
-#Go to init_Path and source config
-INIT_PATH=$(cat $ISSM_DIR/nightlylog/nightly.log | grep "init_path" | awk '{print $2}')
-cd $INIT_PATH
-source $1;
-#}}}
-#check NUMCPUS_RUN options {{{1
-if [ "$NUMCPUS_RUN" = "" ]
-then
-	echo "NUMCPUS_RUN option not found, defaulting to NUMCPUS_RUN = 1"
-	NUMCPUS_RUN=1
-fi
-#}}}
-#create softlink to startup {{{1
-cd $ISSM_DIR/test/NightlyRun/
-ln -s $ISSM_DIR/startup.m .
-#}}}
-
-#Launch all tests on different cpus
-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
-do
-	#Launch matlab and the nightly run script
-	cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
-	warning off %necessary to avoid a nightly.log of several Go for parallel runs
-	try,
-		cd $ISSM_DIR/test/NightlyRun
-		startup;
-		$(if [ "$NROPTIONS" = ""  ]
-	then
-		echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
-	else
-		echo "runme($NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
-	fi
-	)
-	catch me,
-		%An error occured, get report and exit
-		directory=strsplit(pwd,'/');
-		message=getReport(me)
-		fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
-		fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
-		fprintf(fid,'%s',message);
-		fclose(fid);
-	end
-	exit
-EOF
-
-	#Start run from nightlylog directory
-	cd $ISSM_DIR/nightlylog/
-
-	#Start test
-	MATLAB_VERSION="7.6" #7.2,7.4,7.6 and 7.8
-	/usr/local/pkgs/matlab-$MATLAB_VERSION/bin/matlab  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
-
-done
-
-#wait until matlab closes
-wait
-
-#concatenate all reports
-mv matlab_log1.log  matlab_log.log
-for (( i=2;i<=$NUMCPUS_RUN;i++ ))
-do
-	cat matlab_log.log matlab_log$i.log > matlab_log.log.bak
-	mv matlab_log.log.bak matlab_log.log
-	rm matlab_log$i.log
-
-done
