#!/bin/ksh set -x . /etc/ksh.kshrc if [ -a .profile ]; then . ./.profile fi if [ -a .kshrc ] ; then . ./.kshrc fi machine_prefix=`cat /proc/sys/kernel/hostname | cut -c 1-1` if [[ $machine_prefix == 't' || $machine_prefix == 'g' ]] ; then thismachine=IBM MPIEXEC=mpirun.lsf . /usrx/local/Modules/3.2.9/init/ksh module purge module load lsf module load ics/14.0.2 module load prod_util elif [[ $machine_prefix == 'v' || $machine_prefix == 'm' ]] ; then thismachine=DELL MPIEXEC=mpirun . /usrx/local/prod/lmod/lmod/init/ksh module purge module load ips/18.0.1.163 module load lsf/10.1 module load prod_util/1.1.0 elif [[ $machine_prefix == 'd' || $machine_prefix == 'c' ]] ; then thismachine=CRAY MPIEXEC=mpiexec . /usr/share/lmod/lmod/init/ksh module purge module load envvar/1.0 module load PrgEnv-intel/8.1.0 module load craype/2.7.10 module load intel/19.1.3.304 module load libjpeg/9c module load cray-mpich/8.1.9 module load cray-pals/1.0.17 module load prod_util/2.0.13 fi if [[ $machine_prefix == 'v' || $machine_prefix == 'g' ]] ; then wd=g #stands for wcoss-dev is gyre else wd=t #stands for wcoss-dev is tide fi ########################### BEGIN CHANGES ########################################## vernum=2.10.5 # prod_rtma_ver=2.10 # # RUN=akrtma # CAP_RUN=AKRTMA # NET=rtma # envir=test # ENVIR=TEST # last_jobname=aktestRftp # # if [[ $thismachine == 'IBM' ]] ; then # ftpqueue=transfer #set to "dev2" when transfer queue is closed # elif [[ $thismachine == 'DELL' ]] ; then # ftpqueue=dev_transfer #set to "dev" when transfer queue is closed # elif [[ $thismachine == 'CRAY' ]] ; then # ftpqueue=dev_transfer #set to "dev" when transfer queue is closed # fi # # ptmp=lfs/h2/emc/ptmp # # # SINGLE_CYCLE=yes # # #CDATE0=`date -u +%Y%m%d%H` # CDATE0=2023101213 # # CDATE_STOP=2030010100 # # hpss_save=yes # write_to_rzdm=no # # remove_wrkdirs=no #if set to "yes", will remove all working directories # #at the end of the analysis # # ########################### END CHANGES ########################################## ptmp_base=/${ptmp}/${USER}/faaupgrade cycdir=${ptmp_base}/cycs/${envir}_${RUN} mkdir -p $cycdir if [ ${SINGLE_CYCLE} = yes ] ; then CDATE=$CDATE0 else #make sure previous cycle has finished bjobs | grep " ${last_jobname}" > ${cycdir}/test.dat if [[ -s ${cycdir}/test.dat ]] ; then exit 0 fi rm ${cycdir}/test.dat lastCDATE=`cat ${cycdir}/lastCDATE` CDATE=`$NDATE +1 $lastCDATE` if [[ $CDATE -ge $CDATE_STOP ]] ; then echo 'CDATE is ' $CDATE echo 'CDATE_STOP is ' $CDATE_STOP exit 0 fi fi YYYY=`echo ${CDATE} | cut -c 1-4` PDY=`echo ${CDATE} | cut -c 1-8` cyc=`echo ${CDATE} | cut -c 9-10` COMROOT=${ptmp_base}/com if [ ${ftpqueue} != "transfer" && ${ftpqueue} != "dev_transfer" ] ; then write_to_rzdm=no hpss_save=no fi tarfile_1=com2_${NET}_${envir}_${RUN}.${PDY} tarfile_2=com2_${NET}_${envir}_${NET}.${PDY} HOMErtma=/lfs/h2/emc/da/noscrub/${USER}/space3/faaupgrade/nw${envir}/${NET}.v${vernum} lscripts=$HOMErtma/scripts/${RUN} lscripts_emc=$HOMErtma/emc/scripts mkdir -p $lscripts mkdir -p $lscripts_emc lconfig=${ptmp_base}/config/${NET}/${envir}/${RUN} mkdir -p $lconfig ljobs=$HOMErtma/emc/jobs/${RUN} mkdir -p $ljobs LLOGS0=${ptmp_base}/${envir}_${RUN}_2dvar LLOGS1=$LLOGS0/logs mkdir -p $LLOGS1 LLOGS2=${ptmp_base}/logs #used for ftp stderr. no need to export mkdir -p $LLOGS2 utilscript=/nwprod2/util/ush utilexec=/nwprod2/util/exec #========================================================================================= cat << EOF > $lconfig/${RUN}_envir.sh #! /bin/ksh export thismachine=$thismachine export vernum=$vernum export RUN=$RUN export CAP_RUN=$CAP_RUN export YYYY=$YYYY export NET=$NET export envir=$envir export PDY=$PDY export cyc=$cyc export COMROOT=$COMROOT export COMOUT=$COMROOT/${NET}/${envir}/${RUN}.$PDY export COMOUT_GEMPAK=${COMROOT}/${envir}/${RUN}.${PDY}/gempak export COMIN=$COMROOT/${NET}/${envir}/${RUN}.$PDY export COMINhrrr=/lfs/h1/ops/prod/com/hrrr/v4.1 export COMINrap=/lfs/h1/ops/prod/com/rap/v5.1 export COMINnam=/lfs/h1/ops/prod/com/smartinit/v4.4/nam.${PDY} #note that COMINnam contains one more subdirectory than COMINhrrr, COMINrap export COMINobsproc_rtma=/lfs/h1/ops/prod/com/obsproc/v1.1/${NET}.${PDY} #path to input prepbufr, satwnd, and efclam files for GSI analysis export DATAshared=${ptmp_base}/TMPDATA/${CAP_RUN}_${ENVIR} export GESIN=${ptmp_base}/nwges2/${NET}/${envir} export GESOUT=${ptmp_base}/nwges2/${NET}/${envir} export DATAGES=${LLOGS0}/wrkdir_ges.$PDY$cyc export DATAGSI=${LLOGS0}/tmpreg export DATAPOST=${LLOGS0}/wrkdir_post.$PDY$cyc export DATA_WRAPUP=${LLOGS0}/${RUN}_$PDY$cyc export DATA_GEMPAK=${LLOGS0}/wrkdir_gem.$PDY$cyc export DATA_RHIST=${LLOGS0}/wrkdir_rhist.$PDY$cyc export FIX${NET}=$HOMErtma/fix/${RUN} export EXEC${NET}=$HOMErtma/exec export HOMErtma=$HOMErtma export lscripts=$lscripts export lscripts_emc=$lscripts_emc export lcodes=$HOMErtma/sorc export fixparm=$HOMErtma/fix/${RUN} export cycdir=$cycdir export MPIEXEC=$MPIEXEC export SENDCOM=YES export jlogfile_ges=$LLOGS2/${RUN}_jlogfile_ges export jlogfile_gsi=$LLOGS2/${RUN}_jlogfile_gsi export jlogfile_post=$LLOGS2/${RUN}_jlogfile_post export jlogfile_wrapup=$LLOGS2/${RUN}_jlogfile_wrapup export jlogfile_gem=$LLOGS2/${RUN}_jlogfile_gempak export jlogfile_tohpss=$LLOGS2/${RUN}_jlogfile_tohpss export jlogfile_ftp=$LLOGS2/${RUN}_jlogfile_ftp export LLOGS1=$LLOGS1 export LLOGS2=$LLOGS2 export PCOM=$COMROOT/${NET}/${envir}/pcom/${RUN} export utilscript=$utilscript export utilexec=$utilexec export valdir0=/lfs/h2/emc/stmp/${USER}/faaupgrade/${envir}_CVRAWDATA_${RUN} export cross_validation_on=no export cressman_anl_on=yes export gradsdir=$HOMErtma/emc/grads export rungrads=yes export tarfile_1=${tarfile_1} export tarfile_2=${tarfile_2} export hpsspath0=/NCEPDEV/emc-da/5year/${USER}/faaupgrade/${envir}_${RUN} export write_to_rzdm=${write_to_rzdm} export hpss_save=${hpss_save} export USHrhist=/nwprod/runhistory.v2.2.39/ush #export OLD_RUNS=/${ptmp}/${USER}/${envir}_${RUN}_2dvar/old_runs export OLD_RUNS=${ptmp_base}/old_runs/${envir}_${RUN}_2dvar export remove_wrkdirs=$remove_wrkdirs EOF #========================================================================================= . $lconfig/${RUN}_envir.sh if [ ${SINGLE_CYCLE} = no ] ; then if [ -s $COMINobsproc_rtma/rtma.t${cyc}z.prepbufr.tm00 ] ; then echo "Proceed! prepbufr file is available." else echo "Quitting now. prepbufr file is unavailable" exit 0 fi fi mkdir -p $OLD_RUNS datestring=`date +%d%b%Y`_`date +%T` list_keep="$DATAGES $DATA_WRAPUP $DATA_GEMPAK" for type in $list_keep do if [ -e $type ] ; then mv ${type} ${type}_${datestring} mv ${type}_${datestring} ${OLD_RUNS}/. fi if [ -d $type ] ; then mv ${type} ${type}_${datestring} mv ${type}_${datestring} ${OLD_RUNS}/. fi mkdir -p $type done #list_erase="$DATAGSI $DATAPOST $DATAshared" list_erase="$DATAGSI $DATAPOST" for type in $list_erase do /bin/rm -rf $type mkdir -p $type done mkdir -p $COMOUT mkdir -p $COMOUT_GEMPAK mkdir -p $GESIN mkdir -p $GESOUT mkdir -p $PCOM cd $LLOGS1 /bin/rm -rf rtma_guess.out.* /bin/rm -rf rtma_gsi_twodvar.out.* /bin/rm -rf rtma_post.out.* /bin/rm -rf rtma_wrapup.out.* /bin/rm -rf rtma_ftp.out.* /bin/rm -rf ftp_to_server_* /bin/rm -rf rtma_gempak.out.* cd $ljobs module list ############### submit jobs ######################### GES=`qsub ./run_ges.ll` echo $GES GSI=`qsub -W depend=afterok:$GES ./run_gsi.ll` echo $GSI POST=`qsub -W depend=afterok:$GSI ./run_post.ll` echo $POST GEMPAK=`qsub -W depend=afterok:$POST ./run_gempak.ll` echo $GEMPAK WRAPUP=`qsub -W depend=afterok:$POST ./run_wrapup.ll` echo $WRAPUP #FTP=`qsub -q $ftpqueue -W depend=afterok:$WRAPUP ./run_ftp.ll` #echo $FTP ################################################################################################ #==> update lastCDATE in $cycdir ################################################################################################ #CDATE=$PDY$cyc #echo $CDATE > ${cycdir}/cycle_$CDATE #cp -p ${cycdir}/cycle_$CDATE ${cycdir}/lastCDATE ################################################################################################ exit