/// <summary>
 /// Calls the model destructor (closes data files)
 /// </summary>
 public void Finish()
 {
     if (!(MohidWaterEngineDLLAccess.Finish()))
     {
         CreateAndThrowException();
     }
     while (Kernel32Wrapper.FreeLibrary(_FortranDllHandle))
     {
         ;
     }
 }
        /// <summary>
        /// Loads the Fortran Dll and initializes the model (calling the constructor)
        /// </summary>
        /// <param name="filePath">Path to the nomfich.dat file</param>
        public void Initialize(string filePath)
        {
            //Loads the library
            _FortranDllHandle = Kernel32Wrapper.LoadLibrary(@"D:\Software\Mohid\MOHID.Numerics\Solutions\VisualStudio2008_IntelFortran11\MOHIDNumerics\MohidWaterEngine\Release OpenMI\MohidWaterEngine.dll");

            //Sets the directory temporary to the exe dir of the model
            String currentDir = Environment.CurrentDirectory;

            Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(filePath);

            //Calls the constructor and reads data files, etc
            if (!(MohidWaterEngineDLLAccess.Initialize(filePath, ((uint)filePath.Length))))
            {
                CreateAndThrowException();
            }

            Environment.CurrentDirectory = currentDir;
        }