Introducing Compaq Visual Fortran www compaq com Compaq

  • Slides: 193
Download presentation

Introducing Compaq Visual Fortran www. compaq. com

Introducing Compaq Visual Fortran www. compaq. com

Compaq Visual Fortran ® u Offers a combination of: l l The robustness and

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

Compaq Visual Fortran u 32 -bit Development System for x 86 (Intel® , AMD®,

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

Compaq Visual Fortran u The Compaq Fortran Compiler l l Full support of the

Compaq Visual Fortran u The Compaq Fortran Compiler l l 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

Compaq Visual Fortran u Offers Portability from other Platforms l l l Microsoft-recommended upgrade

Compaq Visual Fortran u Offers Portability from other Platforms l l l Microsoft-recommended upgrade for Power. Station 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 Tru 64 UNIX® Alpha – Linux® Alpha – Open. VMS Alpha TM TM

Compaq Visual Fortran u Microsoft visual development environment l l l Windows-based application development

Compaq Visual Fortran u Microsoft visual development environment l l l 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++® V 6

Compaq Visual Fortran u Visual development tools l Debugger l Source Code Browser l

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

About this demo. . . u This presentation was created using Microsoft Power. Point®

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

About this demo. . . u Slowing down the demo l To pause the

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

About this demo. . . Choosing ‘Advance’ performs the next slide action ‘Reverse’ displays

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

Project-based Development u Visual Fortran organizes application source files by grouping code, libraries, and

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

Visual Fortran Can Build Several Kinds of Projects To create a new project, click

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 Win 32® APIs

Visual Fortran Can Build Several Kinds of Projects Fortran Windows Applications are GUI applications

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

Visual Fortran Can Build Several Kinds of Projects The Quick. Win environment provides an

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

Visual Fortran Can Build Several Kinds of Projects If you have the Microsoft Visual

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

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

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

Compaq Visual Fortran u Visual Fortran is available for x 86 PC systems running

Compaq Visual Fortran u Visual Fortran is available for x 86 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

Version 6. 5 New Features u New Features for Version 6. 5: l l

Version 6. 5 New Features u New Features for Version 6. 5: l l Architecture-specific support for Pentium III, AMD K 6 -2/K 6 -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 inprocess servers that use custom or dual interfaces New COM routines COMString. From. GUID and COMIs. Equal. GUID 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

Version 6. 5 New Features l l l l New exception handling routines CLEARSTATUSFPQQ

Version 6. 5 New Features l l l l New exception handling routines CLEARSTATUSFPQQ and GETEXCEPTIONPTRSQQ (x 86 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

New Features in Version 6 u In addition to v 6. 5 new features,

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

New Features in Version 6 New optimization features can significantly improve application performance over

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

New Features in Version 6 New Fortran application wizards help you get started on

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

New Features in Version 6 Traceback Reporting u When a Fortran program terminates due

New Features in Version 6 Traceback Reporting u 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.

New Features in Version 6 Traceback Reporting u When you request traceback information during

New Features in Version 6 Traceback Reporting u 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.

New Features in Version 6 A traceback report might appear as follows: The stack

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

Compaq Extended Math Library (CXML) u Compaq Extended Math Library (CXML) provides: l Basic

Compaq Extended Math Library (CXML) u Compaq Extended Math Library (CXML) provides: l Basic Linear Algebra Subprograms (BLAS) library – Industry-standard Basic Linear Algebra Subprograms, including Level 1 (vector-vector, BLAS 1), Level 2 (matrix-vector, BLAS 2), and Level 3 (matrix-matrix, BLAS 3), BLAS Level 1 Extensions, and Sparse BLAS Level 1. l 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. l 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.

Compaq Extended Math Library (CXML) l LAPACK subprograms – Industry-standard subprogram package offering an

Compaq Extended Math Library (CXML) l 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. l Utility subprograms – Provides random number generation, vector math functions, and sorting subprograms. u u CXML is also available for other Compaq Fortran Alpha platforms (see http: //www. compaq. com/math) To call CXML routines from Visual Fortran, add the following INCLUDE statement: INCLUDE 'CXML_INCLUDE. F 90’

Main Menu I would like to… è è è Learn more about the Microsoft

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

Building a Project: qwpaint We will now use Compaq Visual Fortran to build a

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

Welcome to the visual development environment! The visual development environment allows you to compile

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

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

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

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

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

The Output window displays compile and link errors as well as debugging information Back

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

Choose the File | New. . . menu item to create a new Project

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

The “New” dialog box. . . Don’t forget to name your project Choose Fortran

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

In our application, we’ll use multiple windows Select the Windows interface best suited to

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

Now we will add some files to the project The qwpaint project has been

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

Insert Files into a Project. . . Use this dialog box to select the

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

As a default, the editor highlights Fortran keywords in blue and comments in green

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

After adding files to a project, select each new file in the File. View

After adding files to a project, select each new file in the File. View 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

The qwpaint Project requires qwpaint. mod Back to Main Menu It looks like we

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

Double clicking on the error message or pressing F 4 brings the editor to

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

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

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

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

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

This is what our application looks like The mouse draws shapes in this window

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

It looks like we have a bug in our program! This area should have

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

Now we need to debug our program. The visual development environment makes this easy,

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

But where do we begin? From this comment, we can guess that the bug

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

We’d like to locate Draw. Control. Grid() in the code. We could do a

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

We can use the “Find in Files” tool to search a number of files

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

“Find in Files…” The text to search for. . . …where to look for

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

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

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

“Find in Files” finds all occurrences of a given string, but we’d like to

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

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

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

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

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

The “Project Settings” dialog box. . . Settings must be changed under the “Fortran”

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

The “Project Settings” dialog box. . . The project settings dialog box also allows

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

…then in the Tools menu choose Source Browser to start browsing Back to Main

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

You can browse information about any identifier in your source code. We want to

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

Clicking “OK” brings up this box This window lists all of the places in

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

We want to know where Draw. Control. Grid is defined. Double-click on the definition.

We want to know where Draw. Control. Grid is defined. Double-click on the definition. . . Back to Main Menu

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

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

If we look at the code for Draw. Control. Grid(), we see that the

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

We’d like to know more about the setcolor Quick. Win function. We can use

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

Click the word we’d like to know more about. . . and press the

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

This dialog box searches the online help. Click Display to view the help page

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

A new window opens to allow you to view the online documentation. Information about

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

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

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

You can browse the online help by clicking on the various topics Back toto

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

We think that the bug occurs somewhere in this code Let’s use the Visual

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

Click this button to start debugging Back to Main Menu Click the hand to

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

This arrow points to the next line to be executed The visual development environment

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

This window allows you to view the values of local variables. Over here, you

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

You can step through the program by clicking this icon Variable values are updated

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

After some more debugging, we find the answer to our problem. By examining the

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

…we can stop debugging. . . Now that we have changed our source code.

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

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

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

Our problem has been fixed Back to Main Menu

Our problem has been fixed Back to Main Menu

Building a Project: qwpaint We used Visual Fortran to build an application that used

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

Main Menu I would like to… è Learn more about the Microsoft visual development

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

Building a DLL Functions in dynamic-link libraries (DLLs) are not loaded until they are

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

Building a DLL We will now use Visual Fortran to construct a DLL u

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

Building a DLL Our application will be called spline because our DLL contains functions

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

Building a DLL u spline demonstrates mixed language programming using Visual Fortran and Visual

Building a DLL u spline demonstrates mixed language programming using Visual Fortran and Visual C++ l 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

Building a DLL u The spline Workspace consists of three Projects: l l l

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

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

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

We’ll create a Fortran Dynamic Link Library project. . . …called splinedll. . .

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

Choose “an empty DLL application” in the app-wizard dialogue. . . …and click “Finish”.

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

The App Wizard creates an empty workspace for our project. Let’s add some files

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

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

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

The visual development environment editor formats itself for editing fixed-form Fortran source code spline.

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

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

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

Now we’re going to build splineqw, a Fortran Quick. Win program that uses splinedll.

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

We’ll create a Fortran Quick Win project. . . …and include it into our

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

Select the Windows interface that best suits your application Choose the windowing options that

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

Now that we’ve created the splineqw project. . . Back to Main Menu …we’ll

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

Locate the file you wish to insert Be sure to insert it into the

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

Fspline. f 90 uses the Quick. Win graphics library to draw a spline curve

Fspline. f 90 uses the Quick. Win graphics library to draw a spline curve that fits some data points Back to Main Menu

Before we can build Splineqw. exe, we have to link in file splinedll. lib

Before we can build Splineqw. exe, we have to link in file splinedll. lib We can do that by adding the (relative) path here in the Project settings dialog Back to Main Menu 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

Before we can run splineqw. exe, we must be sure that the system can

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

Build splineqw. exe Back to Main Menu

Build splineqw. exe Back to Main Menu

In splineqw the user clicks on a window and a spline curve is displayed

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

Next we’ll use Visual C++ to build a new Windows application that uses splinedll.

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

We’ll create a Visual C++ Win 32 application …called splinevc. . . …and include

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

Choose to build an empty project. . . …and the App. Wizard finishes the

Choose to build an empty project. . . …and the App. Wizard finishes the job Back to Main Menu

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

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

We must specify that we are using the Microsoft Foundation Classes under Project Settings

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

Instead of adjusting the link settings, splinedll. lib can be added directly to the

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

Before you attempt to build any project, make sure it is set as the

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

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

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

The MFC application has a different look to it. . . …but it performs

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

Building a DLL We used Visual Fortran to build a dynamic link library that

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

Main Menu I would like to… è Learn more about the Microsoft visual development

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

Working with COM Objects Many windows applications provide a means of accessing their functionality

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

Working with COM Objects u COM is a language independent object model designed for

Working with COM Objects u COM is a language independent object model designed for application interaction l u 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

Working with COM Objects u The Module Wizard creates Fortran module files that provide

Working with COM Objects u The Module Wizard creates Fortran module files that provide an interface to functions used to access COM objects l l 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

Working with COM Objects We will now build a Console application that uses the

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

Working with COM Objects u dlines calls COM routines from Developer Studio that: l

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

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

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

Named dlines New Fortran Console Application Back to Main Menu

Named dlines New Fortran Console Application Back to Main Menu

Choose to build an empty project. . . …and the App. Wizard finishes the

Choose to build an empty project. . . …and the App. Wizard finishes the job Back to Main Menu

Now let’s use the Module Wizard to create the interface to the visual development

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

The Visual Fortran Module Wizard We’ll be getting information from a COM interface Our

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

The Visual Fortran Module Wizard C: PROGRAM FILESMICROSOFT VISUAL STUDIOCOMMONMSDEV 98BINDEVSHL. DLL (Visual C++

The Visual Fortran Module Wizard C: PROGRAM FILESMICROSOFT VISUAL STUDIOCOMMONMSDEV 98BINDEVSHL. 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

The Visual Fortran Module Wizard Generate the Fortran module file Back to Main Menu

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

The Visual Fortran Module Wizard You can specify the name of the source file

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

The Visual Fortran Module Wizard We’ll repeat the process for another Developer Studio COM

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

C: PROGRAM FILESMICROSOFT VISUAL STUDIOCOMMONMSDEV 98BINDEVEDIT. PKG (Visual C++ Text Editor) …select all of

C: PROGRAM FILESMICROSOFT VISUAL STUDIOCOMMONMSDEV 98BINDEVEDIT. PKG (Visual C++ Text Editor) …select all of the COM Interfaces as before. . . …generate the Fortran module file and save it as dstext. f 90 Back to Main Menu Using the Visual C++ Text Editor this time. . .

Add the files generated by the Module Wizard to the dlines project Back to

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

dsapp. f 90 was generated by the Fortran Module Wizard This is an INTERFACE

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

Let’s add these sample files which are located in your samplesadvancedcomdlines directory Back to

Let’s add these sample files which are located in your samplesadvancedcomdlines directory Back to Main Menu

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

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

After other COM functions are called to modify the Fortran source file. . .

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

[Mbcomp. for] Execute the program This Fortran fixed-format file contains lines beginning with the

[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

dlines. exe Specify the file on which to operate* The debug character and the

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

Mbcomp 2. for * Back to Main Menu The ‘E’ debug lines have been

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

Working with COM Objects dlines made use of functions that are a part of

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

Main Menu I would like to… è Learn more about the Microsoft visual development

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

Visual Fortran Professional Edition u In addition to the Standard Edition, a Professional Edition

Visual Fortran Professional Edition u In addition to the Standard Edition, a Professional Edition is available that includes: l l u 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 Tru 64 UNIX and other UNIX systems. Back to Main Menu

Visual Fortran Professional Edition u The Visual Numerics® IMSL numerical libraries provide over 900

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

Visual Fortran Professional Edition u IMSL General Mathematics library l l l l Solving

Visual Fortran Professional Edition u IMSL General Mathematics library l l l l 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

Visual Fortran Professional Edition u IMSL Statistics Library l l l Basic statistics, regression,

Visual Fortran Professional Edition u IMSL Statistics Library l l l 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

IMSL Library Example We will now build a Fortran Console application that uses a

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

IMSL Library Example This sample program comes from the IMSL online documentation u After

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

The IMSL libraries come with extensive online documentation as well as a number of

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

In the contents, click Appendix B, Alphabetic Summary of Routines. Locate VHSTP. The VHSTP

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

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

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

This sample program calls VHSTP to draw a vertical histogram of some data It

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

Copy the program text from the online help into a Visual Fortran source file.

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

mnrain - Compaq Visual Fortran Now we need to add the source code to

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

We want to make a new File. . . Add it to the current

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 Main Menu Back toto Main Menu

mnrain - Compaq Visual Fortran mnrain. for is open in the editor and has

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

After we paste in the text from the IMSL documentation file, edit the text

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

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

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

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

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

mnrain. exe By calling two IMSL library routines, our data was tabulated and displayed

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

Creating Fortran COM Servers u u u Visual Fortran (all editions) provides the Fortran

Creating Fortran COM Servers u u u 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 V 6. 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 servers are reusable components, so multiple client applications can use the server. Back to Main Menu

Creating Fortran COM Servers Creating a Fortran COM Server consists of these steps: u

Creating Fortran COM Servers Creating a Fortran COM Server consists of these steps: u u u 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

Creating Fortran COM Servers After you create the Fortran COM Server project, you specify

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

Creating Fortran COM Servers Choose whether a COM or dual interface is needed Expand

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

Creating Fortran COM Servers To add Clear and Add methods for the IAdd interface:

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

Creating Fortran COM Servers Back to Main Menu

Creating Fortran COM Servers Back to Main Menu

Creating Fortran COM Servers Once you click Save, your project appears. In the File.

Creating Fortran COM Servers Once you click Save, your project appears. In the File. View pane, expand the + next to Adder files and Source Files folders. Back to Main Menu 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.

Creating Fortran COM Servers You need to modify the source files after lines that

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. u To activate the COM Server Wizard later, open your Fortran COM Server project and click Fortran COM Server Wizard in the View menu. u For more information, see: u l l The Creating a COM Server chapter in the online Programmers Guide. The Adder sample in. . . SamplesAdvancedCOMAdder, which contains Visual C++ and Visual Fortran clients as subprojects. Back to Main Menu

Visual Fortran Professional Edition The Professional Edition includes the IMSL numerical libraries, Fortran COM

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. u The Visual Fortran Enterprise Edition includes the Visual Fortran Professional Edition, plus other software that lets you use Visual Fortran on your x 86 PC system to develop applications for Compaq Tru 64 UNIX, and other UNIX and Linux systems. The Enterprise Edition has a separate slide show. u Back to Main Menu

Main Menu I would like to… è Learn more about the Microsoft visual development

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

The Compaq Array Visualizer Compaq Visual Fortran Professional and Enterprise Editions are equipped with

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

The Compaq Array Visualizer u The Compaq Array Visualizer can be: l l Run

The Compaq Array Visualizer u The Compaq Array Visualizer can be: l l Run as a standalone program called Array Viewer Controlled by your Visual Fortran or Visual C++ application Embedded as an Active. X 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

The Compaq Array Visualizer u Compaq Visual Fortran Professional and Enterprise Editions give you

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

The Compaq Array Visualizer u The Array Visualizer interacts with other programs: l l

The Compaq Array Visualizer u The Array Visualizer interacts with other programs: l l As an embedded Active. X 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

The Compaq Array Visualizer u In the following slides we will see the Array

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

The Compaq Array Viewer The data in the array are displayed in this grid

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

Clicking here brings up the color bar Back to Main Menu

Clicking here brings up the color bar Back to Main Menu

The data in the array are plotted along the z-axis Each z-value is assigned

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

The red marker is used to indicate the current array element Double-clicking on the

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

Notice the new position of the marker on the color bar The current array

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

Just click and drag. . . You can rotate the graph using the mouse

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

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

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

In addition, you can “zoom in” on a specific region of the graph. .

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

The Compaq Array Visualizer allows you to create a Visual Fortran application that uses

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

A set of Array Visualizer Fortran routines lets your application control the action of

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

This Array Visualizer program displays an array using the Array Viewer. . . …makes

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

In Visual Fortran Professional and Enterprise Editions, the Array Viewer can be used inside

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

Simple 2 - Compaq Visual Fortran [break] To view an array while debugging, highlight

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

This array is supposed to store sin(x) over the range 1 to 40 Clearly,

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

Using the Array Viewer, you can easily recognize inconsistencies in large sets of data

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

The Compaq Array Visualizer u Visual Fortran Professional and Enterprise Editions give you the

The Compaq Array Visualizer u Visual Fortran Professional and Enterprise Editions give you the full power of the Array Visualizer l l Debug programs using the Array Viewer Write Fortran or C programs to control the Array Viewer Use the Avis 2 d Active. X control to control the Array Viewer graphing modes and appearance Use the Avis Grid Active. X control to create tables of array data Back to Main Menu

Main Menu I would like to… è Learn more about Microsoft visual development environment

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

Compaq Visual Fortran Thank You for Viewing the Compaq Visual Fortran Version 6. 5

Compaq Visual Fortran Thank You for Viewing the Compaq Visual Fortran Version 6. 5 Product Overview www. compaq. com

Visual Fortran u Compaq, DIGITAL, and the Compaq logo are registered in the U.

Visual Fortran u Compaq, DIGITAL, and the Compaq logo are registered in the U. S. Patent and Trademark office. u Open. VMS and Tru 64 UNIX are trademarks of Compaq Information Technologies, L. C. u Active. X, Microsoft, MS, Microsoft Developer Studio, NT, Power. Point, Visual Basic, Visual C++, Win 32, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. u Intel and Pentium are registered trademarks of Intel Corporation. u AMD and Athlon are trademarks of Advanced Micro Devices, Inc. u IMSL and Visual Numerics are registered trademarks of Visual Numerics, Inc. u UNIX and The Open Group are trademarks of The Open Group. u All other trademarks and registered trademarks are the property of their respective holders.

Compaq Visual Fortran Overview © 1997 -2000 Compaq Computer Corporation. For more information about

Compaq Visual Fortran Overview © 1997 -2000 Compaq Computer Corporation. For more information about Compaq Fortran please visit our web site at: http: //www. compaq. com/fortran 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. www. compaq. com

www. compaq. com

www. compaq. com