Skip to content

Commit

Permalink
Correcting minor bug in wave_prn_cur.sh Adjusting indents in exwave_p…
Browse files Browse the repository at this point in the history
…rep.sh Adding defaults for current processing in conif.waveprep.
  • Loading branch information
ajhenrique committed May 28, 2020
1 parent 32c5f29 commit 3393cac
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 47 deletions.
4 changes: 2 additions & 2 deletions parm/config/config.waveprep
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export WAV_WND_HOUR_INC=1 # This value should match with the one used in
# the wind update script
# Intake currents settings
export WAV_CUR_DT=${WAV_CUR_DT:-3}
export WAV_CUR_HF_DT=${WAV_CUR_HF_DT:-3}
export WAV_CUR_HF_FH=${WAV_CUR_HF_FH:-72}
export WAV_CUR_HF_DT=${WAV_CUR_HF_DT:-3} # Defaults to 3h for GEFSv12
export WAV_CUR_HF_FH=${WAV_CUR_HF_FH:-0} # Constant DT for GFSv16 from getgo
export WAV_CUR_CDO_SMOOTH="NO"

# Location of CDO module
Expand Down
87 changes: 43 additions & 44 deletions scripts/exwave_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -638,55 +638,55 @@
touch cmdfile
chmod 744 cmdfile

ymdh_rtofs=${PDY}00 # RTOFS runs once daily
ymdh_end=`$NDATE ${FHMAX_WAV_CUR} ${ymdh_rtofs}`
NDATE_DT=${WAV_CUR_HF_DT}
FLGHF='T'
ymdh_rtofs=${PDY}00 # RTOFS runs once daily use ${PDY}00
ymdh_end=`$NDATE ${FHMAX_WAV_CUR} ${PDY}00`
NDATE_DT=${WAV_CUR_HF_DT}
FLGHF='T'

if [ ${CFP_MP:-"NO"} = "YES" ]; then nm=0 ; fi # Counter for MP CFP
while [ "$ymdh_rtofs" -le "$ymdh_end" ]
do
if [ ${CFP_MP:-"NO"} = "YES" ]; then nm=0 ; fi # Counter for MP CFP
while [ "$ymdh_rtofs" -le "$ymdh_end" ]
do
# Timing has to be made relative to the single 00z RTOFS cycle for that PDY
fhr_rtofs=`${NHOUR} ${ymdh_rtofs} ${PDY}00`
fext='f'
fhr_rtofs=`${NHOUR} ${ymdh_rtofs} ${PDY}00`
fext='f'

fh3_rtofs=`printf "%03d" "${fhr_rtofs#0}"`
fh3_rtofs=`printf "%03d" "${fhr_rtofs#0}"`

curfile1h=${COMIN_WAV_CUR}/rtofs_glo_2ds_${fext}${fh3_rtofs}_1hrly_prog.nc
curfile3h=${COMIN_WAV_CUR}/rtofs_glo_2ds_${fext}${fh3_rtofs}_3hrly_prog.nc
curfile1h=${COMIN_WAV_CUR}/rtofs_glo_2ds_${fext}${fh3_rtofs}_1hrly_prog.nc
curfile3h=${COMIN_WAV_CUR}/rtofs_glo_2ds_${fext}${fh3_rtofs}_3hrly_prog.nc

if [ -s ${curfile1h} ] && [ "${FLGHF}" = "T" ] ; then
curfile=${curfile1h}
elif [ -s ${curfile3h} ]; then
curfile=${curfile3h}
FLGHF='F'
else
echo ' '
set $setoff
echo ' '
echo '************************************** '
echo "*** FATAL ERROR: NO CUR FILE $curfile *** "
echo '************************************** '
echo ' '
set $seton
postmsg "$jlogfile" "FATAL ERROR - NO CURRENT FILE (RTOFS)"
err=11;export err;${errchk}
exit 0
echo ' '
fi
if [ -s ${curfile1h} ] && [ "${FLGHF}" = "T" ] ; then
curfile=${curfile1h}
elif [ -s ${curfile3h} ]; then
curfile=${curfile3h}
FLGHF='F'
else
echo ' '
set $setoff
echo ' '
echo '************************************** '
echo "*** FATAL ERROR: NO CUR FILE $curfile *** "
echo '************************************** '
echo ' '
set $seton
postmsg "$jlogfile" "FATAL ERROR - NO CURRENT FILE (RTOFS)"
err=11;export err;${errchk}
exit 0
echo ' '
fi

if [ ${CFP_MP:-"NO"} = "YES" ]; then
echo "$nm $USHwave/wave_prnc_cur.sh $ymdh_rtofs $curfile $fhr_rtofs > cur_$ymdh_rtofs.out 2>&1" >> cmdfile
nm=`expr $nm + 1`
else
echo "$USHwave/wave_prnc_cur.sh $ymdh_rtofs $curfile $fhr_rtofs > cur_$ymdh_rtofs.out 2>&1" >> cmdfile
fi
if [ ${CFP_MP:-"NO"} = "YES" ]; then
echo "$nm $USHwave/wave_prnc_cur.sh $ymdh_rtofs $curfile $fhr_rtofs > cur_$ymdh_rtofs.out 2>&1" >> cmdfile
nm=`expr $nm + 1`
else
echo "$USHwave/wave_prnc_cur.sh $ymdh_rtofs $curfile $fhr_rtofs > cur_$ymdh_rtofs.out 2>&1" >> cmdfile
fi

if [ $fhr_rtofs -ge ${WAV_CUR_HF_FH} ] ; then
NDATE_DT=${WAV_CUR_DT}
fi
ymdh_rtofs=`$NDATE $NDATE_DT $ymdh_rtofs`
done
if [ $fhr_rtofs -ge ${WAV_CUR_HF_FH} ] ; then
NDATE_DT=${WAV_CUR_DT}
fi
ymdh_rtofs=`$NDATE $NDATE_DT $ymdh_rtofs`
done

# Set number of processes for mpmd
wavenproc=`wc -l cmdfile | awk '{print $1}'`
Expand Down Expand Up @@ -741,13 +741,12 @@
err=11;export err;${errchk}
fi

# rm -f cur.${WAVECUR_FID}
rm -f cur.${WAVECUR_FID}

for file in $files
do
echo $file
cat $file >> cur.${WAVECUR_FID}
rm -f $file
done

cp -f cur.${WAVECUR_FID} ${COMOUT}/rundata/${COMPONENTwave}.${WAVECUR_FID}.$cycle.cur
Expand Down
2 changes: 1 addition & 1 deletion ush/wave_prnc_cur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fi
# Cleanup
rm -f cur_temp[123].nc cur_5min_??.nc cur_glo_uv_${PDY}_${fext}${fh3}.nc weights.nc

if [ ${fhr} -gt ${WAVHINDH} ]
if [ ${fhr} -gt 0 ]
then
sed -e "s/HDRFL/F/g" ${FIXwave}/ww3_prnc.cur.${WAVECUR_FID}.inp.tmpl > ww3_prnc.inp
else
Expand Down

0 comments on commit 3393cac

Please sign in to comment.