Skip to main content
FluidEarth Portal Header version 3

FluidEarth Portal

Go Search
FluidEarth Portal > FluidEarth Wiki > Using Silverfrost FTN95  

Using Silverfrost FTN95

Silverfrost FTN95 can be used as an alternative to the Intel FORTRAN compiler.
Integration with Visual Studio Pro
Integration with Visual Studio Pro is achieved by installing Visual Studio before Silverfrost.  Silverfrost offers an integration option as part of its installation procedure.  Successful integration will allow for real time debugging while the model engine is being run in Pipistrelle.
If Visual Studio Pro is not available, the model engine code can be compiled into a DLL using Silverfrost.  The c# version of Visual Studio Express can then be used to compile the client and server projects.  It should be noted that integration with Silverfrost and real time debugging are not possible with Visual Studio Express.
Exposing functions in the model engine
Functions are exposed to the model server from the model engine DLL.  Silverfrost's method for exposing a function is different to Intel.  Intel uses the !DEC$ compiler directive.  However Silverfrost treats all lines starting !DEC$ in Hrw.OpenMI.ExampleEngine.F90 (SDK v0.6) source file as comments.
Silverfrost FTN95 requires the functions to be exposed at the linking stage.  A description of FORTRAN project settings required are given in the Silverfrost FTN95 help section Samples|Win32 only|Visual C Interoperability 1 - Calling an FTN95 DLL from Visual C++.  These instructions should be followed with the exception that a DLL is generated instead of a LIB.  Also 'export all' should be switched off.  Instead a file including the list of functions to be exposed should be used.
For example, this file  'export.slink' should include the following lines when using SDK v0.6:
export Hrw_OpenMI_Initialise
export Hrw_OpenMI_Initial_Out_Values
export Hrw_OpenMI_PerformTimeStep
export Hrw_OpenMI_Finish
Exception handling
Version 0.6 of the ExampleTankFortran makes use of Intel specific functions to trap errors.  The following lines should be commented out from HrwOpenMIExceptions.F90 if using Silverfrost.
all lines that CALL RaiseException
Certain errors in the model engine that were handled by Intel will cause the model engine to crash in Silverfrost.  This method of error trapping is being modified for version 0.7 of the SDK to remove the dependancy on Intel specific routines.

Last modified at 30/03/2009 11:40  by JMauz