Skip to content

Commit

Permalink
Fix post sounding job (#1212)
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.

This is part of a package of PRs that were tested together as part of a j-job refactor.

Refs #1195
Fixes #1211
  • Loading branch information
WalterKolczynski-NOAA authored Jan 14, 2023
1 parent 469cc7b commit 4e2e01a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 30 deletions.
4 changes: 3 additions & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ elif [[ "${step}" = "init" ]]; then

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

export CFP_MP="YES"

nth_max=$((npe_node_max / npe_node_postsnd))

export NTHREADS_POSTSND=${nth_postsnd:-1}
Expand All @@ -278,7 +280,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
4 changes: 3 additions & 1 deletion env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ elif [[ "${step}" = "init" ]]; then

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

export CFP_MP="YES"

nth_max=$((npe_node_max / npe_node_postsnd))

export NTHREADS_POSTSND=${nth_postsnd:-1}
Expand All @@ -276,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: 2 additions & 0 deletions env/S4.env
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ elif [[ ${step} = "init" ]]; then

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

export CFP_MP="YES"

npe_node_postsnd=${npe_node_postsnd:-${npe_node_max}}
nth_max=$((npe_node_max / npe_node_postsnd))

Expand Down
27 changes: 8 additions & 19 deletions scripts/exgfs_atmos_postsnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,23 @@ 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
if [[ ${CFP_MP:-"NO"} == "YES" ]]; then
nl -n ln -v 0 poe_col > cmdfile
else
mv poe_col cmdfile
fi

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 4e2e01a

Please sign in to comment.