The WRF model has two large classes of simulations
that it is able to generate: those with an ideal
initialization and those utilizing real
data. The idealized simulations
typically manufacture an initial condition file for the WRF model from an
existing 1-D or 2-D sounding and assume a simplified analytic orography. The real-data cases usually require
pre-processing from the WPS package, which provides each atmospheric and static
field with fidelity appropriate to the chosen grid resolution for the
model. The WRF model executable itself
is not altered by choosing one initialization option over another (idealized vs. real), but the WRF model
pre-processors (the real.exe and ideal.exe programs) are specifically built
based upon a user's selection.
The real.exe and
ideal.exe programs are never used together.
Both the real.exe and ideal.exe are the programs that are processed just
prior to the WRF model run.
The ideal vs. real cases are divided as follows:
The selection of the
type of forecast is made when issuing the ./compile statement. When selecting a different case to study, the
code must be re-compiled to choose the correct initialization for the
model. For example, after configuring
the setup for the architecture (with the ./configure command), if the user issues
the command ./compile em_real, then the initialization program is built using module_initialize_real.F as the target module (one of
the ./WRF/dyn_em/module_initialize_*.F files).
For the ideal
initializations, there is a combination of files that may used to build the
executable. For the
em_fire, em_heldsuarez, em_scm_xy, and em_tropical_cyclone cases, a separate
initialization file exists. For the remainder of the idealized cases, the file ./WRF/dyn_em/module_initialize_ideal.F is used. Note that the WRF
forecast model is identical for both of these initialization programs. In each of these initialization modules, the
same sort of activities goes on:
Both the real.exe
program and ideal.exe programs share a large portion of source code, to handle
the following duties:
The real-data case
does some additional processing:
The
“real.exe” program may be run as either a serial or a distributed memory
job. Since the idealized cases only
require that the initialization run for a single time period (no lateral
boundary file is required) and are, therefore, quick to process, all of the
“ideal.exe” programs should be run on a single processor. The Makefile for the 2-D cases will not allow
the user to build the code with distributed memory parallelism. For large 2-D cases, if the user requires
OpenMP, the variables numtiles_x and numtiles_y
must be set in the domains portion of the namelist
file namelist.input (numtiles_y must be set to 1, and numtile_x
then set to the number of OpenMP threads).
The
program "ideal.exe" is the program in the WRF system that allows a
user to run a controlled scenario.
Typically this program requires no input except for the namelist.input
and the input_sounding
files. There are exceptions, for example for the baroclinic wave case uses a
2-D binary sounding file. The program outputs the wrfinput_d01
file that is read by the WRF model executable ("wrf.exe"). Since no external data is required to run the
idealized cases, even for researchers interested in real-data cases, the
idealized simulations are an easy way to ensure that the model is working correctly
on a particular architecture and compiler.
Idealized
runs can use any of the boundary conditions except "specified",
and are not in general set up to run with sophisticated physics. Most have no
radiation, surface fluxes or frictional effects (other than the sea breeze
case, LES, and the global Held-Suarez).
The idealized cases are mostly useful for dynamical studies, reproducing
converged or otherwise known solutions, and idealized cloud modeling. Again
there are exceptions. The tropical cyclone case lacks only radiation schemes,
and the sea breeze case has a full complement of parameterization options.
There
are 1-D, 2-D and 3-D examples of idealized cases, with and without topography,
and with and without an initial thermal perturbation. The namelist can control
the size of the domain, number of vertical levels, model top height, grid size,
time step, diffusion and damping properties, boundary conditions, and physics
options. A large number of existing
namelist settings are already found within each of the directories associated
with a particular case.
The
input_sounding
file (already in appropriate case directories) can be any set of levels that
goes at least up to the model top height (ztop)
in the namelist. The first line includes the surface pressure (hPa), potential
temperature (K) and moisture mixing ratio (g/kg). Each subsequent line has five input values:
height (meters above sea-level), dry potential temperature (K), vapor mixing
ratio (g/kg), x-direction wind component (m/s), and y-direction wind component
(m/s). The “ideal.exe” program
interpolates the data from the input_sounding
file and will extrapolate if not enough data is provided.
The
base state sounding for idealized cases is the initial sounding, minus the
moisture, and therefore does not have to be defined separately. Note for the baroclinic wave case: a 1-D
input sounding is not used because the initial 3-D arrays are read-in from the
file input_jet.
This means for the baroclinic wave case, the namelist.input
file cannot be used to change the horizontal or vertical dimensions since they
are specified in the input_jet
file.
Making
modifications, apart from namelist-controlled options or soundings, has to be
done by editing the Fortran code. Such modifications would include changing the
topography, the distribution of vertical levels, the properties of an
initialization thermal bubble, or preparing a case to use more physics, such as
a land-surface model. The Fortran code to edit is contained in ./WRF/dyn_em/module_initialize_[case].F,
where [case]
is the case chosen in compilation, e.g. module_initialize_fire.F.
or module_initialize_ideal.F. The subroutine to modify is init_domain_rk.
To change the vertical levels, only the 1-D array znw
must be defined, containing the full levels, starting from 1 at k=1, and ending
with 0 at k=kde. To change the topography, only the 2-D array ht
must be defined, making sure it is periodic if those boundary conditions are
used. To change the thermal perturbation bubble, search for the string
"bubble" to locate the code to change.
Each
of the ideal cases provides an excellent set of default examples to the
user. The method to specify a thermal
bubble is given in the super cell case. In the hill2d case, the topography is
accounted for properly in setting up the initial 3-D arrays, so that example
should be followed for any topography cases.
A symmetry example in the squall line cases tests that your indexing
modifications are correct. Full physics
options are demonstrated in the seabreeze2d_x case.
Available Ideal Test Cases
The
available test cases are
The
real-data WRF cases are those that have the input data to the “real.exe”
program provided by the WRF Preprocessing System (WPS). This data from the WPS was
originally generated from a previously-run external analysis or forecast model.
The original data was most-likely in GriB format and was most-likely
ingested into the WPS by first pulling the raw GriB data from one of the
national weather agencies’ anonymous ftp sites.
For example, suppose
a single-domain WRF forecast is desired, with the following criteria:
The following coarse-grid files will be generated by the WPS (starting date through ending date, at 6-h increments):
The convention is to use "met_" to signify data that is output from the WPS “metgrid.exe” program and input into the “real.exe” program. The "d01" portion of the name identifies to which domain this data refers, which permits nesting. The next set of characters is the validation date/time (UTC), where each WPS output file has only a single time-slice of processed data. The file extension suffix “.nc” refers to the output format from WPS which must be in netCDF for the “real.exe” program. For regional forecasts, multiple time periods must be processed by “real.exe” so that a lateral boundary file is available to the model. The global option for WRF requires only an initial condition.
The WPS package
delivers data that is ready to be used in the WRF system by the “real.exe”
program.
Real Data Test Case: 2000
January 24/12 through 25/12
Considerations for Recent
Releases
With the WRF v4.0 release, the default behavior is to include the moist potential temperature option and to include the hybrid vertical coordinate. These two options make backward compatibility difficult.
The initial moist potential temperature capability was introduced in the WRF system with v3.8. In v3.8 through v4.0, all of the processing for moist theta was handled by the model. This caused repeated toggling back and forth inside the main solver routine, so that the definition of the variable grid%t_2 was dependent on the location within the routine. The code has now been properly ported so that the moist theta option is incorporated in the real/ideal pre-processor, and the meaning of the grid%t_2 variable is always the same. With v4.0, all of the real and ideal cases support the moist potential temperature option. Because the v4.0 code assumes that the input variables are consistent with the namelist setting for moist theta, wrfinput_d0x and wrfbdy_d01 files from earlier versions may not generally be used.
If the user has older input data (pre v4.0), and if the user turns off the moist theta option, then the wrfinput_d0x and wrfbdy_d01 data may be used.
If the user turns on the moist potential temperature option, only new wrfinput_d0x and wrfbdy_d01 data may be used.
Since v3.9, the WRF code supported a hybrid vertical coordinate, but only for the real data initialization and the flow over a 2d hill case. With v4.0, all of the real and ideal cases support the use of the HVC. The same sort of proscriptions applies with the hybrid vertical coordinate as with the moist theta option.
If the user has older input data (pre v4.0) that does not use HVC, and if the user turns off the hybrid vertical coordinate option in the WRF model, then the wrfinput_d0x and wrfbdy_d01 data may be used.
If the user turns on the HVC option, only new wrfinput_d0x and wrfbdy_d01 data may be used.
Starting with v4.0, a new namelist option is available (force_use_old_data = .TRUE.) to explicitly allow bringing in old wrfinput_d0x and wrfbdy_d01 files to the WRF model.
Setting Model Vertical Levels
Users
may explicitly define full eta levels using the namelist option eta_levels. Given are two distributions for 28 and 35
levels. The number of levels must agree
with the number of eta surfaces allocated (e_vert). Users may alternatively request only the
number of levels (with e_vert), and the real program will compute values. From V4.0 there are two methods that can be selected
with auto_levels_opt = 1 (old) or 2 (new). The old computation assumes a known
first several layers, then generates equi-height spaced levels up to the top of
the model. The new method has surface and upper stretching factors (dz_stretch_s
and dz_stretch_u) to stretch levels according to log p, up to the point of
maximum thickness (max_dz), and starting from thickness dzbot. The stretching
transitions from dzstretch_s to dzstretch_u by the time the thickness reaches
max_dz/2.
Minimum number of levels as function of
dzstretch and p_top for dzbot=50 m and max_dz=1000 m
dzstretch\ptop |
50 |
30 |
20 |
10 |
1 |
1.1 |
44 |
47 |
50 |
54 |
67 |
1.2 |
32 |
35 |
37 |
41 |
54 |
1.3* |
28 |
31 |
33 |
37 |
50 |
*1.3 reaches 1 km thickness below about 5 km (level 13) – probably not recommended
1.2 reaches 1 km thickness at around 7 km (level 19)
1.1 reaches 1 km thickness at around 13 km (level 36)
dzstretch = 1.1 has 12 levels in lowest 1 km, 34 levels below 10 km
dzstretch = 1.2 has 9 levels in lowest 1 km, 22 levels below 10 km
dzstretch = 1.3 has 8 levels in lowest 1 km, 18 levels below 10 km
Minimum number of levels when dzstretch_s and dzstretch_u are used
dzstretch\ptop |
50 |
30 |
20 |
10 |
1 |
1.2-1.02 |
53 |
58 |
62 |
67 |
81 |
1.2-1.04 |
46 |
49 |
51 |
55 |
68 |
1.2-1.06 |
41 |
44 |
47 |
50 |
63 |
1.3-1.1 |
33 |
36 |
39 |
43 |
56 |
To avoid having max thickness in the upper troposphere, stretching levels need to extend above the tropopause before going to constant d (logp). This can be done by using low enough dzstretch_u values (but larger than ~1.02) to reach the tropopause, while also stretching fast enough to compensate lapse rate.
Two other namelists can be used to add flexibility: dzbot, which is the thickness of the first model layer between full levels (the default value is 50 m), and max_dz, which is the maximum layer thickness allowed with the default value of 1000 m.