Search

Fortran Source, Spring 1998

Volume 14, Issue 1
SPRING 1998

FEATURES
LF90 v4.5 Released
Understand Code with Visual Analyzer
Global Optimization
LF90-Compatible IMSL
New SSL II Math and Statistics Library
Static Linking with C
Free, Unlimited Tech Support

DEPARTMENTS
CEO's Letter
New ISV Products
News Briefs
   Fujitsu Fortran for SunOS and Solaris
    Lahey/Fujitsu Alliance
   Fortran 90 Workshop IX
    1998 Reseller Seminar
   1998 Lahey User Meeting
Q&A
 

LF90 v4.5 Released
Lahey Fortran 90 v4.5 is shipping.  It offers a number of enhancements including the addition of two tools from Fujitsu:  Visual Analyzer (VA) and Scientific Subroutine Library II (SSL II).

VA performs static analysis of programs written in Fortran or C and provides visual displays of the analysis results.  The displays allow you to check program structure, logic flow, standards conformance, argument mismatches, and more. VA includes a 90-page, online manual.  (See "Understand Code with Visual Analyzer")

SSL II is an optimized math library of linear algebra, eigenvalue and eigenvector, nonlinear equation, extrema, interpolation and approximation, transform, numerical differentiation and quadrature, differential equation, special function, and pseudo random number procedures.  SSL II includes an 800-page online manual.  (See "New SSL II Math and Statistics Library")

A new version of the Winteracter Starter Kit (WiSK) offers semi-modeless dialog boxes, radio buttons, improvements to the visual dialog and menu editors, and a handful of miscellaneous new procedures.

Support for linking Microsoft Visual C++ and Borland C++ code into your executable means you don't have to ship your mixed language applications with DLLs.  You’ll also be able to link with commercial C libraries.  (See "Static Linking with C”)

An Automake Configuration File Editor is provided for creating and maintaining Automake configuration files.  In addition, the LF90 v4.5 User’s Guide contains a revised Automake Chapter.  The LF90 v4.5 User's Guide contains a revised Automake chapter and more Automake examples are included on the distribution CD.

Update to LF90 v4.5 from v4.0 for US$150, from v3.5 for US$270, and from v3.0 or earlier for US$350.  Through July 31, 1998, a competitive upgrade from 32-bit, PC Fortrans is available for US$595.  New purchase price is US$895.  Shipping and handling is not included.
 

Understand Code with Visual Analyzer
by Bob Runyan
You've just been handed a new project:  100,000 lines of mixed Fortran and C code, some Fortran 90, some FORTRAN 77, some Fortran 66, some maybe earlier, along with a mixture of K&R and ANSI C.  The original authors of the program are all either dead or working for somebody else.  Your job?  Understand the organization and functionality of the code, port it to the PC, and add new features.  Due date?  Next month.

Now you could break out some butcher paper and colored pens and try diagramming the program's call tree and the logic flow of the important program units.  Might even be fun to do, but it's going to take a week or two to get any kind of grasp and you might make some mistakes.

Fujitsu's Visual Analyzer (VA) will do all of this and more for you in less than the time it takes to compile the code.  VA will produce a graphical call tree.

Visual Analyzer - Graph Flow

The call tree can be focused to just the section of the program you are interested in.

VA will show you each program unit's logic flow.

Visual Analyzer - Logic Flow

You can filter in or out of the logic flow program comments, include files, and C header files.

VA will also show you a detailed cross reference of all the variables in the program and where modules and commons are defined and referenced.  C global variable definitions and references are also displayed.

More than that, VA will detect subtle programming errors, even across multiple files.  A couple of mouse clicks gets you a list of argument mismatches, common block misalignments, and violations of the Fortran and C standards.

Still want to mess with the butcher paper and colored pens?

Visual Analyzer is bundled at no extra charge with version 4.5 of LF90.  A standalone version of Visual Analyzer will be available soon.
 

