Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introducing Compaq Visual Fortran. Introducing Compaq Visual Fortran.

Similar presentations


Presentation on theme: "Introducing Compaq Visual Fortran. Introducing Compaq Visual Fortran."— Presentation transcript:

1

2 Introducing Compaq Visual Fortran

3 Compaq® Visual Fortran
Offers a combination of: The robustness and reliability of Compaq’s Fortran 95 compiler The easy-to-use Microsoft® visual development environment

4 Compaq Visual Fortran 32-bit Development System for x86 (Intel® , AMD®, …) PCs running: Windows® 2000 Windows NT® 4 Windows 98 Windows 95

5 Compaq Visual Fortran The Compaq Fortran Compiler
Full support of the Fortran 95 Standard* Compaq Fortran (formerly DIGITAL® Fortran) and Microsoft Fortran language extensions for easy code portability among platforms * Previous standards (Fortran 90, FORTRAN 77, FORTRAN IV) are also supported

6 Compaq Visual Fortran Offers Portability from other Platforms
Microsoft-recommended upgrade for PowerStation 4.0 users Provides a consistent Fortran language dialect from desktop to mainframe-class systems Compatible with Fortran code written for other Compaq Fortran platforms: Compaq Tru64TM UNIX® Alpha Linux® Alpha OpenVMSTM Alpha

7 Compaq Visual Fortran Microsoft visual development environment
Windows-based application development Visual editor with color coded syntax highlighting Visual debugger Context-sensitive online documentation Same development environment used by Microsoft Visual C++® V6

8 Compaq Visual Fortran Visual development tools Debugger
Source Code Browser Windows resource editor Fortran Module Wizard for working with COM Objects Fortran COM Server Wizard for creating COM servers (Professional and Enterprise Editions) Graphical viewer for visualizing multi-dimensional arrays (Professional and Enterprise Editions)

9 About this demo... This presentation was created using Microsoft PowerPoint® 97 To perform the next event (such as show a line of text or go to the next slide) Press the Page-Down key Or press the right arrow key

10 The demo is paused while
About this demo... Slowing down the demo To pause the demo Click the right mouse button This menu will appear The demo is paused while this menu is displayed

11 About this demo... Choosing ‘Advance’ performs the next slide action
‘Reverse’ displays the last slide you viewed Choosing ‘End Show’ will end the demo

12 Project-based Development
Visual Fortran organizes application source files by grouping code, libraries, and windows resources together in one entity: the project Facilitates Windows and Mixed-Language programming

13 Visual Fortran Can Build Several Kinds of Projects
To create a new project, click New from the File menu. The following screen appears, displaying available project types. A Fortran Console application is a traditional text-oriented interface that can use most Win32® APIs

14 Visual Fortran Can Build Several Kinds of Projects
Fortran Windows Applications are GUI applications with full access to the Win32 APIs

15 Visual Fortran Can Build Several Kinds of Projects
The QuickWin environment provides an easy way to give existing Fortran applications a Windows “look and feel”

16 Visual Fortran Can Build Several Kinds of Projects
If you have the Microsoft Visual C++ or the Visual Fortran Professional or Enterprise Editions installed, additional project types will be listed (not shown on this screen). You can also develop Fortran static and dynamic link libraries

17 Fortran COM Server With the Professional or Enterprise Editions, you can develop Fortran-based COM Servers

18 Compaq Visual Fortran Visual Fortran is available for x86 PC systems running Windows NT, Windows 2000, Windows 98, and Windows 95 operating systems. Visual Fortran uses the same development environment on all operating systems: Compiler Debugger Source Code Browser Fortran Module Wizard Fortran COM Server Wizard Array Visualizer Online Documentation

19 Version 6.5 New Features New Features for Version 6.5:
Architecture-specific support for Pentium III, AMD K6, AMD K6-2/K6-III, and AMD Athlon processors Fortran COM Server project type and Fortran COM Server Wizard (in Professional and Enterprise Editions) simplify creating Fortran-based COM servers. You can create in-process servers that use custom or dual interfaces New COM routines COMStringFromGUID and COMIsEqualGUID New and changed intrinsics: INT_PTR_KIND returns the KIND for an integer that is large enough to hold an address POPCNT, POPPAR, LEADZ, and TRAILZ Optional KIND argument to LEN, SHAPE, SIZE, LBOUND, and UBOUND

20 Version 6.5 New Features New exception handling routines CLEARSTATUSFPQQ and GETEXCEPTIONPTRSQQ (x86 systems) New environment variable FORT_CONVERT_ext for unformatted non-native files Support added to read nondelimited character strings as input for character NAMELIST items DLLEXPORT and DLLIMPORT of variables now allow export/import of module variables and arrays. Concurrent-use licensing is now available Many new sample programs Faster processing of modules at compile time

