/// <summary>
 /// Calls the model destructor (closes data files)
 /// </summary>
 public void Finish()
 {
     if (!(MohidLandEngineDLLAccess.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\MohidLandEngine\Debug OpenMI\MohidLandEngine.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 (!(MohidLandEngineDLLAccess.Initialize(filePath, ((uint)filePath.Length))))
            {
                CreateAndThrowException();
            }

            Environment.CurrentDirectory = currentDir;
        }