12.07.2015 Views

LF95 Linux User's Guide - Lahey Computer Systems

LF95 Linux User's Guide - Lahey Computer Systems

LF95 Linux User's Guide - Lahey Computer Systems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AProgramming HintsThis appendix contains information that may help you create better LF64 programs.Efficiency ConsiderationsIn the majority of cases, the most efficient solution to a programming problem is one that isstraightforward and natural. It is seldom worth sacrificing clarity or elegance to make a programmore efficient.The following observations, which may not apply to other implementations, should be consideredin cases where program efficiency is critical:• One-dimensional arrays are more efficient than two, two are more efficient thanthree, etc.• Make a direct file record length a power of two.• Unformatted input/output is faster for numbers.• Formatted CHARACTER input/output is faster using:CHARACTER*256 Cthan:CHARACTER*1 C(256)Side EffectsLF64 arguments are passed to subprograms by address, and the subprograms reference thosearguments as they are defined in the called subprogram. Because of the way arguments arepassed, the following side effects can result:• Declaring a dummy argument as a different numeric data type from that declared inthe calling program unit can cause unpredictable results and NDP error aborts.<strong>Lahey</strong>/Fujitsu <strong>Linux</strong>64 Fortran User’s <strong>Guide</strong> 123

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!