Template:CMI Example go CXX

From CSDMS
Revision as of 00:48, 1 February 2012 by CSDMSBot (talk | contribs) (Automated import of articles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  int bocca_status = 0;

  this->is_driver = TRUE;

  this->CMI_initialize (NULL);
  this->CMI_run (-1);
  this->CMI_finalize ();

  return bocca_status;

#if 0
  {
    ::sidl::array< ::std::string> properties =
      sidl::array< ::std::string>::create1d(2);
    double duration;

    fprintf (stderr, "Running GO
");
    if (!this->logging_is_initialized)
    {
      fprintf (stderr, "Set up logging
");
      this->log = ::edu::csdms::tools::Verbose::_create ();
      fprintf (stderr, "Logging is set up
");
      this->log.set_log_level (1);
      fprintf (stderr, "Logging level set
");
      this->logging_is_initialized = true;
    }

    PRINT(1, "Read input paramaters");
    { /*   Get site and case prefixes from the GUI */
      string site_prefix = userinput.getString ("/Child/SitePrefix", "");
      string case_prefix = userinput.getString ("/Child/CasePrefix", "");

      duration= userinput.getDouble ("/Child/Input/Var/RunDuration", 0);

      properties.set (0, site_prefix);
      properties.set (1, case_prefix);
    }

    PRINT(1, "Initialize");
    this->initialize_impl (properties);

    PRINT (1, "Run");
    this->run_impl (duration);

    PRINT (1, "Finalize");
    this->finalize_impl ();
  }

  PRINT (1, "Model is complete");
  return bocca_status;
#endif