From 1602ff14433dd8267d0e79fb664303d04983eb62 Mon Sep 17 00:00:00 2001 From: Tiago Pestana Date: Wed, 16 Sep 2020 20:04:23 +0200 Subject: [PATCH] ucftar_pack does not necessarily need to check for the particle file. it's not present for single-phase simulations --- bash/ucftar_pack | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bash/ucftar_pack b/bash/ucftar_pack index b135131..4b1db94 100755 --- a/bash/ucftar_pack +++ b/bash/ucftar_pack @@ -72,7 +72,7 @@ set -- "${POSITIONAL[@]}" # Parse input filename din=$1 -seqnum=$2 +seqnum=$2 # Construct output filename if not specified if [ -z "$fout" ]; then @@ -106,7 +106,8 @@ if [ ! -s ${din}/${fproc} ]; then fi if [ ! -s ${din}/${fpart} ]; then (>&2 echo "[Error] File not found or empty: ${din}/${fpart}") - exit 1 + # exit 1 + fpart= fi # Check if all velocity fields exist and are not empty @@ -174,7 +175,7 @@ while [ $packloop -eq 1 ]; do snumfilecur=0 scursize=1024 # Initialize with size of trailing zero bloc unset flist - while true; do + while true; do sfilesize=$(wc -c ${din}/${flist_sbase[${scounter}]} | awk '{print $1}') # raw size sfilesize=$(((${sfilesize}+511)/512*512+512)) # adjust to 512 byte-blocks and add header spredictsize=$((${scursize}+${sfilesize})) @@ -198,8 +199,8 @@ while [ $packloop -eq 1 ]; do fi flag_splitdone=1 break - fi - done + fi + done fi # Create tar archive tar $flagtar --directory=${din} -cf ${fout} ${flist[@]} @@ -211,7 +212,7 @@ while [ $packloop -eq 1 ]; do # Compare checksums (CNC32), if flag is set flistx=($(echo ${flist[@]} | sed s/"_$seqnum"/""/g)) if [ $checksum -eq 1 ]; then - for ii in "${!flistx[@]}"; do + for ii in "${!flistx[@]}"; do if [ $verbose -eq 1 ]; then (>&2 echo "Verifying checksum: ${flist[$ii]}") fi