parameters: ()
docstring: the main driver
docstring_summary: the main driver
docstring_tokens: the main driver
function: def main():
      """the main driver"""
  
      # note: you need to put a space at the start of the string
      # that gives defines so that the '-' is not interpreted as
      # an option itself
      # https://stackoverflow.com/questions/16174992/cant-get-argparse-to-read-quoted-string-with-dashes-in-it
  
      parser = argparse.ArgumentParser()
      parser.add_argument("--odir", type=str, default="",
                          help="output directory")
      parser.add_argument("--defines", type=str, default="",
                          help="preprocessor defines to interpret")
      parser.add_argument("--nadv", type=int, default=0,
                          help="the number of pure advected quantities")
      parser.add_argument("--ngroups", type=int, default=1,
                          help="the number of radiation groups")
      parser.add_argument("variables_file", type=str, nargs=1,
                          help="input variable definition file")
      parser.add_argument("--with_fortran", action="store_true",
                          help="do we build the Fortran module?")
  
      args = parser.parse_args()
  
      if args.odir != "" and not os.path.isdir(args.odir):
          try:
              os.makedirs(args.odir)
          except FileExistsError:
              # this exception is needed in case of a race condition
              # to create the directory by another make target
              pass
  
      doit(args.variables_file[0], args.odir, args.defines, args.nadv,
           args.ngroups, args.with_fortran)
function_tokens: def main ( ) : # note: you need to put a space at the start of the string # that gives defines so that the '-' is not interpreted as # an option itself # https://stackoverflow.com/questions/16174992/cant-get-argparse-to-read-quoted-string-with-dashes-in-it parser = argparse . ArgumentParser ( ) parser . add_argument ( "--odir" , type = str , default = "" , help = "output directory" ) parser . add_argument ( "--defines" , type = str , default = "" , help = "preprocessor defines to interpret" ) parser . add_argument ( "--nadv" , type = int , default = 0 , help = "the number of pure advected quantities" ) parser . add_argument ( "--ngroups" , type = int , default = 1 , help = "the number of radiation groups" ) parser . add_argument ( "variables_file" , type = str , nargs = 1 , help = "input variable definition file" ) parser . add_argument ( "--with_fortran" , action = "store_true" , help = "do we build the Fortran module?" ) args = parser . parse_args ( ) if args . odir != "" and not os . path . isdir ( args . odir ) : try : os . makedirs ( args . odir ) except FileExistsError : # this exception is needed in case of a race condition # to create the directory by another make target pass doit ( args . variables_file [ 0 ] , args . odir , args . defines , args . nadv , args . ngroups , args . with_fortran )