Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes no such file or directory messages #2146

Closed
Changes from 9 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1d8bec8
Added loop to address erroneous logger statements; linter updates.
henrywinterbottom-wxdev Dec 8, 2023
5243048
Formatting corrections.
henrywinterbottom-wxdev Dec 8, 2023
3a3f2dd
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 12, 2023
912d035
Corrected formatting.
henrywinterbottom-wxdev Dec 12, 2023
90aa5c8
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 13, 2023
930c924
Updated linter check/disable flags relative to reviewer comment.
henrywinterbottom-wxdev Dec 13, 2023
ba4b86d
Corrected file existence and size check as suggested by a reviewer.
henrywinterbottom-wxdev Dec 13, 2023
ced36a8
Corrected formatting.
henrywinterbottom-wxdev Dec 13, 2023
89d1700
Addressed further reviewer comments and previous oversights.
henrywinterbottom-wxdev Dec 13, 2023
f0761f7
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
3f8e6b6
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
4b97ff8
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
9e87b70
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
3bf1c06
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
bfbbd91
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
754dbb3
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
611489f
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
aeb3aae
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
824e9e4
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 14, 2023
c75aa4d
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
3326b06
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
a16edd6
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
9e6fcf6
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
5be64aa
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
c985d1a
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
dc5df67
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
f3f6325
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
0d8eaaa
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
05f8b0e
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
f5f1f5c
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
33d8b70
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
8371746
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
d4202b8
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
7627a8b
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
b4755b9
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
8f2b381
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
80d9b75
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
c4ab778
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 14, 2023
a76c5ce
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 14, 2023
f6292e6
Updated as requested by reviewer.
henrywinterbottom-wxdev Dec 14, 2023
6226168
Updated as requested by reviewer.
henrywinterbottom-wxdev Dec 14, 2023
2eacc85
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 15, 2023
acbb789
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 18, 2023
15c7e9a
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 19, 2023
aa2f723
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 19, 2023
c24df27
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 20, 2023
bbcd7e4
Update scripts/exglobal_diag.sh
HenryRWinterbottom Dec 20, 2023
c7623ec
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 21, 2023
748e5b7
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 22, 2023
9d07973
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Dec 26, 2023
819faae
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Jan 2, 2024
9ad44be
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Jan 8, 2024
963e7b5
Merge branch 'NOAA-EMC:develop' into feature/gfsv17_issue_1252
HenryRWinterbottom Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 99 additions & 86 deletions scripts/exglobal_diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Set environment.

source "$HOMEgfs/ush/preamble.sh"
source "${HOMEgfs}/ush/preamble.sh"

# Directories.
pwd=$(pwd)
Expand All @@ -34,7 +34,7 @@ export NCP=${NCP:-"/bin/cp"}
export NMV=${NMV:-"/bin/mv"}
export NLN=${NLN:-"/bin/ln -sf"}
export CHGRP_CMD=${CHGRP_CMD:-"chgrp ${group_name:-rstprod}"}
export NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen}
export NCLEN=${NCLEN:-${HOMEgfs}/ush/getncdimlen}
export CATEXEC=${CATEXEC:-${ncdiag_ROOT:-${gsi_ncdiag_ROOT}}/bin/ncdiag_cat_serial.x}
COMPRESS=${COMPRESS:-gzip}
UNCOMPRESS=${UNCOMPRESS:-gunzip}
Expand All @@ -53,32 +53,32 @@ SENDDBN=${SENDDBN:-"NO"}

# Analysis files
export APREFIX=${APREFIX:-""}
RADSTAT=${RADSTAT:-${COM_ATMOS_ANALYSIS}/${APREFIX}radstat}
PCPSTAT=${PCPSTAT:-${COM_ATMOS_ANALYSIS}/${APREFIX}pcpstat}
CNVSTAT=${CNVSTAT:-${COM_ATMOS_ANALYSIS}/${APREFIX}cnvstat}
OZNSTAT=${OZNSTAT:-${COM_ATMOS_ANALYSIS}/${APREFIX}oznstat}
RADSTAT=${RADSTAT:-"${COM_ATMOS_ANALYSIS}/${APREFIX}radstat"}
PCPSTAT=${PCPSTAT:-"${COM_ATMOS_ANALYSIS}/${APREFIX}pcpstat"}
CNVSTAT=${CNVSTAT:-"${COM_ATMOS_ANALYSIS}/${APREFIX}cnvstat"}
OZNSTAT=${OZNSTAT:-"${COM_ATMOS_ANALYSIS}/${APREFIX}oznstat"}

