RHESSysWorkflows  1.33
Namespaces | Variables
RunModel.py File Reference

Namespaces

 RunModel
 Run RHESSys.
 

Variables

tuple RunModel.parser = argparse.ArgumentParser(description='Run RHESSys, recording information about the run in metadata')
 
string RunModel.help = 'The configuration file'
 
tuple RunModel.outputType = parser.add_mutually_exclusive_group(required=True)
 
tuple RunModel.args = parser.parse_args()
 
tuple RunModel.cmdline = RHESSysMetadata.getCommandLine()
 
 RunModel.configFile = None
 
tuple RunModel.context = Context(args.projectDir, configFile)
 
tuple RunModel.metadata = RHESSysMetadata.readRHESSysEntries(context)
 
list RunModel.rhessysDir = metadata['rhessys_dir']
 
tuple RunModel.paths = RHESSysPaths(args.projectDir, rhessysDir)
 
list RunModel.rhessysBinPathRel = metadata['rhessys_bin']
 
tuple RunModel.rhessysBinPath = os.path.join(context.projectDir, rhessysBinPathRel)
 
tuple RunModel.outputDir = os.path.join(paths.RHESSYS_OUT, args.outputPrefix)
 
tuple RunModel.outputPrefix = os.path.join(outputDir, RHESSysMetadata.MODEL_NAME)
 
tuple RunModel.outputPrefixRel = paths.relpath(outputPrefix)
 
tuple RunModel.outputDirRel = paths.relpath(outputDir)
 
tuple RunModel.worldfile = os.path.join(paths.RHESSYS_WORLD, args.worldfile)
 
tuple RunModel.worldfileRel = paths.relpath(worldfile)
 
tuple RunModel.tecfile = os.path.join(paths.RHESSYS_TEC, args.tecfile)
 
tuple RunModel.tecfileRel = paths.relpath(tecfile)
 
string RunModel.cmd_proto = "{bin} -st {startDate} -ed {endDate} {outputType} -pre {outputPrefix} -t {tecfile} -w {worldfile} -r {flowtables} {remainders}"
 
 RunModel.surfaceFlow = None
 
list RunModel.subsurfaceFlow = args.flowtables[0]
 
tuple RunModel.subsurfaceFlowRel = paths.relpath(subsurfaceFlow)
 
 RunModel.flowtables = subsurfaceFlow
 
 RunModel.flowtablesRel = subsurfaceFlowRel
 
tuple RunModel.surfaceFlowRel = paths.relpath(surfaceFlow)
 
string RunModel.remainders = ' '
 
string RunModel.startDate = ' '
 
string RunModel.endDate = ' '
 
tuple RunModel.cmd
 
tuple RunModel.cmdRel
 
tuple RunModel.cmdArgs = cmd.split()
 
tuple RunModel.process = subprocess.Popen(cmdArgs, cwd=paths.RHESSYS_DIR, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 
tuple RunModel.rhessysOutPath = os.path.join(outputDir, 'rhessys.out')
 
tuple RunModel.rhessysOut = open(rhessysOutPath, 'w')
 
tuple RunModel.line = process.stdout.readline()
 
tuple RunModel.run = ModelRun()