[Met_help] [rt.rap.ucar.edu #44964] History for pcp_combine

RAL HelpDesk {for Paul Oldenburg} met_help at ucar.edu
Wed Mar 16 08:39:52 MDT 2011


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



MET team,

I ran pcp_combine (subtract mode) on two forecast files and the output
netCDF file contained some negative hourly accumulated precipitation values
(which seems counter-intuitive).  Does the MET package treat these values
as 0.0000 when it performs verification?

Thanks.

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

Subject: Re: [rt.rap.ucar.edu #44964] pcp_combine
From: Paul Oldenburg
Time: Tue Mar 01 13:41:20 2011

James,

grid_stat and point_stat do not treat negative values as zero.  The
issue had not come to our attention until you
brought it up.  We will consider adding that change to a future
version of MET, or maybe even the patches for the
current version.

Paul


On 02/28/2011 03:43 PM, RAL HelpDesk {for James P Cipriani} wrote:
>
> Mon Feb 28 15:43:03 2011: Request 44964 was acted upon.
> Transaction: Ticket created by jpcipria at us.ibm.com
>        Queue: met_help
>      Subject: pcp_combine
>        Owner: Nobody
>   Requestors: jpcipria at us.ibm.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=44964 >
>
>
>
>
> MET team,
>
> I ran pcp_combine (subtract mode) on two forecast files and the
output
> netCDF file contained some negative hourly accumulated precipitation
values
> (which seems counter-intuitive).  Does the MET package treat these
values
> as 0.0000 when it performs verification?
>
> Thanks.


------------------------------------------------
Subject: pcp_combine
From: James P Cipriani
Time: Wed Mar 02 08:26:26 2011


Thank you for your reply.

This was somewhat concerning at first glance.  I do have a simple
question:
how can pcp_combine yield negative accumulated precipitation values
when 2
forecast files are subtracted?  For example, in my case, the 24-hour
forecast file contains accumulated precipitation from the previous 24
hours
while the 23-hour forecast file contains accumulated precipitation
from the
previous 23 hours.  If I subtract the two, I would expect to obtain a
positive difference (or 0.00000 if there was no change in
precipitation).
So a negative value would mean that precipitation has decreased
between
hour 23 and hour 24 - which would then be accounting for evaporation,
runoff, etc.?  Am I correct in this assumption?

Thanks.



From:	"RAL HelpDesk {for Paul Oldenburg}" <met_help at ucar.edu>
To:	James P Cipriani/Watson/IBM at IBMUS
Cc:	met_help at ucar.edu
Date:	03/01/2011 03:41 PM
Subject:	Re: [rt.rap.ucar.edu #44964] pcp_combine



James,

grid_stat and point_stat do not treat negative values as zero.  The
issue
had not come to our attention until you
brought it up.  We will consider adding that change to a future
version of
MET, or maybe even the patches for the
current version.

Paul


On 02/28/2011 03:43 PM, RAL HelpDesk {for James P Cipriani} wrote:
>
> Mon Feb 28 15:43:03 2011: Request 44964 was acted upon.
> Transaction: Ticket created by jpcipria at us.ibm.com
>        Queue: met_help
>      Subject: pcp_combine
>        Owner: Nobody
>   Requestors: jpcipria at us.ibm.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=44964 >
>
>
>
>
> MET team,
>
> I ran pcp_combine (subtract mode) on two forecast files and the
output
> netCDF file contained some negative hourly accumulated precipitation
values
> (which seems counter-intuitive).  Does the MET package treat these
values
> as 0.0000 when it performs verification?
>
> Thanks.



------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #44964] pcp_combine
From: Paul Oldenburg
Time: Wed Mar 02 11:25:35 2011

James,

The reason for the negative values is related to single byte floating
point precision round-off in WRF post-processing.
 It is not meant to be physically meaningful, and should be zeroed
out.  The following R script will read the NetCDF
output of pcp_combine and zero out any negative accumulated precip
values.  Note that you will want to change the input
file name.  If you have any questions, please let us know.

Thanks,

Paul


library(ncdf)

strFileName = "pcp_test.nc";
ncfile = open.ncdf(strFileName, write=TRUE, readunlim=TRUE,
verbose=FALSE);

for(strVarName in names(ncfile$var)){

	#  only treat variables that look like accumulated precip
	if( !grepl("^APCP", strVarName) ){ next; }

	#  get the matrix of variable values and zero out any negative values
	varPrecip = get.var.ncdf(ncfile, strVarName);
	cat("removing", sum(varPrecip < 0, na.rm=TRUE), "zeroes from",
strVarName, "\n");
	varPrecip[ varPrecip < 0 ] = 0;

	#  write the results to the nc object
	put.var.ncdf(ncfile, strVarName, varPrecip);
}

close.ncdf(ncfile);




On 03/02/2011 08:26 AM, RAL HelpDesk {for James P Cipriani} wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=44964 >
>
>
> Thank you for your reply.
>
> This was somewhat concerning at first glance.  I do have a simple
question:
> how can pcp_combine yield negative accumulated precipitation values
when 2
> forecast files are subtracted?  For example, in my case, the 24-hour
> forecast file contains accumulated precipitation from the previous
24 hours
> while the 23-hour forecast file contains accumulated precipitation
from the
> previous 23 hours.  If I subtract the two, I would expect to obtain
a
> positive difference (or 0.00000 if there was no change in
precipitation).
> So a negative value would mean that precipitation has decreased
between
> hour 23 and hour 24 - which would then be accounting for
evaporation,
> runoff, etc.?  Am I correct in this assumption?
>
> Thanks.
>
>
>
> From:	"RAL HelpDesk {for Paul Oldenburg}" <met_help at ucar.edu>
> To:	James P Cipriani/Watson/IBM at IBMUS
> Cc:	met_help at ucar.edu
> Date:	03/01/2011 03:41 PM
> Subject:	Re: [rt.rap.ucar.edu #44964] pcp_combine
>
>
>
> James,
>
> grid_stat and point_stat do not treat negative values as zero.  The
issue
> had not come to our attention until you
> brought it up.  We will consider adding that change to a future
version of
> MET, or maybe even the patches for the
> current version.
>
> Paul
>
>
> On 02/28/2011 03:43 PM, RAL HelpDesk {for James P Cipriani} wrote:
>>
>> Mon Feb 28 15:43:03 2011: Request 44964 was acted upon.
>> Transaction: Ticket created by jpcipria at us.ibm.com
>>        Queue: met_help
>>      Subject: pcp_combine
>>        Owner: Nobody
>>   Requestors: jpcipria at us.ibm.com
>>       Status: new
>>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=44964 >
>>
>>
>>
>>
>> MET team,
>>
>> I ran pcp_combine (subtract mode) on two forecast files and the
output
>> netCDF file contained some negative hourly accumulated
precipitation
> values
>> (which seems counter-intuitive).  Does the MET package treat these
values
>> as 0.0000 when it performs verification?
>>
>> Thanks.
>
>
>


------------------------------------------------
Subject: pcp_combine
From: James P Cipriani
Time: Wed Mar 16 06:54:19 2011


Thank you for the script - and my apologies for not being able to get
back
to you sooner.

Your assistance is much appreciated.  Looking forward to the new
version of
MET - it has been a very useful tool.

Thanks.



From:	"RAL HelpDesk {for Paul Oldenburg}" <met_help at ucar.edu>
To:	James P Cipriani/Watson/IBM at IBMUS
Cc:	met_help at ucar.edu
Date:	03/02/2011 01:25 PM
Subject:	Re: [rt.rap.ucar.edu #44964] pcp_combine



James,

The reason for the negative values is related to single byte floating
point
precision round-off in WRF post-processing.
 It is not meant to be physically meaningful, and should be zeroed
out.
The following R script will read the NetCDF
output of pcp_combine and zero out any negative accumulated precip
values.
Note that you will want to change the input
file name.  If you have any questions, please let us know.

Thanks,

Paul


library(ncdf)

strFileName = "pcp_test.nc";
ncfile = open.ncdf(strFileName, write=TRUE, readunlim=TRUE,
verbose=FALSE);

for(strVarName in names(ncfile$var)){

		 #  only treat variables that look like accumulated precip
		 if( !grepl("^APCP", strVarName) ){ next; }

		 #  get the matrix of variable values and zero out any negative
values
		 varPrecip = get.var.ncdf(ncfile, strVarName);
		 cat("removing", sum(varPrecip < 0, na.rm=TRUE), "zeroes from",
strVarName, "\n");
		 varPrecip[ varPrecip < 0 ] = 0;

		 #  write the results to the nc object
		 put.var.ncdf(ncfile, strVarName, varPrecip);
}

close.ncdf(ncfile);




On 03/02/2011 08:26 AM, RAL HelpDesk {for James P Cipriani} wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=44964 >
>
>
> Thank you for your reply.
>
> This was somewhat concerning at first glance.  I do have a simple
question:
> how can pcp_combine yield negative accumulated precipitation values
when
2
> forecast files are subtracted?  For example, in my case, the 24-hour
> forecast file contains accumulated precipitation from the previous
24
hours
> while the 23-hour forecast file contains accumulated precipitation
from
the
> previous 23 hours.  If I subtract the two, I would expect to obtain
a
> positive difference (or 0.00000 if there was no change in
precipitation).
> So a negative value would mean that precipitation has decreased
between
> hour 23 and hour 24 - which would then be accounting for
evaporation,
> runoff, etc.?  Am I correct in this assumption?
>
> Thanks.
>
>
>
> From:		 "RAL HelpDesk {for Paul Oldenburg}" <met_help at ucar.edu>
> To:		 James P Cipriani/Watson/IBM at IBMUS
> Cc:		 met_help at ucar.edu
> Date:		 03/01/2011 03:41 PM
> Subject:		 Re: [rt.rap.ucar.edu #44964] pcp_combine
>
>
>
> James,
>
> grid_stat and point_stat do not treat negative values as zero.  The
issue
> had not come to our attention until you
> brought it up.  We will consider adding that change to a future
version
of
> MET, or maybe even the patches for the
> current version.
>
> Paul
>
>
> On 02/28/2011 03:43 PM, RAL HelpDesk {for James P Cipriani} wrote:
>>
>> Mon Feb 28 15:43:03 2011: Request 44964 was acted upon.
>> Transaction: Ticket created by jpcipria at us.ibm.com
>>        Queue: met_help
>>      Subject: pcp_combine
>>        Owner: Nobody
>>   Requestors: jpcipria at us.ibm.com
>>       Status: new
>>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=44964 >
>>
>>
>>
>>
>> MET team,
>>
>> I ran pcp_combine (subtract mode) on two forecast files and the
output
>> netCDF file contained some negative hourly accumulated
precipitation
> values
>> (which seems counter-intuitive).  Does the MET package treat these
values
>> as 0.0000 when it performs verification?
>>
>> Thanks.
>
>
>



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


More information about the Met_help mailing list