LF90 to LF95 Porting Guide
This document is provided to facilitate the job of moving your application from LF90 to LF95. Please contact Lahey Technical
Support if you have suggestions for improving this document.
New Language Features
- Partial nesting of FORALL and WHERE statements
- Masked ELSEWHERE
- PURE procedures
- ELEMENTAL procedures
- More consistent calling sequence for MINLOC, MAXLOC, CEILING, and FLOOR intrinsics
- Pointer initialization
- NULL intrinsic for pointer initialization
- Default derived type initialization
- CPU_TIME intrinsic
- Automatic deallocation of allocatable arrays
- Consistent syntax for END INTERFACE
- Comments in NAMELIST input
- Minimal input field width
- Unlimited number of continuation lines in free or fixed source form
- DO UNTIL statement
- FIND statement
- STRUCTURE statement
- END STRUCTURE statement
- UNION statement
- END UNION statement
- MAP statement
- END MAP statement
- RECORD statement
- Non-standard POINTER statement
- AUTOMATIC statement
- STATIC statement
- VALUE statement
- BYTE statement
- Hollerith constants
- Bdigits form of binary constant
- digitsO form of octal constant
- X'digits' form of hexadecimal constant
- 'digits'X form of hexadecimal constant
- Zdigits form of hexadecimal constant
- Binary, Octal, or Hexadecimal constant in a DATA, PARAMETER, or type declaration statement
- '.' period structure component separator
- IMPLICIT UNDEFINED statement
- Namelist input/output on internal file
- FORM = 'BINARY'
- TOTALREC specifier
- STATUS = 'SHR'
- Gw edit descriptor
- $ edit descriptor
- \ edit descriptor
- R edit descriptor
- LOC intrinsic function
- The following service subroutines: ABORT, BEEP, BIC, BIS, CLOCK, CLOCKM, DATE, EXIT, ERRSAV, ERRSTR, ERRSET, ERRTRA, FDATE, FREE,GETARG, GETDAT, GETLOG, GETPARM, GETTIM, GMTIME, IBTOD, IDATE, IETOM, ITIME, IVALUE, LTIME, MTOIE, PERROR, PRNSET, QSORT, SETRCD, SETBIT, SIGNAL, SLEEP
- The following service functions: ACCESS, ALARM, BIT, CHDIR, CHMOD, CTIME, DRAND, DTIME, ETIME, FGETC, FPUTC, FSEEK, FSTAT, FTELL, GETC, GETCWD, GETFD, GETPID, HOSTNM, IARGC, IERRNO, INMAX, IOINIT, IRAND, JDATE, KILL, LNBLNK, LONG, LSTAT, MALLOC, NARGS, PUTC, RAN, RAND, RENAME, RINDEX, RTC, SECOND, SECNDS, SETDAT, SETTIM, SHORT, STAT, TIME, TIMEF, UNLINK
Known incompatibilities between LF95 5.0 and LF90 4.5
- The Pentium flaw check that used to be available as part of the runtime startup code is now available as a freely distributable Fortran source file (SRC\PENTEST.F90).
- List-directed output is formatted differently. If you need a particular output formatting, use an explicit format.
- LF90 objects are not compatible with LF95 objects. All Fortran source files must be recompiled.
- GETENV() is now a subroutine with two arguments instead of a function with one.
- MODTABLE.TXT no longer exists; modules generate .obj files instead of .lib files.
- Module object files must be included on the LF95 command line whenever the module is USE'd.
- Modules with names greater than 8 characters can only be compiled on drives/volumes that support long filenames.
- You must use -nomap when compiling files that have spaces in their names.
- There's a limit of 250 files open concurrently. This includes the pre-connected units 0, 5, and 6.
- You can't control line width and page length in cross-reference and listing files.
- -nsav is now the default. Specify -sav if you want local variables saved by default.
- You can't create DOS applications. Win32s is not supported, but applications created with LF95 seem to work fine on Win32s, in the limited testing we've done.
- -winconsole is the default (and -win32s isn't available).
- Console I/O is not allowed with -win. Use -winconsole instead.
- LF95 uses -dal by default; LF90 used -ndal. Automatic deallocation is standard in Fortran 95.
- Compile-time global procedure interface checking isn't reported in error messages, only in listing file.
- -syn switch isn't available. Use -c, compile only, or run your code through Visual Analyzer.
- The –tpp switch generates code that will only run on Pentium Pro, Pentium II, and Pentium II processors.
- The YIELD subroutine is not supported by LF95. Delete references to YIELD.
- -wrap switch isn't available. Use the horizontal scroll bar to view long messages.
- -o3 switch isn't available. Use -o1.
- -f90 switch isn't available. Use -f95.
- -vax switch isn't available. The VAX and IBM extensions are now intrinsic. If you have name clashes use the EXTERNAL attribute on user-defined procedures that share the same names.
- Argument consistency checking is done at run-time. LF90 did it at compile-time.
- No support for Lahey's non-standard namelist format.
- Sharing modes aren't available for the ACTION= specifier. Default behavior is DENYNONE.
- INTRUP intrinsic isn’t available.
- LF95 uses a different unformatted sequential file format. Convert files with SEQUNF.F90.
- LF95 doesn't support Lahey direct file headers. Convert files with HDRSTRIP.F90.
- Argument checking for transcendental intrinsics (e.g., SIN, LOG, etc.) is done at run-time in LF95.
- The POINTER and OFFSET functions cannot take literal constant arguments, only variables.
- LISK is not included. Move to WiSK or Winteracter (or continue to use LF90).
- Object files are placed in the current working directory. LF90 placed them in the directory where the source file resides. Override this behavior with LF95's -o switch if needed.
- In LF95, you must specify REC= on an I/O statement for a file opened for direct access. LF90 would default to the current record.
- In LF95, files opened for direct or transparent access will not take the END= branch when EOF is encountered. "END=" must be replaced by "ERR=".
- LF95 does not allow the same common to be initialized in multiple block data program units. LF90 allowed this extension. Initialize a common in a single block data with LF95.
- In the debugger and in the map file a routine in a module is referred to by LF95 as module@routine. LF90 used routine@module.
- In LF95, when a write statement is executed for which no open statement has occurred, an implicit open is executed with a filename of "fort.n", where n is the unit number. This means that
will never return an iostat with a value equivalent to "no file connected to unit"
- For LF95, RANDOM_SEED takes a seed size of 1. For LF90 the seed size was 10.
- LF95 allows assignment of LOGICAL to REAL and INTEGER to LOGICAL.
- LF95 pre-connects unit 5 for reading and unit 6 for writing. LF90 pre-connects units 5 and 6 for both reading and writing.
- LF95 will invoke the linker even if a module procedure contains no executable code. Use the -c compiler switch to override this behavior.
- Since files created by LF95 do not have headers, the following INQUIRE statement keyword return values may be "UNDEFINED" or "UNKNOWN" for files that are not connected: ACCESS, SEQUENTIAL, DIRECT, FORM, FORMATTED, UNFORMATTED, RECL, NEXTREC
- A module subprogram name cannot be specified in DLL_EXPORT statement. If you want that module subprogram to be in a DLL, specify the module name in a DLL_EXPORT statement before the module's CONTAINS statement. Declare the module as DLL_IMPORT in program units where the module is USE'd and the exported module procedure is referenced.
- In LF95, if you want to choose which routine to call in a DLL (created with -ml msvc) at runtime instead of coding the routine name at compile time and specifying the proper dll at link time, you must prepend the name of the routine with an underscore.
In LF90, you write:
conversion_demo = (MYPROC)
but in LF95, you write:
conversion_demo = (MYPROC)