# Remove stat file if file already exists
[[ -s $RADSTAT ]] && rm -f $RADSTAT
[[ -s $PCPSTAT ]] && rm -f $PCPSTAT
[[ -s $CNVSTAT ]] && rm -f $CNVSTAT
[[ -s $OZNSTAT ]] && rm -f $OZNSTAT
[[ -s "${RADSTAT}" ]] && rm -f "${RADSTAT}"
[[ -s "${PCPSTAT}" ]] && rm -f "${PCPSTAT}"
[[ -s "${CNVSTAT}" ]] && rm -f "${CNVSTAT}"
[[ -s "${OZNSTAT}" ]] && rm -f "${OZNSTAT}"

# Obs diag
GENDIAG=${GENDIAG:-"YES"}
DIAG_SUFFIX=${DIAG_SUFFIX:-""}
if [ $netcdf_diag = ".true." ] ; then
if [[ "${netcdf_diag}" = ".true." ]] ; then
DIAG_SUFFIX="${DIAG_SUFFIX}.nc4"
fi
DIAG_COMPRESS=${DIAG_COMPRESS:-"YES"}
DIAG_TARBALL=${DIAG_TARBALL:-"YES"}
USE_CFP=${USE_CFP:-"NO"}
CFP_MP=${CFP_MP:-"NO"}
nm=""
if [ $CFP_MP = "YES" ]; then
if [[ "${CFP_MP}" = "YES" ]]; then
nm=0
fi
DIAG_DIR=${DIAG_DIR:-${COM_ATMOS_ANALYSIS}/gsidiags}
DIAG_DIR=${DIAG_DIR:-"${COM_ATMOS_ANALYSIS}/gsidiags"}
REMOVE_DIAG_DIR=${REMOVE_DIAG_DIR:-"NO"}

# Set script / GSI control parameters
Expand All @@ -87,11 +87,11 @@ lrun_subdirs=${lrun_subdirs:-".true."}

################################################################################
# If requested, generate diagnostic files
if [ $GENDIAG = "YES" ] ; then
if [ $lrun_subdirs = ".true." ] ; then
for pe in $DIAG_DIR/dir.*; do
pedir="$(basename -- $pe)"
$NLN $pe $DATA/$pedir
if [[ "${GENDIAG}" = "YES" ]] ; then
if [[ "${lrun_subdirs}" = ".true." ]] ; then
for pe in "${DIAG_DIR}"/dir.*; do
pedir=$(basename -- "${pe}")
"${NLN}" "${pe}" "${DATA}/${pedir}"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
done
else
err_exit "***FATAL ERROR*** lrun_subdirs must be true. Abort job"
Expand All @@ -110,27 +110,27 @@ if [ $GENDIAG = "YES" ] ; then
diaglist[2]=listozn
diaglist[3]=listrad

diagfile[0]=$CNVSTAT
diagfile[1]=$PCPSTAT
diagfile[2]=$OZNSTAT
diagfile[3]=$RADSTAT
diagfile[0]="${CNVSTAT}"
diagfile[1]="${PCPSTAT}"
diagfile[2]="${OZNSTAT}"
diagfile[3]="${RADSTAT}"

numfile[0]=0
numfile[1]=0
numfile[2]=0
numfile[3]=0

# Set diagnostic file prefix based on lrun_subdirs variable
if [ $lrun_subdirs = ".true." ]; then
if [[ "${lrun_subdirs}" = ".true." ]]; then
prefix=" dir.*/"
else
prefix="pe*"
fi

if [ $USE_CFP = "YES" ]; then
[[ -f $DATA/diag.sh ]] && rm $DATA/diag.sh
[[ -f $DATA/mp_diag.sh ]] && rm $DATA/mp_diag.sh
cat > $DATA/diag.sh << EOFdiag
if [[ "${USE_CFP}" = "YES" ]]; then
[[ -f "${DATA}/diag.sh" ]] && rm "${DATA}/diag.sh"
[[ -f "${DATA}/mp_diag.sh" ]] && rm "${DATA}/mp_diag.sh"
cat > "${DATA}/diag.sh" << EOFdiag
#!/bin/sh
lrun_subdirs=\$1
binary_diag=\$2
Expand All @@ -147,15 +147,15 @@ else
fi
file=diag_\${type}_\${string}.\${CDATE}\${DIAG_SUFFIX}
if [ \$binary_diag = ".true." ]; then
cat \${prefix}\${type}_\${loop}* > \$file
cat \${prefix}\${type}_\${loop}* > "\${file}"
else
$CATEXEC -o \$file \${prefix}\${type}_\${loop}*
"${CATEXEC}" -o \$file \${prefix}\${type}_\${loop}*
fi
if [ \$DIAG_COMPRESS = "YES" ]; then
$COMPRESS \$file
if [[ "{\$DIAG_COMPRESS}" = "YES" ]]; then
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
"${COMPRESS}" "{\$file}"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
fi
EOFdiag
chmod 755 $DATA/diag.sh
chmod 755 "${DATA}/diag.sh"
fi

