Merge branch 'ohd_14.4.1' of ssh://vlab.ncep.noaa.gov:29418/AWIPS2_Dev_Baseline into master_14.4.1

Former-commit-id: 429e0abfd6 [formerly ff74566cda] [formerly 429e0abfd6 [formerly ff74566cda] [formerly 66dd6987a1 [formerly c1bcd2a0db42c30d447a54ed185fc33d875628b3]]]
Former-commit-id: 66dd6987a1
Former-commit-id: 255948188a [formerly bd5c416c7c]
Former-commit-id: 29fa1f12d1
This commit is contained in:
Fay.Liang 2015-02-24 14:57:03 -05:00
commit 1a618a383b
10 changed files with 68 additions and 26 deletions

View file

@ -1 +1 @@
b0ccb6afd656a3d8b4e26247bfa669f5f9e31291
cb98ce7da536d5c8a5ab8d6562c9f787734e3ea4

View file

@ -1 +1 @@
b0ccb6afd656a3d8b4e26247bfa669f5f9e31291
cb98ce7da536d5c8a5ab8d6562c9f787734e3ea4

View file

@ -71,6 +71,7 @@
* Date Developer Action
* 08/16/2007 Guoxian Zhou first version
* 07/2013 JingtaoD dual pol
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
***********************************************************************/
static double ** origLocBias = NULL;
@ -102,7 +103,8 @@ int applyLocalBias(const time_t tRunTime ,
struct tm * pRunTime = NULL ;
static int first = 0;
char prefix[10] = {'\0'};
char prefix[20] = {'\0'};
int i, j ;
@ -128,7 +130,7 @@ int applyLocalBias(const time_t tRunTime ,
{
strcpy(prefix, "LOCBIASDP");
sprintf ( message , "STATUS: using dual pol local bias.") ;
printMessage( message );
hpe_fieldgen_printMessage( message );
}
}
@ -138,7 +140,7 @@ int applyLocalBias(const time_t tRunTime ,
{
sprintf ( message , "WARNING: token \"%s\" not available"
" - using mean field bias.", LOCBIAS_DIR_TOKEN) ;
printMessage( message );
hpe_fieldgen_printMessage( message );
return 0;
@ -147,7 +149,7 @@ int applyLocalBias(const time_t tRunTime ,
{
strcpy(prefix, "LOCBIAS");
sprintf ( message , "STATUS: using single pol local bias.") ;
printMessage( message );
hpe_fieldgen_printMessage( message );
}
}
@ -161,7 +163,7 @@ int applyLocalBias(const time_t tRunTime ,
"%Y%m%d%H", pRunTime);
sprintf(fileName, "%s/%s%sz", localBiasDir, prefix, strDateTime );
sprintf(message, "STATUS: local bias file name is %s.", fileName);
sprintf(message, "STATUS: in apply_local_bias-local bias file name is %s.", fileName);
hpe_fieldgen_printMessage( message );

View file

@ -11,6 +11,8 @@
* MODIFICATION HISTORY:
* DATE PROGRAMMER DESCRIPTION/REASON
* 07/2013 JingtaoD add prototypes for dual pol proudcts DSA/DPR
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
* update wrtodb_HPERadarResult()
********************************************************************************
*/
@ -742,6 +744,7 @@ void read_daabiasdyn(const char *radar_id,
void wrtodb_HPERadarResult(const char * hpe_productname,
const char * producttime,
const empe_params_struct * pEMPEParams,
const int radar_data_source);
const int radar_data_source,
const int nobias_flag);
#endif /* #ifndef MPE_FIELDGEN_H */

View file

@ -92,7 +92,7 @@
* Jul. 2001 R. Fulton added mxpra limiting of projected rates
* Aug. 11, 2006 Shucai Guan finish conversion to C Language
* Mar., 2008 Guoxian Zhou finish first operational version
*
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
***********************************************************************/
static void writeGrib(char * fileName, char * procFlag)
@ -175,6 +175,7 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
int i, j, iprj, isFilled;
long irc;
int nobias_flag;
int origRowSize = pGeoData->num_rows;
int origColSize = pGeoData->num_cols;
@ -508,11 +509,13 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
if (strstr(mosaicID, "BDHR") != NULL)
{
nobias_flag = 0;
sprintf(procFlag, "%s%02d ", biasedRateFilePrefix, k * 15);
sprintf(fileName, "%sM%d%sz", biasedRateFilePrefix, k * 15,
strDateTime);
} else
{
nobias_flag = 1;
sprintf(procFlag, "%s%02d ", rateFilePrefix, k * 15);
sprintf(fileName, "%sM%d%sz", rateFilePrefix, k * 15,
strDateTime);
@ -587,8 +590,10 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
sprintf ( message , "\nSTATUS: In Project, insert/update 1km mosaic nowcast into HPERadarResult table");
printLogMessage( message );
sprintf ( message, "nobias flag is %d", nobias_flag);
printLogMessage( message );
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, radar_data_source);
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, radar_data_source, nobias_flag);
}
@ -636,10 +641,12 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
{
if (strstr(mosaicID, "BDHR") != NULL)
{
nobias_flag = 0;
sprintf(procFlag, "rfcwide ");
sprintf(fileName, "%s4kmH%sz", biasedAccFilePrefix, strDateTime);
} else
{
nobias_flag = 1;
sprintf(procFlag, "rfcwide ");
sprintf(fileName, "%s4kmH%sz", accFilePrefix, strDateTime);
}
@ -662,7 +669,7 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
sprintf ( message , "\nSTATUS: In Project, insert/update 4km mosaic nowcast into HPERadarResult table");
printLogMessage( message );
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, radar_data_source);
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, radar_data_source, nobias_flag);
}
}
@ -683,10 +690,12 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
if (strstr(mosaicID, "BDHR") != NULL)
{
nobias_flag = 0;
sprintf(procFlag, "BTP1H ");
sprintf(fileName, "%sH%sz", biasedAccFilePrefix, strDateTime);
} else
{
nobias_flag = 1;
sprintf(procFlag, "TP1H ");
sprintf(fileName, "%sH%sz", accFilePrefix, strDateTime);
}
@ -760,7 +769,7 @@ void project(const geo_data_struct * pGeoData, const char * mosaicID,
sprintf ( message , "\nSTATUS: In Project, insert/update 1km mosaic nowcast into HPERadarResult table");
printLogMessage( message );
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, radar_data_source);
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, radar_data_source, nobias_flag);
}
/*

View file

@ -71,6 +71,7 @@
* Date Developer Action
* 10/24/2006 Guoxian Zhou Modified from run_bmosaic.c
* 07/2013 JingtaoD dual pol
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
***********************************************************************/
static double ** Mosaic = NULL;
@ -114,9 +115,14 @@ void runBDHRMosaic(const run_date_struct * pRunDate ,
static int first = 1 ;
struct tm * pRunTime = NULL ;
long int irc ;
int nobias_flag;
/*for BDHR product, there is bias applied */
nobias_flag = 0;
int status = 0 ;
/*
* strDateTime string should be in format: yyyymmddHHMM
*/
@ -235,7 +241,7 @@ void runBDHRMosaic(const run_date_struct * pRunDate ,
sprintf ( message , "\nSTATUS: In BDHRMOSAIC, insert/update HPERadarResult table");
printLogMessage( message );
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, dualpol_used);
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, dualpol_used, nobias_flag);
sprintf ( message , "\nSTATUS: In BDHRMOSAIC, complete insert/update HPERadarResult table");

