HWRF  trunk@4391
__init__.py
1 """!High-level logic of the HWRF Python scripts.
2 
3 @section scripting_layer Scripting Layer
4 
5 The scripts package contains the high-level logic of the HWRF
6 system. These are command line executable scripts that can be run
7 manually, or by the workflow layer (such as the wrappers, Rocoto or
8 the J-Jobs via ecFlow). Their job is to pass control on to the hwrf
9 and pom packages to actually do the work of running the HWRF system.
10 
11 Generally, these are all simple Python scripts which load the
12 hwrf_expt module, import some of its objects and tell them to
13 execute part of the workflow. All of these scripts will log an
14 initial message and a final success or failure message to the main
15 log stream, the jlogfile.
16 
17 Most of the Python scripts in this directory follow a standard
18 pattern:
19  1. Initialize the produtil.setup and hwrf_expt Python modules.
20  2. Log a message to the produtil.log.jlogger saying that the
21  script is starting.
22  3. Import one or more hwrf.hwrftask.HWRFTask objects and call
23  their run() methods.
24  4. Log a message to the produtil.log.jlogger saying the script has
25  succeeded or failed.
26 
27 The actual logic of how to run the HWRF system is in the hwrf
28 package, and the connections between the various HWRF components is
29 made in the hwrf_expt module, and its various helper modules (such
30 as hwrf.init and hwrf.hwrfsystem).
31 
32 In some cases, the Scripting Layer has to do significant extra
33 processing in order to glue everything together. For example, the
34 exhwrf_output has to copy many Tasks' outputs to the COM directory
35 or elsewhere. The exhwrf_post has to run several Tasks at the same
36 time and does so with a sophisticated loop. The exhwrf_products has
37 a similar problem which it solves by running multiple scripts at the
38 same time in different MPI ranks.
39 
40 @section script_overview Scripting Layer Contents
41 
42 This section describes the relationships between the various
43 scripts, and references useful pages of documentation. Pages in
44 parentheses are hwrf and pom package documentation.
45 
46 @subsection launcher_scripts HWRF Launching Script
47 
48 There is one script that must be run first:
49 
50 * exhwrf_launch --- sets up the workflow for a particular forecast cycle
51 
52 That launcher job creates the directory structure, database files
53 and other critical initial files needed by the HWRF system. It will
54 also run sanity checks to see if the system will be able to run the
55 requested configuration.
56 
57 @subsection pulling_pushing Data Pulling/Pushing Scripts
58 
59 These scripts pull data from tape or over the internet to serve as
60 input to the HWRF, or they push the data to tape for storage. This
61 is needed because a full-scale test of the HWRF system cannot
62 generally fit on disk. The needed input from four years of GFS,
63 GDAS and GFS ENKF runs also will not fit on disk. Instead, it is
64 placed on tape, and pulled to disk as needed.
65 
66 * exhwrf_input --- pulls data for input (hwrf.input) to HWRF
67 * exhwrf_bufrprep --- turns data tanks into bufr files for
68  exhwrf_gsi's consumption (hwrf.bufrprep, hwrf.gsi)
69 * exhwrf_para_archive --- pushes data to tape after HWRF has finished
70 * exhwrf_wrfout_archive --- special extra archiving job for native wrfout files
71 
72 @subsection initialization_scripts Initialization Scripts
73 
74 After the parent model and observational data has been pulled from
75 tape (or wherever) it must then be processed to create initial and
76 boundary conditions. Here are the initialization jobs in
77 approximate order they appear in the workflow:
78 
79 * exhwrf_ocean_init --- generates ocean initial and boundary
80  conditions (hwrf.mpipomtc, pom) from data pulled by the
81  exhwrf_input script.
82 
83 * exhwrf_init --- spectral processing (hwrf.prep), interpolation and
84  creation of wrfanl, ghost, wrfinput, wrfbdy and other input files
85  (hwrf.fcsttask) from inputs obtained by the exhwrf_input script.
86  The high-level description of this workflow is created in the
87  hwrf.init module.
88 
89 * exhwrf_relocate --- takes input from the exhwrf_init job, and
90  relocates the vortex, resizing it and changing its intensity if
91  needed (hwrf.relocate)
92 
93 * exhwrf_gsi --- runs the GSI data assimilation system (hwrf.gsi) on
94  the relocated vortex
95 
96 * exhwrf_merge --- merges (hwrf.relocate) the relocated vortex and
97  GSI output to create the final input to WRF
98 
99 @subsection forecast_scripts Forecast and Post-Processing
100 
101 After the initial and boundary conditions are available, the
102 forecast starts, and its output must be converted to forms usable by
103 forecasters.
104 
105 * exhwrf_gsi_post --- post-processes (hwrf.gsipost, hwrf.hwrfsystem)
106  the inputs and outputs of GSI (hwrf.gsi) to create lat-lon GRIB2
107  files suitable for study. This is for examining the effect of
108  data assimilation on the input conditions to the forecast.
109 
110 * exhwrf_forecast --- runs the full-length forecast, either with
111  (hwrf.mpipomtc.WRFCoupledPOM) or without (hwrf.fcsttask.WRFAtmos)
112  ocean coupling. Takes inputs from the exhwrf_ocean_init,
113  exhwrf_init, exhwrf_relocate and exhwrf_merge jobs.
114 
115 * exhwrf_unpost --- deletes the output of the exhwrf_post,
116  exhwrf_products and some of exhwrf_output, allowing the
117  post-processing to be redone.
118 
119 * exhwrf_post --- runs the Unified Post Processor (hwrf.post,
120  hwrf.hwrfsystem) on the output of the exhwrf_forecast to create
121  native grid GRIB files.
122 
123 * exhwrf_products --- runs GRIB regridding utilities (hwrf.gribtask,
124  hwrf.regrib) on the output of the exhwrf_post to create lat-lon
125  GRIB2 output files suitable for use by forecasters. Runs the GFDL
126  vortex tracker (hwrf.tracker) to create a hurricane track file
127 
128 * exhwrf_output --- delivers the output of the exhwrf_products and
129  exhwrf_forecast to their destination. In the operational HWRF,
130  this job also emails the NOAA Senior Duty Meteorologist the AFOS
131  file, which contains the HWRF track.
132 
133 @subsection scripts_ensda Data Assimilation Ensemble
134 
135 The HWRF system is capable of running a 6hr forecast ensemble based
136 on the output of the GFS ENKF. The output of this ensemble is fed
137 into the next HWRF cycle's exhwrf_gsi to be used by hwrf.gsi for
138 generating forecast error covariances.
139 
140 * exhwrf_ensda_pre --- determines if the ensemble should be run
141 
142 * exhwrf_ensda --- runs one member of the forecast ensemble (hwrf.ensda)
143 
144 * exhwrf_ensda_output --- checks to see if the exhwrf_ensda scripts
145  all completed
146 """