Wraps a try / except and a check for self.filename around ConfigParser
    as it talks to the configuration file.
    Also, checks for existence of configuration file so this won't execute (and fail) 
    when no configuration file is provided (e.g., running in coupled mode with CSDMS 
    entirely with getters and setters)

    vartype can be 'float', 'str' or 'string' (str and string are the same),
    or 'int' or 'integer' (also the same).
    
    "Optional" determines whether or not the program will exit if the variable 
    fails to load. Set it to "True" if you don't want it to exit. In this case,
    the variable will be set to "None". Otherwise, it defaults to "False".
    
    "specialReturnMessage" is something that you would like to add at the end 
    of a failure to execute message. By default it does not print.

def configGet(self, vartype, category, name, optional=False, specialReturnMessage=None):
    """
    Wraps a try / except and a check for self.filename around ConfigParser
    as it talks to the configuration file.
    Also, checks for existence of configuration file so this won't execute (and fail) 
    when no configuration file is provided (e.g., running in coupled mode with CSDMS 
    entirely with getters and setters)

    vartype can be 'float', 'str' or 'string' (str and string are the same),
    or 'int' or 'integer' (also the same).
    
    "Optional" determines whether or not the program will exit if the variable 
    fails to load. Set it to "True" if you don't want it to exit. In this case,
    the variable will be set to "None". Otherwise, it defaults to "False".
    
    "specialReturnMessage" is something that you would like to add at the end 
    of a failure to execute message. By default it does not print.
    """
    
    try:
      if vartype == 'float':
        var = self.config.getfloat(category, name)
      elif vartype == 'string' or vartype == 'str':
        var = self.config.get(category, name)
        if var == ""  and optional == False:
          # but "" is acceptable for boundary conditions
          if name[:17] != 'BoundaryCondition':
            if self.Quiet != True:
              print("An empty input string here is not an acceptable option.")
              print(name, "is not optional.")
              print("Program crash likely to occur.")
      elif vartype == 'integer' or vartype == 'int':
        var = self.config.getint(category, name)
      elif vartype == 'boolean' or vartype == 'bool':
        var = self.config.getboolean(category, name)
      else:
        print("Please enter 'float', 'string' (or 'str'), 'integer' (or 'int'), or 'boolean (or 'bool') for vartype")
        sys.exit() # Won't exit, but will lead to exception
      return var
    except:
      if optional:
        # Carry on if the variable is optional
        var = None
        if self.Verbose or self.Debug:
          if self.grass == False:
            print("")
            print('No value entered for optional parameter "' + name + '"')
            print('in category "' + category + '" in configuration file.')
            print("No action related to this optional parameter will be taken.")
            print("")
      else:
        print('Problem loading ' + vartype + ' "' + name + '" in category "' + category + '" from configuration file.')
        if specialReturnMessage:
          print(specialReturnMessage)
        sys.exit("Exiting.")