[Met_help] [rt.rap.ucar.edu #74793] History for How to run pcp_combine for 2 files that have different init_time

John Halley Gotway via RT met_help at ucar.edu
Wed Jan 20 11:14:08 MST 2016


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Hi MET Helper,

I am trying to get daily total precipitation (PCP accumulated over 24 hours) from WRF outputs using pcp_combine utility.

How to combine 2 files that have different init_time and each has PCP accumulated over 12 hours.
I have tried to use pcp_combine with -add and -sum . None are worked.

Since files are small, I attached 2 files:

WRFPRS_1997-06-03_APCP_A12.nc  (MET nc file created using pcp_combine -substract)
WRFPRS_d01_1997-06-04_00_APCP_A12.grb (Grib format)

Thank you for your time in advance, NTsengel




----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: How to run pcp_combine for 2 files that have different init_time
From: John Halley Gotway
Time: Wed Jan 20 09:09:01 2016

NTsengel,

I see that you are try to get 24-hour accumulated precipitation by
combining 12-hour accumulated precipitation from two different
initialization times.  The "-sum" command assumes the same
initialization
time.  So I'd suggest using the "-add" option instead.

However, I don't understand why you've sent me both a GRIB file and a
NetCDF file.  Why wouldn't you just use all GRIB data rather than
running
one of the files through pcp_combine first?

So I suspect there's a simpler way of computing this from your
post-processed GRIB output, but if you'd basically like to add
together the
precip from the two files you sent me, here's how you can do it:

met-5.1/bin/pcp_combine -add \
   WRFPRS_1997-06-03_APCP_A12.nc 'name="APCP_12"; level="(*,*)";' \
   WRFPRS_d01_1997-06-04_00_APCP_A12.grb 12 \
   sum.nc

For the first file, I listed the file name followed by a config string
describing the field I wanted to use from that NetCDF file.
For the second file, I listed the file name simply followed by the
accumulation interval I wanted to use (12 for 12 hours).

Here's a small excerpt from the pcp_combine usage statement:
   Note: For "-add" and "-subtract", the accumulation intervals may be
substituted with config file strings.
For that first file, we replaced the accumulation interval with a
config
file string.

FYI, here are 3 commands you could use to plot these data files:
   met-5.1/bin/plot_data_plane WRFPRS_1997-06-03_APCP_A12.nc
WRFPRS_1997-06-03_APCP_A12.ps 'name="APCP_12"; level="(*,*)";'
   met-5.1/bin/plot_data_plane WRFPRS_d01_1997-06-04_00_APCP_A12.grb
WRFPRS_d01_1997-06-04_00_APCP_A12.ps 'name="APCP" level="A12";'
   met-5.1/bin/plot_data_plane sum.nc sum.ps 'name="APCP_24";
level="(*,*)";'

I've attached the resulting images which show that the addition worked
as
expected.

Hope that helps.

Thanks,
John Halley Gotway
met_help at ucar.edu

On Tue, Jan 19, 2016 at 5:55 PM, Nergui, Tsengel via RT
<met_help at ucar.edu>
wrote:

>
> Tue Jan 19 17:55:38 2016: Request 74793 was acted upon.
> Transaction: Ticket created by tsengel.nergui at wsu.edu
>        Queue: met_help
>      Subject: How to run pcp_combine for 2 files that have different
> init_time
>        Owner: Nobody
>   Requestors: tsengel.nergui at wsu.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=74793 >
>
>
> Hi MET Helper,
>
> I am trying to get daily total precipitation (PCP accumulated over
24
> hours) from WRF outputs using pcp_combine utility.
>
> How to combine 2 files that have different init_time and each has
PCP
> accumulated over 12 hours.
> I have tried to use pcp_combine with -add and -sum . None are
worked.
>
> Since files are small, I attached 2 files:
>
> WRFPRS_1997-06-03_APCP_A12.nc  (MET nc file created using
pcp_combine
> -substract)
> WRFPRS_d01_1997-06-04_00_APCP_A12.grb (Grib format)
>
> Thank you for your time in advance, NTsengel
>
>
>
>

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #74793] How to run pcp_combine for 2 files that have different init_time
From: Nergui, Tsengel
Time: Wed Jan 20 10:51:22 2016

Thank you John for your great help, I should have approached you
earlier.

Reason I had to add nc and grib file is that I have run WRF for 3 day
chunks, I mean every 4th day, WRF re-initialized 12 hour prior. For
the first 2 days, I simply obtained APCP for 24h using pcp_combine
with -subtract.
But the 3rd day, I needed to add first 12h accumulation with 12h
accumulation in next day 00 hour.

Again, your help really resolved the issue- I did not know how to
specify accumulation interval and level of nc file, I was given input
file as 'filename 12'.

Thank you- John additional helps and hints, you are awesome!

Have a good day! NTsengel



-----Original Message-----
From: John Halley Got itway via RT [mailto:met_help at ucar.edu]
Sent: Wednesday, January 20, 2016 8:09 AM
To: Nergui, Tsengel
Subject: Re: [rt.rap.ucar.edu #74793] How to run pcp_combine for 2
files that have different init_time

NTsengel,

I see that you are try to get 24-hour accumulated precipitation by
combining 12-hour accumulated precipitation from two different
initialization times.  The "-sum" command assumes the same
initialization time.  So I'd suggest using the "-add" option instead.

However, I don't understand why you've sent me both a GRIB file and a
NetCDF file.  Why wouldn't you just use all GRIB data rather than
running one of the files through pcp_combine first?

So I suspect there's a simpler way of computing this from your post-
processed GRIB output, but if you'd basically like to add together the
precip from the two files you sent me, here's how you can do it:

met-5.1/bin/pcp_combine -add \
   WRFPRS_1997-06-03_APCP_A12.nc 'name="APCP_12"; level="(*,*)";' \
   WRFPRS_d01_1997-06-04_00_APCP_A12.grb 12 \
   sum.nc

For the first file, I listed the file name followed by a config string
describing the field I wanted to use from that NetCDF file.
For the second file, I listed the file name simply followed by the
accumulation interval I wanted to use (12 for 12 hours).

Here's a small excerpt from the pcp_combine usage statement:
   Note: For "-add" and "-subtract", the accumulation intervals may be
substituted with config file strings.
For that first file, we replaced the accumulation interval with a
config file string.

FYI, here are 3 commands you could use to plot these data files:
   met-5.1/bin/plot_data_plane WRFPRS_1997-06-03_APCP_A12.nc
WRFPRS_1997-06-03_APCP_A12.ps 'name="APCP_12"; level="(*,*)";'
   met-5.1/bin/plot_data_plane WRFPRS_d01_1997-06-04_00_APCP_A12.grb
WRFPRS_d01_1997-06-04_00_APCP_A12.ps 'name="APCP" level="A12";'
   met-5.1/bin/plot_data_plane sum.nc sum.ps 'name="APCP_24";
level="(*,*)";'

I've attached the resulting images which show that the addition worked
as expected.

Hope that helps.

Thanks,
John Halley Gotway
met_help at ucar.edu

On Tue, Jan 19, 2016 at 5:55 PM, Nergui, Tsengel via RT
<met_help at ucar.edu>
wrote:

>
> Tue Jan 19 17:55:38 2016: Request 74793 was acted upon.
> Transaction: Ticket created by tsengel.nergui at wsu.edu
>        Queue: met_help
>      Subject: How to run pcp_combine for 2 files that have different
> init_time
>        Owner: Nobody
>   Requestors: tsengel.nergui at wsu.edu
>       Status: new
>  Ticket
> <URL:https://urldefense.proofpoint.com/v2/url?u=https-
3A__rt.rap.ucar.
> edu_rt_Ticket_Display.html-3Fid-
3D74793&d=CwIBaQ&c=C3yme8gMkxg_ihJNXS0
> 6ZyWk4EJm8LdrrvxQb-Je7sw&r=OUixJTR1U-
9NUyc8rj3XpGV38A03YgZoNOMgJhE5JYE
> &m=uroy0cqehHUFDa_XnyVGgAk899DNWG_0znw_jVjhBtQ&s=nah1205xXYaq-
IzQgFDCU
> wpfN5FY-2az8J8l3e1CqYM&e= >
>
>
> Hi MET Helper,
>
> I am trying to get daily total precipitation (PCP accumulated over
24
> hours) from WRF outputs using pcp_combine utility.
>
> How to combine 2 files that have different init_time and each has
PCP
> accumulated over 12 hours.
> I have tried to use pcp_combine with -add and -sum . None are
worked.
>
> Since files are small, I attached 2 files:
>
> WRFPRS_1997-06-03_APCP_A12.nc  (MET nc file created using
pcp_combine
> -substract)
> WRFPRS_d01_1997-06-04_00_APCP_A12.grb (Grib format)
>
> Thank you for your time in advance, NTsengel
>
>
>
>



------------------------------------------------


More information about the Met_help mailing list