UPP: error loop

Questions relating to the use of the WRF Post Processor V3

UPP: error loop

Postby julien1188 » Sun Aug 21, 2011 5:44 am

Hi!

I would like to use UPP to post process my wrfout. I configured all UPP but I have a loop infinite... My configuration:
export startdate=2011081700
export fhr=00
export lastfhr=12
export incrementhr=00

I have one wrfout with a forecast every hours (00 UTC to 12 UTC). What is the problem? Error configuration? Error script unipost?

Thanks for your help

julien1188
julien1188
 
Posts: 21
Joined: Sat Nov 06, 2010 9:43 am

Re: UPP: error loop

Postby mbiggs » Thu Oct 20, 2011 11:54 pm

If you want a forecast every hour, then set incrementhr = 1.

You have it = 0, which means that the loop will just repeat the same time over and over again. (The run_unipost script just loops from fhr to lasthr by increments of incrementhr.)
mbiggs
 
Posts: 3
Joined: Thu Oct 20, 2011 11:09 pm

Re: UPP: error loop

Postby julien1188 » Thu Nov 03, 2011 3:45 am

Thank you for your answer.

Unfortunately, If I set incrementhr=1, UPP try to open a new forecast file. My WRF output contains all the forecast hours. Solution: one wrf output by forecast hours?
julien1188
 
Posts: 21
Joined: Sat Nov 06, 2010 9:43 am

Re: UPP: error loop

Postby mbiggs » Tue Nov 08, 2011 4:59 pm

Oh! I solved that with some code inspired by a co-worker. I'm not sure if this is standard practice, but I was surprised it's not at all part of the basic run_wrfpost / run_unipost scripts provided by WRF.

Modify the relevant portion of the script like this:

Code: Select all
export NEWDATE=$startdate

# make initial date, for the input dataset file in wrfprd
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 -Z4 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

#--- EDIT HERE --------------------------------------------------------
# Update domains
# ie. for domain in d01 d02 d03
for domain in d01
do

#--- EDIT HERE --------------------------------------------------------
# Create input file for Unipost
#   First line is where your wrfout data is
#   Second line is the format
#   Third line is the time for this process file
#   Forth line is a tag identifing the model
#----------------------------------------------------------------------
# ../wrfprd/wrfout_${domain}_${YY}-${MM}-${DD}_${HH}:00:00
cat > itag <<EOF
../wrfprd/wrfout_${domain}_${YYi}-${MMi}-${DDi}_${HHi}:00:00
netcdf
${YY}-${MM}-${DD}_${HH}:00:00
${tag}
EOF


... and so on.

What I'm doing is saving variables for the year, month, day, hour of the very first date: these are YYi, MMi, etc. In the "itag" file that is created by the script, we tell it to look for the (never-changing) wrfprs file with this initial date. The other parts of the script (within the loop-body, etc.) will retrieve updated (incremented) times from that same file, by modifying the NEWDATE variable (which is what the old script did).

My method isn't pretty, but the whole run_unipost script is ugly anyway.

Hope this helps,
mbiggs
 
Posts: 3
Joined: Thu Oct 20, 2011 11:09 pm

Re: UPP: error loop

Postby mr.cjones » Fri Jul 27, 2012 11:39 pm

hi,

an old post may also have another and easier solution for UPP to loop through several forecasts from the same file:
viewtopic.php?f=53&t=1610

apparently changing this part of the run_unipost script works:

#--- EDIT HERE --------------------------------------------------------
# Create input file for Unipost
# First line is where your wrfout data is
# Second line is the format
# Third line is the time for this process file
# Forth line is a tag identifing the model
#../wrfprd/wrfout_${domain}_${YY}-${MM}-${DD}_${HH}:00:00
#----------------------------------------------------------------------
cat > itag <<EOF
../wrfprd/wrfout_d02_2004-12-29_00:00:00
netcdf
${YY}-${MM}-${DD}_${HH}:00:00
${tag}
EOF
Dr. Charles Jones
Researcher
Earth Research Institute (ERI)
University of California, Santa Barbara, CA 93106-3060
email: cjones@eri.ucsb.edu
URL: http://www.eri.ucsb.edu/asr/
mr.cjones
 
Posts: 2
Joined: Thu Oct 28, 2010 10:29 pm
Location: Santa Barbara CA


Return to WRF Post Processor V3

Who is online

Users browsing this forum: No registered users and 2 guests