[Met_help] Re: Fwd: MET compilation and NETCDF library on NCAR machine

John Halley Gotway johnhg at rap.ucar.edu
Thu Aug 21 13:30:12 MDT 2008


Segayle,

The forecast data in /ptmp/swalford/METv1.1/data/fcst contains files named WRFPRS_d01.NN where NN is the lead time.  I couldn't find the "wgrib" utility on lightning, but I copied a couple files over
to my machine and ran wgrib on them there.  I found that the accumulated precipitation field actually contains precip accumulated from the beginning of the run out to the lead time.  For example, the
file WRFPRS_d01.13 contains precip accumulated from hour 0 to hour 13, and WRFPRS_d01.14 contains precip from hour 0 to hour 14.

You can run the pcp_combine tool on these files, however you'll want to run it in "subtract" mode.

For example, to get the 18 files there into 3 6-hourly chunks (i.e. 0 to 6, 6 to 12, and 12 to 18), I'd do the following:

(1) The file WRFPRS_d01.06 already contains precip accumulated from 0 to 6 hours.

(2) Get the 6 to 12 hour accumulation by subtracting the 6 hour accumulation from the 12 hour accumulation as follows:
../bin/pcp_combine -subtract /ptmp/swalford/METv1.1/data/fcst/WRFPRS_d01.12 12 /ptmp/swalford/METv1.1/data/fcst/WRFPRS_d01.06 6 ~/6_to_12.nc

(3) Get the 12 to 18 hour accumulation by subtracting the 12 hour accumulation from the 18 hour accumulation as follows:
../bin/pcp_combine -subtract /ptmp/swalford/METv1.1/data/fcst/WRFPRS_d01.18 18 /ptmp/swalford/METv1.1/data/fcst/WRFPRS_d01.12 12 ~/12_to_18.nc

To break it up into 3-hourly or 1-hourly chunks, you'd do something similar, just change the arguments as necessary.

Since the precip is stored in this way, I assume you're running the ARW model.  The NMM model on the other hand typically dumps out "buckets" of accumulated precip every 3 hours (or whatever interval
you set).  The pcp_combine tool may be run on the output of both.  You just need to use different command line arguments to tell it what you'd like it to do.

Does that make sense?

John