An LF90-Based Application Development System for Global Optimization
by János D. Pintér
Decision problems arising in the sciences, engineering, and economics are often described mathematically by constrained optimization models. The most well-known continuous model versions (linear and convex nonlinear programming) have been extensively applied to formulate and solve optimization problems in academia and industry for over fifty years. Note, however, that the scope of these model types is limited to local search and optima.

The objective of global optimization (GO) is to find the best solution of difficult nonlinear decision models in the presence of multiple local solutions (Horst and Pardalos, 1995; Pinter 1996). For illustration, consider the multiextremal function shown below.  This could depict, for example, a projection of the aggregated error function in an inverse model parameterization (calibration) problem.


The presence of multiple (local) optima, as a rule,
excludes the possibility of directly applying
traditional optimization methodology.

Typically, GO problems are very difficult to solve, and require a sophisticated model development environment. When I started to develop LGO, a proprietary integrated modeling and solver system for analyzing general-continuous and Lipschitz-GO problems (Pintér, 1997), I was looking for a robust and efficient software platform. LGO was to be suitable to handle GO problems which are related to standalone “black box” system models or to models supported by limited, difficult-to-use analytical information. This feature makes LGO uniquely and easily applicable to numerous scientific, engineering, and economic decision problems. However, it also implies specific requirements of the implementation platforms.

The possibility of external system calls and mixed platform development was among the most highly desirable features. Further, a consistent and aesthetic DOS and Windows 3.1x/95/NT interface has also been one of the important criteria. Obviously, robustness and program execution speed have been also crucial, since GO problems tend to be numerically very demanding (even problems in, say, 5 or 10 variables can be far from trivial).

Lahey Fortran has all the listed capabilities and its add-on LISK/WiSK interface libraries also make possible very fast problem visualization. Graphical problem representation-built into LGO-can greatly assist the model development and solution process. An excellent feature of Lahey Fortran is its direct connectivity to several other popular platforms such as Borland Delphi, Microsoft Visual Basic, and C/C++ environments, in addition to its generic connectivity to Windows applications. Last, but very far from least, over the past years I have found Lahey's customer support truly responsive, knowledgeable, and fast. As a result, Lahey Fortran has become my primary LGO development platform.

Currently, LGO is implemented at leading universities, research institutes, and several major industrial companies in over half a dozen countries. Among other tasks, it is used for robust product design, model development in chemical industries, hydrodynamical design, and environmental management decision support. (LGO demonstration executable programs, a detailed list of relevant professional references, and additional information are available upon request.)

References

  • Horst, R. and Pardalos, P.M., eds. (1995) Handbook of Global Optimization. Kluwer Academic Publishers, Dordrecht, Boston, London.
  • Lahey Computer Systems (1997) Fortran 90 User's Guide. Incline Village, Nevada, U.S.A.
  • Pintér, J.D. (1996) Global Optimization in Action. Kluwer Academic Publishers, Dordrecht, Boston, London.
  • Pintér, J.D. (1997) LGO--A Model Development System for Continuous Global Optimization. User's Guide. (3rd revised edition.) Pintér Consulting Services, Halifax, Nova Scotia, Canada.

János D. Pintér can be reached at Pintér Consulting Services, 129 Glenforest Drive, Halifax, NS, Canada B3M 1J2, +1-902-443-5910, pinter@tuns.ca, http://www.tuns.ca/~pinter.

LF90-Compatible IMSL
Through an agreement with Visual Numerics, Inc., Lahey is pleased to announce availability of the LF90-Compatible IMSL Fortran 90 MP Library.  The IMSL Fortran 90 MP Library includes many Fortran 90-coded, not translated, routines and more than 900 FORTRAN 77 subroutines (the IMSL FORTRAN 77 Numerical Libraries) for applications in general applied mathematics and for analyzing and presenting statistical data in scientific and business applications.  The Library sells for US$625 or when purchased with LF90 v4.5 (new, update, or competitive upgrade), US$300.  The LF90-Compatible IMSL Fortran 90 MP Library is available directly from Lahey and through Lahey resellers worldwide.
 

Static Linking with C
by Bob Runyan and Jeff Green

