Skip to content

Commit 440ad19

Browse files
More double equals, double quotes, and double brackets
1 parent 77f94f3 commit 440ad19

16 files changed

+148
-148
lines changed

scripts/exgdas_atmos_chgres_forenkf.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then
126126
export OMP_NUM_THREADS=$NTHREADS_CHGRES
127127
SIGLEVEL=${SIGLEVEL:-${FIXgfs}/am/global_hyblev.l${LEVS_ENKF}.txt}
128128

129-
if [ $USE_CFP = "YES" ]; then
130-
if [[ -f $DATA/mp_chgres.sh ]]; then
131-
rm $DATA/mp_chgres.sh
129+
if [[ "${USE_CFP}" == "YES" ]]; then
130+
if [[ -f "${DATA}/mp_chgres.sh" ]]; then
131+
rm "${DATA}/mp_chgres.sh"
132132
fi
133133
fi
134134

135-
nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g')
135+
nfhrs=$(echo "${IAUFHRS_ENKF}" | sed 's/,/ /g')
136136
for FHR in $nfhrs; do
137137
echo "Regridding deterministic forecast for forecast hour $FHR"
138138
rm -f chgres_nc_gauss0$FHR.nml

scripts/exgdas_enkf_ecen.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fi
102102
cd $DATA || exit 99
103103

104104
ENKF_SUFFIX="s"
105-
if [[ $SMOOTH_ENKF = "NO" ]]; then
105+
if [[ "${SMOOTH_ENKF}" == "NO" ]]; then
106106
ENKF_SUFFIX=""
107107
fi
108108

@@ -256,10 +256,10 @@ if [ $RECENTER_ENKF = "YES" ]; then
256256

257257
export OMP_NUM_THREADS=$NTHREADS_CHGRES
258258

259-
if [[ -f $chgresnml ]]; then
260-
rm -f $chgresnml
259+
if [[ -f "${chgresnml}" ]]; then
260+
rm -f "${chgresnml}"
261261
fi
262-
cat > $chgresnml << EOF
262+
cat > "${chgresnml}" << EOF
263263
&${nmltitle}_setup
264264
i_output=$LONB_ENKF
265265
j_output=$LATB_ENKF
@@ -368,9 +368,9 @@ done # loop over analysis times in window
368368
################################################################################
369369
# Postprocessing
370370
cd $pwd
371-
if [[ $mkdata = "YES" ]]; then
372-
rm -rf $DATA
371+
if [[ "${mkdata}" == "YES" ]]; then
372+
rm -rf "${DATA}"
373373
fi
374374

375375

376-
exit ${err}
376+
exit "${err}"

scripts/exgdas_enkf_post.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ENKF_SPREAD=${ENKF_SPREAD:-"NO"}
5353
################################################################################
5454
# Preprocessing
5555
ENKF_SUFFIX="s"
56-
if [[ $SMOOTH_ENKF = "NO" ]]; then
56+
if [[ "${SMOOTH_ENKF}" == "NO" ]]; then
5757
ENKF_SUFFIX=""
5858
fi
5959

@@ -95,16 +95,16 @@ for fhr in $(seq $FHMIN $FHOUT $FHMAX); do
9595
${NLN} "${COMIN_ATMOS_HISTORY}/${PREFIX}atmf${fhrchar}${ENKF_SUFFIX}.nc" "atmf${fhrchar}${ENKF_SUFFIX}_${memchar}"
9696
done
9797
fi
98-
if [[ $ENKF_SPREAD = "YES" ]]; then
98+
if [[ "${ENKF_SPREAD}" == "YES" ]]; then
9999
${NLN} "${COMOUT_ATMOS_HISTORY_STAT}/${PREFIX}atmf${fhrchar}.ensspread.nc" "atmf${fhrchar}.ensspread"
100100
fi
101101
done
102102

103103
################################################################################
104104
# Generate ensemble mean surface and atmospheric files
105105

