Skip to content

Commit

Permalink
modified files
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonMFernando-NOAA committed Feb 28, 2025
1 parent bb48ed9 commit 0cfb50b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions ush/atmos_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ for outtype in "f2d" "f3d"; do
if [[ -f "${infile}" ]]; then # check if input file exists before extraction
new_infile="${outdirpre}/$(basename "${infile}")_ext"
cpfs "${infile}" "${new_infile}"
if [[ ! -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
if [[ $? -ne 0 ]]; then
echo "ERROR: Failed to copy ${infile} to ${new_infile}. Skipping."
continue
fi
# shellcheck disable=SC2312
${WGRIB2} "${new_infile}" | grep -F -f "${varlist}" | ${WGRIB2} -i "${new_infile}" -append -grib "${outfile}"
Expand All @@ -94,8 +95,9 @@ for outtype in "f2d" "f3d"; do
if [[ -f "${infile}" ]]; then # check if input file exists before extraction
new_infile="${outdirpre}/$(basename "${infile}")_ext"
cpfs "${infile}" "${new_infile}"
if [[ ! -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
if [[ $? -ne 0 ]]; then
echo "ERROR: Failed to copy ${infile} to ${new_infile}. Skipping."
continue
fi
# shellcheck disable=SC2312
${WGRIB2} "${new_infile}" | grep -F -f "${varlist_d}" | ${WGRIB2} -i "${new_infile}" -append -grib "${outfile}"
Expand Down
5 changes: 3 additions & 2 deletions ush/ocnice_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ for (( nh = FHMIN_GFS + fhout_ocnice; nh <= FHMAX_GFS; nh = nh + fhout_ocnice ))

if [[ -f "${infile}" ]]; then #check if input file exists before extraction
cpfs "${infile}" "${new_infile}" #copy infile to the subdata directory
if [[ ! -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
if [[ $? -ne 0 ]]; then
echo "ERROR: Failed to copy ${infile} to ${new_infile}. Skipping."
continue
fi
varsrequested=$(paste -s "${varlist}")
varsinfile=$(cdo -showname "${new_infile}")
Expand Down
5 changes: 3 additions & 2 deletions ush/wave_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ for (( nh = FHOUT_WAV_EXTRACT; nh <= FHMAX_WAV; nh = nh + FHOUT_WAV_EXTRACT ));

if [[ -f "${infile}" ]]; then # Check if input file exists before extraction
cpfs "${infile}" "${new_infile}" # Copy infile to the subdata directory
if [[ ! -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
if [[ $? -ne 0 ]]; then
echo "ERROR: Failed to copy ${infile} to ${new_infile}. Skipping."
continue
fi
# shellcheck disable=SC2312
${WGRIB2} "${new_infile}" | grep -F -f "${varlist_wav}" | ${WGRIB2} -i "${new_infile}" -append -grib "${outfile}"
Expand Down

0 comments on commit 0cfb50b

Please sign in to comment.