walford02 at hotmail.com wrote:
> ok. I am running a script.
> /ptmp/swalford/METv1.1/scripts/pcp.sh
> with the data
> /ptmp/swalford/METv1.1/data/fcst
> I have used gribscan -gv -I WRFPRS_d01*  but I am not too familiar with
> grib data
> 
> Segayle
> 
> --------------------------------------------------
> From: "John Halley Gotway" <johnhg at rap.ucar.edu>
> Sent: Thursday, August 21, 2008 2:17 PM
> To: <walford02 at hotmail.com>
> Subject: Re: Fwd: MET compilation and NETCDF library on NCAR machine
> 
>> Segayle,
>>
>> I'd be happy to help.
>>
>> Please send me the exact command you're passing the pcp_combine tool.
>> Also, if your data is on "lightning", just send me the path to it, and
>> I'll take a look.  I have access to lightning.
>>
>> You're probably already familiar with this, but you can use the
>> "wgrib" command to dump out information about the records in your
>> WRFPRS GRIB files.  Perhaps you don't have 1 hourly accumulations in
>> your WRFPRS files, for example?  You can refer to the usage statement
>> for the pcp_combine tool or the METv1.1 User's Guide for an
>> explanation of its command line arguments.
>>
>> Thanks,
>> John
>>
>> walford02 at hotmail.com wrote:
>>> The main problem that I was encountering was that I was trying to set
>>> the
>>> g2c directly. I left it open (like in your  Makefile) and it compiled
>>> properly.
>>>
>>> However, when I try to run the pcp_combine script I get an error
>>> that says:
>>> ERROR:  sum_grib_files() -> Cannot find a file with a valid time of
>>> 20060728_060000 and accumulation time of 1 hours in ../data/fcst
>>> matching the regular expression ".*"
>>>
>>> I am using forecast files (WRFPRS_d01*) produced by WPPv3 .
>>> Any clue as to what the problem is with this?  My run starts at
>>> 20060727_120000 and finishes at 20060728_060000.
>>>
>>> I am not sure it the problem is with the model run, the post processing
>>> (WPP) or the verification (MET).
>>> I can send a few of the grib (WPP output ) files if that will help.
>>>
>>>
>>>
>>> --------------------------------------------------
>>> From: "John Halley Gotway" <johnhg at rap.ucar.edu>
>>> Sent: Wednesday, August 20, 2008 11:56 AM
>>> To: "Segayle Thompson" <walford02 at hotmail.com>
>>> Cc: "Jamie Wolff" <jwolff at ucar.edu>; "met_help" <met_help at ucar.edu>
>>> Subject: Re: Fwd: MET compilation and NETCDF library on NCAR machine
>>>
>>>> Segayle,
>>>>
>>>> Your MET help question was forwarded to me from the WRF-Help folks. 
>>>> For
>>>> future reference, please direct all MET related questions to the
>>>> MET-Help
>>>> email address: met_help at ucar.edu.
>>>>
>>>> Regarding your question about building MET on lightning...
>>>>
>>>> I believe the errors you're seeing come from using inconsistent sets of
>>>> compilers.  The NetCDF library to which you're linking
>>>> (/usr/local/apps/netcdf-3.6.2) was built using PGI compilers.  However,
>>>> you're trying to build MET using the GNU g++/g77 compilers. 
>>>> Instead, I'd
>>>> suggest using the PGI compilers on ligthning.  I've build METv1.1 on
>>>> lightning in /gpfs/lightning/johnhg/MET_releases/METv1.1.
>>>>
>>>> Take a look at the Makefile I used in
>>>> /gpfs/lightning/johnhg/MET_releases/METv1.1/Makefile.  You'll need to
>>>> rebuild BUFRLIB using the PGI compilers before rebuilding MET.  Or I
>>>> suppose you could just
>>>> link to my PGI version of BUFRLIB in
>>>> /gpfs/lightning/johnhg/MET_releases/external_libs/bufrlib.
>>>>
>>>> Hope this helps.
>>>>
>>>> Thanks,
>>>> John Halley-Gotway
>>>> johnhg at ucar.edu
>>>>
>>>> WRF Help wrote:
>>>>> Hi John,
>>>>>
>>>>> This was in the NMM wrfhelp inbox.  Maybe you can respond as
>>>>> methelp and
>>>>> let them know to send questions there.
>>>>>
>>>>> Jamie
>>>>>
>>>>>
>>>>>   --- the forwarded message follows ---
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
>>>>> Subject:
>>>>> MET compilation and NETCDF library on NCAR machine
>>>>> From:
>>>>> <walford02 at hotmail.com>
>>>>> Date:
>>>>> Tue, 19 Aug 2008 18:17:33 -0400
>>>>> To:
>>>>> "WRF Help" <wrfhelp at ucar.edu>
>>>>>
>>>>> To:
>>>>> "WRF Help" <wrfhelp at ucar.edu>
>>>>>
>>>>>
>>>>> hello,
>>>>>
>>>>> I am trying to compile METv1.1 on the lightning machine at NCAR
>>>>> however
>>>>> and I am getting some problems with netcdf_c++ libraries. When I
>>>>> compile
>>>>> I get this error in my met.log file:
>>>>>
>>>>> /usr/bin/g++ -o pcp_combine pcp_combine.cc \
>>>>> -Wall -Wshadow -static   -DMET_BASE=\"/ptmp/swalford/METv1.1\" \
>>>>> -I../../lib -I/usr/local/apps/netcdf-3.6.2/include
>>>>> -I/home/lightning/swalford/gsl-1.11/include
>>>>> \
>>>>> -L../../lib -L/usr/local/apps/netcdf-3.6.2/lib
>>>>> -L/home/lightning/swalford/gsl-1.11/lib
>>>>> \
>>>>> -lvx_met_util -lvx_analysis_util -lvx_wrfdata -lvx_met_util \
>>>>>         -lvx_contable -lvx_grib_classes \
>>>>> -lvx_econfig -lvx_gsl_prob -lgsl \
>>>>> -lvx_plot_util  -lvx_render -lvx_pxm -lvx_color -lvx_ps -lvx_afm \
>>>>> -lvx_data_grids -lvx_gnomon -lvx_nav -lvx_cal -lvx_util -lvx_math
>>>>> -lm \
>>>>> -lnetcdf_c++ -lnetcdf \
>>>>>
>>>>>
>>>>> [1]    Exit 2                        make >& met.log
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x23ac): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::NcFile[in-charge](char const*,
>>>>> NcFile::FileMode, unsigned long*, unsigned long, NcFile::FileFormat)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2416): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::is_valid() const'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x246d): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::close()'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x257c): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x26c3): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x26e1): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2746): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x279a): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x27de): more undefined references to
>>>>> `NcFile::add_att(char const*, char const*)' follow
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2f38): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2f4e): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2f67): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, float)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2f7d): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2f93): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2fac): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, float)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2fc3): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, int)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x2ff2): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x3021): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x3062): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x307b): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, float)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x3115): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x312a): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, long)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x31b5): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x31ca): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, long)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x321a): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::add_att(char const*, char const*)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x33a2): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::put(float const*, long, long, long,
>>>>> long, long)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x33eb): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::put(float const*, long, long, long,
>>>>> long, long)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x3433): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcVar::put(float const*, long, long, long,
>>>>> long, long)'
>>>>> /ptmp/swalford/cc6cdgZB.o(.text+0x34b3): In function
>>>>> `write_netcdf(long
>>>>> long, long long, int, GribRecord&)':
>>>>> : undefined reference to `NcFile::close()'
>>>>> collect2: ld returned 1 exit status
>>>>> make[3]: *** [pcp_combine] Error 1
>>>>> make[2]: *** [all] Error 2
>>>>> make[1]: *** [targets] Error 2
>>>>> make: *** [all] Error 2
>>>>>
>>>>> I am using the netcdf located at /usr/local/apps/netcdf-3.6.2
>>>>>
>>>>> Should I try to reinstall netcdf in my directory for this?
>>>>>
>>>>> Segayle
>>>>>
>>>>
>>


More information about the Met_help mailing list