Skip to content

Commit

Permalink
Fix post sounding job
Browse files Browse the repository at this point in the history
A few minor errors were blocking the sounding job from completing
successfully:
- CFP APRUN command was using incorrect number of PEs
- Updates were needed to run on Orion. Removed the machine-specific
code for Hera and Jet so it runs the same on all machines, while
refactoring it to use C-style loop.
- Bash base errors (see also #1195), which are now corrected, while
refactoring to use C-style loop.

Refs #1195
Fixes #1211
  • Loading branch information
WalterKolczynski-NOAA committed Jan 6, 2023
1 parent 8581eac commit 54bb59e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 30 deletions.
2 changes: 1 addition & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ elif [[ "${step}" = "postsnd" ]]; then

export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1}
[[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max}
export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}"
export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsndcfp} ${mpmd_opt}"

elif [[ "${step}" = "awips" ]]; then

Expand Down
2 changes: 1 addition & 1 deletion env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ elif [[ "${step}" = "postsnd" ]]; then

export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1}
[[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max}
export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}"
export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsndcfp} ${mpmd_opt}"

elif [[ "${step}" = "awips" ]]; then

Expand Down
23 changes: 4 additions & 19 deletions scripts/exgfs_atmos_postsnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,19 @@ fi
# Create Regional Collectives of BUFR data and
# add appropriate WMO Headers.
########################################
collect=' 1 2 3 4 5 6 7 8 9'
if [ $machine == "HERA" -o $machine == "JET" ]; then
for m in ${collect}
do
sh $USHbufrsnd/gfs_sndp.sh $m
done

################################################
# Convert the bufr soundings into GEMPAK files
################################################
sh $USHbufrsnd/gfs_bfr2gpk.sh

else
rm -rf poe_col
for m in ${collect}
do
echo "sh $USHbufrsnd/gfs_sndp.sh $m " >> poe_col
for (( m = 1; m <10 ; m++ )); do
echo "sh ${USHbufrsnd}/gfs_sndp.sh ${m} " >> poe_col
done

mv poe_col cmdfile
nl -n ln -v 0 poe_col > cmdfile

cat cmdfile
chmod +x cmdfile

${APRUN_POSTSNDCFP} cmdfile

sh $USHbufrsnd/gfs_bfr2gpk.sh
fi
sh "${USHbufrsnd}/gfs_bfr2gpk.sh"


############## END OF SCRIPT #######################
15 changes: 6 additions & 9 deletions ush/gfs_bufr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ cat << EOF > gfsparm
/
EOF

hh=${FSTART}
while (( hh <= FEND )); do
hh2=$(printf %02i ${hh})
hh3=$(printf %03i ${hh})
for (( hr = 10#${FSTART}; hr <= 10#${FEND}; hr = hr + 10#${FINT} )); do
hh2=$(printf %02i "${hr}")
hh3=$(printf %03i "${hr}")

#---------------------------------------------------------
# Make sure all files are available:
#---------------------------------------------------------
# Make sure all files are available:
ic=0
while (( ic < 1000 )); do
if [ ! -f "${COMIN}/${RUN}.${cycle}.logf${hh3}.${logfm}" ]; then
Expand All @@ -71,11 +70,9 @@ while (( hh <= FEND )); do
exit 2
fi
done
#------------------------------------------------------------------
#------------------------------------------------------------------
ln -sf "${COMIN}/${RUN}.${cycle}.atmf${hh3}.${atmfm}" "sigf${hh2}"
ln -sf "${COMIN}/${RUN}.${cycle}.sfcf${hh3}.${atmfm}" "flxf${hh2}"

hh=$((hh + FINT))
done

# define input BUFR table file.
Expand Down

0 comments on commit 54bb59e

Please sign in to comment.