[Wrf-users] run_wrfpost is not processing more than one day
mmkamal at uwaterloo.ca
mmkamal at uwaterloo.ca
Sun Sep 25 17:16:57 MDT 2011
Hi,
I have been trying to convert my WRF history file into GRIB format
using WPP but "run_wrfpost" stop after converting one days although my
history file contain one year output. I have modified my "run_wrfpost"
based on the "run_wrfpost_frames". Could any one please help me to
overcome this problem.
Thanks in advance
Kamal
======================================================
run_wrfpost
======================================================
#!/bin/ksh
#
set -x
# August 2005: Hui-Ya Chuang, NCEP: This script uses
# NCEP's WRF-POSTPROC to post processes WRF native model
# output, and uses copygb to horizontally interpolate posted
# output from native A-E to a regular projection grid.
#
# July 2006: Meral Demirtas, NCAR/DTC: Added new "copygb"
# options and revised some parts for clarity.
#
#--------------------------------------------------------
# This script performs 2 jobs:
#
# 1. Run WRF-POSTPROC
# 2. Run copygb to horizontally interpolate output from
# native A-E to a regular projection grid
#--------------------------------------------------------
# Set path to your top directory and your run dorectory
#
export TOP_DIR=/scratch/mkamal/WRF_new
export DOMAINPATH=${TOP_DIR}/DOMAINS
#Specify Dyn Core (ARW or NMM in upper case)
dyncore="ARW"
if [ $dyncore = "NMM" ]; then
export tag=NMM
elif [ $dyncore = "ARW" ]; then
export tag=NCAR
else
echo "${dyncore} is not supported. Edit script to choose ARW or NMM dyncore."
exit
fi
# Specify forecast start date
# fhr is the first forecast hour to be post-processed
# lastfhr is the last forecast hour to be post-processed
# incrementhr is the incement (in hours) between forecast files
export startdate=2004010200
export fhr=00
export lastfhr=21
export incrementhr=03
# Path names for WRF_POSTPROC and WRFV3
export WRF_POSTPROC_HOME=${TOP_DIR}/WPPV3
export POSTEXEC=${WRF_POSTPROC_HOME}/exec
export SCRIPTS=${WRF_POSTPROC_HOME}/scripts
export WRFPATH=${TOP_DIR}/WRFV3
# cd to working directory
cd ${DOMAINPATH}/postprd
# Link Ferrier's microphysic's table and WRF-POSTPROC control file,
ln -fs ${WRFPATH}/run/ETAMPNEW_DATA eta_micro_lookup.dat
ln -fs ${DOMAINPATH}/parm/wrf_cntrl.parm .
export tmmark=tm00
export MP_SHARED_MEMORY=yes
export MP_LABELIO=yes
#######################################################
# 1. Run WRF-POSTPROC
#
# The WRF-POSTPROC is used to read native WRF model
# output and put out isobaric state fields and derived fields.
#
#######################################################
pwd
ls -x
export NEWDATE=$startdate
YYi=`echo $NEWDATE | cut -c1-4`
MMi=`echo $NEWDATE | cut -c5-6`
DDi=`echo $NEWDATE | cut -c7-8`
HHi=`echo $NEWDATE | cut -c9-10`
while [ $fhr -le $lastfhr ] ; do
typeset -Z3 fhr
NEWDATE=`${POSTEXEC}/ndate.exe +${fhr} $startdate`
YY=`echo $NEWDATE | cut -c1-4`
MM=`echo $NEWDATE | cut -c5-6`
DD=`echo $NEWDATE | cut -c7-8`
HH=`echo $NEWDATE | cut -c9-10`
echo 'NEWDATE' $NEWDATE
echo 'YY' $YY#for domain in d01 d02 d03
for domain in d01
do
cat > itag <<EOF
../wrfprd/wrfout_${domain}_${YYi}-${MMi}-${DDi}_${HHi}:00:00
netcdf
${YY}-${MM}-${DD}_${HH}:00:00
${tag}
EOF
#-----------------------------------------------------------------------
# Run wrfpost.
#-----------------------------------------------------------------------
rm fort.*
ln -sf wrf_cntrl.parm fort.14
ln -sf griddef.out fort.110
${POSTEXEC}/wrfpost.exe < itag > wrfpost_${domain}.$fhr.out 2>&1
mv WRFPRS$fhr.tm00 WRFPRS_${domain}.${fhr}
#
#----------------------------------------------------------------------
# End of wrf post job
#----------------------------------------------------------------------
ls -l WRFPRS_${domain}.${fhr}
err1=$?
if test "$err1" -ne 0
then
echo 'WRF POST FAILED, EXITTING'
exit
fi
if [ $dyncore = "NMM" ]; then
#######################################################################
# 2. Run copygb
#
# Copygb interpolates WRF-POSTPROC output from its native
# grid to a regular projection grid. The package copygb
# is used to horizontally interpolate from one domain
# to another, it is necessary to run this step for wrf-nmm
# (but not for wrf-arw) because wrf-nmm's computational
# domain is on rotated Arakawa-E grid
#
# Copygb can be run in 3 ways as explained below.
# Uncomment the preferable one.
#
#----------------------------------------------------------------------
#
# Option 1:
# Copygb is run with a pre-defined AWIPS grid
# (variable $gridno, see below) Specify the grid to
# interpolate the forecast onto. To use standard AWIPS grids
# (list in http://wwwt.emc.ncep.noaa.gov/mmb/namgrids/ or
# or http://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html),
# set the number of the grid in variable gridno below.
# To use a user defined grid, see explanation above copygb.exe command.
#
# export gridno=212
#
#${POSTEXEC}/copygb.exe -xg${gridno} WRFPRS_${domain}.${fhr}
wrfprs_${domain}.${fhr}
#
#----------------------------------------------------------------------
#
# Option 2:
# Copygb ingests a kgds definition on the command line.
#${POSTEXEC}/copygb.exe -xg"255 3 109 91 37748 -77613 8 -71000 10379
9900 0 64 42000 42000" WRFPRS_${domain}.${fhr} wrfprs_${domain}.${fhr}
#
#----------------------------------------------------------------------
#
# Option 3:
# Copygb can ingests contents of files too. For example:
# copygb_gridnav.txt or copygb_hwrf.txt through variable $nav.
#
# Option -3.1:
# To run for "Lambert Comformal map projection" uncomment the following line
#
read nav < 'copygb_gridnav.txt'
#
# Option -3.2:
# To run for "lat-lon" uncomment the following line
#
#read nav < 'copygb_hwrf.txt'
#
export nav
#
${POSTEXEC}/copygb.exe -xg"${nav}" WRFPRS_${domain}.${fhr}
wrfprs_${domain}.${fhr}
#
# (For more info on "copygb" see WRF-NMM User's Guide, Chapter-7.)
#----------------------------------------------------------------------
# Check to see whether "copygb" created the requested file.
ls -l wrfprs_${domain}.${fhr}
err1=$?
if test "$err1" -ne 0
then
echo 'copygb FAILED, EXITTING'
exit
fi
#----------------------------------------------------------------------
# End of copygb job
#----------------------------------------------------------------------
elif [ $dyncore = "ARW" ]; then
ln -s WRFPRS_${domain}.${fhr} wrfprs_${domain}.${fhr}
fi
done
let "fhr=fhr+$incrementhr"
NEWDATE=`${POSTEXEC}/ndate.exe +${fhr} $startdate`
done
date
echo "End of Output Job"
exit
More information about the Wrf-users
mailing list