Version 4.5 of LF90 supports static linking with Microsoft Visual C++ version 2.0 and greater and with Borland C++ version 4.5 and greater.  The LF90 driver automates the process of linking your LF90 code with C code produced by either of these compilers.  Still, there are several steps and a few pitfalls.  For this article we will create a simple program in Fortran 90, then link with the required C libraries to create a working application. This and other examples (including an example using OpenGL) are provided on the LF90 v4.5 CD.

The program we will create has Fortran calling C.  You can also create applications that call Fortran from C.

This program creates a table of Fahrenheit to Centigrade conversions.  The main program and some of the I/O are in Fortran.  The calculations and the rest of the I/O are done in C.  The program also exercises LF90's ability to create Fortran common blocks accessible by C and to properly invoke and return values from C functions.

Our Fortran 90 code looks like this:

! F90CALLC.F90                                                          ! 1
! Copyright 1998 Lahey Computer Systems, Inc.                           ! 2
!                                                                       ! 3
       ml_external GenTable                                             ! 4
       integer gentable,totalf                                          ! 5
       real totalc                                                      ! 6
       common /mycommon/ totalc, totalf                                 ! 7
       integer start, end, table_lines                                  ! 8
                                                                        ! 9
       write(6,1) 'Where should the table start (enter an &
       &integer less than 10) ? '                                       ! 10
       read(5,*) start                                                  ! 11
       write(6,1) 'In Fortran, now calling C'                           ! 12
       table_lines=gentable(start, end)                                 ! 13
       write(6,1) 'Back in Fortran, after calling C'                    ! 14
       write(6,2) 'The table ended at:',end                             ! 15
       write(6,3) 'Total degrees c=',totalc                             ! 16
       write(6,2) 'Total degrees f=',totalf                             ! 17
                                                                        ! 18
       write(6,2) 'Number of lines in table:',table_lines               ! 19
1      format(1x,a)                                                     ! 20
2      format(1x,a,i4)                                                  ! 21
3      format(1x,a,f6.2)                                                ! 22
       end                                                              ! 23
                                                                        ! 24
       block data setmycommon                                           ! 25
       common /mycommon/ totalc, totalf                                 ! 26
       data totalc/0.0/, totalf/0.0/                                    ! 27
       end block data setmycommon                                       ! 28
Our C code looks like this:
/* F90callC1.C */                                                      // 29
/* Copyright 1998 Lahey Computer Systems, Inc. */                      // 30
                                                                       // 31
#include <stdio.h>                                                     // 32
#include <stdlib.h>                                                    // 33
                                                                       // 34
#define common(name) lc_##name                                         // 35
/* prepending lc_ matches name generated by LF90 */                    // 36
                                                                       // 37
extern struct                                                          // 38
{                                                                      // 39
float total_c;                                                         // 40
int   total_f;                                                         // 41
} common(MYCOMMON);                                                    // 42
                                                                       // 43
                                                                       // 44
int GenTable(int *start, int *end)                                     // 45
{                                                                      // 46
char endstring[10];                                                    // 47
int f;                                                                 // 48
float c;                                                               // 49
FILE *output;                                                          // 50
int lines_in_table, lines_left;                                        // 51
                                                                       // 52
/* Fortran leaves us on the line just printed, so we need to output */ // 53
/* an extra newline before we do any I/O */                            // 54
    printf("\n");                                                      // 55
                                                                       // 56
    printf("IN C\n");                                                  // 57
    printf("%s%s", "Where should the table end (Enter an ", 
           "integer less than 30) ? ");                                // 58
    gets(endstring);                                                   // 59
    *end=atoi(endstring);                                              // 60
    output=fopen("F90callC.out","w");                                  // 61
    printf("Placing Fahrenheit to Centigrade table in F90CALLC.OUT\n");// 62
    lines_left = lines_in_table = *end - *start + 1;                   // 63
    for (f=*start; lines_left > 0; f++, lines_left--)                  // 64
        {                                                              // 65
        c=5./9.*(f-32);                                                // 66
        common(MYCOMMON).total_c+=c;                                   // 67
        common(MYCOMMON).total_f+=f;                                   // 68
        fprintf(output,"%d F = %f C\n",f,c);                           // 69
        }                                                              // 70
    fclose(output);                                                    // 71
    printf("Table generated\n");                                       // 72
                                                                       // 73
/* After the last thing output from C, it is easiest to stay on the */ // 74
/* same line so the next thing output from Fortran can use standard */ // 75
/* carriage control */                                                 // 76
    printf("LEAVING C"); /* note the lack of a \n */                   // 77
                                                                       // 78
/* We flush stdout to make sure all output is out of the buffers */    // 79
/* and displayed on the screen.  If we don't do this, Fortran may */   // 80
/* end up displaying its output before C */                            // 81
    fflush(stdout);                                                    // 82
                                                                       // 83
    return(lines_in_table);                                            // 84
}                                                                      // 85

