Compaq Visual Fortran 6.5A


Compaq released version 6.5 as a paid upgrade to either their own version 6.1 or Digital's version 6.0 of the compiler in January 2001. Specific Information on the compiler can be found in the Fortran section of Compaq's website. We've also found a download on Compaq's website which contains a number of .avi movies showing you how to use the developer studio more effectively. You can download them directly from our site using the link at the bottom of this page.

PLEASE NOTE: Compaq released a service pack for their compiler in January 2001. If you purchased your compiler before then please visit their site and download the free upgrade! There is a bug in the version 6.5 compiler which causes compilation errors when recompiling on a Windows 98 computer. The download is approximately 9.2 MB.

Recompiling TRNSYS for Windows from the Command Prompt

  1. Navigate to the x:\trnsys15\kernal\ directory.
  2. Type the command: fl32 /c /I\trnsys15\include *.for to recompile the standard fortran code
  3. Navigate to the x:\trnsys15\types\ directory
  4. Type the command: fl32 /c /I\trnsys15\include *.for to recompile the standard fortran code
  5. Recompile any non-standard code that you have using the same command
  6. Navigate to the x:\trnsys15\ directory
  7. You may skip the next 3 steps if you have no non standard code to add
  8. Edit the file link.cvf by typing the command edit link.cvf
  9. Add any non standard code to the link.cvf file following the syntax for the other code in the file.
  10. Save your changes and exit back to the command prompt
  11. Type the command link @link.cvf to relink all the newly compiled code into a new trnlib.dll file.

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, cvftrnsys in the x:\cvftrnsys 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\Compaq_65\ 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 cvfdummy.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 DVF50, DVF60, CVF61, or CVF65 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 CVF, 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 DVF50 or 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.

13. Download a series of AVI movies showing you how to use the Developer Studio more effectively (4.4 MB)