106-
if [[ $SMOOTH_ENKF = "YES" ]]; then
107-
$NCP $HYBENSMOOTH ./hybens_smoothinfo
106+
if [[ "${SMOOTH_ENKF}" == "YES" ]]; then
107+
$NCP "${HYBENSMOOTH}" ./hybens_smoothinfo
108108
fi
109109

110110
rc=0

scripts/exgdas_enkf_select_obs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export err=$?; err_chk
104104
################################################################################
105105
# Postprocessing
106106
cd $pwd
107-
if [[ $mkdata = "YES" ]]; then
108-
rm -rf $DATA
107+
if [[ "${mkdata}" == "YES" ]]; then
108+
rm -rf "${DATA}"
109109
fi
110110

111111

scripts/exgdas_enkf_sfc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ LONB_CASE=$((res*4))
8787
export FNTSFA=${FNTSFA:-' '}
8888
export FNACNA=${FNACNA:-${COM_OBS}/${OPREFIX}seaice.5min.blend.grb}
8989
export FNSNOA=${FNSNOA:-${COM_OBS}/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}}
90-
if [[ ! -f $FNSNOA ]]; then
90+
if [[ ! -f "${FNSNOA}" ]]; then
9191
export FNSNOA="${COM_OBS}/${OPREFIX}snogrb_t1534.3072.1536"
9292
fi
9393
FNSNOG=${FNSNOG:-${COM_OBS_PREV}/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}}
94-
if [[ ! -f $FNSNOG ]]; then
94+
if [[ ! -f "${FNSNOG}" ]]; then
9595
FNSNOG="${COM_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536"
9696
fi
9797

scripts/exgdas_enkf_update.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ HYBENSINFO=${HYBENSINFO:-${FIXgfs}/gsi/global_hybens_info.l${LEVS_ENKF}.txt}
119119
ANAVINFO=${ANAVINFO:-${FIXgfs}/gsi/global_anavinfo.l${LEVS_ENKF}.txt}
120120
VLOCALEIG=${VLOCALEIG:-${FIXgfs}/gsi/vlocal_eig_l${LEVS_ENKF}.dat}
121121
ENKF_SUFFIX="s"
122-
if [[ $SMOOTH_ENKF = "NO" ]]; then
122+
if [[ "${SMOOTH_ENKF}" == "NO" ]]; then
123123
ENKF_SUFFIX=""
124124
fi
125125

@@ -149,13 +149,13 @@ ${NLN} "${COM_ATMOS_ANALYSIS_STAT}/${GBIASe}" "satbias_in"
149149
################################################################################
150150

151151
if [ $USE_CFP = "YES" ]; then
152-
if [[ -f $DATA/untar.sh ]]; then
153-
rm $DATA/untar.sh
152+
if [[ -f "${DATA}/untar.sh" ]]; then
153+
rm "${DATA}/untar.sh"
154154
fi
155-
if [[ -f $DATA/mp_untar.sh ]]; then
156-
rm $DATA/mp_untar.sh
155+
if [[ -f "${DATA}/mp_untar.sh" ]]; then
156+
rm "${DATA}/mp_untar.sh"
157157
fi
158-
cat > $DATA/untar.sh << EOFuntar
158+
cat > "${DATA}/untar.sh" << EOFuntar
159159
#!/bin/sh
160160
memchar=\$1
161161
COM_ATMOS_ANALYSIS=\$2
@@ -423,7 +423,7 @@ cat stdout stderr > "${COM_ATMOS_ANALYSIS_STAT}/${ENKFSTAT}"
423423
################################################################################
424424
# Postprocessing
425425
cd "$pwd"
426-
if [[ $mkdata = "YES" ]]; then
426+
if [[ "${mkdata}" == "YES" ]]; then
427427
rm -rf "${DATA}"
428428
fi
429429

scripts/exglobal_atmos_analysis.sh

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ ${NLN} ${ABIBF} abibufr
500500
${NLN} ${HDOB} hdobbufr
501501
${NLN} ${SSTVIIRS} sstviirs
502502

503-
if [[ ${DONST} = "YES" ]]; then
504-
${NLN} ${NSSTBF} nsstbufr
503+
if [[ "${DONST}" == "YES" ]]; then
504+
${NLN} "${NSSTBF}" nsstbufr
505505
fi
506506

