25 """!Log a message to produtil.log.jlogger and exit with status 0
26 @param msg the error message"""
31 """!Runs the hwrf.init.HWRFInit.run_relocate() for the selected initialization:
33 * INIT_MODEL=GFS --- hwrf_expt.gfs_init.run_relocate()
34 * INIT_MODEL=GDAS --- the run_relocate() is called for the appropriate
35 member of hwrf_expt.fgat_init"""
37 init_model=ENV[
'INIT_MODEL'].lower()
38 init_fhr=int(ENV.get(
'INIT_FHR',
'0'))
39 if init_model!=
'gfs' and init_model!=
'gdas1':
40 fail(
'Aborting: init_model="%s" must be "gfs" or "gdas1"'%(init_model,))
41 if init_model==
'gdas1' and init_fhr<1:
42 fail(
'Aborting: when init_model=gdas1, init_fhr must be >= 1 (init_fhr=%d)'%(init_fhr,))
43 if init_model==
'gfs': init_fhr=0
48 jlogger.info(
'HWRF relocation for GFS fhr starting')
49 init=hwrf_expt.gfs_init.run_relocate()
50 jlogger.info(
'HWRF relocation for GFS fhr completed')
51 elif not hwrf_expt.conf.getbool(
'config',
'run_gsi'):
52 jlogger.info(
'GSI is disabled. This job need not be run.')
56 logger=hwrf_expt.fgat_init.log()
57 logger.info(
'search for fgat hour %d'%(init_fhr,))
58 for fhr,init
in hwrf_expt.fgat_init.fhr_and_init():
59 if abs(fhr-init_fhr)<0.01:
60 logger.info(
'fhr %d is init_fhr %d'%(fhr,init_fhr))
61 jlogger.info(
'HWRF relocation for GDAS1 fhr %d starting'%fhr)
63 jlogger.info(
'HWRF relocation for GDAS1 fhr %d completed'%fhr)
66 logger.info(
'fhr %d is not init_fhr %d'%(fhr,init_fhr))
67 assert(init
is not None)
69 if __name__==
'__main__':
73 except Exception
as e:
74 jlogger.critical(
'HWRF relocation is aborting: '+str(e),exc_info=
True)
Contains setup(), which initializes the produtil package.
def init_module
Initializes the HWRF object structure.
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.
def main()
Runs the hwrf.init.HWRFInit.run_relocate() for the selected initialization:
def fail(msg)
Log a message to produtil.log.jlogger and exit with status 0.