code: def get_model_type(model_type, config):
      
  
      # If no model type is given, then check the config file
      if not model_type:
          model_type = config.get('model')
  
      # If there is still no model type, try the parent directory
      if not model_type:
          model_type = os.path.basename(os.path.abspath(os.pardir))
          print('payu: warning: Assuming model is {0} based on parent directory '
                'name.'.format(model_type))
  
      if model_type not in supported_models:
          print('payu: error: Unknown model {0}'.format(model_type))
          sys.exit(-1)
docs: Determine and validate the active model type.