Digital released an update to their version 5.0 Developer Studio in April 1997. They were later bought out by Compaq, which released a free upgrade to Compaq Visual Fortran 6.1. The two versions are practically indistinguishable from a functionally point of view. Since Digital was bought by Compaq, users with questions regarding the Visual Fortran studio should address their questions to Compaq
Recompiling TRNSYS for Windows from the Command Prompt
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:\dvftrnsys 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_60\ directory. If you add Type61.for to your project, you will also need to add a library: \trnsys15\include\extdll.lib to your project. Finally, add the file 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.
Debug Tab | |
General | Executable for Session: c:\trnsys15\trnsys.exe |
Working Directory: c:\trnsys15 | |
Program Arguments: Here you can enter the name of a TRNSYS input file that you with to debug | |
Additional DLLs | Local Name: c:\trnsys15\trnlib.dll |
Uncheck: Try to locate other dlls | |
Fortran Tab | |
General | Check the box for "Generate Source Browser Information" |
Libraries | Use Fortran Run-time Libraries should be set to "static *" |
Preprocessor | Enter: \trnsys15\include" for Custom INCLUDE and USE paths |
Run Time | check boxes next to all "Runtime Error Checking" options |
Check box next to "Generate Traceback Info" | |
Link Tab | |
General | Output File Name: c:\trnsys15\trnlib.dll |
Check box next to "Generate Debug Info" | |
Customize | Output filename should now read: c:\trnsys15\trnlib.dll |
Input | Under "Ignore Libraries" enter "libcd.lib" * |
5. NOTE! In this step, the current trnlib.dll file will be overwritten! It is wise to back it up somewhere on your computer before proceeding! Under the Build menu, click Rebuild All. Watch the bottom window for errors and problems with compiling and creating the trnlib.dll output file. If everything worked correctly, the TRNSYS DLL was created in the \trnsys15 directory and TRNSYS can be run with the updated DLL. To run TRNSYS, select Execute from the Build menu. TRNSYS will prompt you for a TRNSYS input file.
6. To use the debugging features of DVF60, select Start Debug from the Build menu, then Go. At this point, the program will state that "TRNSYS.EXE does not have any debug information. OK?" Click OK because we are concerned with the Fortran DLL and not the TRNSYS executable. Click the box by Don t ask this in the future and click OK. Without a breakpoint or a bug, TRNSYS will just start and run until the simulation is finished.
7. To halt execution at some point in the source code, insert breakpoints at one or more lines in the Fortran code of one or more subroutines. For example, open the file trnsys.for and create a breakpoint at the beginning of the source code, perhaps in the definitions of variables and common blocks. To create a breakpoint, put the cursor on a line of the source code and press F9. A red dot will appear to the left of the source code line. When TRNSYS is executing through the Debug feature of DVF, it will always stop at this point in the code.
8. Experiment with the other debug commands by setting (and turning off) breakpoints with the F9 key, adding watch variables, stepping through the source code (F11), and running until you reach the cursor (F7). You can see the value of a variable simply by placing your cursor on top of that variable in the source code for a couple of seconds.
9. You should modify the default way in which the debugger handles exceptions (for example, an array-out-of-bounds error). When TRNSYS halts at the red dot, select the Debug main menu and then the item Exceptions. Note that the Debug main menu is not visible unless the debugger is running. In the Exceptions dialog box, select all the exceptions from the list using the Shift key. Then, select Stop Always and click Change. This is important so that the debugger will stop and display the line that has a run-time error such as Array out of Bounds.
10. Under the Tools main menu, select Options. Choose Tabs and then select Insert Spaces if it says Keep Tabs. This can save a lot of hassle if you edit in DVF60 and then open the file with another editor that does not accept tabs.
11. Familiarize yourself with the Find in Files option under the Edit main menu. This feature allows you to search for text strings throughout all the Fortran code in your project. This is very convenient if you are adjusting COMMON blocks in many subroutines, for example.
12. Familiarize yourself with the various commands under the Debug main menu. Also note that it is possible to have Conditional Breakpoints by selecting Breakpoints from the Edit main menu.