View file

@ -74,9 +74,10 @@
* Date Developer Action
* 8/13/2006 Guoxian Zhou Build operational version
* 07/2013 Jingtao Deng Modify for adding dual pol producat DPR
* first try to find the DPR product from dprradar
* table and calculate the rain rate. if
* not able to get DPR product, then use DHR product
* first try to find the DPR product from dprradar
* table and calculate the rain rate. if
* not able to get DPR product, then use DHR product
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
***********************************************************************/
extern short ** radarMiscBins ;
@ -164,6 +165,10 @@ void runDHRMosaic(const run_date_struct * pRunDate,
int dualpol_meanbias_flag[MAX_RADAR_NUM];
int sp_meanbias_flag[MAX_RADAR_NUM];
int dualpol_data_avail[MAX_RADAR_NUM];
int nobias_flag;
/* for DHR product, there is no bias applied */
nobias_flag = 1;
/* initialize no dualpol MFB and no dual pol product avialble for each radar */
for (i = 0; i < MAX_RADAR_NUM; i++)
@ -652,7 +657,7 @@ void runDHRMosaic(const run_date_struct * pRunDate,
sprintf ( message , "\nSTATUS: In DHRMOSAIC, insert/update HPERadarResult table");
printLogMessage( message );
wrtodb_HPERadarResult(dhrmosaic_fileName, prdDateTime, pEMPEParams, dualpol_used);
wrtodb_HPERadarResult(dhrmosaic_fileName, prdDateTime, pEMPEParams, dualpol_used, nobias_flag);
sprintf ( message , "\nSTATUS: In DHRMOSAIC, complete insert/update HPERadarResult table");
printLogMessage( message );

View file

@ -73,7 +73,7 @@
* April 2005 Guoxian Zhou converted to C Language
* 10/05/2006 Guoxian Zhou Modified for empe version
* 08/08/2007 Guoxian Zhou add option to use local bias data
*
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
***********************************************************************/
extern int dualpol_used;
@ -113,9 +113,13 @@ void runEBMosaic(const run_date_struct * pRunDate ,
static int first = 1 ;
struct tm * pRunTime = NULL ;
long int irc ;
int nobias_flag;
int status = 0 ;
/* for EBMOSAIC, there is bias applied */
nobias_flag = 0;
/*
* strDateTime string should be in format: yyyymmddHHMM
*/
@ -225,7 +229,7 @@ void runEBMosaic(const run_date_struct * pRunDate ,
sprintf ( message , "\nSTATUS: In EBMOSAIC, insert/update HPERadarResult table");
printLogMessage( message );
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, dualpol_used);
wrtodb_HPERadarResult(fileName, prdDateTime, pEMPEParams, dualpol_used, nobias_flag);
sprintf ( message , "\nSTATUS: In EBMOSAIC, complete insert/update HPERadarResult table");
printLogMessage( message );

View file

@ -81,6 +81,7 @@
* first try to find the DSA product from dsaradar
* table and calculate the 1 hour precipitation. if
* not able to get DSA product, then use DSP product
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
***********************************************************************/
extern short ** radarMiscBins ;
@ -195,6 +196,10 @@ void runERMosaic(const run_date_struct * pRunDate,
int dualpol_meanbias_flag[MAX_RADAR_NUM];
int sp_meanbias_flag[MAX_RADAR_NUM];
int dualpol_data_avail[MAX_RADAR_NUM];
int nobias_flag;
/*ERMOSAIC product has no bias applied */
nobias_flag = 1;
/* initialize no dualpol MFB and no dual pol product avialble for each radar */
for (i = 0; i < MAX_RADAR_NUM; i++)
@ -970,7 +975,7 @@ void runERMosaic(const run_date_struct * pRunDate,
printLogMessage( message );
if(blnMosaic[ermosaic] == 1)
wrtodb_HPERadarResult(ermosaic_fileName, prdDateTime, pEMPEParams, dualpol_used);
wrtodb_HPERadarResult(ermosaic_fileName, prdDateTime, pEMPEParams, dualpol_used, nobias_flag);
sprintf ( message , "\nSTATUS: In ERMOSAIC, complete insert/update HPERadarResult table");
printLogMessage( message );

View file

@ -12,7 +12,7 @@
* MACHINE:
* MODIFICATION HISTORY:
* MODULE # DATE PROGRAMMER DESCRIPTION/REASON
*
* 02/2015 JingtaoD A2 OB14.4.1 DR#17123 - HPE Bias Source field
********************************************************************************
*/
@ -55,19 +55,20 @@
void wrtodb_HPERadarResult(const char * hpe_productname,
const char * producttime,
const empe_params_struct * pEMPEParams,
const int radar_data_source)
const int radar_data_source,
const int nobias_flag)
{
HPERadarResult hperadarresult_struct;
const char * HPE_BIAS_SOURCE_TOKEN = "hpe_bias_source";
static int first = 1 ;
static int first = 0 ;
static char bias_source[6] = "RFC"; // RFC or LOCAL, default to RFC
char strTokenValue[6] = {'\0'} ;
/* retrieve token HPE_BIAS_SOURCE_TOKEN, it can be LOCAL or RFC */
if(first == 1)
if(first == 0)
{
if(hpe_fieldgen_getAppsDefaults(HPE_BIAS_SOURCE_TOKEN, strTokenValue) != -1)
{
@ -97,12 +98,19 @@ void wrtodb_HPERadarResult(const char * hpe_productname,
hpe_fieldgen_printMessage( message );
}
first = 0;
first = 1;
}
/* Initialize the product name. and assign value */
/*hperadarresult_struct.hpe_productname [ PRESET_DESCR_LEN + 1 ] = '\0';*/
strncpy(hperadarresult_struct.hpe_productname, hpe_productname, PRESET_DESCR_LEN);
sprintf ( message, "STATUS: the hpe productname is %s", hpe_productname);
hpe_fieldgen_printMessage( message );
sprintf ( message, "STATUS: the nobias_flag is %d", nobias_flag);
hpe_fieldgen_printMessage( message );
/* assign producttime */
yearsec_ansi_to_dt(producttime, &hperadarresult_struct.producttime);
@ -114,7 +122,7 @@ void wrtodb_HPERadarResult(const char * hpe_productname,
/* Initialize the bias source . and assign value */
hperadarresult_struct.bias_source[BIAS_LEN + 1] = '\0';
if (pEMPEParams->blnMeanFieldBias == 0 && pEMPEParams->blnDHRMeanFieldBias == 0)
if (nobias_flag == 1)
strcpy(hperadarresult_struct.bias_source, "NO BIAS");
else //EBMOSAIC or BDHRMOSAIC
{