Digital Fortran 5.0 D


Digital's first release of the Developer Studio was version 5.0. They released a number of free patches and upgrades to the compiler and we have found that you need version 5.0D in order to best recompile and relink TRNSYS. As Digital was bought by Compaq in 1999, the Digital Visual Fortran compiler is no longer available. Users who have the compiler and need assistance with it should contact Compaq. It is recommended to use the Visual Studio to recompile and rebuild TRNSYS rather than using the command line. This will allow you to take advantage of the debugging features.

Recompiling TRNSYS for Windows from the Developer Studio

1. Under the File main menu, select New. A New dialog box will appear with the Project tab selected. From the list of projects in this window, select Fortran Dynamic Link Library. Give the project a name and a directory (for example, dvftrnsys in the c:\Trnsys15\Workspace\DVF50 directory). Once selected, a dialog will come up asking for the type of DLL that you want to create. Select Empty dll Application.

2. Under the Project main menu, select Add to Project. From this side menu, select Files. Add all of the Fortran files (.for) from the Kernal and Types subdirectories in the /trnsys15 directory. You will also need to find the files called Type56.obj and Type56_mod.obj that are located in the \trnsys15\types\type56\Digital_50D\ directory or to use the open source version. If you add Type61.for to your project, you will also need to add a library: \Trnsys15\extdll.lib to your project. Finally, add the file \Trnsys15\Dummy\dvfdummy.lib from the Dummy subdirectory. Add any non-standard types that you wish to use in a TRNSYS simulation.

3. Under the Project main menu, select Settings. There are numerous settings here controlled by a series of tabs at the top. Below are the important settings for each of these tabs. Each tab can have several "Categories" so there are many settings involved. Only the settings that must be changed from their default values are mentioned.

4. In the Settings For pull-down menu, select Win32 Debug so that you are modifying the settings for the Debug version.

1. Create a new project

Go to File/New, select the “Project” Tab
Select “Fortran Dynamic Link Library”
Give the project a name and a directory, e.g. DVF50D in \Trnsys15\WorkSpace\DVF50D
Once selected, a dialog will come up asking for the type of DLL that you want to create. Select Empty dll Application.

2. Project files

Under the Project main menu, select Add to Project. From this side menu, select Files.

- Add all Fortran files (.for and .f90) in \Trnsys15\Kernal
- Add all Fortran files (.for and .f90) in \Trnsys15\Types
- Add Type 56 pre-compiled .obj files (from \trnsys15\types\type56\Digital_50D\) or use the open source version files (\Trnsys15\Types\Type56\OpenSource)
- If you add Type61.for
, you will also need to add a library: \Trnsys15\extdll.lib to your project.
- Add the file \Trnsys15\Dummy\dvfdummy.lib
-
Add any non-standard types that you wish to use in a TRNSYS simulation.

4.2. Project settings for "Debug" configuration

Go to Projects/Settings
In the left-hand window, select the “TrnLib” project
Make sure that the "Settings for" drop-down list box shows “Win32 Debug”

There are numerous settings here controlled by a series of tabs at the top. Below are the important settings for each of these tabs. Each tab can have several "Categories" controlled by a drop-down list, so there are many settings involved. Only the settings that must be changed from their default values are mentioned.

Debug Tab  
General Executable for Session: \trnsys15\trnsys.exe
  Working Directory: \trnsys15
  Program Arguments: Here you can enter the name of a TRNSYS input file that you with to debug
Additional DLLs Local Name: \trnsys15\trnlib.dll
  Uncheck: Try to locate other dlls (note: if you select both items in the left "Settings for:" box, you cannot alter this category. You must select only the "Debug" project.
   
Fortran Tab  
General Check the box for "Generate Source Browser Information"
Compatability Under "PowerStation 4.0 Compatability Options" select the box labeled general
Preprocessor Enter: "\trnsys15\include" for Custom INCLUDE and USE paths
Run Time check boxes next to all "Runtime Error Checking" options
   
Link Tab  
General Output File Name: \trnsys15\trnlib.dll
  Check box next to "Generate Debug Info"
  Check box next to "link incrementally"
Customize Output filename should now read: \trnsys15\trnlib.dll
Input Under "Object/library module" enter: dfwin.lib dfport.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
  Under "Ignore Libraries" enter "libc.lib" (NOTE: If you want to use the "Release" configuration, you have to enter libcd.lib instead of libc.lib)

4.3. Build Trnsys library

 Make sure the right project is active in Project/Set active project
Select the appropriate configuration (Debug) in Build/Set Active Configuration
Go to Build/Rebuild all

 


Last updated 2002/10/11