HWRF  trunk@4391
exhwrf_ensda_pre.py
1 #! /usr/bin/env python
2 
3 ##@namespace scripts.exhwrf_ensda_pre
4 #Determines whether the ENSDA needs to be run for this cycle and
5 #writes the ENSDA flag file.
6 
7 import sys, os
9 from produtil.log import jlogger
10 
11 def main():
12  """!Based on the configuration, write an ensda flag file that will
13  either request, or not request, the ensemble da jobs to run."""
14  import hwrf_expt
15  hwrf_expt.init_module(make_ensemble_da=True)
16 
17  conf=hwrf_expt.conf
18  run_ensemble_da=conf.getbool('config','run_ensemble_da')
19  if not run_ensemble_da:
20  jlogger.info('ENSDA is disabled for this configuration. '
21  'This job need not be run.')
22  hwrf_expt.ensda_pre.write_flag_file(False)
23  return
24  hwrf_expt.ensda_pre.run()
25 
26 if __name__=='__main__':
27  try:
29  jlogger.info('ensda_pre is starting')
30  main()
31  jlogger.info('ensda_pre is completed')
32  except Exception as e:
33  jlogger.critical('ensda_pre is aborting: '+str(e),exc_info=True)
34  sys.exit(2)
35 
def main()
Based on the configuration, write an ensda flag file that will either request, or not request...
Contains setup(), which initializes the produtil package.
Definition: setup.py:1
def init_module
Initializes the HWRF object structure.
Definition: hwrf_expt.py:384
def setup(ignore_hup=False, dbnalert_logger=None, jobname=None, cluster=None, send_dbn=None, thread_logger=False, thread_stack=2 **24, kwargs)
Initializes the produtil package.
Definition: setup.py:15
Configures logging.
Definition: log.py:1