507507
##############################################################
@@ -521,39 +521,39 @@ ${NLN} ${SFCG03} sfcf03
521521
${NLN} ${SFCGES} sfcf06
522522
${NLN} ${SFCG09} sfcf09
523523

524-
if [[ -f ${ATMG04} ]]; then
525-
${NLN} ${ATMG04} sigf04
524+
if [[ -f "${ATMG04}" ]]; then
525+
${NLN} "${ATMG04}" sigf04
526526
fi
527-
if [[ -f ${ATMG05} ]]; then
528-
${NLN} ${ATMG05} sigf05
527+
if [[ -f "${ATMG05}" ]]; then
528+
${NLN} "${ATMG05}" sigf05
529529
fi
530-
if [[ -f ${ATMG07} ]]; then
531-
${NLN} ${ATMG07} sigf07
530+
if [[ -f "${ATMG07}" ]]; then
531+
${NLN} "${ATMG07}" sigf07
532532
fi
533-
if [[ -f ${ATMG08} ]]; then
534-
${NLN} ${ATMG08} sigf08
533+
if [[ -f "${ATMG08}" ]]; then
534+
${NLN} "${ATMG08}" sigf08
535535
fi
536536

537-
if [[ -f ${SFCG04} ]]; then
538-
${NLN} ${SFCG04} sfcf04
537+
if [[ -f "${SFCG04}" ]]; then
538+
${NLN} "${SFCG04}" sfcf04
539539
fi
540-
if [[ -f ${SFCG05} ]]; then
541-
${NLN} ${SFCG05} sfcf05
540+
if [[ -f "${SFCG05}" ]]; then
541+
${NLN} "${SFCG05}" sfcf05
542542
fi
543-
if [[ -f ${SFCG07} ]]; then
544-
${NLN} ${SFCG07} sfcf07
543+
if [[ -f "${SFCG07}" ]]; then
544+
${NLN} "${SFCG07}" sfcf07
545545
fi
546-
if [[ -f ${SFCG08} ]]; then
547-
${NLN} ${SFCG08} sfcf08
546+
if [[ -f "${SFCG08}" ]]; then
547+
${NLN} "${SFCG08}" sfcf08
548548
fi
549549

550-
if [ ${DOHYBVAR} = "YES" ]; then
550+
if [ "${DOHYBVAR}" == "YES" ]; then
551551

552552
# Link ensemble members
553553
mkdir -p ensemble_data
554554

555555
ENKF_SUFFIX="s"
556-
if [[ ${SMOOTH_ENKF} = "NO" ]]; then
556+
if [[ "${SMOOTH_ENKF}" == "NO" ]]; then
557557
ENKF_SUFFIX=""
558558
fi
559559

@@ -658,15 +658,15 @@ fi
658658

659659
##############################################################
660660
# If requested, copy and de-tar guess radstat file
661-
if [ ${USE_RADSTAT} = "YES" ]; then
662-
if [ ${USE_CFP} = "YES" ]; then
663-
if [[ -f ${DATA}/unzip.sh ]]; then
664-
rm ${DATA}/unzip.sh
661+
if [[ "${USE_RADSTAT}" == "YES" ]]; then
662+
if [[ "${USE_CFP}" == "YES" ]]; then
663+
if [[ -f "${DATA}/unzip.sh" ]]; then
664+
rm "${DATA}/unzip.sh"
665665
fi
666-
if [[ -f ${DATA}/mp_unzip.sh ]]; then
667-
rm ${DATA}/mp_unzip.sh
666+
if [[ -f "${DATA}/mp_unzip.sh" ]]; then
667+
rm "${DATA}/mp_unzip.sh"
668668
fi
669-
cat > ${DATA}/unzip.sh << EOFunzip
669+
cat > "${DATA}/unzip.sh" << EOFunzip
670670
#!/bin/sh
671671
diag_file=\$1
672672
diag_suffix=\$2
@@ -1007,7 +1007,7 @@ fi
10071007
################################################################################
10081008
# Postprocessing
10091009
cd ${pwd}
1010-
if [[ ${mkdata} = "YES" ]]; then
1010+
if [[ "${mkdata}" == "YES" ]]; then
10111011
rm -rf ${DATA}
10121012
fi
10131013

