def create_copy(self):
if self.executable is None or not isfile(self.executable):<EOL><INDENT>raise FileNotFoundError(<EOL>"<STR_LIT>".format(<EOL>self.version, self.executable<EOL>)<EOL>)<EOL><DEDENT>if self.is_temp:<EOL><INDENT>assert (<EOL>self.root_dir is None<EOL>), "<STR_LIT>"<EOL>self.root_dir = mkdtemp(prefix="<STR_LIT>")<EOL><DEDENT>if exists(self.run_dir):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if not exists(self.root_dir):<EOL><INDENT>makedirs(self.root_dir)<EOL><DEDENT>exec_dir = basename(self.original_dir)<EOL>dirs_to_copy = ["<STR_LIT:.>", "<STR_LIT>", "<STR_LIT>"]<EOL>assert exec_dir in dirs_to_copy, "<STR_LIT>"<EOL>for d in dirs_to_copy:<EOL><INDENT>source_dir = abspath(join(self.original_dir, "<STR_LIT:..>", d))<EOL>if exists(source_dir):<EOL><INDENT>_copy_files(source_dir, join(self.root_dir, d))<EOL><DEDENT><DEDENT>makedirs(join(self.root_dir, "<STR_LIT>"))<EOL>self.set_years()<EOL>self.set_config()<EOL>
Initialises a temporary directory structure and copy of MAGICC
configuration files and binary.