From 676fb35223a77b0b61a304db5f50aa40710926c1 Mon Sep 17 00:00:00 2001
From: dave <dave@dtu.dk>
Date: Thu, 4 Aug 2016 09:23:26 +0200
Subject: [PATCH] prepost.Simulations: fix bug when adding *.sel/*.dat to
 zip-chunk results

---
 wetb/prepost/Simulations.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/wetb/prepost/Simulations.py b/wetb/prepost/Simulations.py
index d42e8df2..cd68dc1a 100755
--- a/wetb/prepost/Simulations.py
+++ b/wetb/prepost/Simulations.py
@@ -1262,11 +1262,17 @@ def create_chunks_htc_pbs(cases, sort_by_values=['[Windspeed]'], ppn=20,
         rpl = (os.path.join(pbs_in_base, '*'), os.path.join(htc_base, '*'))
         pbs += 'find \n'
 
-        # compress all result files into an archive
+        # compress all result files into an archive, first *.sel files
+        # FIXME: why doesn this work with -name "*.sel" -o -name "*.dat"??
         pbs += '\necho "move results into compressed archive"\n'
-        pbs += 'find %s -name "*.dat" -o -name "*.sel" -print0 ' % res_base
+        pbs += 'find %s -name "*.sel" -print0 ' % res_base
         fname = os.path.join(res_base, 'resfiles_chunk_%05i' % ii)
         pbs += '| xargs -0 tar --remove-files -rf %s.tar\n' % fname
+        # now add the *.dat files to the archive
+        pbs += 'find %s -name "*.dat" -print0 ' % res_base
+        fname = os.path.join(res_base, 'resfiles_chunk_%05i' % ii)
+        pbs += '| xargs -0 tar --remove-files -rf %s.tar\n' % fname
+
         pbs += 'xz -z2 -T %i %s.tar\n' % (ppn, fname)
 
         # compress all logfiles into an archive
-- 
GitLab