27 if not conf.getstr(
'archive',
'wrfout',
''):
28 jlogger.info(
'No wrfout option in [archive] section. Will not make wrfout archive.')
36 wrf=hwrf_expt.runwrf.wrf()
41 out=dom.get_output(
'auxhist3',t)
43 out=dom.get_output(
'history',t)
45 out=dom.get_output(
'auxhist2',t)
47 logger.error(
'%s: could not determine wrfout for '
48 'domain %s'%(t.strftime(
'%Y%m%d%H'),
51 if not os.path.exists(out.path()):
52 logger.error(
'%s: does not exist'%(out.path(),))
54 logger.error(
'%s: is empty'%(out.path(),))
55 files.append(out.path())
57 thearchive=conf.timestrinterp(
'archive',
'{wrfout}',0)
58 if thearchive[0:5]!=
'hpss:':
59 logger.error(
'The wrfout archive path must begin with "hpss:": '+
62 thearchive=thearchive[5:]
63 adir=os.path.dirname(thearchive)
64 mkdir=exe(conf.getexe(
'hsi'))[
'-P',
'mkdir',
'-p',adir]
65 run(mkdir,logger=logger)
66 cmd=exe(conf.getexe(
'htar'))[
'-cpf',thearchive][files]
67 checkrun(cmd,logger=logger)
69 if __name__==
'__main__':
72 jlogger.info(
"HWRF rundir archive job starting")
74 jlogger.info(
"HWRF rundir archive job completed")
75 except Exception
as e:
76 jlogger.critical(
'HWRF rundir archive is aborting: '+str(e),
Change directory, handle temporary directories.
def to_timedelta
Converts an object to a datetime.timedelta.
Contains setup(), which initializes the produtil package.
def init_module
Initializes the HWRF object structure.
A shell-like syntax for running serial, MPI and OpenMP programs.
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 isnonempty(filename)
Returns True if the filename refers to an existent file that is non-empty, and False otherwise...
This subclass of TempDir takes a directory name, instead of generating one automatically.
Time manipulation and other numerical routines.