1 """!Combines multiple tasks together to make the HWRF post-processing system.
3 This is a wrapper around the hwrf.post, hwrf.gribtask, hwrf.tracker,
4 hwrf.nhc_products and hwrf.gsipost that creates customizable
5 post-processing tasks. The main purpose of this module is to simplify
6 the hwrf_expt module."""
11 __all__=[
'HWRFGSIPostProcessing',
'HWRFForecastPostProcessing']
24 from hwrf.wrf import WRFDomain,WRFSimulation,ExternalWRFTask
26 from hwrf.regrib import RegribMany,igrb1,clatlon,GRIB2
30 """!Add a domain-centered lat-lon grid to a RegribMany object.
32 Adds to the given hwrf.regrib.RegribMany object a
33 latitude-longitude grid centered on some GRIB product. The grid
34 will be re-centered at every forecast time, so the grid is allowed
35 to move. Centering information comes from the name+"_grid"
36 option in the task's section. The value should be a comma-separated
38 * res1,res2 - grid resolution for GRIB1 grid 255
39 * size1,size2 - size in degrees for GRIB1 grid 255
40 * scan - scanning mode flags for GRIB1 grid 255
41 * n1,n2 - gridpoint count for GRIB1 grid 255
42 @param task the task that provides configuration information
43 @param r the hwrf.regrib.RegribMany object to receive the grid
44 @param name the name of the new grid
45 @param rel the GRIB product in r on which this grid is centered"""
46 contents=task.confstr(name+
"_grid")
47 split=contents.rsplit(
",")
56 r.add(name,clatlon(rel,res=[res1,res2],size=[size1,size2],
60 """!Adds a grid-centered lat-lon grid to a RegribMany object
62 Adds a new grid to an hwrf.regrib.RegribMany object, centered on a
63 prior existing grid but with a border added around its edges. The
64 grid is recalculated at every forecast time so it works with
65 moving grids as well. Grid expansion information comes from
66 the name+"_expand" option in the given task's section. The value
67 should be a comma-separated list of nine values:
68 * west extension in degrees
69 * east extension in degrees
70 * north extension in degrees
71 * south extension in degrees
72 * n1,n2 - new gridpoint count for GRIB1 grid 255
73 * scan - new scanning mode flags for GRIB1 grid 255
74 * res1,res2 - new resolution for GRB1 grid 255
75 @param task the task that provides configuration information
76 @param r the hwrf.regrib.RegribMany object to receive the grid
77 @param name the name of the new grid
78 @param rel the grid on which this grid is centered."""
80 contents=task.confstr(name+
"_expand")
81 split=contents.rsplit(
",")
92 r.add(name,hwrf.tracker.expandlatlon \
93 (r.GRIB(rel),west=west,east=east,north=north,south=south,
94 n=[n1,n2],scan=scan,res=[res1,res2]))
97 """!Requests deliver to com and/or intercom of a RegribMany product.
99 Utility function for deliveries. Given what="hwrftrk" this will
100 look for options "hwrftrk%com" and "hwrftrk%intercom" in the given
101 task's config section. If each option is present and non-empty,
102 the corresponding delivery is enabled and the option's value is
103 used as the delivery location.
104 @param task the task that provides configuration information
105 @param what the RegribMany product being delivered
106 @param r the hwrf.regrib.RegribMany whose products are being delivered"""
108 intercomvar=what+
'%intercom'
109 comloc=task.confraw(comvar,
'')
110 intercomloc=task.confraw(intercomvar,
'')
112 sys.stderr.write(
'to_com(%s,%s) (from %s)\n'%(
113 repr(comloc),repr(what),repr(comvar)))
114 r.to_com(comloc,what)
116 sys.stderr.write(
'to_intercom(%s,%s) (from %s)\n'%(
117 repr(intercomloc),repr(what),repr(intercomvar)))
118 r.to_intercom(intercomloc,what)
122 """!Configures the GSI post-processing and regribbing.
124 Constructs tasks that will run the post-processing and
125 regribbing on the inputs and outputs of GSI. Arranges for the
126 standard HWRF GSI diagnostic output grids, and makes them
127 configurable by the HWRF config files.
129 This class uses a config section to define many aspects of the GSI
134 # Settings for GRIB1 grid 255 for each grid:
135 d3_grid=0.02,0.02,12.,12.,136,600,600
136 d2_grid=0.06,0.06,30.,30.,136,500,500
138 # GRIB2 compression method
139 grib2_compression=32 ; complex packing with second-order differences
140 # grib2_compression=40 ; "lossless" jpeg 2000
143 hwrforg_n%com={out_prefix}.hwrforg_n.grb2f00
144 hwrforg_i%com={out_prefix}.hwrforg_i.grb2f00
145 hwrfges_n%com={out_prefix}.hwrfges_n.grb2f00
146 hwrfges_i%com={out_prefix}.hwrfges_i.grb2f00
147 hwrfanl_n%com={out_prefix}.hwrfanl_n.grb2f00
148 hwrfanl_i%com={out_prefix}.hwrfanl_i.grb2f00
151 The d2_grid and d3_grid options configure the intermediate and
152 innermost domain output grids. They are sent into
153 add_clatlon_grid() to generate the GRIB1 grid 255 (user-defined
154 regular latitude-longitude) grid definition for interpolation."""
156 """!HWRFGSIPostProcessing constructor
157 @param ds passed to Datum: the Datastore object for this Task
158 @param conf the conf object for this task (passed to HWRFTask)
159 @param section the conf section for this task (passed to HWRFTask)
160 @param kwargs more keyword arguments passed to superclass"""
161 super(HWRFGSIPostProcessing,self).
__init__(
162 ds,conf,section,**kwargs)
163 def make_gsi_post(self,gsi_d02,gsi_d03,storm1ghost,storm1ghost_parent,
164 ceninit,gsid03_flag,gsipost_name=
'gsipost',
165 gsigribber_name=
'gsigribber'):
166 """!Creates the gsi post-processor and regribber tasks.
168 Creates the gsipost member variable, an hwrf.gsipost.GSIPost;
169 and the gsigribber member variable, an hwrf.gribtask.GRIBTask.
170 The gsipost converts GSI input and output files (wrfinput,
171 ghost or wrfanl) to native E grid GRIB1 files. The gsigribber
172 converts the E grid GRIB1 files to GRIB2 files on selected
174 @param gsi_d02 the hwrf.gsi.FGATGSI that runs the intermediate
175 domain data assimilation
176 @param gsi_d03 the hwrf.gsi.FGATGSI that runs the innermost domain
178 @param storm1ghost the hwrf.wrf.WRFDomain that represents the
179 innermost ghost domain
180 @param storm1ghost_parent the hwrf.wrf.WRFDomain that represents the
181 intermediate ghost domain
182 @param ceninit the hwrf.init.InitBeforeGSI that runs the
183 analysis time (FGAT 0 hour) initialization off of the GDAS 6hr
185 @param gsid03_flag True=domain 3 gsi was run, False otherwise
186 @param gsipost_name the section and task name for the gsipost
187 @param gsigribber_name the section and task name for the gsigribber"""
197 ceninit.runghost.get_ghout(storm1ghost),
198 org=ceninit.runghost.get_ghost(storm1ghost),
199 ges=ceninit.rstage3.get_ghost(storm1ghost),
200 anl=gsi_d03.get_ghost(storm1ghost) )
203 ceninit.runghost.get_ghout(storm1ghost_parent),
204 org=ceninit.runghost.get_ghost(storm1ghost_parent),
205 ges=ceninit.rstage3.get_ghost(storm1ghost_parent),
206 anl=gsi_d02.get_ghost(storm1ghost_parent) )
208 g2p=
'%d'%(self.
confint(
'grib2_compression',32),)
210 copygb=alias(exe(conf.getexe(
'copygb'))),
211 wgrib=alias(exe(conf.getexe(
'wgrib'))),
212 cnvgrib_g12=alias(exe(conf.getexe(
'cnvgrib'))
214 g.sync_frequently=conf.getbool(
'config',
'sync_frequently',
True)
216 storm1ghost_grib=igrb1(
217 gsipost,domain=storm1ghost,which_step=hwrf.gsipost.F_ORG)
218 storm1ghost_parent_grib=igrb1(
219 gsipost,domain=storm1ghost_parent,which_step=hwrf.gsipost.F_ORG)
223 g.add(
'hwrforg_n',igrb1(gsipost,domain=storm1ghost,
224 which_step=hwrf.gsipost.F_ORG)*g.grid(
'd3')*GRIB2)
225 g.add(
'hwrforg_i',igrb1(gsipost,domain=storm1ghost_parent,
226 which_step=hwrf.gsipost.F_ORG)*g.grid(
'd2')*GRIB2)
228 g.add(
'hwrfges_n',igrb1(gsipost,domain=storm1ghost,
229 which_step=hwrf.gsipost.F_GES)*g.grid(
'd3')*GRIB2)
230 g.add(
'hwrfges_i',igrb1(gsipost,domain=storm1ghost_parent,
231 which_step=hwrf.gsipost.F_GES)*g.grid(
'd2')*GRIB2)
233 g.add(
'hwrfanl_n',igrb1(gsipost,domain=storm1ghost,
234 which_step=hwrf.gsipost.F_ANL)*g.grid(
'd3')*GRIB2)
235 g.add(
'hwrfanl_i',igrb1(gsipost,domain=storm1ghost_parent,
236 which_step=hwrf.gsipost.F_ANL)*g.grid(
'd2')*GRIB2)
238 for w
in (
'org',
'ges',
'anl' ):
240 base=
'hwrf%s_%s'%(w,gr)
244 ds,conf,gsigribber_name,g,start=conf.cycle,step=3600,end=0)
247 return (gsipost,gsigribber)
259 """!Creates the post-processing for the HWRF forecast job.
261 Creates and configures all tasks related to the post-processing
262 system. This includes the post, regribber, trackers, and any
263 NHC-specific product generation, as well as some data delivery
264 settings. Everything is made configurable via the
265 hwrf.config.HWRFConfig system.
267 This class is configurable through config file options:
270 # Post-processing start, end and step for various components:
271 tracker_step=1 # hours between tracker inputs
272 nonsatpost_step=1 # hours between non-satellite post inputs
273 satpost_step=6 # hours between satellite post inputs
274 wrfcopier_start=0 # first WRF native output time to copy to COM
275 wrfcopier_end=9 # last native output time to copy to COM
276 wrfcopier_step=3 # hours between WRF native outputs copied to COM
277 combinetrack_fhr=12 # length of cycling track in hours
279 # Settings for GRIB1 grid 255 (native lat-lon) for each grid:
280 d23_grid=0.02,0.02,12.,15.,136,751,601
281 d123low_grid=0.20,0.20,90.,110.,136,551,451
282 d123high_grid=0.06,0.06,90.,110.,136,1834,1500
283 d2_grid=0.06,0.06,12.,14.,136,234,201
284 d3_grid=0.02,0.02,7.5,9.0,136,450,375
285 d2t_grid=0.06,0.06,30.,30.,128,500,500
286 d1t_grid=0.10,0.10,30.,30.,128,301,301
288 # Tracker grid expansion settings:
289 trk_expand=2.5,2.5,4.0,4.0,1000,1000,128,0.02,0.02
291 # GRIB2 compression method:
292 grib2_compression=32 ; complex packing with second-order differences
293 # grib2_compression=40 ; alternative: "lossless" jpeg 2000
296 hwrftrk%com={out_prefix}.hwrftrk.f{fahr:03d}.grb
297 hwrftrk%intercom={out_prefix}.hwrftrk.grbf{fahr:02d}
299 anl_outer={out_prefix}.wrfanl_d02
300 anl_inner={out_prefix}.wrfanl_d03
302 hwrfprs_m%intercom={out_prefix}.hwrfprs.d23.0p02.f{fahr:03d}.grb
303 hwrfprs_n%intercom={out_prefix}.hwrfprs.d3.0p02.f{fahr:03d}.grb
304 hwrfprs_i%intercom={out_prefix}.hwrfprs.d2.0p06.f{fahr:03d}.grb
305 hwrfprs_p%intercom={out_prefix}.hwrfprs.d1.0p20.f{fahr:03d}.grb
306 hwrfprs_c%intercom={out_prefix}.hwrfprs.d123.0p06.f{fahr:03d}.grb
307 hwrfprs_g%intercom={out_prefix}.hwrfprs.d123.0p25.f{fahr:03d}.grb
309 hwrfsat_m%intercom={out_prefix}.hwrfsat.d23.0p02.f{fahr:03d}.grb
310 hwrfsat_n%intercom={out_prefix}.hwrfsat.d3.0p02.f{fahr:03d}.grb
311 hwrfsat_i%intercom={out_prefix}.hwrfsat.d2.0p06.f{fahr:03d}.grb
312 hwrfsat_p%intercom={out_prefix}.hwrfsat.d1.0p20.f{fahr:03d}.grb
313 hwrfsat_c%intercom={out_prefix}.hwrfsat.d12.0p06.f{fahr:03d}.grb
314 hwrfsat_g%intercom={out_prefix}.hwrfsat.d123.0p25.f{fahr:03d}.grb
316 hwrf2prs_m%com={out_prefix}.hwrfprs.d23.0p02.f{fahr:03d}.grb2
317 hwrf2prs_n%com={out_prefix}.hwrfprs.d3.0p02.f{fahr:03d}.grb2
318 hwrf2prs_i%com={out_prefix}.hwrfprs.d2.0p06.f{fahr:03d}.grb2
319 hwrf2prs_p%com={out_prefix}.hwrfprs.d1.0p20.f{fahr:03d}.grb2
320 hwrf2prs_c%com={out_prefix}.hwrfprs.d123.0p06.f{fahr:03d}.grb2
321 hwrf2prs_g%com={out_prefix}.hwrfprs.d123.0p25.f{fahr:03d}.grb2
323 hwrf2sat_m%com={out_prefix}.hwrfsat.d23.0p02.f{fahr:03d}.grb2
324 hwrf2sat_n%com={out_prefix}.hwrfsat.d3.0p02.f{fahr:03d}.grb2
325 hwrf2sat_i%com={out_prefix}.hwrfsat.d2.0p06.f{fahr:03d}.grb2
326 hwrf2sat_p%com={out_prefix}.hwrfsat.d1.0p20.f{fahr:03d}.grb2
327 hwrf2sat_c%com={out_prefix}.hwrfsat.d12.0p06.f{fahr:03d}.grb2
328 hwrf2sat_g%com={out_prefix}.hwrfsat.d123.0p25.f{fahr:03d}.grb2
331 Config options have certain formats:
332 * product%com and product%intercom --- delivery location in com
333 and intercom for each regribber output product
334 * *_grid --- GRIB1 grid 255 grid descriptions sent to add_clatlon_grid()
335 * *_expand --- GRIB1 grid 255 grid expansions sent to add_expandlatlon_grid()
336 * *_step and *_fhr --- times or timespans in hours.
337 All delivery filenames are relative to {com} and are subject to
338 string expansion by hwrf.config.HWRFConfig.timestrinterp(). Hence
339 everything in the [config] and [dir] sections are available, as
340 well as standard time values.
342 The product names in product%com and product%intercom follow a
348 In the second example, here is what each component means:
349 * hwrf or hwrf2 -- GRIB1 or GRIB2 file? The GRIB1 files are created
350 first, and are later converted to GRIB2
351 * prs or sat -- non-satellite post (prs) or satellite post (sat)
352 * m, n, i, p, c or g -- the grid
353 Here are the grid meanings:
354 * n -- innermost domain only at its resolution
355 * i -- intermediate domain only at its resolution
356 * p -- parent domain only at its resolution
357 * m -- innermost and intermediate domains, at innermost domain resolution
358 * c -- if prs, parent and intermediate domains; if sat, all three
359 domains. This is at the intermediate domain resolution.
360 * g -- global quarter degree grid, GRIB1 grid 193. That is the
361 output grid for the GFS master GRIB files."""
362 def __init__(self,ds,conf,section,runwrf,wrf,postdoms,wrfdoms,
363 moad,storm1inner,storm1outer,**kwargs):
364 """!Constructor for HWRFForecastPostProcessing
365 @param ds the produtil.datastore.Datastore to use
366 @param conf the HWRFConfig to use for configuration options.
367 This conf is passed down to the RegribMany during
368 regribbing operations.
369 @param section the config section to use.
370 @param runwrf the object that runs the forecast, such as an
371 hwrf.fcsttask.WRFAtmos or hwrf.mpipomtc.WRFCoupledPOM
372 @param wrf the hwrf.wrf.WRFSimulation that represents the
374 @param postdoms a list of domains to post-process in order
376 @param wrfdoms a list of WRF domains in order of GRID id
377 @param moad the Mother Of All Domains (MOAD), an
379 @param storm1inner the first storm's intermediate domain, an
381 @param storm1outer the first storm's innermost domain, an
383 @param kwargs additional keyword arguments are passed to the
384 superclass constructor"""
385 super(HWRFForecastPostProcessing,self).
__init__(
386 ds,conf,section,**kwargs)
418 """!Creates the non-satellite post-processor.
420 Creates the nonsatpost member, which runs the non-satellite
421 post processing. That is the object that runs everything
422 except the synthetic satellite brightness temperatures. This
423 is a hwrf.post.PostManyWRF object.
424 @return the created object
425 @param default_step non-satellite post-processor input step,
426 if none is provided in the config file."""
427 step=self.
conffloat(
'nonsatpost_step',default_step)*3600
430 needcrtm=
False,streams=[
'history',
'auxhist2',
'auxhist3'])
438 """!Creates the satellite post-processor
440 Creates the satpost member, an hwrf.post.PostManyWRF object
441 that runs the satellite post-processing.
442 @return the created object
443 @param default_step satellite post-processor input step,
444 if none is provided in the config file."""
446 step=self.
conffloat(
'satpost_step',default_step)*3600
449 needcrtm=
True,streams=[
'history',
'auxhist2',
'auxhist3'])
455 """!Generates the WRF input/output copier task.
457 Creates the wrfcopier member variable which copies inputs and
458 outputs of the forecast job directly to COM. This is an
459 hwrf.copywrf.WRFCopyTask object.
460 @return the created object
461 @param wrfcopier_name the section and task name to use for the
462 hwrf.copywrf.WRFCopyTask that is created."""
463 copystart=self.
conffloat(
'wrfcopier_start',0)
464 copyend=self.
conffloat(
'wrfcopier_end',9)
465 copystep=self.
conffloat(
'wrfcopier_step',3)
473 self.conf.getstr(
'config',
'out_prefix'))
477 self.conf.getstr(
'config',
'out_prefix'))
478 wrfcopier.d_initial(
'namelist.input')
479 wrfcopier.d_initial(
'wrfinput_d01')
480 wrfcopier.d_initial(
'wrfbdy_d01')
481 wrfcopier.d_initial(
'fort.65')
482 wrfcopier.d_initial(wrf.analysis_name(self.
storm1outer),
483 destname=self.
confraw(
'anl_outer'))
484 wrfcopier.d_initial(wrf.analysis_name(self.
storm1inner),
485 destname=self.
confraw(
'anl_inner'))
488 while fhr-0.001<copyend:
489 prodstream=
'history' if fhr % 3 == 0
else 'auxhist2'
490 for product
in runwrf.products(time=3600*fhr,stream=prodstream):
491 wrfcopier.d_wrfprod(product,check=
False,
492 destname=
'{vit[stnum]:02d}{vit[basin1lc]}.'
493 '{inname_colon_s00}')
496 wrfcopier.d_wrfprod(product,check=
False,
497 destname=
'{vit[stnum]:02d}{vit[basin1]}.'
498 '{inname_colon_s00}')
510 wrfcopier.d_final(
'track_d03.patcf')
512 run_wave=self.
confstr(
'run_wave',
'no')
513 if run_wave ==
'yes':
514 ctime=to_datetime_rel(cycling_interval*3600,self.conf.cycle)
515 for p
in runwrf.products(stream=
'ww3rst'):
516 rstime=p[
'restarttime']
518 wrfcopier.d_wrfprod(p,check=
True,
519 destname=
'{vit[stormid3lc]}.restart.f%03d.ww3'%rstime)
521 for p
in runwrf.products(stream=
'ww3out'):
532 """!Generate the regribbing objects and the main tracker.
534 Generates the gribber, tracker, track and nhcp member
535 variables and returns them in a tuple:
536 * nhcp --- the hwrf.nhc_products.NHCProducts object that
537 makes NHC-specific output products and validates the
539 * track --- the final track file output by the tracker, returned
540 by hwrf.tracker.send_atcfunix() called on the new tracker object
541 * tracker --- the hwrf.tracker.TrackerTask that runs the
543 * gribber --- the hwrf.gribtask.GRIBTask that runs the
544 regribbing on the post-processors created by make_satpost()
545 and make_nonsatpost()
547 @param extra_trackers logical flag: are the parent and
548 intermediate domain trackers also desired? If so, extra
549 regribbing is arranged, that will be required by
550 make_extra_trackers()
551 @param satpost_flag logical flag: is satellite post-processing
553 @pre The make_nonsatpost() must have been called. If the
554 satpost_flag=True, then make_satpost() must also have been
556 @returns a tuple (nhcp,track,tracker,gribber) of the objects
560 (moad,storm1inner,storm1outer) = \
563 fcstlen=self.
confint(
'forecast_length',126)
564 combinetrack_fhr=self.
conffloat(
'combinetrack_fhr',12.)
569 grid3=igrb1(nonsatpost,domain=storm1inner)
570 grid2=igrb1(nonsatpost,domain=storm1outer)
571 grid1=igrb1(nonsatpost,domain=moad)
572 satE3=igrb1(satpost,domain=storm1inner)
573 satE2=igrb1(satpost,domain=storm1outer)
574 satE1=igrb1(satpost,domain=moad)
579 'part',hwrf.tracker.hwrf_combine_subset,
None)
584 'part',hwrf.tracker.hwrf_global_subset,
None)
588 'part',hwrf.tracker.tracker_subset,
None)
592 lon=conf[
'config',
'domlon'])
593 basin=conf.syndat.pubbasin2
594 if ((basin==
'AL' or basin==
'EP')
and domloc.ewcenter<360.0):
595 domloc.ewcenter+=360.0
599 g2p=
'%d'%(self.
confint(
'grib2_compression',32),)
600 r=
RegribMany(copygb=alias(exe(conf.getexe(
'copygb'))),
601 wgrib=alias(exe(conf.getexe(
'wgrib'))),
602 cnvgrib_g12=alias(exe(conf.getexe(
'cnvgrib'))
611 qd=hwrf.regrib.quarterDegree
618 r.add(
'hwrfprs_m',grid2*r.grid(
'd23')+grid3*r.grid(
'd23'))
619 r.add(
'parenthigh',grid1/hwrfsub*r.grid(
'd123high'))
623 r.add(
'trkbasic',(r.GRIB(
'parenthigh')/trksub) \
624 .regridmerge(r.grid(
'trk'),r.GRIB(
'hwrfprs_m')/trksub))
627 r.add(
'hwrfprs_n',grid3*r.grid(
'd3'))
628 r.add(
'hwrfprs_i',grid2*r.grid(
'd2'))
629 r.add(
'hwrfprs_p',grid1*r.grid(
'd123low'))
630 r.add(
'hwrfprs_c',grid1/hwrfsub*r.grid(
'd123high') +
631 (grid2/hwrfsub*r.grid(
'd123high') +
632 grid3/hwrfsub*r.grid(
'd123high')))
633 r.add(
'hwrfprs_g',grid1/ghwrfsub*qd +
634 (grid2/ghwrfsub*qd + grid3/ghwrfsub*qd))
638 r.add(
'hwrftrkd01',((grid1/trksub)*r.grid(
'd1t')).make_grbindex())
639 r.add(
'hwrftrkd02',((grid1/trksub)*r.grid(
'd2t')
640 +(grid2/trksub)*r.grid(
'd2t')).make_grbindex())
645 r.add(
'hwrfsat_m',satE2*r.grid(
'd23')+satE3*r.grid(
'd23'))
646 r.add(
'hwrfsat_n',satE3*r.grid(
'd3'))
647 r.add(
'hwrfsat_i',satE2*r.grid(
'd2'))
648 r.add(
'hwrfsat_p',satE1*r.grid(
'd123low'))
649 r.add(
'hwrfsat_c',satE1/hwrfsub*r.grid(
'd123high') +
650 satE2/hwrfsub*r.grid(
'd123high'))
652 r.add(
'hwrfsat_g',satE1/hwrfsub*qd +
653 (satE2/hwrfsub*qd + satE3/hwrfsub*qd))
663 inx=
'hwrf%s_%s'%(T,D)
664 outx=
'hwrf2%s_%s'%(T,D)
665 r.add(outx,r.GRIB(inx)*GRIB2)
668 if satpost_flag: splist.append(
'sat')
669 for v
in (
'',
'2' ):
672 base=
'hwrf'+v+sp+
'_'+g
678 self.
dstore,conf,
'regribber',r,start=conf.cycle,
679 step=3600,end=fcstlen*3600)
684 start=conf.cycle, step=self.
conffloat(
'tracker_step',1)*3600,
686 tracker.add_moving_grid(conf.syndat,gribber,
'hwrftrk')
687 tracker.send_raw_atcfunix(
'rawatcfunix',
688 conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrf.raw'))
689 track=tracker.send_atcfunix(
'cleanatcfunix',
690 conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrf.atcfunix'))
691 tracker.send_atcfunix_subset(
'atcf3hourly',freq=3,
692 location=conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrf.3hourly'))
693 tracker.send_atcfunix_subset(
'atcfshort6hr',freq=6,cut=112,
694 location=conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrf.short6hr'))
695 tracker.send_atcfunix_subset(
'combinetrack',fhr=12,
696 location=conf.strinterp(
697 'dir',
'{com}/{vit[stnum]:02d}{basin1lc}.trak.hwrf.'
698 'atcfunix.{YMDH}.combine'))
704 tracker.send_atcfunix_subset(
'combinetrack_uc',fhr=12,
705 location=conf.strinterp(
706 'dir',
'{com}/{vit[stnum]:02d}{basin1}.trak.hwrf.'
707 'atcfunix.{YMDH}.combine'))
710 tracker.send_atcfunix_subset(
'combinetrack_00',fhr=12,
711 location=conf.strinterp(
712 'dir',
'{realstormcom}/relocate.trak.'
713 '{YMDH}.go',realstorm=
'{fakestormid}'))
732 return (gribber,tracker,track,nhcp)
749 """!Generates intermediate and outermost domain trackers.
751 Generates trackers that use intermediate and outermost domain
752 data to track the storm and analyze its intensity. These are
753 intended for use in analyzing the effects of resolution and
754 upscale feedback on hurricane track, structure and
755 intensity. Creates these member variables and returns them:
756 * trackerd01 --- a tracker that just uses the outermost domain data
757 * trackerd02 --- a tracker that uses the outermost and
758 intermediate domain data
759 @return A tuple (trackerd01,trackerd02) of the new trackers
760 @pre The make_gribber_tracker() must have been called with
761 extra_trackers=True, so it will add the extra GRIB products
762 needed by the new trackers."""
766 fcstlen=conf.getint(
'config',
'forecast_length',126)
767 tracker_step=self.
conffloat(
'tracker_step')*3600
771 start=conf.cycle, step=tracker_step, end=fcstlen*3600)
772 trackerd02.add_moving_grid(conf.syndat,gribber,
'hwrftrkd02')
773 trackerd02.send_raw_atcfunix(
'rawatcfunix',
774 conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrfd02.raw'))
775 trackerd02.send_atcfunix(
'cleanatcfunix',
776 conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrfd02.atcfunix'))
780 start=conf.cycle, step=tracker_step, end=fcstlen*3600)
781 trackerd01.add_moving_grid(conf.syndat,gribber,
'hwrftrkd01')
782 trackerd01.send_raw_atcfunix(
'rawatcfunix',
783 conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrfd01.raw'))
784 trackerd01.send_atcfunix(
'cleanatcfunix',
785 conf.strinterp(
'dir',
'{com}/{out_prefix}.trak.hwrfd01.atcfunix'))
788 return (trackerd01,trackerd02)
800 def __init__(self,conf,ds,wrf,pominit,ww3init,hycominit,ocstatus):
801 super(ForecastBase,self).__init__()
802 ( self.conf, self.ds, self.wrf, self.pominit, self.ww3init ) = \
803 ( conf, ds, wrf, pominit, ww3init )
804 ( self.hycominit, self.ocstatus ) = \
805 ( hycominit, ocstatus )
810 def make_forecast(self):
812 ocean_flag=self.conf.getbool(
'config',
'run_ocean')
813 ocean=self.conf.getstr(
'config',
'ocean_model',
'POM')
814 wave_flag=self.conf.getbool(
'config',
'run_wave')
815 wave=self.conf.getstr(
'config',
'wave_model',
'WW3')
816 fcst_sec=self.conf.getstr(
'config',
'forecast_section',
'runwrf')
817 ww3poststep=self.conf.getint(
'forecast_products',
'ww3_output_step',10800)
820 if ocean_flag
and ocean==
'HYCOM':
821 if wave_flag
and wave==
'WW3':
823 '[config] run_wave=%s for HWRF-HYCOM but should be False'%(
835 self.ds,self.conf,fcst_sec,self.wrf,self.ocstatus,
836 taskname=
'runwrf',hycominit=self.hycominit)
838 self.ds,self.conf,
'hycompost',
839 fcstlen=fcstlen,hycom=runwrf)
840 elif ocean_flag
and ocean==
'POM':
841 if wave_flag
and wave==
'WW3':
843 self.ds,self.conf,fcst_sec,self.wrf,taskname=
'runwrf',
844 pominit=self.pominit,ww3init=self.ww3init)
846 poststep=ww3poststep,ww3=runwrf)
849 self.ds,self.conf,fcst_sec,self.wrf,taskname=
'runwrf',
850 pominit=self.pominit)
853 self.ds,self.conf,fcst_sec,self.wrf,taskname=
'runwrf')
858 def __init__(self,conf,ds,wrf,multistorm_sids,finalmerge,
859 stormNouter,stormNinner):
860 super(FakeStormForecast,self).__init__(
861 conf,ds,wrf,
None,
None,
None,
None)
866 def make_forecast(self):
868 ocean_flag=self.conf.getbool(
'config',
'run_ocean')
869 wave_flag=self.conf.getbool(
'config',
'run_wave')
870 fcst_sec=self.conf.getstr(
'config',
'forecast_section',
'runwrf')
874 if ocean_flag
or wave_flag:
876 'Ocean and wave must be disabled when running in '
877 'multi-storm mode ([config] run_ocean and run_wave '
881 self.ds,self.conf,fcst_sec,self.wrf,taskname=
'runwrf')
884 self.ds,self.conf,
'fakeinit',self.wrf,prioritystorm,
886 runwrf.add_metgrid(fakeinit).add_geogrid(fakeinit) \
887 .add_fort65(fakeinit).add_wrfbdy(fakeinit)
891 self.finalmerge.add_wrfinput(fakeinit,prioritystorm)
892 for i
in range(1,num_realstorms + 1):
894 self.finalmerge.add_merge(fakeinit,stormid)
895 runwrf.add_wrfanl(fakeinit,self.
stormNouter[
'storm%souter'%i])
896 runwrf.add_wrfanl(fakeinit,self.
stormNinner[
'storm%sinner'%i])
def make_nonsatpost
Creates the non-satellite post-processor.
Runs the POM initialization and POM-WRF coupled forecast.
Create namelists, monitor wrf simulations, generate filenames.
Runs regrib operations on many input times, sending output to an hwrf.gribtask.GRIBTask.
gsigribber
The hwrf.gribtask.GRIBTask that will regrid the output of the gsipost, creating lat-lon grib files as...
A wrapper around PostOneWRF that posts many WRF output times.
def make_satpost
Creates the satellite post-processor.
The base class of tasks run by the HWRF system.
tracker
Task that runs the GFDL vortex tracker on all three domains combined.
Post-processes GSI inputs and outputs.
This task runs the GFDL Vortex Tracker on HWRF output.
conf
This HWRFTask's hwrf.config.HWRFConfig object.
dstore
Read-only property, an alias for getdatastore(), the Datastore in which this Datum resides...
storm1inner
The innermost domain, an hwrf.wrf.WRFDomain.
def make_gribber_tracker
Generate the regribbing objects and the main tracker.
trackerd02
The hwrf.tracker.TrackerTask that runs the GFDL vortex tracker on the combined outermost and intermed...
def add_clatlon_grid(task, r, name, rel)
Add a domain-centered lat-lon grid to a RegribMany object.
track
The main track file from self.tracker.
A GRIBBase that subsets GRIB files, keeping only certain parameters.
Defines StormInfo and related functions for interacting with vitals ATCF data.
Base class of tasks run by HWRF.
A shell-like syntax for running serial, MPI and OpenMP programs.
wrfcopier
The task that copies WRF input and output files directly to COM.
gsipost
The hwrf.gsipost.GSIPost object that will post-process GSI inputs and outputs, creating native E grid...
def __init__(self, ds, conf, section, runwrf, wrf, postdoms, wrfdoms, moad, storm1inner, storm1outer, kwargs)
Constructor for HWRFForecastPostProcessing.
def make_wrfcopier
Generates the WRF input/output copier task.
def to_com_intercom(task, what, r)
Requests deliver to com and/or intercom of a RegribMany product.
def __init__(self, ds, conf, section, kwargs)
HWRFGSIPostProcessing constructor.
def confraw
Get a raw configuration value before string expansion.
def make_extra_trackers(self)
Generates intermediate and outermost domain trackers.
Raised when the user requests a configuration that makes sense, but is not supported.
PrepHybrid runs the prep_hybrid program to transform GFS spectral files to the HWRF grid...
Contains the WRFCopyTask, which delivers WRF output and input.
Utilities for ensemble-based data assimilation.
Runs the real_nmm or wrf executables.
def add_expandlatlon_grid(task, r, name, rel)
Adds a grid-centered lat-lon grid to a RegribMany object.
Stores products and tasks in an sqlite3 database file.
The uncoupled HWRF forecast Task.
Runs the GSI data assimilation on the HWRF system.
Time manipulation and other numerical routines.
wrfdoms
The array of WRF domains (hwrf.wrf.WRFDomain objects)
Declares GRIBTask, which automates regribbing operations.
This module contains Tasks to run the WRF Preprocessing System (WPS): Geogrid, Ungrib and Metgrid...
runwrf
The hwrf.fcsttask.WRFAtmos or subclass thereof that runs the WRF.
An hwrf.hwrftask.HWRFTask that performs regribbing operations.
nhcp
The task that generates custom products for NHC.
def confint
Alias for self.conf.getint for section self.section.
def make_gsi_post
Creates the gsi post-processor and regribber tasks.
moad
The Mother Of All Domains (MOAD) in the WRF simulation, an hwrf.wrf.WRFDomain object.
gribber
The hwrf.gribtask.GRIBTask that does the regribbing.
nonsatpost
The non-satellite post-processor, an hwrf.post.PostManyWRF object.
def conffloat
Alias for self.conf.getfloat for section self.section.
Represents a specific location on the earth as a latitude, longitude pair.
satpost
The satellite post-processor, an hwrf.post.PostManyWRF object.
parses UNIX conf files and makes the result readily available
Combines Tasks from multiple modules into a single initialization object.
Creates the initial HWRF directory structure, loads information into each job.
Generates NHC-specific products and validates wrfdiag files.
wrf
The hwrf.wrf.WRFSimulation describing the WRF simulation that was run.
Creates the post-processing for the HWRF forecast job.
storm1outer
The intermediate domain, an hwrf.wrf.WRFDomain.
This is a wrapper around the hwrf_nhc_products Fortran program.
vinttave
An alias for GRIB1VintTave.
Runs the Unified Post Processor on outputs from the WRF-NMM, producing E grid GRIB files as EGRIB1Pro...
This module contains tasks to prepare input for the GFDL Vortex Tracker, run the tracker and deliver ...
def confstr
Alias for self.conf.getstr for section self.section.
Describes regribbing operations using an algebraic structure.
This module implements Python classes that run the 2014 HWRF Relocation.
trackerd01
The hwrf.tracker.TrackerTask that runs the GFDL vortex tracker on the outermost domain vortex only...
Contains Bufrprep, which converts data tanks to bufr files, and otherwise preprocesses the prepbufr a...
Configures the GSI post-processing and regribbing.
postdoms
The array of WRF domains to post-process (hwrf.wrf.WRFDomain objects)
Runs a WRF-POM coupled simulation.