Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Surface Verification on Hera

Updated: December 19, 2025

Loading a real-time run

Here are the steps for loading a real-time run on hera into the surface verification database. (Steps for processing a retro run follow this.)

  1. go to the hera:/home/amb-verif/ruc_madis_surface/beta/ directory.

  2. edit get_iso_file3.pl to point to the output for the new real-time run. (There will likely be a soft link at /home/rtrr/ pointing to the appropriate place--use this link if it exists. If it doesn’t, consider creating a link there.)

  3. edit surface_driver_q1.pl to have the valid times, regions and forecast lengths you want for this real-time run. Look at the forecast lengths for similar runs to get an idea of what is wanted. These will be the forecast lengths for which we’ll make verifications.

  4. run surface_driver_q1.pl <model_name> -5 0 METAR and check that its output looks right. The first time you run this, various tables will be created, and you’ll see that in the output. For instance,

    $> surface_driver_q1.pl RAP_dev3 -5 0 METAR
    hours_ago is 5
    CREATING TABLES IN DATABASE
    create table madis3.RAP_dev3qp like madis3.RR1hqp
    create table madis3.RAP_dev3qp1f like madis3.RR1hqp1f
    create table madis3.RAP_dev3_coastal5 like madis3.RR1h_coastal5
    create table madis3.stations_RAP_dev3_coastal5 like madis3.stations_RR1h_coastal5
    use surface_sums
    create table RAP_dev3_metar_v2_ALL_RR1 like RR1h_0_metar_q_ALL_HRRR
    create table RAP_dev3_metar_v2_ALL_RUC like RR1h_0_metar_q_ALL_HRRR
    (etc.)

    After that, typical GRIB1 output looks like:

    TO PROCESS: 0 h fcst valid at Tue Jun 12 16:00:00 2012
    data source is RAP_dev3. Looking in directory /home/rtrr/rap_dev3/WRFDATE/postprd/
    filename is /home/rtrr/rap_dev3/2012061216/postprd/wrfprs_rr_00.al00
    FILE FOUND RAP_dev3 0 h fcst valid at Tue Jun 12 16:00:00 2012
    get_grid results: ,,,,758,567,,1,20,2012-06-12 16:00:00,0
    grib_type is 1. |0| |0| |0| |0| |758| |567| |0|
    valid times from get_grid: 2012-06-12 16:00:00,0
    hr_obs_1339516800 exists. Not recreating it.
    arg is /home/amb-verif/ruc_madis_surface/beta/surface_HRRR_q.x METAR RAP_dev3 1339516800 /home/rtrr/rap_dev3/2012061216/postprd/wrfprs_rr_00.al00 tmp/RAP_dev3.7624.grib_data.tmp 1 0 0 0 0 0 0 758 567 1 tmp/RAP_dev3.7624.data tmp/RAP_dev3.7624.data_1f tmp/RAP_dev3.7624.coastal tmp/RAP_dev3.7624.coastal_stations 0 1

    typical GRIB2 output looks like:

    TO PROCESS: 0 h fcst valid at Fri Nov 30 08:00:00 2012
    data source is RTMA. Looking in directory /home/rtrr/hrrr_dev1/WRFDATE/postprd/
    filename is /home/rtrr/hrrr_dev1/2012113008/postprd/wrftwo_hrconus_rtma.grib2
    FILE FOUND RTMA 0 h fcst valid at Fri Nov 30 08:00:00 2012
    NUMBER 2 arg is wgrib2 -grid /home/rtrr/hrrr_dev1/2012113008/postprd/wrftwo_hrconus_rtma.grib2
    NUMBER 3 arg is |wgrib2 /home/rtrr/hrrr_dev1/2012113008/postprd/wrftwo_hrconus_rtma.grib2|
    1:0:d=2012113008:HGT:surface:anl:
    
    DATE for grib2 is 2012113008, 0
    get_grid results: 21.138000,237.280000,262.500000,38.500000,1799,1059,3000.000000,2,1,2012-11-30 08:00:00,0
    grib_type is 2. |21.138| |237.28| |262.5| |38.5| |1799| |1059| |3000|
    valid times from get_grid: 2012-11-30 08:00:00,0
    hr_obs_1354262400 exists. Not recreating it.
    arg is /home/amb-verif/ruc_madis_surface/beta/surface_HRRR_q.x METAR RTMA 1354262400 /home/rtrr/hrrr_dev1/2012113008/postprd/wrftwo_hrconus_rtma.grib2 tmp/RTMA.20102.grib_data.tmp 2 0 21.138 237.28 262.5 38.5 3000 1799 1059 1 tmp/RTMA.20102.data tmp/RTMA.20102.data_1f tmp/RTMA.20102.coastal tmp/RTMA.20102.coastal_stations 1 1
    command: |wgrib2 -i -order raw -no_header -bin tmp/RTMA.20102.grib_data.tmp /home/rtrr/hrrr_dev1/2012113008/postprd/wrftwo_hrconus_rtma.grib2
    2:3810470:d=2012113008:PRES:surface:anl:
    4:10716983:d=2012113008:DPT:2 m above ground:anl:
    5:13098598:d=2012113008:UGRD:10 m above ground:anl:
    6:15956498:d=2012113008:VGRD:10 m above ground:anl:
    3:7620940:d=2012113008:TMP:2 m above ground:anl:
    7:18814398:d=2012113008:SPFH:2 m above ground:anl:
    2:3810470:d=2012113008:PRES:surface:anl:
    4:10716983:d=2012113008:DPT:2 m above ground:anl:
    5:13098598:d=2012113008:UGRD:10 m above ground:anl:
    6:15956498:d=2012113008:VGRD:10 m above ground:anl:
    3:7620940:d=2012113008:TMP:2 m above ground:anl:
    7:18814398:d=2012113008:SPFH:2 m above ground:anl:

    output then proceeds like:

    got here with DEBUG = 1
    valid_secs in get_stations is 1339516800
    query 3:
    select * from hr_obs_1339516800 where net = "METAR"
    
    ;
    
    582 400 42.07 -124.29 459 1339516560 1020 52 52 3 -99999
    4295 stations loaded for METAR network(s)
    reading grib file /home/rtrr/rap_dev3/2012061216/postprd/wrfprs_rr_00.al00
    6 fields to fill
    in agrib: filename = /home/rtrr/rap_dev3/2012061216/postprd/wrfprs_rr_00.al00
    0: filling surface field |PRMSL| (2) Pressure reduced to MSL [Pa] MSL
    4: filling surface field |TMP| (11) Temp. [K] 2 m above gnd
    1: filling surface field |DPT| (17) Dew point temp. [K] 2 m above gnd
    5: filling surface field |RH| (52) Relative humidity [%] 2 m above gnd
    2: filling surface field |UGRD| (33) u wind [m/s] 10 m above gnd
    3: filling surface field |VGRD| (34) v wind [m/s] 10 m above gnd
    all 6 fields filled
    ...
    1658 stations out of domain
    model is RAP_dev3
    load data concurrent local infile 'tmp/RAP_dev3.7624.data'
    replace into table RAP_dev3qp
    columns terminated by ','
    lines terminated by 'n'
    2637 rows affected
    0.430 sec to load data file into mysql
    load data concurrent local infile 'tmp/RAP_dev3.7624.coastal'
    replace into table RAP_dev3_coastal5
    columns terminated by ','
    lines terminated by 'n'
    598 rows affected
    0.230 sec to load coastal file into mysql
    load data concurrent local infile 'tmp/RAP_dev3.7624.coastal_stations'
    replace into table stations_RAP_dev3_coastal5
    columns terminated by ','
    lines terminated by 'n'
    598 rows affected
    0.120 sec to load coastal stations  into mysql
    zeros: 0, loaded: 4295
    updating 0 h forecast summaries in surface_sums.RAP_dev3_metar_v2_ALL_RR1 for Tue Jun 12 16:00:00 2012
    (etc.)
  5. If everything looks correct, move the files you’ve edited (get_iso_file3.pl and surface_driver_q1.pl) up to the non-beta directory: /home/amb-verif/ruc_madis_surface/.

  6. Run surface_driver_q1.pl <model_name> -5 0 METAR there to make sure everything looks good. (The output will probably say that everything has been processed; to force processing, change the ‘0’ argument in the command above to ‘1’.)

  7. If the non-beta processing looks correct, try qsubbing the job with a command like

    $> ~/utilities/qs2.sh ~/ruc_madis_surface/rt.sh RAP_dev1 -5 0 METAR

    This command should return a job name, such as [2277074.bqs1.hera.fairmont.rdhpcs.noaa.gov](http://2277410.bqs1.zeus.fairmont.rdhpcs.noaa.gov/)

    After a couple of minutes, you should see three files in the ~/ruc_madis_surface/tmp/ directory, like:

    RAP_sfc_verif.o2277074
    RAP_dev1.sfc_drq.2277074.out
    RAP_sfc_verif.e2277074

    The *.out file will have the output from the job.

  8. If all that looks correct, add a line to the crontab, like this one:

    31 * * * * ~/utilities/qs2.sh ~/ruc_madis_surface/rt.sh RAP_dev1 -5 0 METAR > /dev/null
  9. After the time for the cron job has passed, check the output to see that it ran correctly.

  10. go to http://ruc.noaa.gov/stats/surface/beta/?debug=true and reload the page. See if the new model run appears in the list of models. If it doesn’t, see whether this table exists in the database:

    surface_sums.<model_name>_metar_v2_ALL_HRRR

    (the “%” is the mysql match-multiple-characters flag.) If it doesn’t, there’s been a big problem that will require more investigation.

  11. If the model run does appear, select it, along with an appropriate time window and see if verification data comes up.

  12. If it does, compare this model with a known model to see that the verification results make sense. If they do, you’re done!

Loading a retro run (Hera or Jet)

Here are the steps for loading retro runs (on hera or on jet) into the surface verification database.

Retro name prefixes (REQUIRED!!!):
HRRR retro -> HRRRret_{user details}
RAP retro -> RRret_{user details}
RRFS retro -> RRFSret_{user details}

  1. make sure the observations for the time period you need are in the madis3.obs_retro table. The simplest way to do this is to log in to the madis3 mysql database and run this query:

    select from_unixtime(floor(time/86400)*86400) as day
    from obs_retro
    group by day
    order by day;

    This will show you what days (they may be partial) are included in the obs_retro table. If the days you want aren’t in there then do this:

    on emb-prod-db, run this command:

    ~amb-verif@emb-prod-db:~/madis51/retro> load_retro.pl <start_secs> <end_secs>

    where <start_secs> and <end_secs> are seconds since 1/1/70 for the start end end of the time window you want to load. This job may take several hours for 10 days worth of data. This loads only METAR stations.

  2. In directory ~amb-verif/ruc_madis_surface/beta/RR_retro/ make a soft link to the directory holding the retro run grib files. This works on both jet and hera
    For instance:

    ln -s /scratch2/portfolios/BMC/wrfruc/ejames/rapretro/jun2011/DOMAINS/wrfrr13_cycle/ <expt_name>

    Where the final argument is the experiment name.

    The directory linked to should include files named like wrfprs_rr_NN.grib1, where NN is the forecast projection.

  3. In /~amb-verif/ruc_madis_surface/beta/, run

    [**retro2.pl**](http://retro.pl/) **<experiment_name> <start_secs> <end_secs>**

    for instance:

    [retro2.pl](http://retro.pl/) RRret_May8_SFOV_v1 1273968000 1273968000

    This job will create the needed tables for <expt_name> and fill them. The experiment name must match the name of the soft link created in step 2. (If you run this with a wrong experiment name, let me or Jeff know, so we can remove all the tables that will have been created.)

    The job will ignore time periods that have already been processed, so it can be put into cron without causing unnecessary computing. (However, if you want to force retro2.pl to reprocess already-processed hours, add a final non-zero argument, for instance:

    [**retro2.pl**](http://retro.pl/) **RRret_May8_SFOV_v1 1273968000 1273968000 1**

    The final ‘1’ causes reprocessing of all available hours.)

    The job will generate results for forecast lengths 1,0,3,6,9,12, and for regions ALL_RR1 ALL_RUC E_RUC W_RUC ALL_HRRR E_HRRR W_HRRR.

  4. After retro2.pl has processed a few time periods you can go to the website http://ruc.noaa.gov/stats/surface/beta/ and look at results. You may have to reload this page for your new experiment name to show up in the list of model runs.

This processing does not produce rh verification results. But it does generate statistics for temperature, dewpoint, and wind.

-Bill Moninger

Adding a region to an existing model run on hera

Xue Wei 10-9-2013

Z-134 amb-verif@fe4:~/ruc_madis_surface/beta/retro_ak.pl

Adding new projection to surface verification

Xue Wei 23-09-2013

surface_dirver_q1.pl → get_iso_files3.pl ( file path/name for each model run)
  → get_grid.pl (read grib file, get all meta information)
  → col_wgrib.x
  → surface_HRRR_q.x (wrf=1 for all other models)
  → agrib_madis_sites_q.x ( wrf=0 for ruc ncep)

in makefile

q: $(OBJS) HRRR_driver_q.o fill_surface_values_q.o fill_GLMP_surface_values.o write_stations5q.o rotLL_geo.o get_stations_q.o

$(CL) $(OBJS) HRRR_driver_q.o fill_surface_values_q.o fill_GLMP_surface_values.o write_stations5q.o rotLL_geo.o get_stations_q.o -lm -o surface_HRRR_q.x $(INCS) $(LIBS)

fill_surface_values_q.c: w3fb11(alat,elon,alat1,elon1,dx,elonv,alattan,&xreal,&yreal);

fill_GLMP_surface_values.c: void w3fb11(float alat,float elon,

Need do this to run .x from command line

I19 amb-verif@fe8:~/ruc_madis_surface/beta$ setenv DBI_USER "sfc_driver5"
20 amb-verif@fe8:~/ruc_madis_surface/beta$ setenv DBI_PASS "driver5"
setenv CLASSPATH "/home/amb-verif/javalibs/mysql-connector-java-5.1.6/mysql-connector-java-5.1.6-bin.jar:."

/home/amb-verif/ruc_madis_surface/beta/surface_HRRR_q.x METAR 242_alaska 1381352400 /public/data/grids/rap/242_alaska/grib2//1328220000001 tmp/242_alaska.13342.grib_data.tmp 2 1 30 187 225 30 11250 553 425 1 tmp/242_alaska.13342.data tmp/242_alaska.13342.data_1f tmp/242_alaska.13342.coastal tmp/242_alaska.13342.coastal_stations 0 1