Example #1
0
#conf=hafs.launcher.HAFSLauncher().read(environ_CONFhafs)
conf=hafs.launcher.load(environ_CONFhafs)

logger=conf.log('ww3post')
logger.info("ww3post started")

if not conf.getbool('config','run_wave'):
    logger.info('Wave is disabled. This job need not be run.')
    sys.exit(0)

wave_model=conf.getstr('config','wave_model')
if not wave_model=='WW3':
    logger.critical('Config file error: unsupported wave model '
                     '%s.'%(repr(wave_model),))
    sys.exit(2)

DATA=os.environ.get('DATA',conf.getloc('WORKhafs','.')+"/wav_post")
fcstlen=conf.getint('config','NHRS',126)
os.environ['MPISERIAL'] = conf.getloc('MPISERIAL','NONE') 
os.environ['mpiserial'] = conf.getloc('mpiserial','NONE') 

filename=DATA+"/ww3post_state.sqlite3"
remove_file(filename)
ds=Datastore(filename,logger=logger)

ww3postworkdir=DATA+"/ww3post"
ww3post=hafs.ww3.WW3Post(dstore=ds,conf=conf,section='ww3post',taskname='ww3post',workdir=ww3postworkdir,fcstlen=fcstlen)
ww3post.run()

logger.info("ww3post done")
Example #2
0
        sys.exit(1)
    else:
        logger.warning('%s: overwriting pre-existing XML file.' % (outxml, ))

havedb = isnonempty(outdb)
deletedb = False
if havedb:
    if force or ask(
            'ALERT! %s: database for old configuration exists.  Use it (y/n)?'
            % (outdb, )):
        logger.warning('%s: not deleting database for old configuration.' %
                       (outdb, ))
    elif ask('%s: Delete database for old configuration (y/n)?' % (outdb, )):
        logger.warning('%s: deleting database for old configuration.' %
                       (outdb, ))
        remove_file(outdb)
    else:
        logger.error('%s: database exists, user does not want to delete '
                     'or use it.  Aborting.')
        sys.exit(2)

with open(outxml, 'wt') as outf:
    outf.write(rocotoxml.getvalue())

########################################################################
# Run rocotorun

clustername = produtil.cluster.name()

if clustername in ('tide', 'gyre'):
    WHERE_AM_I = 'wcoss'