Skip to content

Commit

Permalink
post-processing: find tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Feb 3, 2016
1 parent f18d275 commit cbf2b90
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 111 deletions.
6 changes: 4 additions & 2 deletions scripts/findNotDelivered
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ cordex()

while read line ; do
test ${#line} -eq 0 && continue
test "${line:0:6}" = 'output' && continue

word=( ${line//,/ } )

Expand All @@ -69,7 +68,10 @@ cordex()
test "$q" = mon -o "$q" = sem && isTake=t
fi

continue
while read line ; do
word=( ${line//,/ } )
test ${word[0]} = output && continue 2
done
fi

# append to the list of var and freq
Expand Down
143 changes: 76 additions & 67 deletions scripts/taskSummary
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,78 @@ descript()
echo " --help"
}

blk2Files()
{
# same header for the current entry of each file
word=( ${blk[iP]} )
str0="\n - annotation:"
str0="${str0}\n path: ${word[1]}"

if [ "${iV}" -gt -1 ] ; then
word=( ${blk[iV]} )
str0="${str0}\n variable:"

# add the list of variables
for(( i=iV+1 ; i < iP ; ++i )) ; do
word=( ${blk[i]} )
str0="${str0}\n - ${word[1]}"
done
elif [ "${iA}" -gt -1 ] ; then
# note: the same for file: and atomic:
word=( ${blk[iA]} )
str0="${str0}\n atomic: ${word[1]}"
elif [ "${iF}" -gt -1 ] ; then
# note: the same for file: and atomic:
word=( ${blk[iF]} )
str0="${str0}\n file: ${word[1]}"
fi

# a sorted array is required below
tags=( $( echo -e ${tags[*]/%\\n} | sort) )
tags_ix=( ${tags[*]#*|} )
tags=( ${tags[*]%|*} )

prev_tag=
N=${#tags_ix[*]}

for(( j=0 ; j < N ; ++j )) ; do
ix=${tags_ix[j]}

# strip embracing '
tag=${tags[j]}

word=( ${blk[$((ix-1))]} )
impact=${word[1]}

# switch to a another output file
if [ "${prev_tag}" != $tag ] ; then
# flush before the switch
test "${str:0:1}" && echo -e "${str}" >> $outT

outT=$summary/$exp/${impact}-${tag}
test ! -e $outT && echo -e "--- # Annotations (${tag})\n" > $outT

prev_tag=$tag
str="${str0}\n events:"
fi

str="${str}\n - event:"
str="${str}\n caption: ${blk[$((ix-2))]:9}"
str="${str}\n impact: ${impact}"
str="${str}\n tag: '${tag}'"
done

unset blk
tags=()
tags_ix=()
iP=-1
iV=-1
iF=-1
iA=-1

return
}

period()
{
# determine periods checked so far.
Expand Down Expand Up @@ -205,73 +277,7 @@ txt="Annotation summary of the QA of experiment\n \
while read line ; do
if [ "${line:0:7}" = '- date:' ] ; then
# the end of a block

# same header for the current entry of each file
word=( ${blk[iP]} )
str0="\n - annotation:"
str0="${str0}\n path: ${word[1]}"

if [ "${iV}" -gt -1 ] ; then
word=( ${blk[iV]} )
str0="${str0}\n variable:"

# add the list of variables
for(( i=iV+1 ; i < iP ; ++i )) ; do
word=( ${blk[i]} )
str0="${str0}\n - ${word[1]}"
done
elif [ "${iA}" -gt -1 ] ; then
# note: the same for file: and atomic:
word=( ${blk[iA]} )
str0="${str0}\n atomic: ${word[1]}"
elif [ "${iF}" -gt -1 ] ; then
# note: the same for file: and atomic:
word=( ${blk[iF]} )
str0="${str0}\n file: ${word[1]}"
fi

# a sorted array is required below
tags=( $( echo -e ${tags[*]/%\\n} | sort) )
tags_ix=( ${tags[*]#*|} )
tags=( ${tags[*]%|*} )

prev_tag=
N=${#tags_ix[*]}

for(( j=0 ; j < N ; ++j )) ; do
ix=${tags_ix[j]}

# strip embracing '
tag=${tags[j]}

word=( ${blk[$((ix-1))]} )
impact=${word[1]}

# switch to a another output file
if [ "${prev_tag}" != $tag ] ; then
# flush before the switch
test "${str:0:1}" && echo -e "${str}" >> $outT

outT=$summary/$exp/${impact}-${tag}
test ! -e $outT && echo -e "--- # Annotations (${tag})\n" > $outT

prev_tag=$tag
str="${str0}\n events:"
fi

str="${str}\n - event:"
str="${str}\n caption: ${blk[$((ix-2))]:9}"
str="${str}\n impact: ${impact}"
str="${str}\n tag: '${tag}'"
done

unset blk
tags=()
tags_ix=()
iP=-1
iV=-1
iF=-1
iA=-1
blk2Files
fi

# indices
Expand All @@ -294,6 +300,9 @@ txt="Annotation summary of the QA of experiment\n \
blk[${#blk[*]}]="$line"
done

# the last one is still missing
blk2Files

# there is still one remaining
test "${str:0:1}" && echo -e "${str}" >> $outT

Expand Down
62 changes: 26 additions & 36 deletions scripts/xtractNotes_from_log
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ findPureAtomic()
# ensemble of atomic vars; either for all or for groups

# array with all pure atomic tags
for(( ix=1 ; ix < ${#pureAtomicTags[*]} ; ++ix )) ; do
for(( ix=0 ; ix < ${#pureAtomicTags[*]} ; ++ix )) ; do
tags=( ${pureAtomicTags[ix]//,/ } )

for(( j=0 ; j < ${#tags[*]} ; ++j )) ; do
Expand All @@ -388,7 +388,7 @@ findPureAtomic()
for(( i=0 ; i < N ; ++i )) ; do

# each tag gets indices of corresponding atomicBase names
for(( ix=1 ; ix < ${#pureAtomicTags[*]} ; ++ix )) ; do
for(( ix=0 ; ix < ${#pureAtomicTags[*]} ; ++ix )) ; do
tags=( ${pureAtomicTags[ix]//,/ } )

for(( j=0 ; j < ${#tags[*]} ; ++j )) ; do
Expand Down Expand Up @@ -743,7 +743,7 @@ printA_fileTag()

echo "${blk[e]}" # the line with event:

for(( j=1 ; j < ${#event_ix[*]} ; ++j )) ; do
for(( j=0 ; j < ${#event_ix[*]} ; ++j )) ; do
test ! ${event_ix[j]} && continue

e=${event_ix[j]}
Expand Down Expand Up @@ -810,41 +810,29 @@ printA_header()

for(( i=0 ; i < sz ; ++i )) ; do
if [ "$1" = group ] ; then
if [ ${#b_ix[*]} -eq 1 ] ; then
if [ $i -eq ${file_ix} ] ; then
echo " atomic: ${atomicBase[${b_ix[0]}]}"
continue
elif [ $i -eq ${end_ix} ] ; then
echo " end: ${atomicEnd[${b_ix[0]}]}"
continue
fi
if [ $i -eq ${file_ix} ] ; then
echo " variable:"

else
if [ $i -eq ${file_ix} ] ; then
echo " variable:"

for(( j=0 ; j < ${#b_ix[*]} ; ++j )) ; do
echo " - ${atomicBase[${b_ix[j]}]}"
done

#adjust the path: remove the trailing varName-directory
# local atomicBaseSet
# declare -a atomicBaseSet
# for(( j=0 ; j < ${#b_ix[*]} ; ++j )) ; do
# atomicBaseSet[j]=${atomicBase[${b_ix[j]}]}
# done

# splitAtomicBase

echo "${blk[$((++i))]%/*/*}" # data_path
echo "${blk[$((++i))]%/*/*}" # result_path
continue
elif [ $i -eq ${end_ix} ] ; then
echo " end: ${atomicEnd[ix]}"
continue
fi
fi
for(( j=0 ; j < ${#b_ix[*]} ; ++j )) ; do
echo " - ${atomicBase[${b_ix[j]}]}"
done

#adjust the path: remove the trailing varName-directory
# local atomicBaseSet
# declare -a atomicBaseSet
# for(( j=0 ; j < ${#b_ix[*]} ; ++j )) ; do
# atomicBaseSet[j]=${atomicBase[${b_ix[j]}]}
# done

# splitAtomicBase

echo "${blk[$((++i))]%/*/*}" # data_path
echo "${blk[$((++i))]%/*/*}" # result_path
continue
elif [ $i -eq ${end_ix} ] ; then
echo " end: ${atomicEnd[ix]}"
continue
fi
fi

echo "${blk[i]}"
Expand Down Expand Up @@ -1119,6 +1107,7 @@ xtrctAnnotated()

rmdir ${path[i]}${dir}head &> /dev/null
rmdir ${path[i]}${dir}annot &> /dev/null
rmdir ${path[i]}${dir} &> /dev/null

# restore stdin and free #9
exec 0<&9 9<&-
Expand Down Expand Up @@ -1227,4 +1216,5 @@ if [ ${#tokens[*]} -gt 0 ] ; then
exit
fi

set -x
xtrctAnnotated
9 changes: 3 additions & 6 deletions src/QA_CORDEX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,9 @@ DRS_CV::findPath_faults(Split& drs, Split& x_e,
{
if(x_e[j] == "activity" )
{
if( notes->inq( "1_1a", pQA->fileStr, "INQ_ONLY") )
{
std::string s( hdhC::Upper()(drs[i]) ) ;
if( s == t )
continue;
}
std::string s( hdhC::Upper()(drs[i]) ) ;
if( s == t && !notes->inq( "1_3a", pQA->fileStr, "INQ_ONLY") )
continue;
}

text = " check failed, expected " ;
Expand Down
1 change: 1 addition & 0 deletions tables/projects/CORDEX/CORDEX_check-list.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ DRS CV path: failed check & 1_1a
DRS CV path: swapped components & 1_1b
DRS CV filename: failed check & 1_2a
DRS CV filename: swapped components & 1_2b
DRS CV activity: case-sensitive & 1_3a,D

Unregistered GCMModelName & 1_3a
Unregistered RCMModelName & 1_3b
Expand Down

0 comments on commit cbf2b90

Please sign in to comment.