WRF-Var Namelists, Diagnostics, and Tools http://www.mmm.ucar.edu/wrf/users/tutorial/tutorial_presentation.htm WRF-Var Namelist WRF-Var Tools and Verification http://www.mmm.ucar.edu/wrf/users/tutorial/200807/VAR/WRF-Var2008JulyTutorial_wrfvarnamelist-HuiShao.pdf http://www.mmm.ucar.edu/wrf/users/tutorial/200807/VAR/wrfvar_tools.pdf see other related detailed tutorial presentations available at
36
Embed
WRF-Var Namelists, Diagnostics, and Tools WRF-Var Namelist WRF-Var Tools and Verification.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
“analysis_increments” (analysis-background). The file is a binary file, generated every time you run WRF-Var by using a FORTRAN code given in WRFVAR/da/da_setup_structures/da_write_increments.inc .
You could still produce your own analysis increment file by extracting first guess from analysis files (both in netcdf format). The advantage of using this “analysis_increment” is to avoid spurious increments (because it is generated directly from the code without including the first guess).
if (seconds > ANALYSIS_ACCU) then write(unit=message(1),fmt='(A,A,A,A)') & "xb_date=",xb_date," an_date=", an_date write(unit=message(2),fmt='(A,I6,A,I6)') & "diff=",seconds," ANALYSIS_ACCU=",ANALYSIS_ACCU message(3)="=======> Wrong xb time found???" call da_warning(__FILE__,__LINE__,message(1:3)) end if end if
• Fg_format: The format of the first guess of WRF-Var.
– 1 = WRF-ARW: Default (recommended).
• Ob_format: The format of the conventional and satellite retrieval observation data going into WRF-Var.
– 1 = BUFR (Please use this option with caution).
– 2 = ASCII (ob.ascii): Default. Both formats are supported by OBSPROC.
• Num_fgat_time: number of data time window (slot) used in WRF-Var.
– 1 = 3DVAR: Default.
– >1 apply to FGAT and 4D-Var.
Namelist - WRFVAR3
First-Guess at Appropriate Time (FGAT): An option in WRF-3DVar that allows the observations to be applied at the correct time, rather than at the middle of the time window.
09Z 10Z 11Z 12Z 13Z 14Z 15Z
obs
FG
09Z 10Z 11Z 12Z 13Z 14Z 15Z
obsobs obs obs obs obs obs
FG FG FG FG FG FGFG
Analysis timeTime window=3hrNum_fgat_time=1
Time window=3hrNum_fgat_time=7
Namelist - WRFVAR4
• Use_obstype: Set to true to use particular observation types.– E.g, use_gpsrefobs=.true.: Assimilate GPS refractivity
observations if any available in the data file.
• Use_obs_errfac: Option for using tuned observation error.– .false. : Default. At this moment, please use this option.– .true. : Use tuned observation error statistics (need to
produce errfac.dat beforehand created by da_tune_obs_desrozier.f).
Namelist - WRFVAR5
• Check_max_iv: Option for WRF-Var internal QC procedure, which is basically a maximum observation error check based on the innovations (Obs-Background).– .true. : default
– .false: Use this option only if the observation data have been cleaned before going into WRF-Var.
• Put_rand_seed:• Omb_set_rand: • Omb_add_noise:
For observation error tuning.
• Obs_qc_pointer: – 0 : Default, Good data. For ASCII observation files generated by OBSPROC, QC flag value ranges
from -88 to 88 (please refer to the latest QC flags from OBSPROC).– qc = -88 : Missing data qc = 0 : Good data qc = -77 : Outside of horizontal domain qc = -15 : Wind direction <0 or > 360 degrees qc = -14 : Negative wind speed vector norm qc = -13 : Null wind speed vector norm qc = -12 : Spike in the wind profile qc = -11 : Null temperature or dew point qc = -10 : Superadiabatic temperature qc = -9 : Spike in Temperature profile qc = -8 : Height higher than model lid's height qc = -5 : h,p or T from standard atmosphere qc = -4 : h,p or T from background qc = 1 : convective adjustement correction qc = 2 : surface_correction qc = 3 : Height recovery from hydrostaic + OBS qc = 4 : Height recovery from reference + OBS qc = 88 : Any other check
For PREBUFR observation files generated by OBSPROC, qc = 0 indicates the best quality (please refer to the latest QC flags from OBSPROC).
Namelist - WRFVAR5 (Cont.)
if (qc .le. 128 .and. qc .ge. -5 ) then qz = 0else qz = 4 ! >= 4 is rejectendif
Namelist - WRFVAR6
The following namelist variables are for minimization options:
• Max_ext_its: Number of outer loops.– 1: Default. Only one outer loop.– Currently, maximum outer loop number is 10.
• Ntmax: Maximum number of iterations in an inner loop for the minimization in WRF-Var.
– 200: Default. The minimization in the inner loop can not exceed 200.
• Eps: Value for minimization convergence criterion. It is an array with the dimension=max_ext_its.
– 0.01(max_ext_its): The minimization is considered to converge when the norm of the cost function gradient is reduced at least 2 orders.
Minimization
i≥ntmaxor
|Jnew|< eps• |J|
Update first guess
j ≥ max_ext_its
No
Yes
i=i+1
j=j+1
No
Yes
Outer
Inner
Namelist - WRFVAR7• Rf_passes: number of passes of
recursive filter used in WRF-Var to define the horizontal correlation shape of background errors.
• Var_scaling1(2,…5): The tuning factor of background error covariance for control variables. Control variables:
1: stream function 2: unbalanced potential velocity 3: unbalanced temperature 4: pseudo relative humidity 5: Unbalanced surface pressure
• Len_scaling1(2,…5): The tuning factor of scale-length for control variables.
An example of pseudo single observation test (PSOT)
T
u
• Test_transforms: – .false. (default): Run data assimilation.
– .true.: Perform adjoint check for the code debugging.
Namelist - WRFVAR10
• Cv_options_hum: – 1 (default): Please do not change.
• Check_rh: 0 : No supersaturation check after minimization.1: With the supersaturation (rh> 100%) and minimum rh (rh<10%) check, and make the local adjustment of q.2 (default): With the supersaturation (rh> 95%) and minimum rh (rh<11%) check, and make the multi-level q adjustment under the constraint of integrated water vapor in column conserved.
– 1 (default): The surface observations will be assimilated based on the lowest model level first guess.
– 2: The surface observations will be assimilated based on surface similarity theory in PBL. Innovations are computed based on 10-m wind and 2-m temperature & moisture.
For ensemble perturbation purpose.
Please use this option with caution, since the results could be very sensitive.
• Lat_stats_option: .False. (default). Only set it true when be.dat is computed with i-dependence (approximately latitude-dependence) .
Namelist - WRFVAR11
The following namelist variables are related to Background Error (BE) computation and should be consistent to those in BE file (be.dat) computed from GEN_BE (July 22: BE talk).
Namelist - WRFVAR13
• Vert_corr: 2 (default). Please do not change it at this moment.• Vertical_ip: 0 (default). Not used.• Vert_evalue: 1 (default). Please do not change it at this moment.• Max_vert_var1(2,…5): Maximum truncation value (percentage) used in the
vertical eigenvector decomposition in BE calculation.
• Balance_type: 1 (default). Not used.
Namelist - WRFVAR12
• num_pseudo = 0 (default), Set the number of pseudo observations. Currently only the value of 1 is allowed, i.e. num_pseudo = 1 --- the SINGLE-OBS test.• pseudo_x = 1.0 (default), Set the x-position (J) of the OBS in unit of grid-point.• pseudo_y = 1.0 (default), Set the y-position (I) of the OBS in unit of grid-point.• pseudo_z = 1.0 (default), Set the z-position (ZK) of OBS with the vertical level index. In MM5, the top level has z=1, and bottom level, z=kx.• pseudo_val = 1.0 (default), Set the innovation of the OBS variable: u/v at m/s, p at Pa, t at degree, and q at kg/kg.• pseudo_err = 1.0 (default), Set the OBS error of the OBS variable.
Namelist - WRFVAR15
• pseudo_var = 't' (default) Set the name of the OBS variable: 'u' = X-direction component of wind, 'v' = Y-direction component of wind, 't' = Temperature, 'p' = Pressure, 'q' = Specific humidity, 'pw' = Total precipitable water, 'ztd' = Zenith tropospheric delay, 'ref' = Refractivity
Namelist - WRFVAR19
The namelist variables here are for pseudo single-observation test (PSOT) (July 22: Single ob experiment talk).
u v
T q
• Analysis_type: Indicate job type of WRF-Var.– 3D-VAR (default): Run 3D-Var data assimilation.– VERIFY: Run WRF-Var verification mode ( then Check_max_iv=.false.
and ntmax=0 by default). July 22: WRF-Var tools Talk.– QC-OBS: Run WRF-Var QC procedure. By combined with Check_max_iv=.true. and ntmax=0, you can produce
a WRF-Var filtered (QCed) observation data set (filtered_obs) without running the data assimilation.
Namelist - WRFVAR17
In AMPS, 60% SYNOP obs were rejected.
1st screen/QC procedure performed by observation preprocessor (OBSPROC).
2nd screen/QC procedure performed in WRF-Var.
Main impact of 2nd screen/QC is on surface observations*.
Rejection rates will reduce with higher resolution, higher-order interpolation.
* Surface observation rejection here is mostly due to surface elevation check with sfc_assi_options=1. Such a rejection may be bypassed by using sfc_assi_options=2.
check_max_ivcost_fnfiltered_obs (analysis_type=“QC-OBS”)grad_fngts_omb_omajostatisticsunpert_obspert_obs (omb_add_noise=true)runtime.log or rsl.out.0000
WRF-Var diagnostics
ASCII output files in the WRF-Var working directory
For outer iteration 1, Total Rejections for Synop follows:
Number of failed u-wind observations: 25 on 230Number of failed v-wind observations: 30 on 230Number of failed pressure observations: 5 on 230Number of failed temperature observations: 0 on 230Number of failed mixing ratio observations: 1 on 230Finally Total Synop rejections 61 on 1150
Err_max failed:ID=47843FM-12 SYNOP Ix= 204 Ixf= 30 Err_max ratio = 1.3 for V inv, error: 0.708141E+01 0.110000E+01Err_max < 0 ==> 0.0 -4444440.0 5.0 for V OBS ID: 98752FM-12 SYNOP LA/LON/ELV: 9.93 125.51 46.00
check_max_iv
&wrfvar1 CHECK_MAX_IV_PRINT=true (default)
&wrfvar5 CHECK_MAX_IV=true (default)
Check for observations with innovations (O-B) larger than [ factor observation error ]
factors are hard-wired in var/da/da_control/da_control.f90
Synop: u, v, t, p, qMetar: u, v, t, p, qShip: u, v, t, p, qGeoamv: u, vPolaramv: u, vGpspw: tpwSound: u, v, t, qSonde_sfc: u, v, t, p, qAirep: u, v, tPilot: u, vSatem: thicknessQscat: u, vProfiler: u, vBuoy: u, v, t, p, qAirsr: t, qGpsref: ref
listed variables of each observation type vary:
gts_omb_oma is used invar/graphics/ncl/plotobs.nclvar/da/da_verif_obs/da_verif_obs.f90
complete point-by-point, detailed observation information
• SATOB are separated as geoamv and polaramv in WRF-Var
• AMDAR and AIREP are grouped as airep in WRF-Var
statistics
Diagnostics of OI for synop
var u (m/s) n k v (m/s) n k t (K) n k p (Pa) n k q (kg/kg) n k
jo is written out in var/da/da_minimisation/da_get_var_diagnostics.inc
Sum of individual Jo (numbers in red boxes)equals the printout value in rsl.out.0000 Final value of Jo = 28880.81069
cost function of each observation type
Blue boxes are observation error factor used in WRF-Var.
To apply observation error tuning factors:prepare an ASCII errfac.dat (or an output from da_util/da_tune_obs_desroziers.f90 )and run WRF-Var with&wrfvar4 use_obs_errfac=true
errfac.dat is read in var/da/da_obs_io/da_read_errfac.inc
unpert_obs is written out in var/da/da_obs_io/da_write_y.incpert_obs (y=H(x’(yo+noise)))
Synop: u, v, t, p, qMetar: u, v, t, p, qShip: u, v, t, p, qGeoamv: u, vPolaramv: u, vGpspw: tpwSound: u, v, t, qSonde_sfc: u, v, t, p, qAirep: u, v, tPilot: u, vSatem: thicknessQscat: u, vProfiler: u, vBuoy: u, v, t, p, qAirsr: t, qGpsref: ref
listed variables of each observation type vary:
unpert_obs and pert_obs, together with other files, are used in var/da/da_util/da_tune_obs_desroziers.f90Reference: Desroziers, G. and S. Ivanov, 2001: Diagnosis and adaptive tuning of observation-error parameters in a variational assimilation. Q. J. R. Meteorol. Soc., 127, 1433-1452.
Observation error tuning
Data used in calculating tuning factors:
a collection of unpert_obs, jo and rsl.out.0000 from regular WRF-Var runsa collection of rand_obs_error and pert_obs from perturbed WRF-Var runs
Steps:
(1) a series of WRF-Var regular runs to collect unpert_obs [y = H(x'(yo)) of each obs type], jo [Jo of each obs type], and rsl.out.0000 which contains the final total cost function (J, Jo, Jb) information
(2) a series of WRF-Var perturbed runs (&wrfvar5 omb_add_noise = .true.) to collect rand_obs_error [noise of each obs type] and pert_obs [yp = H(x'(yo+noise)) of each obs type]
(3) run da_tune_obs_desroziers.exe to generated errfac.dat
wrf forecasts from 4 different initial times, each wrfout contains, for example, 00h, 12h, 24h forecasts
EXP1 and EXP2 have different types of observations assimilated - testing impact of synop
Step 1: generate one set of observations to be used for verifying wrf forecasts
Step 2: run WRF-Var with the observations from step 1 and with each forecast you want to verify as a first-guess to collect O-F (observation minus forecast) values, i.e. gts_omb_oma and statistics.
Step 3: graphics/visualization
Pre-Step 2: split wrf output so that each file contains data from only one time.
WRF-Var does not actually do QC except for (1) rejecting observations that fail check_max_iv
check when check_max_iv = true(2) rejecting surface observations with larger than
100m height difference between model and observation when sfc_assi_options = 1
(3) Rejecting observations below the lowest model level and above the highest model level
filtered_obs (in the same format as obs_gts*.3DVAR) will be used in Step 2.
Purpose: to write out goodgood observationswith respect to the background used
Step 2: run WRF-Var with the filtered observations from step 1 and with each forecast or analysis you want to verify as a first-guess to collect O-F (observation minus forecast) values, i.e. gts_omb_oma and statistics.
Run WRF-Var with the settings:
&wrfvar5 check_max_iv=false
&wrfvar6 ntmax=0
(only O-B information is needed, no need to go through minimization)
Pseudo single obs test plottingvar/scripts/da_plot_psot.kshvar/graphics/ncl/psot_xy_auto.nclvar/graphics/ncl/psot_xz_auto.nclvar/graphics/ncl/psot_yz_auto.ncl
var/graphics/ncl/WRF-Var_plot.nclWRF_contributed.ncl.test (procedure WRF_map_c for setting map resources)
kl = 18fg = first_guess->Uan = analysis->Uplot_data = an
Alternative tools WRF tutorial: Post-processing Tools (1): NCL by Cindy Bruyere WRF tutorial: Post-processing Tools (3): RIP by Cindy Bruyere
Reads in WRF-Var ASCII output: cost_fn and grad_fn
Run WRF-Var with&wrfvar11 CALCULATE_CG_COST_FN=trueto get cost function value of each iteration
However, CALCULATE_CG_COST_FN=true increases run-time significantly.Default setting in Registry.wrfvar is CALCULATE_CG_COST_FN=false
Eta-level plots only
Reads in WRF netCDF files: wrfinput_d01 and wrfvar_output
var/graphics/ncl/plotobs.ncl
; method 1: set a 2-D array of bounded pressure levels in hPaplevs = (/ (/1005.,995./),(/930.,920./),(/855.,845/),(/705.,695./) /); plevs = (/ (/1050.,0./),(/-999.,-999./) /)
; method 2: set a 1-D array of fixed pressure levels in hPa; plevs = (/ 1000., 850., 500., 300., 250., 200., 150., 100. /)
mapinfo_from_file = Truefname=“wrfinput_d01”; subdomain = Truesubdomain = Falseif ( subdomain ) then ; subdomain needs to be a lat-lon box maxlat = 35. minlat = 25. maxlon = -75. minlon = -90.end if
Reads in WRF-Var ASCII output: gts_omb_oma
I guess the 'QC' term used in the plots is somewhat misleading. Please refer to p.17 of this presentation about the meaning of “QC”.
The information stored in gts_omb_oma is obs, omb, oma. Background value is calculated using obs - omb.Analysis value is calculated using obs - oma.In the case of a rejected obs, its ombis 0, which leads to obs = bak.All rejected observations show up on the scatter plots on the diagonal line.The shape of 'before QC' and 'after QC' scatter plots are the same, with 'before QC' having lower mean and rms values because of those obs=bak points.
The information stored in gts_omb_oma is obs, omb, oma.
Background value is calculated usingobs - omb.
Analysis value is calculated using obs - oma.
In the case of a rejected obs, its omb is set to be 0, which leads to obs = bak.
All rejected observations show up on the scatter plots on the diagonal line.The shape of 'before QC' and 'after QC' scatter plots are the same, with 'before QC' having lower mean and rms values because of those obs=bak points.