#!/bin/ksh set -xa #################################### # Specify NET and RUN Name and model #################################### export NET=cfs export RUN=cdas export RUN1=cdas1 export host=${host:-`hostname | cut -c1`} date export PS4='$SECONDS + ' ########################################################## export DATA=${DATA:-${DATAROOT:?}/${jobid:?}} mkdir -p $DATA cd $DATA #################################### # Determine Job Output Name on System #################################### export pgmout="OUTPUT.$$" export pgmerr=errfile export cycle=t${cyc}z #################################### # VERBOSE - Specify Verbose Output #################################### export VERBOSE=${VERBOSE:-YES} ########################################################## # define cfs directories/scripts/executables ########################################################## export EXECcfs=$HOMEcfs/exec export PARMcfs=$HOMEcfs/parm export USHcfs=$HOMEcfs/ush export FIXcfs=$HOMEcfs/fix ############################################### # Define the config file ############################################### export CDAS_CONFIG_FILE=${CDAS_CONFIG_FILE:-$PARMcfs/cfs_parm_am/cfs_cdas_config} ############################## # Run setpdy and initialize PDY variables ############################## sh setpdy.sh . ./PDY export CDATE=${CDATE:-${PDY}$cyc} export YYYY=`echo $PDY |cut -c1-4` ############################################## # Define COM directories ############################################## export COMROT=$(compath.py -o ${NET}/${cfs_ver}) export COMIN=$(compath.py -o ${NET}/${cfs_ver}/${RUN}.${PDY}) export COMOUT=$(compath.py -o ${NET}/${cfs_ver}/${RUN}.${PDY}) mkdir -m775 -p $COMOUT export COMINIC=$COMROT/cdas.$PDYm1 env ############################################################# # execute the updated fit script for cfs and gfs ############################################################# HOMEf2o=$HOMEcfs/Fit2Obs EXECf2o=$HOMEf2o/exec fitdir=$HOMEf2o/batrun TMPDIR=$DATAROOT/fit2obs.$$; mkdir -p $TMPDIR export OMP_NUM_THREADS=${FITOMP:-1} export MPIRUN="mpiexec -n 3" export KMP_AFFINITY=disabled export KEEPDATA=${KEEPDATA:-NO} export NEMS=${NEMS:-YES} export COMINgfs=${COMINgfs:-$(compath.py gfs/${gfs_ver})} export PRVT=${PRVT:-$COMINgfs/fix/prepobs_errtable.global} export HYBLEVS=${HYBLEVS:-$HOMEcfs/fix/cfs_fix_am/global_hyblev.l65.txt} ################################################################ # Run the fits for this time for the CFS and the GFS models # -------------------------------------------------------------- # The vars COM_INA and COM_INF are quoted strings which evaluate # at runtime in Fit2Obs processing. They are # pathname templates which may need to be changed. Also the tags # which cycle EXPNAM are preset configs for different models # and they might be adjusted too. ################################################################# expnams=${expnams:-'GFS16 CFS22'} for EXPNAM in $expnams ; do if [[ $EXPNAM = GFS16 ]] ; then COM_INA='$(compath.py gfs/${gfs_ver}/gdas.${PDY}/${cyc}/atmos)' COM_INAprep='$(compath.py obsproc/${obsproc_ver})/gdas.${PDY}/${cyc}/atmos' COM_INF='$(compath.py gfs/${gfs_ver}/gfs.${fdy}/${fzz}/atmos)' COMFIT=$(compath.py -o gfs/${gfs_ver}) OMP_NUM_THREADS=1 RUN_ENVIR=netcdf ACPROFit=YES CONVNETC=YES fi if [[ $EXPNAM = CFS22 ]] ; then COM_INA='$(compath.py -o cfs/${cfs_ver}/cdas.$PDY)' COM_INF='$(compath.py -o cfs/${cfs_ver}/cfs.$fdy/$fzz/6hrly_grib_01)' COMFIT=$(compath.py -o cfs/${cfs_ver}) OMP_NUM_THREADS=9 RUN_ENVIR=cfs ACPROFit=NO CONVNETC=NO fi ARCDIR=$DATA/$EXPNAM.fits time $fitdir/runfits $EXPNAM $CDATE $COMFIT export err=$?; err_chk # tar up the fits and save in COMROT/fit2obs cd $ARCDIR EXP=$(echo $EXPNAM|cut -c 1-3) FITARC=$COMROT/fit2obs/${EXP}.fits/${YYYY}; mkdir -p $FITARC tar -cf $FITARC/$EXP.fits.$CDATE * chgrp rstprod $FITARC/$EXP.fits.$CDATE chmod 640 $FITARC/$EXP.fits.$CDATE err=$?; err_chk done ################################################### # msg end of job and clean up temperary directory ################################################### cat $pgmout msg="ENDED NORMALLY." postmsg "$msg" ######################################## # Remove the Temporary working directory ######################################## cd $DATAROOT if [ ${KEEPDATA:-NO} = NO ] ; then rm -rf $DATA ; fi date