33 if not conf.has_option(
'archive',
'hycomab'):
34 jlogger.info(
'No hycomab option in [archive] section. '
35 'Will not make hycomab archive.')
39 rundir=hwrf_expt.runwrf.location
42 for globme
in [
"*archv*.[ab]" ]:
43 globout=list(glob.glob(globme))
45 logger.warning(
'There are no files matching %s in %s'%(
47 abfiles.extend(globout)
50 logger.critical(
'Could not find any hycom output files. '
51 'Hycom failed. Will now cry.')
55 logger.info(
'Found %d hycom files:\n %s'%(
56 len(abfiles),
"\n ".join(abfiles)))
58 thearchive=conf.timestrinterp(
'archive',
'{hycomab}',0)
59 if thearchive[0:5]!=
'hpss:':
60 logger.error(
'The hycomab archive path must begin with "hpss:": '+
63 thearchive=thearchive[5:]
64 adir=os.path.dirname(thearchive)
67 jlogger.info(
'%s: archiving %d hycom files to HPSS.'
68 %(thearchive,len(abfiles)))
70 mkdir=exe(conf.getexe(
'hsi'))[
'-P',
'mkdir',
'-p',adir]
71 run(mkdir,logger=logger)
72 cmd=exe(conf.getexe(
'htar'))[
'-cpf',thearchive][abfiles]
73 checkrun(cmd,logger=logger)
75 if __name__==
'__main__':
78 jlogger.info(
"HWRF hycomab archive job starting")
80 jlogger.info(
"HWRF hycomab archive job completed")
81 except Exception
as e:
82 jlogger.critical(
'HWRF hycomab archive is aborting: '+str(e),
Change directory, handle temporary directories.
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.
This subclass of TempDir takes a directory name, instead of generating one automatically.
Time manipulation and other numerical routines.