# Collect diagnostic files as a function of loop and type.
Expand All @@ -170,113 +170,126 @@ EOFdiag
# innovation files.

loops="01 03"
for loop in $loops; do
case $loop in
for loop in ${loops}; do
case "${loop}" in
01) string=ges;;
03) string=anl;;
*) string=$loop;;
*) string="${loop}";;
esac
echo $(date) START loop $string >&2
echo "$(date)" START loop "${string}" >&2 || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
n=-1
while [ $((n+=1)) -le $ntype ] ;do
for type in $(echo ${diagtype[n]}); do
count=$(ls ${prefix}${type}_${loop}* 2>/dev/null | wc -l)
if [ $count -gt 1 ]; then
if [ $USE_CFP = "YES" ]; then
echo "$nm $DATA/diag.sh $lrun_subdirs $binary_diag $type $loop $string $CDATE $DIAG_COMPRESS $DIAG_SUFFIX" | tee -a $DATA/mp_diag.sh
if [ ${CFP_MP:-"NO"} = "YES" ]; then
# shellcheck disable=SC2116
# shellcheck disable=SC2012
# shellcheck disable=SC2003
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
while [[ $((n+=1)) -le "${ntype}" ]] ;do
for type in $(echo "${diagtype[n]}"); do
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
count=$(ls "${prefix}${type}_${loop}*" 2>/dev/null | wc -l) || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
if [[ "${count}" -gt 1 ]]; then
if [[ "${USE_CFP}" = "YES" ]]; then
echo "${nm} ${DATA}/diag.sh ${lrun_subdirs} ${binary_diag} ${type} ${loop} ${string} ${CDATE} ${DIAG_COMPRESS} ${DIAG_SUFFIX}" | tee -a "${DATA}/mp_diag.sh"
if [[ ${CFP_MP:-"NO"} = "YES" ]]; then
nm=$((nm+1))
fi
else
if [ $binary_diag = ".true." ]; then
cat ${prefix}${type}_${loop}* > diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}
if [[ "${binary_diag}" = ".true." ]]; then
cat "${prefix}${type}_${loop}*" > "diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
else
$CATEXEC -o diag_${type}_${string}.${CDATE}${DIAG_SUFFIX} ${prefix}${type}_${loop}*
"${CATEXEC}" -o "diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}" "${prefix}${type}_${loop}*"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
fi
fi
echo "diag_${type}_${string}.${CDATE}*" >> ${diaglist[n]}
numfile[n]=$(expr ${numfile[n]} + 1)
elif [ $count -eq 1 ]; then
cat ${prefix}${type}_${loop}* > diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}
if [ $DIAG_COMPRESS = "YES" ]; then
$COMPRESS diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}
echo "diag_${type}_${string}.${CDATE}*" >> "${diaglist[n]}"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
numfile[n]=$(expr "${numfile[n]}" + 1)
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
elif [[ "${count}" -eq 1 ]]; then
cat "${prefix}${type}_${loop}*" > "diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
if [[ "${DIAG_COMPRESS}" = "YES" ]]; then
"${COMPRESS}" "diag_${type}_${string}.${CDATE}${DIAG_SUFFIX}"
fi
echo "diag_${type}_${string}.${CDATE}*" >> ${diaglist[n]}
numfile[n]=$(expr ${numfile[n]} + 1)
echo "diag_${type}_${string}.${CDATE}*" >> "${diaglist[n]}"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
numfile[n]=$(expr "${numfile[n]}" + 1)
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
fi
done
done
echo $(date) END loop $string >&2
echo "$(date)" END loop "${string}" >&2 || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
done

# We should already be in $DATA, but extra cd to be sure.
cd $DATA
cd "${DATA}" || exit
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved

# If requested, compress diagnostic files
if [ $DIAG_COMPRESS = "YES" -a $USE_CFP = "NO" ]; then
echo $(date) START $COMPRESS diagnostic files >&2
for file in $(ls diag_*${CDATE}${DIAG_SUFFIX}); do
$COMPRESS $file
if [[ "${DIAG_COMPRESS}" = "YES" && "${USE_CFP}" = "NO" ]]; then
echo "$(date)" START "${COMPRESS}" diagnostic files >&2 || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
# shellcheck disable=SC2045
for file in $(ls "diag_*${CDATE}${DIAG_SUFFIX}"); do
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
"${COMPRESS}" "${file}"
done
echo $(date) END $COMPRESS diagnostic files >&2
echo "$(date)" END "${COMPRESS}" diagnostic files >&2 || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
fi

if [ $USE_CFP = "YES" ] ; then
chmod 755 $DATA/mp_diag.sh
ncmd=$(cat $DATA/mp_diag.sh | wc -l)
if [ $ncmd -gt 0 ]; then
if [[ "${USE_CFP}" = "YES" ]] ; then
chmod 755 "${DATA}/mp_diag.sh"
# shellcheck disable=SC2002,SC2312
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
ncmd=$(cat "${DATA}/mp_diag.sh" | wc -l)
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
# shellcheck disable=SC2034
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
if [[ "${ncmd}" -gt 0 ]]; then
ncmd_max=$((ncmd < npe_node_max ? ncmd : npe_node_max))
# shellcheck disable=SC2086,SC2250
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
APRUNCFP_DIAG=$(eval echo $APRUNCFP)
$APRUNCFP_DIAG $DATA/mp_diag.sh
"${APRUNCFP_DIAG}" "${DATA}/mp_diag.sh"
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
export err=$?; err_chk
fi
fi

# Restrict diagnostic files containing rstprod data
rlist="conv_gps conv_ps conv_pw conv_q conv_sst conv_t conv_uv saphir"
for rtype in $rlist; do
for rtype in ${rlist}; do
set +e
${CHGRP_CMD} *${rtype}*
${STRICT_ON:-set -e}
# shellcheck disable=SC2045,SC2035,SC2086
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
for filename in $(ls *${rtype}*); do
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
if [[ -s "${filename}" ]]; then
"${CHGRP_CMD}" "${filename}"
${STRICT_ON:-set -e}
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
fi
done
done

# If requested, create diagnostic file tarballs
if [ $DIAG_TARBALL = "YES" ]; then
echo $(date) START tar diagnostic files >&2
if [[ "${DIAG_TARBALL}" = "YES" ]]; then
echo "$(date)" START tar diagnostic files >&2 || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
n=-1
while [ $((n+=1)) -le $ntype ] ;do
while [[ $((n+=1)) -le "${ntype}" ]] ;do
TAROPTS="-uvf"
if [ ! -s ${diagfile[n]} ]; then
if [[ ! -s "${diagfile[n]}" ]]; then
TAROPTS="-cvf"
fi
if [ ${numfile[n]} -gt 0 ]; then
tar $TAROPTS ${diagfile[n]} $(cat ${diaglist[n]})
if [[ "${numfile[n]}" -gt 0 ]]; then
# shellcheck disable=SC2046
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
tar "${TAROPTS}" "${diagfile[n]}" $(cat "${diaglist[n]}") || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
export err=$?; err_chk
fi
done

# Restrict CNVSTAT
chmod 750 $CNVSTAT
${CHGRP_CMD} $CNVSTAT
chmod 750 "${CNVSTAT}"
"${CHGRP_CMD}" "${CNVSTAT}"

# Restrict RADSTAT
chmod 750 $RADSTAT
${CHGRP_CMD} $RADSTAT
chmod 750 "${RADSTAT}"
"${CHGRP_CMD}" "${RADSTAT}"

echo $(date) END tar diagnostic files >&2
echo "$(date)" END tar diagnostic files >&2 || true
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
fi
fi # End diagnostic file generation block - if [ $GENDIAG = "YES" ]
fi # End diagnostic file generation block - if [[ ${GENDIAG} = "YES" ]]

################################################################################
# Postprocessing
# If no processing error, remove $DIAG_DIR
if [[ "$REMOVE_DIAG_DIR" = "YES" && "$err" = "0" ]]; then
rm -rf $DIAG_DIR
if [[ "${REMOVE_DIAG_DIR}" = "YES" && "${err}" = "0" ]]; then
rm -rf "${DIAG_DIR}"
fi

cd $pwd
[[ "${mkdata:-YES}" = "YES" ]] && rm -rf $DATA
cd "${pwd}" || exit
HenryRWinterbottom marked this conversation as resolved.
Show resolved Hide resolved
[[ "${mkdata:-YES}" = "YES" ]] && rm -rf "${DATA}"


exit $err
exit "${err}"