Home Agenda Lectures Virtual Mtg. Etiquette



  Quick Links

2-Way Nested Domain Example
 

A 2-way nested run is a simulation with two or more domains at different resolutions. There is an outer (parent) coarse domain, and one or more finer–resolution domains within. The domains are run simultaneously and communicate with each other. The coarser domain provides boundary values for the nest, and the nest feeds its calculations back to the coarse domain – if feedback=1 (on) is turned on.


Note: See the tutorial presentation on Nesting for additional information.


Recall the flowchart from the initial practice exercise. You will follow the same process here, but you'll be preparing a simulation with a nested domain (two total domains). For this run, you do not need to repeat step 2, as you have already ungribbed the data during the Single Domain Run, and data are domain–independent. If you no longer have these files, go back to the Single Domain Run and repeat step 2.




**Click on the links to jump to the desired section**

1. Set-up and Run Geogrid
2. No Ungrib
3. Set-up and Run Metgrid
4. Prepare to Run Real & WRF
5. Run the Real Program
6. Run the WRF Model



Set-up and Run Geogrid

Recall the geogrid program defines the map projection, and the geographic location, size, and resolution of the domain. It also interpolates static fields (e.g., topography height, landuse category, etc.) to the domain. You now need to run this for 2 domains.


  1. Make sure you are in the wps directory.

  2. Edit namelist.wps to configure the simulation domain. Pay attention to the BOLD modifications in the box below that pertain to a 2–domain simulation.


    Note

    For a nested domain, the only namelist variables that need to be modified are those that, by default, have multiple columns (each column represents a different domain). If the default namelist only has a single value, the model only expects a single value. Adding additional columns causes an error.


  3. You are now going to add a second domain over the midwest United States. Domain 2 will have 118 x103 grid points, and will use a 3:1 grid ratio between the second and first domains.

    Make the following changes to the "&share" and "&geogrid" records in namelist.wps.


    &share
    max_dom = 2,

    &geogrid
    parent_id = 1, 1,
    parent_grid_ratio = 1, 3,
    i_parent_start = 1, 36
    j_parent_start = 1, 32
    e_we = 100, 118
    e_sn = 100, 103
    dx = 30000
    dy = 30000
    geog_data_res = 'default','default',
    geog_data_path = Untitled Document '/glade/work/wrfhelp/WPS_GEOG'





    Note

    We are using a 3:1 grid ratio (which is recommended), so we must follow the '3*x+1' rule, where x is the number of coarse grids that cover the nesting area, when picking domain sizes (e_we and e_sn) for domain 2. If interested, test the above grid dimensions for domain 2 to make sure they follow this rule.




  4. Before running geogrid.exe, preview the domain to make sure it is correct.  
  5. Now generate geographical data files "geo_em.d01.nc" and "geo_em.d02.nc" by running geogrid.exe

     



Go back to top



Do Not Run Ungrib

Because data are only specific to the date and time of the simulation, and are not domain–dependent, if you already have the intermediate files (prefix FILE) from the single domain simulation, there is no need to rerun the ungrib program. You may continue to run metgrid.



Go back to top



Set-up and Run Metgrid

Recall the metgrid program horizontally interpolates meteorological data (extracted by the ungrib program) to the simulation domains (defined by geogrid). This program creates input data files necessary to run the WRF model. You will now create these files for both domains.


  1. Before you run metgrid.exe, make sure the dates in namelist.wps are set correctly for domain 2.

    Untitled Document

    &share
    start_date = '2023-03-31_00:00:00 ', '2023-03-31_00:00:00 ',
    end_date = '2023-04-01_00:00:00 ', '2023-03-31_00:00:00 ',
    interval_seconds = 21600 ,
     




    Note

    End_date for domain 2 is equal to the start_date. Only the initial time is required for this domain because it receives all its boundary conditions from d01.


  2. Now run "metgrid.exe"

     This creates a number of files (note the single extra domain 2 file now being created):

    met_em.d01.2023-03-31_00:00:00.nc
    met_em.d01.2023-03-31_06:00:00.nc
    met_em.d01.2023-03-31_12:00:00.nc
    met_em.d01.2023-03-31_18:00:00.nc
    met_em.d01.2023-04-01_00:00:00.nc
    met_em.d02.2023-03-31_00:00:00.nc



  3. If interested, try the netcdf data browser 'ncview' to quickly examine your data files from metgrid.
 



