Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!exodus!exodus-bb!khb From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup) Newsgroups: comp.lang.fortran Subject: Re: Basic Questions Message-ID: Date: 25 Mar 91 18:58:56 GMT References: <1991Mar25.063607.7530@fs7.ece.cmu.edu> Sender: news@exodus.Eng.Sun.COM Organization: Sun MegaSystems Lines: 80 In-reply-to: winstead@faraday.ECE.CMU.EDU's message of 25 Mar 91 06:36:07 GMT In article <1991Mar25.063607.7530@fs7.ece.cmu.edu> winstead@faraday.ECE.CMU.EDU (Charles Holden Winstead) writes: I am a novice FORTRAN programmer, and these will probably be easy questions ... Spark station, and would like to tell you the version number but I ^ SPARC, but spelling flames are absurd ;> (and I am a frequent offender) > access to the man pages If you have the compiler legally you have at least the online man pages! In general, it isn't very efficient to ask the thousands of folks on the net to key in parts of the manual for you (at least not globally efficient, it may be easy for you ;>). Seriously, please score a copy of the documentation, it will make your life easier in many ways. 1. If I use write(*,*), and then redirect my output to a file when running, is there a way to write to the screen, say accessing standard error instead of standard output? Yes. write(0,*) "foo" goes to standard error. ... 3. Where do I get a list of all the intrinsic functions? As in the specific name differences for using a double precision one, or a double complex one. Typically in Appendix B of the Sun FORTRAN Reference Manual. In general, it is best to avoid specific names, use the generic ones. 4. Is there a way for a subroutine to know from which module it was called? i.e. was it called from line ## from main, or line # from subroutine foo? Not in any socially approved way. The traceback mechanism clearly knows how, but it relies on knowing far more about the OS than is healthy. It isn't a public interface, because it is subject to much change. 5. What is a good FORTRAN book that tells me how to write efficient code, how fortran looks at data and pointers etc. I'd like a book that assumes that I know something about programming and want to be better. J. M. Levesque AND J. W. Williamson "A Guidebook to Fortran on Supercomputers" Academic Press San Diego, CA, 1989 Metcalf's "FORTRAN Optimization. and "Effective Fortran 77" Oxford Science Publications ISBN 0-19-853709 (I forget the isbn of the optimization book). Come to mind. 6. If I divide a double complex by a double precision am I safe or should I somehow cast my dp variable as a dc one. Are there other pitfalls in mixing types? Read the standard carefully. It is safe, if you and it agree. It is often the case that folks are surprised by what happens .... 8. Where do I get f2c, and a renumbering program? responses posted privately. cheers -- ---------------------------------------------------------------- Keith H. Bierman kbierman@Eng.Sun.COM | khb@chiba.Eng.Sun.COM SMI 2550 Garcia 12-33 | (415 336 2648) Mountain View, CA 94043