Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

How can I output some selected variables in the wrfout_d01_*** at the specify pressure/z levels when running ./wrf.exe


New member
Dear all,

I would like to output some variables in the wrfout_d01_*** (such as QRAIN,QICE,QSNOW) at the specify pressure/z levels (for instance, press_levels = 92500, 85000, 70000, 60000, 50000/z_levels = -30, -80, -150) and specify time interval.

I know I can set the namelist.input as follow:

auxhist22_outname ="wrf_specify_vars_zl_d<domain>_<date>"
auxhist22_interval = 180, 360,
frames_per_auxhist22 = 8, 100,
io_form_auxhist22 = 2

auxhist23_outname = "wrf_specify_vars_pl_d<domain>_<date>"
auxhist23_interval = 360, 360,
frames_per_auxhist23 = 4, 100,
io_form_auxhist23 = 2

diag_nwp2 = 1
p_lev_diags = 1
num_press_levels = 9,
press_levels = 92500, 85000, 70000, 60000, 50000, 40000, 30000, 20000, 10000
z_lev_diags = 1
num_z_levels = 3,
z_levels = -30, -80, -150
But it can only output U, V, wind speed, T, dew point T, RH and geopotential height at a number of pressure/z levels I provided,

So I want to know how to set the namelist.input or modify the relatived model scripts (such as some Registry files) to output some specify variables that I want.

Do I need to change the Registry.EM_COMMON file and how ?

Thanks a lot!


There are probably two options you could try.

1) It may be possible to modify the code to include some other output variables. The code for p_lev_diags is in the file phys/module_diag_pld.F. I would recommend taking a look at some of the other variables in that file and see if you can replicate it for the variables you want. Try just one variable at first to make sure you can get it to work, and then add others, if so. Once you modify that file, you'll need to modify all the files that use that information. For e.g., do a search for the subroutine name to see where it's called.

>grep -i "call pld" */*.F
dyn_em/start_em.F:    CALL pld (                                  &
phys/module_diagnostics_driver.F:               CALL pld (                                                   &
wrftladj/start_em_tl.F:    CALL pld (                                  &

You'll need to follow standard fortran syntax and rules to ensure everything is done correctly. After modifying those files, you'll need to modify any other files the information is continued to be passed-up and called.

Unfortunately we don't have the resources to fully assist with code modification, so you may have to do some research on your own if you start running into syntax errors and such when compiling the code.

2) Another option is to try the p_interp utility to see if it works for what you're interested in. This is an older program that hasn't been updated or maintained in some time, but it's probably worth looking into before trying option 1.