The first thing to notice is the ML_EXTERNAL declaration in line 4.  All C functions referenced in your Fortran code must be declared using the ML_EXTERNAL statement.  Notice that the arguments on the C side of GenTable are picked up by reference instead of by value (note the * in front of the variable names in GenTable's argument list on line 45 and references to those variables on line 63).  You could instead pass by value if you wished, using the Fortran CARG intrinsic procedure with each argument in the invocation of GenTable on line 13.

To access the common block defined on line 7 from C we will need to pick up the values as components of a C structure.  This structure is declared in lines 35 to 42.  The #define on line 35 prepends a leading "lc_" to the structure name, which LF90 requires.  Use of the #define will make subsequent code more readable, as in lines 67 and 68.

The final perhaps non-intuitive thing to do is to flush stdout before returning to Fortran from C.  Otherwise, the C output might display after output from subsequent Fortran I/O statements.

A linker response file, provided with LF90, automates the link process.  Before using this file you must edit it to make sure that the libpath switch points to the correct directory where the C libraries reside.

To build the executable, first compile the C source as follows for Microsoft Visual C++:

    CL /c F90CALLC1.C
Or as follows for Borland C++:
    BCC32 /c F90CALLC1.C
Then compile the Fortran source and link using the following command line:
    LF90 F90CALLC.F90 F90CALLC1.OBJ -WINCONSOLE -ML MSVC -STATICLINK
(use -ML BC if you are using Borland C++)

We now run the executable file and get the following output:

Where should the table start (enter an integer less than 10) ? 3
In Fortran, now calling C
IN C
Where should the table end (Enter an integer less than 30) ? 29
Placing Fahrenheit to Centigrade table in F90CALLC.OUT
Table generated
LEAVING C
Back in Fortran, after calling C
The table ended at:  29
Total degrees c=   -240.00
Total degrees f= 432
Number of lines in table:  27

That's all there is to it (and you thought this was going to be hard).

New SSL II Math and Statistics Library
Also bundled with version 4.5 of LF90 is the Fujitsu Scientific Subroutine Library (SSL II).  SSL II has been in use for years in Japan on Fujitsu mainframe and workstation hardware.  It is now available on the PC with LF90 version 4.5. An LF90-compatible, standalone version of SSL II will also be available soon.  SSL II offers over 250 optimized routines in the following areas:

Linear Algebra

  • Matrix Storage Mode Conversion
  • Matrix Manipulation
  • Linear Equations and Matrix Inversion (Direct Method)
  • Least Squares Solution

Eigenvalues and Eigenvectors

  • Eigenvalues and Eigenvectors of a Real Matrix
  • Eigenvalues and Eigenvectors of a Complex Matrix
  • Eigenvalues and Eigenvectors of a Real Symmetric Matrix
  • Eigenvalues and Eigenvectors of a Hermitian Matrix
  • Eigenvalues and Eigenvectors of a Real Symmetric Band Matrix
  • Eigenvalues and Eigenvectors of a Real Symmetric Generalized Eigenproblem
  • Eigenvalues and Eigenvectors of a Real Symmetric Band Generalized Eigenproblem

Nonlinear Equations

  • Polynomial Equations
  • Transcendental Equations
  • Nonlinear Simultaneous Equations

Extrema

  • Minimization of Function with a Variable
  • Unconstrained Minimization of Multivariable Function
  • Unconstrained Minimization of Sum of Squares of Functions (Nonlinear Least Squares Solution)
  • Linear Programming
  • Nonlinear Programming (Constrained Minimization of Multivariable Function)

Interpolation and Approximation

  • Interpolation
  • Approximation
  • Smoothing
  • Series

Transforms

  • Discrete Real Fourier
  • Discrete Cosine
  • Discrete Sine
  • Discrete Complex Fourier
  • Laplace

Numerical Differentiation and Quadrature

Differential Equations

Special Functions

  • Elliptic Integrals
  • Exponential Integral
  • Sine and Cosine Integrals
  • Fresnel Integrals
  • Gamma Functions
  • Error Functions
  • Bessel Functions
  • Normal Distribution Functions

Pseudo Random Numbers

  • Generation
  • Testing
 

Free, Unlimited Tech Support
by Joe Chirieleison
Free, unlimited tech support continues to be a benefit for registered users of Lahey products.  Most requests for tech support are received via e-mail and telephone though occasional requests arrive by fax or postal mail.  When we receive a tech support request, every effort is made to process it as soon as possible.  Here's what you can do to help:
Include your registered serial number.
Include everything we need to resolve the problem.
If code is included, limit the number of lines to that which isolates the problem.
If we are to test something, provide step-by-step directions on what's to be done.
Read over or have someone else read over what you send before you send it.
Don't ask too many questions in any one request.  We tend to hold a request until we can answer all the questions.

Some of the answers we give can be found in the manuals, readme files, and the Frequently Asked Questions at our Web site, http://www.lahey.com/faq.htm.  Check these sources before you call.

We look forward to helping you find solutions to your problems.
Contact the Solutions Department at support@lahey.com or 702-831-2500.
 

CEO's Letter
Dear Users of Fortran,
User Interfaces.  Did you notice the new salutation?  It's been impressed on me recently that few Fortran users consider themselves programmers; rather, they are experts in a discipline.  Lahey users (geologists, engineers, statisticians, actuaries ...) program in Fortran to get answers.  However, thanks to the OS evolution you now find yourself spending more time coding user interfaces.  To help you solve this problem, Lahey now offers three alternatives, each with its niche, all Fortran-oriented:  RealWin ($395), Winteracter ($675), and GINO (from $195).

Essential LF90.  A couple of years ago, Lahey recognized the need for an educational version of Fortran 90.  After creating a set of requirements, we carefully reviewed Fortran 90 and did the following to create Essential LF90:

  • Eliminated all extensions.
  • Eliminated more than twenty statements (ASSIGN, BLOCK DATA, ENTRY, PAUSE, COMMON, EQUIVALENCE, DATA, Arithmetic IF, COMPUTED GO TO ...).
  • Eliminated many redundant features (fixed source form, type on the function statement, LOGICAL CASE expression, DSIN ...).
  • Eliminated features that could lead to poor programming practices (multiple statements per line, leading zeros on labels, alternate returns ...).
  • Converted optional features into requirements to encourage good programming (PROGRAM and IMPLICIT NONE statements, blank for all multiple-word keywords, arguments must have INTENT declared, type declaration limited to :: syntax ...).
  • Features were not eliminated with the idea of crippling the product.  MODULEs, derived type, array expressions, etc. are in Essential LF90.
  • Finally, most compile time switches (including optimization) were eliminated.
So why do I tell you this?  Because I'm asking you to consider adopting Essential LF90 for writing new code.  Essential LF90 includes one CD and an electronic manual; it costs $195 ($79 educational).  The language system, without the tools (ED, MAKE, SOLD ...) and electronic manual, is maintained on our site, available for downloading.  And, because Essential LF90 is upward compatible with LF90, when you're ready for production you can use the Essential LF90 code you wrote with LF90.

Now we come to the best part.  You try Essential LF90 for a while and find you would like to see some changes.  Send me e-mail (tlahe@lahey.com) telling me the changes you would make for the educational version and, more importantly, what Essential LF90 needs to make it a production language.  I'll consider and respond to every suggestion.  I have a caution here.  As examples, please don't suggest restoration of multiple statements per line in the educational version or to allow the PRINT statement.  One of our goals is to keep the educational version minimal.

In the Fortran 90 Workshops, I have learned that few sites adhere to a Fortran coding standard -- each programmer does his/her own thing.  My perception is that most workshop participants agree that a standard would be a good thing for their group.  Here's a shortcut to getting a good start on a Fortran coding standard:  Adopt Essential LF90!  I guarantee your group's code will be meaningfully more consistent.

Last argument:  Do you remember reading above that Essential LF90 has no extensions?  That means that taking into account "implementation dependent," your code will port to other platforms with zero changes.

Here's another shortcut.  The US Geological Survey has a Fortran [77] Coding Standard; it's available at http://water.usgs.gov/software/sysdoc.html.

Regards,
Tom
 

New ISV Products
by Danielle Kirby, Independent Software Vendor Coordinator

The following three products are available from AEM Engineering Computations:

FORGL
Fortran Graphics Library (FORGL) enables engineers and scientists to produce  high-resolution color graphics with Fortran on personal computers. Features include line, arc, and curve drawing, area fill, quadratic surface shading, line thicknesses (on printers only), 20 character fonts, hidden-surface removal by the list-priority technique and the z-buffer algorithm, segment structures for correct zooming and saving, as well as 3D transformations, projections, and viewing. FORGL is CalComp compatible.  Compatible with LF90.

µRAS
Micro-Rasterizer (µRAS) is a finite element (FE) and computational fluid dynamics (CFD) pre- and post-processor used to plot computational grids and FE mesh with hidden-surface removal, shaded polygons, vectors or particle paths and streamlines and to triangulate 4(+) column data and plot contour lines, shaded polygons, and vector fields.  Compatible with LF90.

µHIDE
Micro-Hidden-Line-Removal (µHIDE) performs true hidden-line elimination and (optionally) displays node and element numbers, deformed grid lines overlaid on the original mesh lines as well as contour lines of scalar results. Compatible with LF90.

AEM Engineering Computations
18 Lantana Street, Heldervue
7130 Somerset West
South Africa
+021-855-3081
+021-855-3081 FAX
aem@iafrica.com

News Briefs
Fujitsu Fortran for SunOS and Solaris
Need fast Fortran applications?  Try Fujitsu Fortran for SunOS and Solaris.  Now available from Lahey Computer Systems, Inc.  Prices from US$1,195.

Lahey/Fujitsu Alliance
On November 19, 1997, Fujitsu Limited and Lahey Computer Systems, Inc. announced an alliance to develop and market future generations of Fortran language systems and tools for Windows-based PCs.  The alliance brings together decades of Fortran compiler experience from both sides of the Pacific and will lead to the widespread availability of solid, high-performance compilers and tools for Fortran 95, Fortran 2000, and beyond.

"Fujitsu's strength in code generation and optimization technology, the craftsmanship of their tools and their experience in Fortran will augment our existing strengths in the PC Fortran marketplace," said Bob Runyan, President, Lahey Computer Systems.  "Together we will have the development, distribution, service, and support strength to continue to bring the best Fortran tools to Windows users worldwide."

According to Toshiaki Hirota, Manager of Compiler Technology for Fujitsu, "Fujitsu is delighted to enter into this alliance with Lahey Computer Systems.  Lahey's solid reputation and expertise in the PC Fortran arena will complement Fujitsu's high performance and reliable compiler technology making world-class Fortran development tools possible."

Founded in 1935, Fujitsu Limited is an international leader in information technology, telecommunications, semiconductors, and other electronics devices.  Fujitsu, with over 400 technology, software, and service companies, posted global revenues of more than US$36 billion in the fiscal year ended March 31, 1997.  Visit Fujitsu at http://www.fujitsu.co.jp/index-e.html.
 

Fortran 90 Workshop IX
Tom Lahey and Tim Zeisloft conducted Fortran 90 Workshop IX March 2 - 4, 1998 at Granlibakken Resort and Conference Center at Lake Tahoe.  Not only were there good weather, excellent skiing, and great food, there were attendees from around the world who successfully ported their programs to Fortran 90.  Here is what they had to say:

"I learned that in some large measures my goals were rather naive.  It is not simply a question of adding some more modern features, but to a large extent exploring a new way of coding.  This will require some careful consideration and a lot of experience - but I am NO LONGER AFRAID OF IT!  THANKS!" Stephen Ross, University of New Brunswick

"I wouldn't know what I was missing in Fortran 90 without coming to the workshop.  I didn't need a semester-long class to learn Fortran 90 as may be taught at colleges.  I needed a transition class like this one."  Kevin Bratcher, Framatome Technologies

"Both Tim and Tom are excellent teachers, and the Lahey staff was great.  I had a wonderful time!  I would and will recommend your workshop to others."  Paula Arsenault, PMA Engineering

Call us to reserve your seat at our next Fortran 90 Workshop!
 

1998 Reseller Seminar
Lahey sponsored another successful Reseller Seminar on March 3 & 4, 1998. Attending were resellers from Australia, Germany, and the United Kingdom.  Steven Terui, Fortran Product Manager, Fujitsu Software Corporation, led a discussion on how Lahey and Fujitsu will be working together in the future.  Lahey President, Bob Runyan, led the group through a detailed discussion of LF90 and competing Fortran 90 language systems.  At the end, our roundtable discussion gave resellers the opportunity to tell Lahey how we can do things better.  But the seminar wasn't all about work.  Wednesday afternoon the group took time to acquaint itself with the local pastime -- skiing.  Homewood Ski Resort proved to be a nice diversion.  Hope to see all of Lahey's Resellers next year!

1998 Lahey User Meeting
The not-so-annual annual Lahey User Meeting was held March 5 and 6, 1998 at the Granlibakken Resort and Conference Center at Lake Tahoe.

Here's what happened:  Tom Lahey discussed the future of Fortran.  Bob Runyan, President, Lahey Computer Systems, and Steven Terui, Fortran Product Manager, Fujitsu Software Corporation, discussed the new features of LF90 v4.5.  Steven demonstrated the Fujitsu Visual Analyzer and talked a bit about the Lahey/Fujitsu Fortran Alliance.  Richard Hanson, Visual Numerics, Inc., talked about the Lahey/VNI relationship and discussed the Fortran 90 advantages of the IMSL Fortran 90 MP Library.  Mike Boucher, Vice President, Dakota Scientific Software, talked about parallel processing and high performance math libraries.  David McNamara, Product Manager, Pacific-Sierra Research Corporation, gave us some advice about porting FORTRAN 77 code to Fortran 90 using the VAST 77 to 90 translator.  Bruce Bush, Indowsway Software, and Eric Wilson, Berkeley Simulation Software, demonstrated how to use RealWin to create custom Windows applications.  Kevin Bradly, Bradly Associates, showed how GinoMenu makes Windows GUI programming easy.  Lawson Wakefield, Interactive Software Services, was unable to attend, but did send along a 25-minute, multimedia presentation of Winteracter, MenuED, DialogED, and the beta version of his new Winteracter Development Environment (WiDE).  Joe Chirieleison, Lahey Computer Systems, demonstrated a blackjack program written with LF90 and the Winteracter Starter Kit.  Howell Johnson, Lahey Computer Systems, discussed calling Fortran DLLs from Windows applications.  John Appleyard, President, Polyhedron Software, showed us the new Automake Configuration File Editor and talked about the benefits of using the plusFORT analysis tools.  We all sat around on Thursday evening and discussed things like DLLs, graphics, and exception handling.

A lot happened in two days.  Thank you to all our guest speakers for your well received presentations and to Danielle Kirby for organizing the 1998 Lahey User Meeting.
 

Q&A
Q: I have problems with Automake when I need to modify the AUTOMAKE.FIG file. Are there any tips you can share?
A: Here are a few tips:

You must have the LF90 keyword in AUTOMAKE.FIG.  If it is omitted, Automake will not run the LF90 compiler.

In most cases the COMPILE= commands should have -c as a switch. The exception is when building libraries.

Every FILES= statement should have an associated COMPILE= statement, which should occur before the AND. If the COMPILE= is omitted, it will use the default command, even if another COMPILE= command is specified further down in the file.

If you have multiple FILES= statements, you cannot use a response file to compile your code.  A response file in the link command is fine in this situation.

If you need to link in a .LIB file that's not in the same as directory as your program source files, you need a "-lib x:\mypath\mylib" statement on your LINK= line.

LF90 v4.5 includes the new Windows Automake Configuration File Editor. Give it a try.

Q: Do my programs have a "Year 2000" date problem?
A: Lahey compilers include a 2-digit date subroutine called DATE() that returns the last two digits of the current system date. Changing the output of this subroutine to 4 digits would cause problems in existing code so this subroutine will not be revised.  If you have code that calls the DATE subroutine, and that code assumes that the century is 1900, you may be subject to "Year 2000" problems.

Our Fortran 90 compiler, LF90, and our educational Fortran compiler, Essential LF90, include the Fortran 90 standard DATE_AND_TIME subroutine.  DATE_AND_TIME returns a 4-digit date.

We recommend changing all code that uses DATE to use DATE_AND_TIME instead. DATE_AND_TIME is not included with our FORTRAN 77 compiler, F77L-EM/32.  We recommend that EM/32 owners upgrade to LF90.

Q: Does LF90 support Holleriths?
A: Yes, to some degree. Fatal errors are generated in the following circumstances:

When literal data of any type, including those using a Hollerith, are assigned to a variable that has not been declared as a character.

When a Hollerith is used and the line has characters past column 72.

When a Hollerith is extended to the next line.

The TRANSFER function or EQUIVALENCE statement can be used if a numeric representation of a variable is required after it has been assigned an alpha-numeric expression by a Hollerith.  The TRANSFER function is recommended.

Q: When compiling my LF90 programs from the Editor, the compiler output is not showing up. What could be the problem?
A: You may have an old ANSI driver on your system which for some reason stops ED from getting program output. If there is a reference to either vansi.sys or eansi.sys in your config.sys or config.nt file, removing the  reference should eliminate the problem.

Q: Are C compilers compatible with Lahey Fortran 90?
A: For LF90 versions up through 4.0, to do a static link (i.e., have your C routines become part of your .exe), the compiler to use is MetaWare High C.  Beginning with LF90 v4.5, static linking with Microsoft Visual C/C++ and Borland C++ objs is supported.  If you prefer to create and reference C routines in a dynamic link library (DLL) both Microsoft Visual C/C++ or Borland C++ are supported.
 

Q: Where can I find a listing of LF90 runtime error messages?
A: LF90 runtime error messages are documented in the RTERRMSG.TXT file. This is in the installation directory.  You can also use the IOSTAT_MSG subroutine from within your source code.  See the LF90 Language Reference for more information on IOSTAT_MSG.

Q: What can I do to minimize the size of my Windows executable program?
A: The reason you get a large executable is that our linker does not do executable compression for Windows executables.  The following are options available to work around this:

Consider compiling for DOS (using -nwin -pack -bind) and running the resulting program in a DOS box.  This will give you an extended-DOS rather than a Windows console-mode application. Our linker will compress extended-DOS applications.

Make your large arrays allocatable (a Fortran 90 feature).  In this way, your executable stays small.  You allocate the memory at runtime as needed.

There is a third-party product called Shrinker available from Blink, Inc. that will compress your Windows executables. See http://www.blinkinc.com.
 

Help us end waste. Let us know if you change your address, receive duplicate copies of Fortran SOURCE, or would like to be removed from our mailing list.  Call us toll-free at 1-800-548-4778 or send us e-mail at shipping@lahey.com.  Thank you.