Go back to top



Prepare to run the Real and WRF Programs



  1. Make sure you are in the correct directory to run real.exe and wrf.exe.


  2. Edit namelist.input to reflect domain and date information for this case. Pay attention to BOLD modifications in the box below.



    &time_control
    run_hours = 24,
    start_year = 2023, 2023,
    start_month = 03, 03,
    start_day = 31, 31,
    start_hour = 00, 00,
    end_year = 2023, 2023,
    end_month = 04, 04,
    end_day = 01, 01,
    end_hour = 00, 00
    interval_seconds = 21600
    input_from_file = .true.,.true.,
    history_interval = 180, 180,
    frames_per_outfile = 1, 1,
    restart = .false.,
    restart_interval = 72000,

    &domains
    time_step = 180
    max_dom = 2,
    e_we = 100, 118
    e_sn = 100, 103
    e_vert =45, 45,
    num_metgrid_levels = 34
    num_metgrid_soil_levels = 4
    dx = 30000
    dy = 30000
    grid_id = 1, 2, 3,
    parent_id = 0, 1, 2,
    i_parent_start = 1, 36
    j_parent_start = 1, 32
    parent_grid_ratio = 1, 3,
    parent_time_step_ratio = 1, 3,  
     





  3. Notes

    • Notice some parameters have 2 columns now and some still only require one. If you are ever unsure about which ones need settings for each domain, you can find that information in the /wrf/run/README.namelist file. If a value is required for each domain, you will see "(max_dom)" beside the variable. Otherwise, only a single value is required.

    • input_from_file=.true. for domain 2, indicates we are creating an input data file (wrfinput_d02) for domain 2. This is the standard setting for basic nesting cases. You would set this to false if running a vortex-following case.

    • Read more about:





Go back to top



Run the Real Program

Recall the real program uses horizontally-interpolated meteorological data (met_em* files from wps) and vertically interpolates them for use with the WRF model. It creates initial condition files and a lateral boundary file that used by WRF.


  1. Link the metgrid output data files from wps to the current directory.

  2. Submit the runreal.sh batch script to the queue to produce model initial and lateral boundary files.

    If successful, you should now have the following input files (Note: a wrfbdy_d02 file is not created, as the nest always gets its boundary conditions from the parent domain):
    wrfbdy_d01
    wrfinput_d01
    wrfinput_d02

    View the rsl.out.0000 file to ensure the run was successful.


Go back to top



Run the WRF Model

Recall the WRF model uses intitial and boundary condition files generated by the real program to perform model integration, using user-specified options provided in the namelist.input file (e.g., physics options).


  • Submit the runwrf.sh batch script to the queue to run the nested wrf simulation for a model simulation and forecast.
     
    Running a 24–hour simulation for this 2–domain case could take ~10 mins to complete. You can use the qstat command to check the status of your simulation, or you can look at the rsl.out.0000 file.

    If successful, this generates the following history files:
    wrfout_d01_2023-03-31_00:00:00
    wrfout_d01_2023-03-31_03:00:00
    wrfout_d01_2023-03-31_06:00:00
    wrfout_d01_2023-03-31_09:00:00
    wrfout_d01_2023-03-31_12:00:00
    wrfout_d01_2023-03-31_15:00:00
    wrfout_d01_2023-03-31_18:00:00
    wrfout_d01_2023-04-01_00:00:00

    wrfout_d02_2023-03-31_00:00:00
    wrfout_d02_2023-03-31_03:00:00
    wrfout_d02_2023-03-31_06:00:00
    wrfout_d02_2023-03-31_09:00:00
    wrfout_d02_2023-03-31_12:00:00
    wrfout_d02_2023-03-31_15:00:00
    wrfout_d02_2023-03-31_18:00:00
    wrfout_d02_2023-04-01_00:00:00


    Feel free to use some of the options or graphics you used in previous exercises to check your output.

WRF Tutorial Exercises



Continue to More Exercises

If you plan to attempt more exercises right now, you can access the cases studies menu by clicking here.