SELECT
  model,
  NOW()  fcst_init,
  NOW()  fcst_valid,
  
  HOUR(fcst_valid) valid_hour,
  fcst_thr,
'WRF_precip' fcst_var,
  'CNTSUM_FSA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY fcst_thr IN ('>=0.254')
  AND   BINARY model IN ('AI_B3H_area100', 'AI_B6H_area100', 'AI_GDAS_area100')
  AND HOUR(fcst_valid) IN ('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23')
 AND  BINARY  fcst_var = 'WRF_precip'
  AND fcst_flag = 1
  AND simple_flag = 1  AND mode_obj_single.mode_header_id = mode_header.mode_header_id
  AND mode_cts.mode_header_id = mode_obj_single.mode_header_id
  AND mode_cts.field = 'OBJECT'
GROUP BY
  valid_hour,
  model,
  fcst_thr

SELECT
  model,
  NOW()  fcst_init,
  NOW()  fcst_valid,
  
  HOUR(fcst_valid) valid_hour,
  fcst_thr,
'WRF_precip' fcst_var,
  'CNTSUM_OSA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY fcst_thr IN ('>=0.254')
  AND   BINARY model IN ('AI_B3H_area100', 'AI_B6H_area100', 'AI_GDAS_area100')
  AND HOUR(fcst_valid) IN ('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23')
 AND  BINARY  fcst_var = 'WRF_precip'
  AND fcst_flag = 0
  AND simple_flag = 1  AND mode_obj_single.mode_header_id = mode_header.mode_header_id
  AND mode_cts.mode_header_id = mode_obj_single.mode_header_id
  AND mode_cts.field = 'OBJECT'
GROUP BY
  valid_hour,
  model,
  fcst_thr

