# Definitions of _BTXE and _BXE in wrfbdy output

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

#### sunraysmile

##### New member
Hi everyone,

When I checked the results of wrfbdy output, there are two kinds of variables related to QVAPOR: one is QVAPOR_BTXE (BTXS/BTYE/BTYS) and the other one is QVAPOR_BXE (BXS/BYE/BYS). What are the definitions of those suffixes?

Any help could be really appreciated!

Hi,

These variables dictate the value of the variable at each side of the domain:
BXS = x start
BXE = x end
BYS = y start
BYE = y end

And then the following are the time tendencies of the variable at each side of the domain:
BTXS, BTXE, BTYS, BTYE

Thank you for your reply! If I want to add anomalies to the QVAPOR variable during the simulation period, should I change both?

The lateral boundary condition is comprised of two components.
1. The first is the "initial" condition (of each of the lateral boundary time periods). These are the fields that use the suffixes _B[XY][SE].
2. The second is the tendency that takes the field from the "initial" time to the next lateral boundary time. These are the fields that include the letter "T" (tendency) in the suffix: _BT[XY][SE].

Here is some important info to consider:
1. The scalar Qv field in the lateral boundary file is similar to the original Qv field, in that it has the same horizontal and vertical staggering.
2. For all lateral boundary arrays, the first index is the LONG horizontal index. For example, the southern boundary (YS for start of the y-direction) has the fastest incrementing index as "i", from west to east. For the 3d arrays, the second dimension is the vertical (bottom to top ordering), and the third dimension extends from the outer-most extent of the boundary inward. For example, the nominally northern boundary has the third index moving from the outer-most row towards the center of the domain with the index increasing (backwards from the traditional domain indexing).
3. The lateral boundary arrays are mass-weighted (multiplied by a function of pressure).
4. The lateral boundary conditions must match the WRF model's initial condition.

The easiest place to modify the Qv lateral boundaries is in the real program. Look at WRF/dyn_em/module_initialize_real.F, towards the very end of the init_domain_rk routine. Just before all of the HALO exchanges, add in a Fortran DO-loop:
DO j = jts, min(jde-1,jte)
DO k = kts, kte
DO i = its, min(ide,ite)
moist(i,k,j,P_Qv) = moist(i,k,j,P_Qv) + SOME_USER_DEFINED_PERTURBATION
END DO
END DO
END DO
This will cause the initial condition AND the lateral boundary to be modified and to be consistent. This loop will be processed separately for each time period that is input from the metgrid program, so make sure that the random perturbations are not identical during each time loop.

Entirely separate from the above information, note that WRF model does have a stochastic option for modifying the lateral boundaries.

Hi everyone,

suffixes_B and suffixes_BT show really different values in my case. With the unit of QVAPOR being kg/kg, suffixes_B shows the super high value (e.g., 1828) and suffixes_BT has the super low value (e.g., 1.8*10^-5). Both values are not reasonable in my case. Since I intend to modify QVAPOR in the wrf_bdy of d02 and d03 after using ndown, how do I get the real value of QVAPOR at each grid?

There are several 3d values that tend to appear in the lateral boundary file: horizontal winds (u and v), the moist perturbation potential temperature, mixing ratio scalars (vapor, cloud, snow, ice, etc), and geopotential.

Each of these 3d fields is "coupled" or "mass weighted" with the 3d value of d(Pd)/d(eta). These d(Pd)/d(eta) values range from 0 to about 10^5, and are effectively used as scale factors. They DRAMATICALLY change the interpretation of the value of the original field.

Pd(i,k,j) = C3(k) * ( Pds(i,j) - Pt ) + C4(k) + Pt.
The eta array is the full-level values of the vertical coordinate (can be specified in the namelist, or can be computed automatically).
Pt is the model lid (Pa), and defined in the namelist.
The 1d constants (C3 and C4) are computed internally.
The dry surface pressure is Pds.

Then, d(Pd(i,k,j))/d(eta(k)) = C1(k) * ( Pcb(i,j) + Pc(i,j) ) + C2(k).
Pcb is the base column pressure (reference), and Pc is the perturbation column pressure (in the WRF model, these are the 2d mub and mu fields). Care must be taken to use the correct horizontal stagger for mub and mu for the different variables for momentum cell-face staggering vs mass point staggering. Also the internally computed and readily available half-layer vs full-level values of the 1d arrays must match the expected field (potential temperature vs geopotential, for example).

So, the boundary values (the BXE, BYE, BXS, BYS arrays) for the moist fields would be qv(i,k,j)*C1(k) * ( mub(i,j) + mu(i,j) ) + C2(k).

For the suffix:
B = Boundary
X/Y = X or Y lateral boundary
S/E = Start or End

The fields that include the "T" in the suffix are the tendencies of the lateral boundaries. If the data from ungrib is 3-hourly (then metgrid is 3-hourly, then the lateral BC data from the real program is 3-hourly).

The tendency array for the 3d array alpha would be alpha_tend = ( alpha(at hour t + 3h) - alpha(at hour t) ) / 10800 s.

Hello Mr. Dave

Pd(i,k,j) = C3(k) * ( Pds(i,j) - Pt ) + C4(k) + Pt.

What does C3 and C4 stand for?
Can you tell us how to calculate C3 and C4? Or, Is there any reference?