e. WRF-VAR Diagnostics

WRF-Var produces a number of diagnostic files that contain useful information on how the data assimilation has performed. This section will introduce you to some of these files, and what to look for.

By this stage of the online tutorial you have successfully compiled and run WRF-Var. If not, you should return to the WRF-Var Tutorial Page to try these out.

i. Which are the important diagnostic to look for?

Having run WRF-Var, it is important to check a number of output files to see if the assimilation appears sensible. Change directory to where you ran this case:

            cd ${RUN_DIR}/2007010200/wrfvar

            ls -l

You will see something like the following:


-rw-r--r-- 1 rizvi  ncar     280 Mar 18 15:41 cost_fn
-rw-r--r-- 1 rizvi  ncar     247 Mar 18 15:41 grad_fn
-rw-r--r-- 1 rizvi  ncar 9048641 Mar 18 15:41 gts_omb_oma
-rw-r--r-- 1 rizvi  ncar    4156 Mar 18 15:41 index.html
-rw-r--r-- 1 rizvi  ncar    1942 Mar 18 15:41 namelist.input
-rw-r--r-- 1 rizvi  ncar   76986 Mar 18 15:41 namelist.output
drwxr-xr-x 2 rizvi  ncar   65536 Mar 18 15:41 rsl
-rw-r--r-- 1 rizvi  ncar   22730 Mar 18 15:41 statistics
drwxr-xr-x 2 rizvi  ncar   65536 Mar 18 15:41 trace
drwxr-xr-x 3 rizvi  ncar   65536 Mar 18 15:41 working

Content of some useful diagnostic files are as follows:

cost_fn and grad_fn: These ASCII files hold the WRF-Var cost and gradient function values, respectively, for the first and last iterations. However, if you run with “NL_CALCULATE_CG_COST_FN=true”, they list these values for each iterations. For visualization purpose, sometimes it is good to run WRF-Var with this option, as it will list the cost and gradient function for each iteration. The NCL script “WRFV3/var/graphcs/ncl/plot_cost_grad_fn.ncl” may be used to plot the content of cost_fn and grad_fn, if these files are generated with “NL_CALCULATE_CG_COST_FN=true”.

Note: Make sure that you removed first two records (header) in cost_fn and grad_fn. Also you will need to specify the directory name for these two files.

gts_omb_oma: It holds (in ASCII format) information of each type of observations, like its value, quality, observation error, observation minus background (OMB) and observation minus analysis (OMA). This information is very useful for both analysis or forecasts verification purposes.

namelist.input: WRF-Var input namelist file. It displays all the non-default options which user defined. If any of your namelist defined options did not appear in this file, you may like to check its name and match it with the “WRFV3/Registry/Registry.wrfvar”.   

namelist.output: Consolidated list of all the namelist options used.      

rsl: Directory containing information of standard WRF-Var output from individual processors. It contains host of information on number of observations, minimization, timings, etc. Additional diagnostics may be printed in these files by including various “print” WRF-Var namelist options. To learn more about these additional “print” options, search “print_” string in “WRFV3/Registry/Registry.wrfvar”.

statistics: Textfile containing OMB (OI), OMA (OA) statistics (minimum, maximum, mean and standard deviation) for each observation type and variable. This information is very useful in diagnosing how WRF-Var has used different components of the observing system. Also contained are the analysis minus background (A-B) statistics, i.e., statistics of the analysis increments for each model variable at each model level. This information is very useful in checking the range of analysis increment values found in the analysis, and where they are in the WRF-model grid space.

ii. Where is the final analysis file?

The final analysis file resides in $FC_DIR/2007010200/wrfinput_d01. It is in WRF (NetCDF) format.  It may be visualized usingthe NCL script “WRFV3/var/graphcs/ncl/WRF-Var_plot.ncl”.

You need to specify the analsyis_file name, its full path, etc. The details are listed in this script as comments.  

As an example, if you are aiming to display the wind U-component field of the analysis at level 18, execute following command after modifying the script “WRFV3/var/graphcs/ncl/WRF-Var_plot.ncl”

            ncl  WRF-Var_plot.ncl

It will display like:

You may like to change the variable name, level, etc., in this script to display the variable of your choice at the desired sigma level.

Take time to look through the textual output files to ensure you understand how WRF-Var has performed. For example,

1.      How closely has WRF-Var fitted individual observation types? Look at the statistics file to compare the O-B and O-A statistics.

2.      How big are the analysis increments? Again, look in the statistics file to see minimum/maximum values of A-B for each variable at various levels. It will give you a feel of the impact of input observation data you assimilated via WRF-Var by modifying the input analysis first guess.

3.      How long did WRF-Var take to converge? Does it really converge? You will get the answers to all these questions by looking into "rsl" files, as it indicates the number of iterations taken by WRF-Var to converge. If this is the same as the maximum number of iterations specified in the namelist (NTMAX) or its default value (=200) set in WRFV3/Registry/Registry.wrfvar”, then it means that the analysis solution did not converge. If so, so you may like to increase the value of “NTMAX” and re-run your case to ensure that the convergence is achieved.

iii. Plotting WRF-Var analysis increments

A good visual way of seeing the impact of assimilation of observations is to plot the analysis increments (i.e., analysis minus first guess difference). There are many different graphics packages (e.g., RIP, NCL, GRADS etc) that can do this. The plot of level 18 theta increments below was produced using a particular NCL script. This script is located at

“WRFV3/var/graphcs/ncl/WRF-Var_plot.ncl”

You need to modify this script to fix the full path for first_guess and analysis files. You may also like to modify the display level by setting “kl” and the name of the variable to display by setting “var”. Further details are given in this script.

If you are aiming to display increment of potential temperature at level 18, after modifying “WRFV3/var/graphcs/ncl/WRF-Var_plot.ncl” suitably, when you execute the following command from“WRFV3/var/graphics/ncl”.

            ncl WRF-Var_plot.ncl

The plot created will looks as follows:

Note: Higher the analysis increments, more is the data impact in that region.

iv. What next?

OK, you have run WRF-Var, checked out the diagnostics and are confident things are OK. Before running a forecast, you must first modify the tendencies within the lateral boundary condition files to be consistent with the new WRF-Var initial conditions.

f) Updating WRF lateral boundary conditions


Trouble Shooting: If you have questions, ask wrfhelp@wrf-model.org.


Return to WRF-VarTutorial Page