Skip to content

Commit

Permalink
Fix shell check error
Browse files Browse the repository at this point in the history
  • Loading branch information
EricSinsky-NOAA committed Jul 17, 2024
1 parent ea0bd8c commit 142450a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ush/ocnice_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ for (( nh = FHMIN_GFS; nh <= FHMAX_GFS; nh = nh + fhout_ocnice )); do
if [[ ${component_name} == "ocn" ]];then
infile=${COMIN_OCEAN_NETCDF}/${RUN}.ocean.t${cyc}z.${datares}.f${fnh}.nc
# For ocean products, add an argument to extract a subset of levels
otherargs="-d ${depthvar_name},${zmin},${zmax}"
otherargs=(-d ${depthvar_name},${zmin},${zmax})

Check warning

Code scanning / shellcheck

Use spaces, not commas, to separate array elements. Warning

Use spaces, not commas, to separate array elements.

Check warning

Code scanning / shellcheck

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. Warning

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

Check warning

Code scanning / shellcheck

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. Warning

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

Check warning

Code scanning / shellcheck

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. Warning

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
elif [[ ${component_name} == "ice" ]];then
infile=${COMIN_ICE_NETCDF}/${RUN}.ice.t${cyc}z.${datares}.f${fnh}.nc
otherargs=""
otherargs=()
fi
outfile=${subdata}/${RUN}.${component_name}.t${cyc}z.${datares}.f${fnh}.nc
fi
Expand All @@ -59,7 +59,7 @@ for (( nh = FHMIN_GFS; nh <= FHMAX_GFS; nh = nh + fhout_ocnice )); do
echo "WARNING: No variables from parm file ${varlist} are available in netcdf file ${infile}."
else
ocnice_vars=${varsavailable::-1}
ncks -v "${ocnice_vars}" ${otherargs} "${infile}" "${outfile}"
ncks -v "${ocnice_vars}" "${otherargs[@]}" "${infile}" "${outfile}"
fi
fi
if [[ ${datacompress} -eq 1 ]];then
Expand Down

0 comments on commit 142450a

Please sign in to comment.