21 New Features in Version 6
In addition to v6.5 new features, earlier Visual Fortran V6 releases included hundreds of new and improved features, which include: Full Fortran 95 Standard support. Optional diagnostics flag features deemed "obsolescent" or "deleted" (such features are still supported by the compiler).

22 New Features in Version 6
New optimization features can significantly improve application performance over V5, including architecture-specific optimizations. Full traceback reporting on severe errors with file names, routine names, and line numbers. Dialog support now includes modeless dialogs and additional controls, including ActiveX® controls, progress, tab, and spin controls. Microsoft's newest visual development environment, featuring seamless integration with Microsoft Visual C++ V6, makes it easy to develop and debug mixed-language applications.

23 New Features in Version 6
New Fortran application wizards help you get started on new projects. You can save Fortran project settings for later use when creating new projects of the same project type. Compaq Extended Math Library (CXML) is now provided, including over 1500 mathematical routines. Compaq Array Visualizer (in Professional and Enterprise Editions only) provides an interactive graphic view of your application's array data.

24 New Features in Version 6
Traceback Reporting When a Fortran program terminates due to a severe error condition, the Fortran run-time system displays a report of the calling sequence leading to the error. This tabular report contains one line per call stack frame and includes at least the image name and a hexadecimal program counter (PC) in that image.

25 New Features in Version 6
Traceback Reporting When you request traceback information during compilation, the report contains program counter to source file line correlation information in the displayed error message report. The file names, routine names, and line numbers simplify the task of locating the cause of severe run-time errors.

26 New Features in Version 6
A traceback report might appear as follows: The stack frame of real interest is the first frame in image teof.exe, which shows that the error originated in the routine named AGAIN in source module teof.for at line 21

27 Compaq Extended Math Library (CXML)
Compaq Extended Math Library (CXML) provides: Basic Linear Algebra Subprograms (BLAS) library Industry-standard Basic Linear Algebra Subprograms, including Level 1 (vector-vector, BLAS1), Level 2 (matrix-vector, BLAS2), and Level 3 (matrix-matrix, BLAS3), BLAS Level 1 Extensions, and Sparse BLAS Level 1. Signal Processing library Provides a basic set of signal processing functions, including one-, two-, and three-dimensional Fast Fourier Transforms (FFT), group FFTs, Cosine/Sine Transforms (FCT/FST), Convolution, Correlation, and Digital Filters. Sparse Linear System library Provides both direct and iterative sparse linear system solvers. The direct solver package supports both symmetric and nonsymmetric sparse matrices stored using the skyline storage scheme. The iterative solver package contains a basic set of storage schemes, preconditioners, and iterative solvers.

