WRF学习之 ch5 WRF模式(二)运行WRF(a-c): 理想个例,真实个例,重启运行【待译】
Chapter 5: WRF Model
from https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.1/users_guide_chap5.html
Table of Contents
• Introduction
• Installing WRF
• Running WRF
o Idealized Case
o Real Data Case
o Restart Run
o Two-Way Nested Runs
o One-Way Nested Run Using ndown
o Moving Nested Run
o Analysis Nudging Runs
o Observation Nudging
o Global Run
o DFI Run
o SST Update
o Using bucket_mm and bucket_J options
o Adaptive Time Stepping
o Stochastic Parameterization Schemes
o Run-Time IO
o Output Diagnostics
o WRF-Hydro
o Using IO Quilting
o Using Physics Suites
o Hybrid Vertical Coordinate.
• Examples of namelists for various applications
• Check Output
• Trouble Shooting
• Physics and Dynamics Options
• Summary of PBL Physics Options
• Summary of Microphysics Options
• Summary of Cumulus Parameterization Options
• Summary of Radiation Options
• Description of Namelist Variables
• WRF Output Fields
• Special WRF Output Variables
Running WRF
One may run the model executables in either the run/ directory, or the test/case_name directory. In either case, one should see executables ideal.exe or real.exe (and ndown.exe), and wrf.exe, linked files (mostly for real-data cases), and one or more namelist.input files in the directory.
Hint: If you would like to run the model executables in a different directory, copy or link the files in the test/em_* directory to that directory, and run from there.
a. Idealized case
Suppose the test case em_squall2d_x is compiled. To run, type
cd test/em_squall2d_x
Edit the namelist.input file (see README.namelist in the WRF/run/ directory or its web version) to change length of integration, frequency of output, size of domain, timestep, physics options, and other parameters.
If you see a script in the test case directory, called run_me_first.csh, run this one first by typing:
./run_me_first.csh
This links some physics data files that might be needed to run the case.
To run the initialization program, type
./ideal.exe
This program will typically read an input sounding file located in that directory, and generate an initial condition file wrfinput_d01. All idealized cases do not require a lateral boundary file because of the boundary condition choices they use, such as the periodic option. If the job is run successfully, the last thing it prints should be: ‘wrf: SUCCESS COMPLETE IDEAL INIT’.
To run the model and save the standard output to a file, type
./wrf.exe >& wrf.out &
or for a 3D test case compiled with MPI (dmpar) option,
mpirun –np 4 ./wrf.exe
If successful, the wrf output file will be written to a file named
wrfout_d01_0001-01-01_00:00:00.
Pairs of rsl.out.* and rsl.error.* files will appear with any MPI runs. These are standard out and error files. Note that the execution command for MPI runs may be different on different machines and for different MPI installation. Check the user manual.
If the model run is successful, the last thing printed in the ‘wrf.out’ or rsl..0000 files should be: ‘wrf: SUCCESS COMPLETE WRF’. Output files wrfout_d01_0001-01-01 and wrfrst* should be present in the run directory, depending on how namelist variables are specified for output. The time stamp on these files originates from the start times in the namelist file.
b. Real-data case
To make a real-data case run, cd to the working directory by typing
cd test/em_real (or cd run)
Start with the namelist.input template file in the directory and edit it to match your case.
Running a real-data case requires successfully running the WRF Preprocessing System programs (or WPS). Make sure met_em.* files from WPS are seen in the run directory (either link or copy the files):
cd test/em_real
ls –l ../../../WPS/met_em*
ln –s ../../..WPS/met_em* .
Make sure you edit the variables in the &time_control and &domains sections of the namelist.input file (the description of the namelists can be found in the later part of this chapter):
&time_control
run_days = 0,
run_hours = 24,
run_minutes = 0,
run_seconds = 0,
start_year = 2000, 2000, 2000,
start_month = 01, 01, 01,
start_day = 24, 24, 24,
start_hour = 12, 12, 12,
end_year = 2000, 2000, 2000,
end_month = 01, 01, 01,
end_day = 25, 25, 25,
end_hour = 12, 12, 12,
interval_seconds = 21600
input_from_file = .true.,.true.,.true.,
history_interval = 180, 60, 60,
frames_per_outfile = 1000, 1000, 1000,
/
&domains
time_step = 180,
max_dom = 1,
e_we = 74, 112, 94,
e_sn = 61, 97, 91,
e_vert = 30, 30, 30,
p_top_requested = 5000,
num_metgrid_levels = 27,
num_metgrid_soil_levels = 4,
dx = 30000, 10000, 3333.33,
dy = 30000, 10000, 3333.33,
grid_id = 1, 2, 3,
parent_id = 0, 1, 2,
i_parent_start = 1, 31, 30,
j_parent_start = 1, 17, 30,
parent_grid_ratio = 1, 3, 3,
parent_time_step_ratio = 1, 3, 3,
/
Make sure that the dates and dimensions of the domain match those set in WPS. If only one domain is used, entries in other columns will be ignored.
Other options for use to assist vertical interpolation in &domains are:
interp_type = 2
extrap_type = 2
t_extrap_type = 2
lowest_lev_from_sfc = .false.
use_levels_below_ground = .true.
use_surface = .true.
lagrange_order = 1
force_sfc_in_vinterp = 1
zap_close_levels = 500
sfcp_to_sfcp = .false.
adjust_heights = .false.
smooth_cg_topo = .false.
To run the real-data initialization program, compiled using serial or OpenMP (smpar) options, type
./real.exe >& real.out
Successful completion of the job should have ‘real_em: SUCCESS EM_REAL INIT’ printed at the end of the real.out file. It should also produce wrfinput_d01 and wrfbdy_d01 files. In the real data case, both files are required.
Run the WRF model by typing
./wrf.exe
A successful run should produce one or several output files with names like wrfout_d
wrfout_d01_2000-01-24_12:00:00
The time stamp on the file name is always the first time the output file is written. It is always good to check the times written to the output file by typing:
ncdump -v Times wrfout_d01_2000-01-24_12:00:00
You may have other wrfout files, depending on the namelist options (how often you split the output files is determined by the namelist option frames_per_outfile). You may also create restart files if you have a restart frequency (restart_interval in the namelist.input file) set within your total integration time. The restart file(s) should have the following naming convention
wrfrst_d
The time stamp on a restart file is the time at which that restart file is valid.
For DM (distributed memory) parallel systems, some form of the mpirun command will be needed to run the executables. For example, on a Linux cluster, the command to run MPI code, using 4 processors, may look like:
mpirun -np 4 ./real.exe
mpirun -np 4 ./wrf.exe
or
mpiexec_mpt ./wrf.exe (on NCAR’s cheyenne)
c. Restart Run
A restart run allows a user to extend a run to a longer simulation period. It is effectively a continuous run made of several shorter runs. Hence the results at the end of one or more restart runs should be identical to a single run without any restart.
In order to do a restart run, one must first create a restart file. This is done by setting the namelist variable restart_interval (default unit is in minutes) to be equal to or less than the simulation length in the first model run, as specified by run_* variables or start_* and end_* times. When the model reaches the time to write a restart file, a restart file named wrfrst_d
When one starts the restart run, edit the namelist.input file, so that your start_* time will be set to the restart time (which is the time the restart file is written). The other namelist variable one must set is restart, this variable should be set to .true. for a restart run.
In summary, these namelist entries should be modified:
start_, end_: start and end times for restart model integration
restart: logical to indicate whether the run is a restart or not
If the history and restart intervals are changed in a restart run, and the outcome isn’t what is expected to be, use namelist ‘override_restart_timers = .true.’.
If history output is desired at the time of restart, use namelist ‘write_hist_at_0h_rst = .true.’
Hint: Typically the restart file is several times the size of the history file, hence one may find that it is even ok to write a single model history output time to a file in netCDF format (frame_per_outfile=1), but it may fail to write a restart file. This is because the basic netCDF file support is only 2Gb (since WRF v3.9, this restriction is removed by default). There are two solutions to the problem. The first is to simply set the namelist option io_form_restart = 102 (instead of 2), and this will force the restart file to be written into multiple pieces, one per processor. As long as one restarts the model using the same number of processors, this option works well (and one should restart the model with the same number of processors in any case). The second solution is to recompile the code using the netCDF large file support option (for WRF versions before v3.9: see the section on “Installing WRF” in this chapter).
2020-04-13 12:54