Skip to content

Commit

Permalink
Correct issue in linking final restart files (NOAA-EMC#1285)
Browse files Browse the repository at this point in the history
A bug in forecast_predet.sh, because when run cycled model, the interval_restart_gfs=0, it will cause the condition failed and will not run the following statements, which will cause gmemdir is not set values in the forecast_postdet.sh. Therefore, I delete the condition to solve this issue.

Fixes NOAA-EMC#1284
  • Loading branch information
XianwuXue-NOAA authored Jan 27, 2023
1 parent 9a87592 commit e092e8b
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions ush/forecast_predet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,22 +209,20 @@ FV3_GFS_predet(){
RSTDIR_ATM=${RSTDIR_ATM:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/atmos/RERUN_RESTART}
if [ ! -d $RSTDIR_ATM ]; then mkdir -p $RSTDIR_ATM ; fi
$NLN $RSTDIR_ATM RESTART
if [[ $(( ${FHMAX_GFS} % ${restart_interval_gfs} )) == 0 ]]; then
# The final restart written at the end doesn't include the valid date
# Create links that keep the same name pattern for these files
VDATE=$($NDATE +$FHMAX_GFS $CDATE)
vPDY=$(echo $VDATE | cut -c1-8)
vcyc=$(echo $VDATE | cut -c9-10)
files="coupler.res fv_core.res.nc"
for tile in {1..6}; do
for base in ca_data fv_core.res fv_srf_wnd.res fv_tracer.res phy_data sfc_data; do
files="${files} ${base}.tile${tile}.nc"
done
# The final restart written at the end doesn't include the valid date
# Create links that keep the same name pattern for these files
VDATE=$($NDATE +$FHMAX_GFS $CDATE)
vPDY=$(echo $VDATE | cut -c1-8)
vcyc=$(echo $VDATE | cut -c9-10)
files="coupler.res fv_core.res.nc"
for tile in {1..6}; do
for base in ca_data fv_core.res fv_srf_wnd.res fv_tracer.res phy_data sfc_data; do
files="${files} ${base}.tile${tile}.nc"
done
for file in $files; do
$NLN $RSTDIR_ATM/$file $RSTDIR_ATM/${vPDY}.${vcyc}0000.$file
done
fi
done
for file in $files; do
$NLN $RSTDIR_ATM/$file $RSTDIR_ATM/${vPDY}.${vcyc}0000.$file
done
else
mkdir -p $DATA/RESTART
fi
Expand Down

0 comments on commit e092e8b

Please sign in to comment.