#!/bin/ksh set -ax #------------------------------------------------------------------------------ # # NAME: anupdatem.ksh # # LANGUAGE: K-shell # # PURPOSE: Performs update of GFS grib files and processes those files # into Packed files. # # DESCRIPTION: Queries for new updates to GFS model grib fields and in # turn processes those Grib files into packed file format for # inclusion into SHIPS model runs. # # INFORMATION: # National Hurricane Center / Tropical Prediction Center # Department of Commerce - NOAA / NWS # # CATEGORY: Grib unpacking # # CALLING SEQUENCE: anupdatem.ksh # # INPUTS: # # OUTPUTS: # # EXTERNAL: # # SIDE EFFECTS: Unknown # # RESTRICTIONS: # # EXAMPLE or USAGE: anupdatem.ksh # # OTHER NOTES: None # # VERSION: 3.1.1 # # MODIFICATION HISTORY: # Written by: M. DeMaria and F. Horsfall, 15-MAY-2001 (NOAA-NWS) V1.0.0 # Revised by: C. Sisko, 24-MAR-2003 (NOAA-NWS) V1.1.0 # Revised by: M. DeMaria 13-MAY-2003 (Mods for frost/snow) V1.2.0 # Revised by: C. Sisko, 20-DEC-2006 (NOAA-NWS) V1.3.0 # Revised by: M. DeMaria 01-MAY-2013 (NOAA-NESDIS) V2.0.0 # Major re-write for WCOSS transition. # Uses wgrib utilities instead of FORTRAN code for grib exraction # New pressure levels added, sfc variables added # Domain of packed ASCII files extended to 160 E # Resolution increased from 2 to 1 deg lat/lon # Forecast length increased from 126 to 174 h # Revised by: NCO, transition to prod 01-AUG-2014 V2.1.0 # Revised by: K. Musgrave and M. DeMaria 26-FEB-2016 (CIRA/CSU, NOAA-NWS) V3.0.0 # Major re-write to use grib2 instead of grib1, some script clean up # Revised by: M. DeMaria 21-Nov-2016 V3.1.0 # Transition to Cray # Revised by : S. Stevenson 10-May-2019 # Added logic for FV3-GFS, set by "gflag" variable at top # Revised by : S. Stevenson 06-May-2020 V3.1.1 # Added file size check to remove any files less than 3.1MB #------------------------------------------------------------------------------ # # common root path # NCO path commonp="${HOMEnhcg}" # Test path #commonp="/u/Mark.DeMaria/svn/g2test/anupdate" # Define wgrib utility name with full path #WGRIB="/nwprod/util/exec/wgrib" #WGRIB2="/nwprod/util/exec/wgrib2" # TODO: Load module instead? module load grib_util/1.0.4 # JY WGRIB2="/gpfs/hps/nco/ops/nwtest/grib_util.v1.0.4/exec/wgrib2" #module load ips/18.0.1.163 #module load grib_util/1.1.0 # # Specify the directory to put the packed ASCII analysis files # NCO paths #pdir="${COM_STORM_DATA}/ships/gfs" ### output dir for storing the A120 files PACKdir="${COM_STORM_DATA}/ships/gfs" ### output dir for storing the A120 files # Test paths #pdir="${commonp}/packdata" ### output dir for storing the A120 files #PACKdir="${commonp}/packdata" ### output dir for storing the A120 files mkdir -p ${PACKdir} # # Specify the directory containing the executables xdir=${commonp}"/exec/" # # Specify the directory containing the grib files # NCO path gdir="${GFSDIR}/" # Test path #gdir="/com/gfs/prod/" # Specify gflag (="gfs" or "fv3") gflag="fv3" # # Initialize the grib file date directory variable gddir="19550930" logf="anupdate.log" rm $logf # # Find most recent GFS grib file directory # NCO date/time variables tday="${storm_tday}" ttim="${storm_ttim}" tyear="${storm_year}" # Test date/time variables #tday=`date -u +%m%d` #ttim=`date -u +%H` #tyear=`date -u +%Y` # # # Get the gddir from gdir ${GFSDIR} defined in the j-job # gddir=`ls $gdir | grep "gfs\." | grep ${tyear}${tday} | cut -c5-12`; ### get the GFS gddir from ${tyear}${tday} if [[ $gddir == '' ]]; then echo "gddir is empty $gddir ...., get from $gdir ...." for line0 in `ls $gdir|grep "gfs\."` do a1=`echo $line0 | cut -c1-3` if [ $a1 = "gfs" ]; then # Check to skip directories with future dates dday=`echo $line0 | cut -c9-12` # if [ $ttim -ge 4 ] then if [ $dday -le $tday ] then gddir=`echo $line0 | cut -c5-12` fi fi # if [ $ttim -lt 4 ] then if [ $dday -lt $tday ] then gddir=`echo $line0 | cut -c5-12` fi fi fi # done fi # Find most recent 126 hour GFS forecast that is completed #if [ "${1}" = "gfs" ]; then if [ "${gflag}" = "gfs" ]; then for line0 in `ls $gdir"gfs."$gddir | grep "gfs.t[0-9][0-9]z.pgrb2.1p00.f126$"` do echo $line0 > $logf gtimeq=`echo $line0 | cut -c6-7` done fi #if [ "${1}" = "fv3" ]; then if [ "${gflag}" = "fv3" ]; then for line0 in `ls $gdir"gfs."$gddir/[0-9][0-9]/atmos/ | grep "gfs.t[0-9][0-9]z.pgrb2.1p00.f126$"` do echo $line0 > $logf gtime=`echo $line0 | cut -c6-7` done fi # echo " *** Use cyc for gtime .... *** " # Only use cyc for NCO version # gtime=$CYC gmax=$((100*$gddir + $gtime)) echo "The most recent GFS run available is "$gmax >> $logf #if [ "${1}" = "fv3" ]; then if [ "${gflag}" = "fv3" ]; then gddir=${gddir}"/${gtime}/atmos/" fi # # Find the most recent analysis file dmax="0000000000" for line0 in `ls $PACKdir | grep A126` do ayr=`echo $line0 | cut -c5-6` axy=`echo $line0 | cut -c8-8` amon1=`echo $line0 | cut -c9-9` amon2=`echo $line0 | cut -c10-10` aday1=`echo $line0 | cut -c11-11` aday2=`echo $line0 | cut -c12-12` # # The following section avoids computation with amon and aday # values such as 08 if [ $amon1 -eq 0 ] then amon=$amon2 fi # if [ $amon1 -ge 1 ] then amon=$((10*$amon1 + $amon2)) fi # if [ $aday1 -eq 0 ] then aday=$aday2 fi # if [ $aday1 -ge 1 ] then aday=$((10*$aday1 + $aday2)) fi # # Adjust year ayr=$(($ayr + 2000)) # # Adjust day and calculate time atime="00" if [ $aday -ge 51 ] then aday=$(($aday - 50)) atime="12" fi # if test $axy = 'Y' then atime=$(($atime + 6)) fi # dtem=$((1000000*$ayr + 10000*$amon + 100*$aday + $atime)) # if [ $dtem -ge $dmax ] then dmax=$dtem fi done # echo "The most recent GFS run processed is "$dmax >> $logf # if [ $dmax -ge $gmax ] then echo "" >> $logf echo "*** Grib unpack *not* needed, anupdatem completed" >> $logf exit 0 fi # Update the packed ASCII GFS files rm -f gfs_casest rm -f gfs_cases icount=1 inc=6 for line0 in `ls $gdir"gfs."$gddir | grep "gfs.t${gtime}z.pgrb2.1p00.f[0-9][0-9][0-9]$"` do icount=$((icount+1)) let mtime=`echo $line0 | cut -c22-24` # let tem1=$((mtime/inc)) let tem2=$((tem1*inc)) let resid=$((mtime-tem2)) # if [ $resid -eq 0 ] then # # Reduce number of NCO times for testing if needed if [ $mtime -lt 175 ] # if [ $mtime -lt 12 ] then # Zero pad as necessary typeset -Z3 IFHR=$mtime echo $gmax"_"$IFHR >> gfs_casest fi fi done # sort -u gfs_casest > gfs_cases # # Loop through all available grib files for current forecast # time and create packed ASCII files for each rm -f A*_PACK.DAT for line0 in `cat gfs_cases` do # Create gfs_indate with date/time information for current grib file line1=`echo $line0 | cut -c1-8` line2=`echo $line0 | cut -c9-10` line3=`echo $line0 | cut -f2 -d"_"` rm -f gfs_indate echo $line1 > gfs_indate echo $line2 >> gfs_indate echo $line3 >> gfs_indate ftime=$line3 # Create current grib file name gribfil=$gdir"gfs."$gddir"/gfs.t"$gtime"z.pgrb2.1p00.f"$ftime echo $gribfil " " $line3 " " $tchar2 " " $tchar3 # Get date and hour of analysis to process YMD=`head -1 gfs_indate` HH=`head -2 gfs_indate | tail -1` IFHR=`head -3 gfs_indate | tail -1` # # Pull desired fields # TODO: Parallelize the next 71 lines (across 3 nodes with 24 cores each) # using MPMD script and aprun on Cray # #echo "$WGRIB2 -s $gribfil |grep ':70 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH\"_F\"$IFHR\"_u70.bin\"" $WGRIB2 -s $gribfil |grep ':70 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u70.bin" $WGRIB2 -s $gribfil |grep ':100 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u100.bin" $WGRIB2 -s $gribfil |grep ':150 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u150.bin" $WGRIB2 -s $gribfil |grep ':200 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u200.bin" $WGRIB2 -s $gribfil |grep ':250 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u250.bin" $WGRIB2 -s $gribfil |grep ':300 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u300.bin" $WGRIB2 -s $gribfil |grep ':400 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u400.bin" $WGRIB2 -s $gribfil |grep ':500 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u500.bin" $WGRIB2 -s $gribfil |grep ':600 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u600.bin" $WGRIB2 -s $gribfil |grep ':700 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u700.bin" $WGRIB2 -s $gribfil |grep ':850 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u850.bin" $WGRIB2 -s $gribfil |grep ':925 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u925.bin" $WGRIB2 -s $gribfil |grep ':1000 mb:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u1000.bin" $WGRIB2 -s $gribfil |grep ':0.995 sigma level:'|grep ':UGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_u1070.bin" $WGRIB2 -s $gribfil |grep ':70 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v70.bin" $WGRIB2 -s $gribfil |grep ':100 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v100.bin" $WGRIB2 -s $gribfil |grep ':150 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v150.bin" $WGRIB2 -s $gribfil |grep ':200 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v200.bin" $WGRIB2 -s $gribfil |grep ':250 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v250.bin" $WGRIB2 -s $gribfil |grep ':300 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v300.bin" $WGRIB2 -s $gribfil |grep ':400 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v400.bin" $WGRIB2 -s $gribfil |grep ':500 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v500.bin" $WGRIB2 -s $gribfil |grep ':600 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v600.bin" $WGRIB2 -s $gribfil |grep ':700 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v700.bin" $WGRIB2 -s $gribfil |grep ':850 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v850.bin" $WGRIB2 -s $gribfil |grep ':925 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v925.bin" $WGRIB2 -s $gribfil |grep ':1000 mb:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v1000.bin" $WGRIB2 -s $gribfil |grep ':0.995 sigma level:'|grep ':VGRD:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_v1070.bin" $WGRIB2 -s $gribfil |grep ':70 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height70.bin" $WGRIB2 -s $gribfil |grep ':100 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height100.bin" $WGRIB2 -s $gribfil |grep ':150 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height150.bin" $WGRIB2 -s $gribfil |grep ':200 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height200.bin" $WGRIB2 -s $gribfil |grep ':250 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height250.bin" $WGRIB2 -s $gribfil |grep ':300 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height300.bin" $WGRIB2 -s $gribfil |grep ':400 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height400.bin" $WGRIB2 -s $gribfil |grep ':500 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height500.bin" $WGRIB2 -s $gribfil |grep ':600 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height600.bin" $WGRIB2 -s $gribfil |grep ':700 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height700.bin" $WGRIB2 -s $gribfil |grep ':850 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height850.bin" $WGRIB2 -s $gribfil |grep ':925 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height925.bin" $WGRIB2 -s $gribfil |grep ':1000 mb:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height1000.bin" $WGRIB2 -s $gribfil |grep ':surface:'|grep ':HGT:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_height1070.bin" $WGRIB2 -s $gribfil |grep ':70 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp70.bin" $WGRIB2 -s $gribfil |grep ':100 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp100.bin" $WGRIB2 -s $gribfil |grep ':150 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp150.bin" $WGRIB2 -s $gribfil |grep ':200 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp200.bin" $WGRIB2 -s $gribfil |grep ':250 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp250.bin" $WGRIB2 -s $gribfil |grep ':300 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp300.bin" $WGRIB2 -s $gribfil |grep ':400 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp400.bin" $WGRIB2 -s $gribfil |grep ':500 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp500.bin" $WGRIB2 -s $gribfil |grep ':600 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp600.bin" $WGRIB2 -s $gribfil |grep ':700 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp700.bin" $WGRIB2 -s $gribfil |grep ':850 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp850.bin" $WGRIB2 -s $gribfil |grep ':925 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp925.bin" $WGRIB2 -s $gribfil |grep ':1000 mb:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp1000.bin" $WGRIB2 -s $gribfil |grep ':0.995 sigma level:'|grep ':TMP:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_temp1070.bin" $WGRIB2 -s $gribfil |grep ':100 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh100.bin" $WGRIB2 -s $gribfil |grep ':70 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh70.bin" $WGRIB2 -s $gribfil |grep ':150 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh150.bin" $WGRIB2 -s $gribfil |grep ':200 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh200.bin" $WGRIB2 -s $gribfil |grep ':250 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh250.bin" $WGRIB2 -s $gribfil |grep ':300 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh300.bin" $WGRIB2 -s $gribfil |grep ':400 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh400.bin" $WGRIB2 -s $gribfil |grep ':500 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh500.bin" $WGRIB2 -s $gribfil |grep ':600 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh600.bin" $WGRIB2 -s $gribfil |grep ':700 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh700.bin" $WGRIB2 -s $gribfil |grep ':850 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh850.bin" $WGRIB2 -s $gribfil |grep ':925 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh925.bin" $WGRIB2 -s $gribfil |grep ':1000 mb:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh1000.bin" $WGRIB2 -s $gribfil |grep ':0.995 sigma level:'|grep ':RH:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_relh1070.bin" $WGRIB2 -s $gribfil |grep ':mean sea level:'|grep ':PRMSL:'| $WGRIB2 -s -i -no_header $gribfil -order raw -bin $YMD$HH"_F"$IFHR"_p1070.bin" # Convert binary files to packed ASCII $xdir"bin2packa.x" rm *.bin done # # Remove any incomplete (< 3.1 MB) PACK files first. pfiles=`find . -name "A*_PACK.DAT" -size -3100k` rm -f $pfiles #GFS_PACK_DIR copy only needed for NCO version #if [ "${1}" = "fv3" ]; then if [ "${gflag}" = "fv3" ];then gddir=`echo ${gddir} | rev | cut -c 4- | rev` fi export GFS_PACK_DIR=${COM_STORM_DATA}/gfs_PACK.${gddir} mkdir -p ${GFS_PACK_DIR} cp -p A*_PACK.DAT ${GFS_PACK_DIR} ##DBNET ALERTS dcount=0 if [ $SENDDBN = YES ]; then for file in `find $GFS_PACK_DIR/*.DAT -type f` do ${DBNROOT}/bin/dbn_alert MODEL NHC_ATCF_PACK $job $file ls $file dcount=$((dcount+1)) echo $file done echo "Totall number of alerted files is $dcount" fi #####END ALERT mv A*_PACK.DAT ${PACKdir} echo "" >> $logf echo "*** Grib unpack update completed." >> $logf exit 0