home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!stanford.edu!unixhub!slacvx.slac.stanford.edu!fairfield
- From: fairfield@slacvx.slac.stanford.edu
- Subject: Re: SUMMARY: CHARACTER FUNCTION as dummy argument
- Message-ID: <1992Dec15.111717.1@slacvx.slac.stanford.edu>
- Lines: 49
- Sender: news@unixhub.SLAC.Stanford.EDU
- Organization: Stanford Linear Accelerator Center
- References: <BURLEY.92Dec15044825@apple-gunkies.gnu.ai.mit.edu>
- Date: Tue, 15 Dec 1992 19:17:17 GMT
-
- A few comments on Craig Burley's summary:
-
- In article <BURLEY.92Dec15044825@apple-gunkies.gnu.ai.mit.edu>, burley@apple-gunkies.gnu.ai.mit.edu (Craig Burley) writes:
-
- First:
- [...]
- > If anyone has a system that supports the code in Sample 1 (like VAX/VMS
- > FORTRAN), it'd be interesting to see how well it handled the following:
- >
- > C Sample 6
- > CHARACTER*(*) CFUNC
- > EXTERNAL CFUNC
- > CALL X (CFUNC)
- > PRINT *, 'Done!'
- > END
-
- VAX Fortran rejects this at compile time, to wit (I called the source file
- BURLEY.FOR, thus BURLEY$MAIN):
-
- 00001 CHARACTER*(*) CFUNC
- 00002 EXTERNAL CFUNC
- 00003 CALL X (CFUNC)
- 00004 PRINT *, 'Done!'
- 00005 END
- %FORT-F-ADJLENUSE, Passed length character name used in invalid context
- [CFUNC] in module BURLEY$MAIN
-
- The rest of Sample 6 compiled fine...
-
- I won't comment on whether or not the VAX way of passing character
- arguments (functions and/or variables) is efficient or not since someone
- like Steve Lionel is in a _much_ better position to answer (although I
- do suspect there's no performance hit on VMS because ALL character
- entities are passed by [the address of a] descriptor). However, while I do
- appreciate issues of efficiency in Fortran code, CHARACTER manipulations
- are one place I think we should "look the other way", so to speak. These
- manipulation most often occur in the user interface, and users are SLOW
- DEVICES ;-) Furthermore, if you DO need efficient character manipulation,
- try recoding using the equivalent of Hollerith data: it's MUCH faster to
- compare INTEGER variables, even in a loop, than to compare CHARACTER
- variables. (Well, I admit there is likely hardware dependency in this...).
-
- Cheers, Ken
- --
- Dr. Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu
- SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX)
- Stanford, CA 94309 | BITNET Fairfield@Slacvx
- ----------------------------------------------------------------------------
- These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
-