scripts/exglobal_atmos_analysis_calc.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,17 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then
155155
$NLN $ATMGES sigf06
156156
$NLN $ATMG09 sigf09
157157

158-
if [[ -f $ATMG04 ]]; then
159-
$NLN $ATMG04 sigf04
158+
if [[ -f "${ATMG04}" ]]; then
159+
$NLN "${ATMG04}" sigf04
160160
fi
161-
if [[ -f $ATMG05 ]]; then
162-
$NLN $ATMG05 sigf05
161+
if [[ -f "${ATMG05}" ]]; then
162+
$NLN "${ATMG05}" sigf05
163163
fi
164-
if [[ -f $ATMG07 ]]; then
165-
$NLN $ATMG07 sigf07
164+
if [[ -f "${ATMG07}" ]]; then
165+
$NLN "${ATMG07}" sigf07
166166
fi
167-
if [[ -f $ATMG08 ]]; then
168-
$NLN $ATMG08 sigf08
167+
if [[ -f "${ATMG08}" ]]; then
168+
$NLN "${ATMG08}" sigf08
169169
fi
170170

171171
# Link hourly backgrounds (if present)
@@ -194,8 +194,8 @@ echo "${rCDUMP} ${PDY}${cyc} atmanl and sfcanl done at $(date)" > "${COMOUT_ATMO
194194
################################################################################
195195
# Postprocessing
196196
cd $pwd
197-
if [[ $mkdata = "YES" ]]; then
198-
rm -rf $DATA
197+
if [[ "${mkdata}" == "YES" ]]; then
198+
rm -rf "${DATA}"
199199
fi
200200

201201

scripts/exglobal_atmos_sfcanl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ LONB_CASE=$((res*4))
6262
export FNTSFA=${FNTSFA:-${COMIN_OBS}/${OPREFIX}rtgssthr.grb}
6363
export FNACNA=${FNACNA:-${COMIN_OBS}/${OPREFIX}seaice.5min.blend.grb}
6464
export FNSNOA=${FNSNOA:-${COMIN_OBS}/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}}
65-
if [[ ! -f ${FNSNOA} ]]; then
65+
if [[ ! -f "${FNSNOA}" ]]; then
6666
export FNSNOA="${COMIN_OBS}/${OPREFIX}snogrb_t1534.3072.1536"
6767
fi
6868
FNSNOG=${FNSNOG:-${COMIN_OBS_PREV}/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}}
69-
if [[ ! -f ${FNSNOG} ]]; then
69+
if [[ ! -f "${FNSNOG}" ]]; then
7070
FNSNOG="${COMIN_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536"
7171
fi
7272

scripts/exglobal_cleanup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if [[ "${RUN}" == "gfs" ]]; then
8585
fhmax=$((FHMAX_FITS + 36))
8686
RDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} -${fhmax} hours")
8787
verify_dir="${ROTDIR}/vrfyarch/${RUN}.${RDATE:0:8}"
88-
if [[ -d ${verify_dir} ]]; then
88+
if [[ -d "${verify_dir}" ]]; then
8989
rm -rf "${verify_dir}"
9090
fi
9191

@@ -94,7 +94,7 @@ if [[ "${RUN}" == "gfs" ]]; then
9494
touch_PDY="${touch_date:0:8}"
9595
touch_cyc="${touch_date:8:2}"
9696
touch_dir="${ROTDIR}/vrfyarch/${RUN}.${touch_PDY}/${touch_cyc}"
97-
if [[ -d ${touch_dir} ]]; then
97+
if [[ -d "${touch_dir}" ]]; then
9898
touch "${touch_dir}"/*
9999
fi
100100
touch_date=$(date --utc +%Y%m%d%H -d "${touch_PDY} ${touch_cyc} +6 hours")

0 commit comments

Comments
 (0)