28 Compaq Extended Math Library (CXML)
LAPACK subprograms Industry-standard subprogram package offering an extensive set of linear system and eigenproblem solvers. LAPACK uses blocked algorithms that are better suited to most modern architectures. Utility subprograms Provides random number generation, vector math functions, and sorting subprograms. CXML is also available for other Compaq Fortran Alpha platforms (see To call CXML routines from Visual Fortran, add the following INCLUDE statement: INCLUDE 'CXML_INCLUDE.F90’

29 Main Menu I would like to…
Learn more about the Microsoft visual development environment Learn more about mixed language programming and dynamic link libraries Learn more about using COM objects with Visual Fortran Learn about Visual Fortran Professional Edition Learn about the Compaq Array Visualizer End the presentation

30 Building a Project: qwpaint
We will now use Compaq Visual Fortran to build a Fortran QuickWin application named qwpaint This sample application draws simple colored shapes with the mouse Along the way we’ll be using the Debugger and Browser to help us fix a problem in our program Back to Main Menu

31 Welcome to the visual development environment!
The visual development environment allows you to compile and run your Fortran application with a click of a button Before we begin, we will customize the visual development environment’s appearance to suit our needs Back to Main Menu

32 The toolbars can be repositioned
within the visual development environment Back to Main Menu

33 Other useful windows can
be displayed as well Back to Main Menu

34 The Output window displays compile and link errors as
well as debugging information Back to Main Menu

35 Choose the File | New... menu item to create a new Project
Back to Main Menu

36 The “New” dialog box... Don’t forget to name your project
Choose Fortran QuickWin Application as the kind of project to build You can specify in which directory it is placed (or accept the default location) Back to Main Menu

37 Select the Windows interface best suited to your application
In our application, we’ll use multiple windows Select the Windows interface best suited to your application Back to Main Menu

38 Now we will add some files to the project The qwpaint project
has been opened. Back to Main Menu

39 Insert Files into a Project...
Use this dialog box to select the source files for the project. Back to Main Menu

40 As a default, the editor highlights Fortran keywords in blue
and comments in green The files are listed under Source Files in the Project Window. To edit a file, double-click its name. Back to Main Menu

41 Clicking the build button or choosing Build | Build qwpaint.exe will
After adding files to a project, select each new file in the FileView pane and select Compile from the Build menu. Clicking the build button or choosing Build | Build qwpaint.exe will compile and link this project Information about the build will be displayed here Back to Main Menu

42 It looks like we The qwpaint Project have a syntax error.
requires qwpaint.mod Back to Main Menu

43 Double clicking on the error message or pressing F4 brings
the editor to the erroneous line Back to Main Menu

44 Now that the problem has been fixed, rebuild the project
Back to Main Menu

45 Let’s run the application
Oh good, everything built Back to Main Menu

46 application looks like
This is what our application looks like The mouse draws shapes in this window Over here, you can adjust the shape and its color Back to Main Menu

47 It looks like we have a bug
in our program! This area should have 16 different colored squares. Like this! Back to Main Menu

48 Now we need to debug our program.
The visual development environment makes this easy, though. Back to Main Menu

49 From this comment, we can guess that the bug occurs in the
But where do we begin? From this comment, we can guess that the bug occurs in the subroutine DrawControlGrid() Back to Main Menu

50 We could do a text search for DrawControlGrid()...
We’d like to locate DrawControlGrid() in the code. We could do a text search for DrawControlGrid()... …but that would be slow and could become complicated if we had to search through a number of files. Back to Main Menu

51 We can use the “Find in Files” tool to search a number
of files for a certain string Back to Main Menu

52 …where to look for the files
“Find in Files…” The text to search for... …where to look for the files Back to Main Menu

53 Results of the search are displayed in this window
Back to Main Menu

54 “Find in Files” finds all occurrences of a
given string, but we’d like to know more. Specifically, we’d like to know where DrawControlGrid() is defined. Back to Main Menu

55 For this task we can use Visual Fortran’s Source Code Browser
Back to Main Menu

56 To use the source code browser, we need to adjust the project settings
Back to Main Menu

57 The “Project Settings” dialog box...
Settings must be changed under the “Fortran” and “Browse Info” tabs Back to Main Menu

58 The “Project Settings” dialog box...
The project settings dialog box also allows you to generate listing and assembly files. Back to Main Menu

59 Rebuild your project to generate browser information
…then in the Tools menu choose Source Browser to start browsing Back to Main Menu

60 You can browse information
about any identifier in your source code. We want to know about DrawControlGrid This is the main Browser dialog box You can get information about variable declaration and usage, call structure, and file hierarchy. Since the Fortran language is not case-sensitive, be sure to uncheck the “case-sensitive” check box! Back to Main Menu

61 Clicking “OK” brings up this box
This window lists all of the places in your code in which DrawControlGrid() occurs Double-click on any of these entries to go to that line of source code Back to Main Menu

62 DrawControlGrid is defined.
We want to know where DrawControlGrid is defined. Double-click on the definition... Back to Main Menu

63 …and the Browser takes you
right to the code Back to Main Menu

64 If we look at the code for DrawControlGrid(), we see
that the grid is drawn here The function setcolor is called to change the color Back to Main Menu

65 We’d like to know more about the setcolor QuickWin function.
We can use the HTML Help Viewer online documentation to get information about setcolor. Back to Main Menu

66 Click the word we’d like to know more about...
and press the F1 key to search the online help. Back to Main Menu

67 This dialog box searches
the online help. Click Display to view the help page Back to Main Menu

68 A new window opens to allow you to view the online documentation.
Information about function parameters and return values. Description of usage and functionality available in “Remarks” Back to Main Menu

69 Many help topics come with example code
Links to other online documentation Many help topics come with example code Back to Main Menu

70 You can browse the online help by clicking on the various topics
Back to Main Menu Back to Main Menu

71 We think that the bug occurs somewhere in this code
Let’s use the Visual Fortran debugger to see what happens during execution Back to Main Menu

72 Click the hand to set a breakpoint at the current Click this button
cursor position Click this button to start debugging Back to Main Menu

73 This arrow points to the next line to be executed
The visual development environment has changed into debugging mode Back to Main Menu

74 This window allows you to view the values of local variables.
Over here, you can watch the value of a certain variable. Records and arrays can be viewed in their entirety with just the click of a button Back to Main Menu

75 You can step through the program by clicking this icon
Variable values are updated automatically Back to Main Menu

76 After some more debugging, we find the answer to our problem.
By examining the values of i, j, and i2, we determine that the argument to setcolor should be i*4+j not i*4+i Back to Main Menu

77 Now that we have changed
…we can stop debugging... ..and rebuild Now that we have changed our source code... Back to Main Menu

78 No errors! Let’s run our application
Back to Main Menu

79 Our problem has been fixed Back to Main Menu

80 Building a Project: qwpaint
We used Visual Fortran to build an application that used the QuickWin graphics libraries The source files were organized using a project We used the context-sensitive feature of the online documentation The Browser and Debugger helped us fix a couple of problems with our program Back to Main Menu

81 Main Menu I would like to…
Learn more about the Microsoft visual development environment Learn more about mixed language programming and dynamic link libraries Learn more about using COM objects with Visual Fortran Learn about Visual Fortran Professional Edition Learn about the Compaq Array Visualizer End the presentation

82 Building a DLL Functions in dynamic-link libraries (DLLs) are not loaded until they are called at run-time Using DLLs reduces the size of executables and modularizes source code Back to Main Menu

83 Building a DLL We will now use Visual Fortran to construct a DLL
The DLL will be written using fixed-source form syntax, but its functions will be called in programs written in Fortran 95 and C++ Even though Microsoft Visual C++ 6 is purchased separately from Visual Fortran, both products share the same development environment! Back to Main Menu

84 Building a DLL Our application will be called spline because our DLL contains functions that perform a spline analysis on data spline also introduces the concept of visual development environment workspaces. Workspaces allow several projects to be grouped together. Back to Main Menu

85 Building a DLL spline demonstrates mixed language programming using Visual Fortran and Visual C++ Installing Visual C++ adds options to the visual development environment that are not applicable to Visual Fortran Different kinds of Projects to build C++ tools Back to Main Menu

86 Building a DLL The spline Workspace consists of three Projects:
splinedll - a DLL containing routines that perform a spline analysis on data splineqw - a Visual Fortran QuickWin application that calls routines in splinedll.dll splinevc - a Visual C++ program that uses the routines in splinedll.dll Back to Main Menu

87 To create a new workspace,
choose File | New... Back to Main Menu

88 We’ll create a Fortran Dynamic Link Library project...
…called splinedll... …and simultaneously create a workspace for our project Back to Main Menu

89 Choose “an empty DLL application” in the app-wizard dialogue...
…and click “Finish”... Back to Main Menu

90 The App Wizard creates an empty workspace for our project.
Let’s add some files to the splinedll project Back to Main Menu

91 Insert the spline.for file into the splinedll project
Back to Main Menu

92 spline.for contains two functions,
The visual development environment editor formats itself for editing fixed-form Fortran source code spline.for contains two functions, SplineCalculate() and SplineEvaluate(), which determine the spline curve Back to Main Menu

93 Build the DLL just like you would any other project
Back to Main Menu

94 Now we’re going to build splineqw, a Fortran QuickWin program
that uses splinedll.dll Configuration: spldll - Win32 Debug spline.dll - 0 error(s), 0 warning(s) Back to Main Menu

95 We’ll create a Fortran Quick Win project...
…called splineqw... …and include it into our current workspace Back to Main Menu

96 Select the Windows interface that best suits your application
Choose the windowing options that best suit your application And the Wizard inserts the new project into your workspace Back to Main Menu

97 …we’ll add some files to it
Now that we’ve created the splineqw project... Back to Main Menu

98 Locate the file you wish to insert
Be sure to insert it into the correct project Back to Main Menu

99 Fspline.f90 uses the QuickWin graphics library to draw a spline curve that fits some data points
Back to Main Menu

100 Before we can build Splineqw. exe, we have to link in file splinedll
Before we can build Splineqw.exe, we have to link in file splinedll.lib Instead of adding the link path, you can add the splinedll.lib file to the project by using the Add to Project … Files item in the Project menu We can do that by adding the (relative) path here in the Project settings dialog Back to Main Menu

101 Before we can run splineqw
Before we can run splineqw.exe, we must be sure that the system can find splinedll.dll The simplest way to assure this is to physically move (or copy) splinedll.dll into the directory which contains our executable file, splineqw.exe Back to Main Menu

102 Build splineqw.exe Back to Main Menu

103 In splineqw the user clicks on a window and a spline curve is displayed that best fits the clicked points Back to Main Menu

104 Next we’ll use Visual C++ to build a new Windows application that uses splinedll.dll
We can perform mixed-language programming using Visual Fortran and Visual C++ in the same development environment Back to Main Menu

105 We’ll create a Visual C++ Win32 application
…called splinevc... …and include it into our current workspace Back to Main Menu

106 Choose to build an empty project...
…and the AppWizard finishes the job Back to Main Menu

107 Splinevc uses the Microsoft Foundation Classes to create a user interface
Back to Main Menu

108 We must specify that we are using the Microsoft Foundation Classes under Project Settings
Back to Main Menu

109 Instead of adjusting the link settings, splinedll
Instead of adjusting the link settings, splinedll.lib can be added directly to the project! Back to Main Menu

110 Before you attempt to build any project, make sure it is set as the Active Project
Back to Main Menu

111 Now we are ready to build splinevc.exe
Splinevc runs similarly to splineqw Back to Main Menu

112 The MFC application has a different look to it...
…but it performs the same task Back to Main Menu

113 Building a DLL We used Visual Fortran to build a dynamic link library that contained functions to perform a spline analysis Within the same Workspace we built two applications that used the DLL: one written in Fortran and the other in C++ Back to Main Menu

114 Main Menu I would like to…
Learn more about the Microsoft visual development environment Learn more about mixed language programming and dynamic link libraries Learn more about using COM objects with Visual Fortran Learn about Visual Fortran Professional Edition Learn about the Compaq Array Visualizer End the presentation

115 Working with COM Objects
Many windows applications provide a means of accessing their functionality from another program The Component Object Model (COM) is one such mechanism Back to Main Menu

116 Working with COM Objects
COM is a language independent object model designed for application interaction But the Fortran language does not support objects The Visual Fortran Module Wizard allows you to integrate COM objects into your Fortran application development Back to Main Menu

117 Working with COM Objects
The Module Wizard creates Fortran module files that provide an interface to functions used to access COM objects The Fortran Module Wizard helps you create Fortran applications (clients) that use existing COM or Automation servers The Professional and Enterprise editions include the ability to create an in-process COM server (described in the section Visual Fortran Professional Edition). Back to Main Menu

118 Working with COM Objects
We will now build a Console application that uses the Module Wizard to access a COM Object dlines uses the visual development environment itself to modify a Fortran source file Replaces “debug characters” in column 1 with conditional compilation IF DEFINED directives Back to Main Menu

119 Working with COM Objects
dlines calls COM routines from Developer Studio that: Start the visual development environment running Open a file within the visual development environment Perform editing functions on the open file replace text, go to the next line, etc. Save the file Close the application Back to Main Menu

120 First we need to make a new Project Back to Main Menu

121 New Fortran Console Application
Named dlines New Fortran Console Application Back to Main Menu

122 Choose to build an empty project...
…and the AppWizard finishes the job Back to Main Menu

123 Choose Fortran Module Wizard from the Tools menu
Now let’s use the Module Wizard to create the interface to the visual development environment’s COM functions Choose Fortran Module Wizard from the Tools menu Back to Main Menu

124 The Visual Fortran Module Wizard
We’ll be getting information from a COM interface Our Fortran module will be named dsapp Back to Main Menu

125 The Visual Fortran Module Wizard
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\COMMON\MSDEV98\BIN\DEVSHL.DLL (Visual C++ Shared Objects) Use the Visual C++ Shared Objects You can specify which COM Interfaces you want access to Back to Main Menu

126 The Visual Fortran Module Wizard
Might as well have access to all of the COM Interfaces Generate the Fortran module file Back to Main Menu

127 The Visual Fortran Module Wizard
You can specify the name of the source file containing the Fortran modules Back to Main Menu

128 We’ll repeat the process
The Visual Fortran Module Wizard We’ll repeat the process for another Developer Studio COM Object This module will be called ds_text Back to Main Menu

129 …generate the Fortran module file and save it as dstext.f90
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\COMMON\MSDEV98\BIN\DEVEDIT.PKG (Visual C++ Text Editor) …select all of the COM Interfaces as before... Using the Visual C++ Text Editor this time... …generate the Fortran module file and save it as dstext.f90 Back to Main Menu

130 Add the files generated by the Module Wizard to the dlines project
Back to Main Menu

131 dsapp.f90 was generated by the Fortran Module Wizard
This is an INTERFACE to the function IGenericDocument_Save(), which saves the file open in the visual text editor Back to Main Menu

132 Let’s add these sample files which are located in your samples\advanced\com\dlines directory
Back to Main Menu

133 These two files make use of the interfaces in dsapp and dstext
Back to Main Menu

134 After other COM functions are called
to modify the Fortran source file... … $IGenericDocument_Save() is called to save the changes Now, let’s take a look at the program in action Back to Main Menu

135 This Fortran fixed-format file contains lines beginning with
[Mbcomp.for] Execute the program This Fortran fixed-format file contains lines beginning with the letters ‘D’ and ‘E’. Visual Fortran allows only “Debug Lines” that start with ‘D’ We’ll use dlines to change the ‘E’ debug lines to preprocessed IF DEFINED statements Back to Main Menu

136 dlines.exe Specify the file on which to operate*
The debug character and the IF DEFINED variable to replace it with Remember to use quotation marks when typing DOS pathnames that contain spaces Back to Main Menu

137 The ‘E’ debug lines have been replaced with conditional
compilation IF DEFINED directives Mbcomp2.for * Back to Main Menu

138 Working with COM Objects
dlines made use of functions that are a part of a Component Object Model Object The Visual Fortran Module Wizard was used to create a Fortran module file that allowed dlines to interact with Developer Studio dlines used functions that are a part of the visual development environment to edit a Fortran source file Back to Main Menu

139 Main Menu I would like to…
Learn more about the Microsoft visual development environment Learn more about mixed language programming and dynamic link libraries Learn more about using COM objects with Visual Fortran Learn about Visual Fortran Professional Edition Learn about the Compaq Array Visualizer End the presentation

140 Visual Fortran Professional Edition
In addition to the Standard Edition, a Professional Edition is available that includes: The complete visual development environment IMSL numerical libraries Fortran COM Server Wizard and project type Compaq Array Visualizer The Enterprise Edition includes the Professional Edition software, plus other software that lets you use Visual Fortran (on a PC) to develop applications for Compaq Tru64 UNIX and other UNIX systems. Back to Main Menu

141 Visual Fortran Professional Edition
The Visual Numerics® IMSL numerical libraries provide over 900 Fortran routines for performing advanced mathematical algorithms Applied mathematics Statistical functions Helper functions for printing, etc. IMSL libraries are available for many other OS/architecture platforms (see To call IMSL routines from Visual Fortran, add the following USE statement: USE Numerical_libraries Back to Main Menu

142 Visual Fortran Professional Edition
IMSL General Mathematics library Solving Linear Systems Matrix and vector manipulation Eigenvalues and eigenvectors Integration and differentiation Differential equations Transforms Printing, sorting, and other utilities Back to Main Menu

143 Visual Fortran Professional Edition
IMSL Statistics Library Basic statistics, regression, correlation Analysis of variance Covariant structures and factor analysis Multidimensional scaling Density and hazard estimation Functions for printing console-based charts and graphs (histogram, scatter, etc.) Back to Main Menu

144 IMSL Library Example We will now build a Fortran Console application that uses a couple of the IMSL statistics routines mnrain.exe plots some data in a vertical histogram The data is the average precipitation in Minnesota in the month of March Back to Main Menu

145 IMSL Library Example This sample program comes from the IMSL online documentation After looking at the online documentation, we will build a Visual Fortran project Back to Main Menu

146 The IMSL libraries come with extensive online documentation as well as a number of example programs
Back to Main Menu

147 Volume 2, so open the file STATVOL2.
In the contents, click Appendix B, Alphabetic Summary of Routines. Locate VHSTP. The VHSTP routine is in Volume 2, so open the file STATVOL2. Back to Main Menu

148 The IMSL documentation offers information about the routine’s
usage and arguments Back to Main Menu

149 This sample program calls VHSTP to draw a vertical
histogram of some data It also uses another IMSL routine, OWFRQ, to tabulate the data Let’s build this example program using Visual Fortran Back to Main Menu

150 Copy the program text from the online help into a Visual Fortran source file. In the Edit menu:
1. Click Select All. 2. Click Copy Back to Main Menu Back to Main Menu

151 source code to our project
mnrain - Compaq Visual Fortran Now we need to add the source code to our project We’ve made a Fortran Console Application and named it mnrain So, we’ll create an empty Fortran source file Back to Main Menu

152 We want to make a new File...
Add it to the current project (mnrain) …named mnrain.for We want it to be Fixed Format (.for) Back to Main Menu Back to Main Menu

153 mnrain.for is open in the editor and has been added to the project
mnrain - Compaq Visual Fortran mnrain.for is open in the editor and has been added to the project Now, we’ll paste the IMSL example into mnrain.for Back to Main Menu

154 After we paste in the text from the IMSL documentation file,
edit the text to fit in fixed format: 1. Add the line: USE Numerical_Libraries 2. Comment out the line containing EXTERNAL 3. Change the single quote characters to ASCII single quotation marks 4. Remove extra non-source text Back to Main Menu

155 Let’s compile this file to check for errors.
Back to Main Menu

156 execute the application
Now let’s build and execute the application Back to Main Menu

157 mnrain.exe By calling two IMSL library routines,
our data was tabulated and displayed in this histogram Back to Main Menu

158 Creating Fortran COM Servers
Visual Fortran (all editions) provides the Fortran Module Wizard to help generate code needed to use COM and Automation objects (Fortran client applications). Visual Fortran Professional and Enterprise Editions also provide the ability to create a Fortran COM server. The Fortran COM Server Wizard helps you generate a Fortran application that creates a COM server or a server that supports dual interfaces. The initial implementation in V6.5 supports only in-process servers, loaded into the client's process. COM is language independent, so clients can be created by Visual Basic, Visual C++, Visual Fortran, and other tools that support COM. COM servers are reusable components, so multiple client applications can use the server. Back to Main Menu

159 Creating Fortran COM Servers
Creating a Fortran COM Server consists of these steps: Create a Fortran COM Server project. This includes specifying a class name, interface name, and derived-type name. Select the Fortran COM Server project type when creating the project. Use the Fortran COM Server Wizard to define the interface(s) defined by the class, including the methods, properties, and the arguments for each interface. When you build the project, the Fortran COM Server Wizard generates code. You need to modify the source files by adding code to supply the implementation of the methods. Test the Fortran COM server, by creating one or more clients to access the server. Deploy the Fortran COM server. Back to Main Menu

160 Creating Fortran COM Servers
The right pane shows the properties of the currently selected item (in this case the COM Server Adder) After you create the Fortran COM Server project, you specify a Class name, Class derived-type name, and Interface name. When you click OK, the Fortran COM Server Wizard appears: The left pane shows the COM server hierarchy. The Fortran COM Server Wizard helps you define the interface's methods, properties, and their arguments. Back to Main Menu

161 Creating Fortran COM Servers
Choose whether a COM or dual interface is needed Expand the + signs and click Iadd to display the interface properties Adder is the COM server and also the project name AddingMachine is the class name IAdd is the interface name (interface names start with I) AddingMachine_Instance is the Class derived-type name Back to Main Menu

162 Creating Fortran COM Servers
To add Clear and Add methods for the IAdd interface: 1. Select the IAdd interface 2. Click New 3. Select Method, type in Clear, and click OK 4. Repeat steps 1-3, specifying the name Add 5. Select the Add method 6. Click New 7. Select Argument, type in Operand, and click OK 8. Specify the Fortran data type as REAL(4) 9. Let's assume you are done, so click Save

163 Creating Fortran COM Servers
Back to Main Menu

164 Creating Fortran COM Servers
Once you click Save, your project appears. The TODO.TXT file informs you of changes made to your project by the Wizard, and lets you know when you need to make changes. In the FileView pane, expand the + next to Adder files and Source Files folders. Back to Main Menu

165 Creating Fortran COM Servers
You need to modify the source files after lines that start with ! TODO..., build the project, and then use one of the clients to test the server. To activate the COM Server Wizard later, open your Fortran COM Server project and click Fortran COM Server Wizard in the View menu. For more information, see: The Creating a COM Server chapter in the online Programmers Guide. The Adder sample in ...Samples\Advanced\COM\Adder, which contains Visual C++ and Visual Fortran clients as subprojects. Back to Main Menu

166 Visual Fortran Professional Edition
The Professional Edition includes the IMSL numerical libraries, Fortran COM Server Wizard, and the Compaq Array Visualizer. The Array Visualizer is discussed in the next section. The Visual Fortran Enterprise Edition includes the Visual Fortran Professional Edition, plus other software that lets you use Visual Fortran on your x86 PC system to develop applications for Compaq Tru64 UNIX, and other UNIX and Linux systems. The Enterprise Edition has a separate slide show. Back to Main Menu

167 Main Menu I would like to…
Learn more about the Microsoft visual development environment Learn more about mixed language programming and dynamic link libraries Learn more about using COM objects with Visual Fortran Learn about Visual Fortran Professional Edition Learn about the Compaq Array Visualizer End the presentation

168 The Compaq Array Visualizer
Compaq Visual Fortran Professional and Enterprise Editions are equipped with the Compaq Array Visualizer The Array Visualizer uses ActiveX technology to visualize multi-dimensional arrays of data generated by Visual Fortran programs Back to Main Menu

169 The Compaq Array Visualizer
The Compaq Array Visualizer can be: Run as a standalone program called Array Viewer Controlled by your Visual Fortran or Visual C++ application Embedded as an ActiveX control within a Visual Fortran, Visual C++, or Visual Basic® application Used in conjunction with the visual development environment to view large arrays while debugging Back to Main Menu

170 The Compaq Array Visualizer
Compaq Visual Fortran Professional and Enterprise Editions give you full access to the power of the Array Visualizer Build Applications that interact with the Array Visualizer Use the Array Visualizer to view large multi-dimensional arrays while debugging Back to Main Menu

171 The Compaq Array Visualizer
The Array Visualizer interacts with other programs: As an embedded ActiveX control in Visual Fortran, Visual C++, and Visual Basic applications Operated via a simple set of function calls in C and Fortran programs Back to Main Menu

172 The Compaq Array Visualizer
In the following slides we will see the Array Visualizer at work Rendering 3D graphs of array data Being controlled by a Visual Fortran Program Back to Main Menu

173 The Compaq Array Viewer
The data in the array are displayed in this grid This pane contains a graphical view of the data Back to Main Menu

174 Clicking here brings up the color bar
Back to Main Menu

175 The data in the array are plotted along the z-axis
Each z-value is assigned a color The name and the type of the array are shown here Back to Main Menu

176 The red marker is used to indicate the current array element
Double-clicking on the graph will update the marker and grid accordingly Back to Main Menu

177 Notice the new position of the marker on the color bar
The current array element is listed here Back to Main Menu

178 You can rotate the graph using the mouse
Just click and drag... You can rotate the graph using the mouse Back to Main Menu

179 The Compaq Array Viewer can open array data files
Back to Main Menu

180 …and customize the colors and scaling factors used in the graph.
In addition, you can “zoom in” on a specific region of the graph... Back to Main Menu

181 The Compaq Array Visualizer allows you to create a Visual Fortran application that uses the Array Viewer. Back to Main Menu

182 A set of Array Visualizer Fortran routines lets your application control the action of the Array Viewer. Back to Main Menu

183 …and displays the modified result.
This Array Visualizer program displays an array using the Array Viewer... …makes some changes to the array... …and displays the modified result. Back to Main Menu

184 In Visual Fortran Professional and Enterprise Editions, the Array Viewer can be used inside the debugger! Back to Main Menu

185 To view an array while debugging, highlight the variable name
Simple 2- Compaq Visual Fortran [break] To view an array while debugging, highlight the variable name Then click the Array Viewer icon Back to Main Menu

186 This array is supposed to store sin(x) over the range 1 to 40
Clearly, something is wrong! Back to Main Menu

187 Using the Array Viewer, you can easily recognize inconsistencies in large sets of data
Back to Main Menu

188 The Compaq Array Visualizer
Visual Fortran Professional and Enterprise Editions give you the full power of the Array Visualizer Debug programs using the Array Viewer Write Fortran or C programs to control the Array Viewer Use the Avis2d ActiveX control to control the Array Viewer graphing modes and appearance Use the Avis Grid ActiveX control to create tables of array data Back to Main Menu

189 Main Menu I would like to…
Learn more about Microsoft visual development environment Learn more about mixed language programming and dynamic link libraries Learn more about using COM objects with Visual Fortran Learn about Visual Fortran Professional Edition Learn about the Compaq Array Viewer End the presentation

190 Compaq Visual Fortran Thank You for Viewing the
Compaq Visual Fortran Version 6.5 Product Overview

191 Visual Fortran Compaq, DIGITAL, and the Compaq logo are registered in the U.S. Patent and Trademark office. OpenVMS and Tru64 UNIX are trademarks of Compaq Information Technologies, L.C. ActiveX, Microsoft, MS, Microsoft Developer Studio, NT, PowerPoint, Visual Basic, Visual C++, Win32, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. Intel and Pentium are registered trademarks of Intel Corporation. AMD and Athlon are trademarks of Advanced Micro Devices, Inc. IMSL and Visual Numerics are registered trademarks of Visual Numerics, Inc. UNIX and The Open Group are trademarks of The Open Group. All other trademarks and registered trademarks are the property of their respective holders.

192 Compaq Visual Fortran Compaq Visual Fortran Overview
© Compaq Computer Corporation. For more information about Compaq Fortran please visit our web site at: Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is subject to change without notice.

193


Download ppt "Introducing Compaq Visual Fortran. Introducing Compaq Visual Fortran."

Similar presentations


Ads by Google