#!/bin/ksh ########################################################################## #### UNIX Script Documentation Block # # # # Script name: wrapup.sh # # Script description: - convert output to grads format. # # # # Author: Manuel Pondeca Org: NP22 Date: 2005-10-30 # # # # Script history log: # # 2005-10-30 pondeca # ########################################################################## set -x msg="JOB $job HAS BEGUN" postmsg "$jlogfile" "$msg" #export g2ctl=${g2ctl:-/u/Wesley.Ebisuzaki/bin/g2ctl} export g2ctl=${g2ctl:-$gradsdir/from_binbin_g2ctl} if [[ $thismachine == 'IBM' ]] ; then export gribmap=${gribmap:-/usrx/local/GrADS/2.0.2/bin/gribmap} #WCOSS phase 1 & 2 elif [[ $thismachine == 'DELL' ]] ; then export gribmap=${gribmap:-/usrx/local/dev/packages/grads/2.2.0/bin/gribmap} #DELL fi export cycle=t${cyc}z setpdy.sh . PDY CDATE=$PDY$cyc YYYYMMDD=$PDY YYYYMM=`echo $CDATE | cut -c 1-6` YYYY=`echo $CDATE | cut -c 1-4` cd $DATA_WRAPUP fldlist="2dvarges 2dvaranl 2dvarerr" case $RUN in rtma2p5) suffixlist="ndfd.grb2 nwrfc.grb2 ndfd.grb2_ext ndfd.grb2_wexp ndfd.grb2_wexp_allflds";; akrtma) suffixlist="ndfd_3p0.grb2 ndfd.grb2 ndfd_3p0.grb2_allflds";; *) suffixlist="ndfd.grb2 ndfd.grb2_allflds";; esac for type in $fldlist ; do for suffix in $suffixlist ; do cp -p $COMOUT/${RUN}.t${cyc}z.${type}_${suffix} . done done ######################################################################################################## #==> grads ######################################################################################################## if [ ${rungrads} = yes ] ; then cd $DATA_WRAPUP fldlist="2dvarges 2dvaranl 2dvarerr" for type in $fldlist ; do for suffix in $suffixlist ; do $g2ctl ${RUN}.t${cyc}z.${type}_${suffix} > ${RUN}.t${cyc}z.${type}_${suffix}.des $gribmap -i ${RUN}.t${cyc}z.${type}_${suffix}.des done done ######################################################################################################## case $RUN in rtma2p5) cp ${RUN}.t${cyc}z.2dvarges_ndfd.grb2_wexp.des thisges.des cp ${RUN}.t${cyc}z.2dvaranl_ndfd.grb2_wexp.des thisanl.des cp ${RUN}.t${cyc}z.2dvarerr_ndfd.grb2_wexp.des thiserr.des;; akrtma) cp ${RUN}.t${cyc}z.2dvarges_ndfd_3p0.grb2.des thisges.des cp ${RUN}.t${cyc}z.2dvaranl_ndfd_3p0.grb2.des thisanl.des cp ${RUN}.t${cyc}z.2dvarerr_ndfd_3p0.grb2.des thiserr.des;; *) cp ${RUN}.t${cyc}z.2dvarges_ndfd.grb2.des thisges.des cp ${RUN}.t${cyc}z.2dvaranl_ndfd.grb2.des thisanl.des cp ${RUN}.t${cyc}z.2dvarerr_ndfd.grb2.des thiserr.des;; esac cp $gradsdir/basicgrads.gs . if [[ ${RUN} = 'gurtma' ]] ; then cp $COMOUT/${RUN}.t${cyc}z.sigf12 sigges else cp $COMOUT/${RUN}.t${cyc}z.sigf06 sigges fi cp $COMOUT/${RUN}.t${cyc}z.siganl siganl $gradsdir/gradout_2dvar sigges ges firstguess $gradsdir/gradout_2dvar siganl anl gsisolution if [ ${cressman_anl_on} = yes ] ; then cp $COMOUT/${RUN}.t${cyc}z.sigcress sigcress $gradsdir/gradout_2dvar sigcress cress gsisolution fi fi ######################################################################################################## #==> cross-validation files ######################################################################################################## if [ ${cross_validation_on} = yes ] ; then valdir=${valdir0}/${YYYY}/${YYYYMM}/${YYYYMMDD}/${CDATE} mkdir -p $valdir # cp -p $COMOUT/${RUN}.t${cyc}z.diag_conv_ges.Z $valdir/. # cp -p $COMOUT/${RUN}.t${cyc}z.diag_conv_anl.Z $valdir/. cp -p $COMOUT/${RUN}.t${cyc}z.*fits $valdir/. cp -p $COMOUT/${RUN}.t${cyc}z.*allcv_groups* $valdir/. cp -p $COMOUT/${RUN}.t${cyc}z.rawstats.dat_for_rmuse_* $valdir/. cp -p $COMOUT/${RUN}.t${cyc}z.stats_for_rmuse_* $valdir/. fi ######################################################################################################## #==> clean disk space ######################################################################################################## LOCAL_HH=`date +"%H"` echo "LOCAL HOUR = "${LOCAL_HH} if [ ${LOCAL_HH} = 15 ] ; then cd ${DATA_WRAPUP}/.. # /bin/rm -r ${RUN}_${PDYm1}* # /bin/rm -r ${RUN}_${PDYm2}* /bin/rm -r ${RUN}_${PDYm3}* /bin/rm -r ${RUN}_${PDYm4}* /bin/rm -r ${RUN}_${PDYm5}* cd ${ldump} # /bin/rm -r ndfd.${PDYm1} # /bin/rm -r ndfd.${PDYm2} # /bin/rm -r ndfd.${PDYm3} /bin/rm -r ndfd.${PDYm4} /bin/rm -r ndfd.${PDYm5} fi cp -p $DATAGES/stdout_output_ndfd $COMOUT/${RUN}.t${cyc}z.stdout_output_ndfd cp -p $DATAGSI/stdout $COMOUT/${RUN}.t${cyc}z.stdout_gsi cp -p $DATAPOST/stdout_post $COMOUT/${RUN}.t${cyc}z.stdout_post cp -p $LLOGS1/${NET}_guess.out.* $COMOUT/${RUN}.t${cyc}z.${NET}_guess.out cp -p $LLOGS1/${NET}_gsi_twodvar.out.* $COMOUT/${RUN}.t${cyc}z.${NET}_gsi_twodvar.out cp -p $LLOGS1/${NET}_post.out.* $COMOUT/${RUN}.t${cyc}z.${NET}_post.out cp -p $DATAGES/stdout_output_ndfd $DATA_WRAPUP/stdout_output_ndfd cp -p $DATAGSI/stdout $DATA_WRAPUP/stdout_gsi cp -p $DATAPOST/stdout_post $DATA_WRAPUP/stdout_post cp -p $LLOGS1/${NET}_guess.out.* $DATA_WRAPUP/${NET}_guess.out cp -p $LLOGS1/${NET}_gsi_twodvar.out.* $DATA_WRAPUP/${NET}_gsi_twodvar.out cp -p $LLOGS1/${NET}_post.out.* $DATA_WRAPUP/${NET}_post.out if [ ${remove_wrkdirs} = yes ] ; then cd $DATAGES/.. /bin/rm -rf wrkdir_ges.$PDY$cyc cd $DATAPOST/.. /bin/rm -rf wrkdir_post.$PDY$cyc cd $DATAshared/.. /bin/rm -rf ${CAP_RUN}_${ENVIR} fi #*********************************************************************************************** echo "ALL DONE FOR CDATE "${CDATE} > ${DATA_WRAPUP}/ALLDONE0 ######################################################## postmsg $jlogfile "$0 of $job completed normally" ################## END OF SCRIPT ####################### exit 0