HWRF  trunk@4391
Classes | Variables
hwrf.copywrf Namespace Reference

Contains the WRFCopyTask, which delivers WRF output and input. More...

Detailed Description

Contains the WRFCopyTask, which delivers WRF output and input.

This module contains the implementation of WRFCopyTask, which delivers WRF input and output files. It maintains three sets of deliveries:

The WRFCopyTask.run() and WRFCopyTask.runpart() monitor the WRF execution and copy files as needed.

Examples:

1 wrf=WRFSimulation(...)
2 ... add domains to the wrf simulation ...
3 sim=ExternalWRFTask(dstore,conf,section,wrf,...more stuff...)
4 wrfcopier=WRFCopyTask(dstore,conf,"wrf_copier",sim,
5  "{vit[stormname]}{vit[stormid3]}.{YMDH}.")
6 wrfcopier.d_initial('namelist.input')
7 wrfcopier.d_initial('wrfinput_d01')
8 wrfcopier.d_initial('wrfbdy_d01')
9 wrfcopier.d_initial('fort.65')
10 fhr=0
11 while fhr-0.001<126:
12  for product in runwrf.products(time=3600*fhr,stream="history"):
13  wrfcopier.d_wrfprod(product,check=False)
14  fhr+=3
15 wrfcopier.d_final('track_d03.patcf')
16 wrfcopier.run()

This example will monitor an external WRF simulation. It will deliver four files at the beginning of the simulation: namelist.input, wrfinput_d01, wrfbdy_d01 and fort.65. One file will be delivered at the end: track_d03.patcf. All three-hourly history stream files (wrfout_d...) will be delivered as they become available. The files will be delivered to com, prepending the storm name, id and cycle.

For example, this file wrfout_d01_2016-08-14_09:00:00 will go here: /path/to/com/invest97l.2016081400.wrfout_d01_2016-08-14_09:00:00 due to the wrfcopier.d_wrfprod() call.

All of the delivery happens in the last line of the code example when WRFCopier.run() is called. That call will not return until all files are delivered or the WRF model fails.

Classes

class  WRFCopyTask
 wrf file delivery task More...
 

Variables

list __all__ = ['WRFCopyTask']
 list of symbols exported by "from hwrf.copywrf import *"