From 527088658a869e6153462f7dd858243116e81e2a Mon Sep 17 00:00:00 2001
From: ivar <amvdw95@gmail.com>
Date: Tue, 24 Jul 2012 11:20:43 +0000
Subject: [PATCH] In case of restart=True (cycle>1) my.basedir is set correctly
 to the exec-dir

---
 da/tm5/observationoperator.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/da/tm5/observationoperator.py b/da/tm5/observationoperator.py
index cab988a9..e9aedcf2 100755
--- a/da/tm5/observationoperator.py
+++ b/da/tm5/observationoperator.py
@@ -79,7 +79,7 @@ class TM5ObservationOperator(ObservationOperator):
             self.DaCycle = {}
 
         msg                 = 'Observation Operator initialized: %s (%s)'%(self.Identifier, self.Version,) ; logging.info(msg)
-
+        
     def Initialize(self ):
         """ 
            Execute all steps needed to prepare the ObsOperator for use inside CTDAS, only done at the very first cycle normally
@@ -111,10 +111,19 @@ class TM5ObservationOperator(ObservationOperator):
 
             self.CompileTM5()
 
+        else:
+            NewItems = {
+                        'my.basedir'     : self.DaCycle['dir.exec']    ,
+                        }
+            self.ModifyRC(NewItems)
+    
+
+
+
         # Replace the rc filename for TM5 with the newly created one in the new run directory
 
         workingcopytm5rc = os.path.join(self.tm_settings['rundir'], self.tm_settings['install.rc'] )
-
+        
         self.RcFileName  = workingcopytm5rc
 
         msg              = 'Working copy of the tm5.rc file is in place (%s) '%workingcopytm5rc ; logging.debug(msg)
@@ -439,6 +448,7 @@ class TM5ObservationOperator(ObservationOperator):
 
         sourcedir   = self.DaCycle['dir.restart.current']
         targetdir   = self.tm_settings[self.savedirkey]
+        self.outputdir      = self.tm_settings[self.outputdirkey]  #IV test
 
         for file in os.listdir(sourcedir):
 
@@ -575,6 +585,7 @@ class TM5ObservationOperator(ObservationOperator):
         DaPlatForm              = self.DaCycle.DaPlatForm
 
         tm5submitdir               = os.path.join(self.tm_settings[self.rundirkey])
+        msg                     = 'tm5submitdir',tm5submitdir ; logging.info(msg)
 
         # Go to executable directory and start the subprocess, using a new logfile
 
-- 
GitLab