Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime!heyman.austin.ibm.com!jerry From: jerry@heyman.austin.ibm.com (Jerrold Heyman) Newsgroups: comp.lang.fortran Subject: Re: How do compilers handle dimensions? Summary: Word size Message-ID: <2790@awdprime.UUCP> Date: 17 Jul 90 20:06:25 GMT References: <90198.114258FC138001@ysub.ysu.edu> Sender: news@awdprime.UUCP Organization: IBM AWD, Austin Lines: 44 In article <90198.114258FC138001@ysub.ysu.edu> FC138001@ysub.ysu.edu (Phil Munro) writes: > > All of my Fortran has been with mainframes and for the past year or >so I am using the VS2 compiler. Probably my questions are simple, but >perhaps they will be of interest to others also. > >1. The normal dimension byte size on the mainframe machine (which I >presume is a 64-bit machine) is *4. Does this size, and the resulting >size of numbers, have anything to do with the bit size of a machine? >For example, a PC would have 8, 16, or 32 for the bit size depending >upon whether it is an XT-type, AT-type, or 386-type machine, as I >understand it. If I transport a program from a 64-bit mainframe, will >the numerical precision for REAL numbers, and the maximum size for >INTEGERS, be less? Would it be necessary to change variables to >DOUBLE PRECISION, or something like that, to get the same precision? > Most mainframes that I've come in contact with use a 32-bit WORD. I'm aware of Cray's 64-bit word and probably there exist a few others, but making the assumption of a 64-bit word might be incorrect. As for the rest of your question, several years ago I ported a Fortran 77 program from a PRIME 750 to an IBM PC Clone (using Microsoft Fortran 3.2). With the exception of things that the Microsoft compiler didn't support (mostly string handling), we used the code as is and came up with the same results as the PRIME. Now I know that the PRIME is a 32-bit machine, and the PC Clone was an Intel 8088 based machine (making it an 8/16 bit machine). The only big thing that was noticed with the word size was that INTEGERS on the Clone defaulted to 16-bit and therefore any number larger than 2^16-1 would cause overflow. This was compensated by declaring all variables INTEGER*4 (forcing them to be 32-bit) - can't remember if there was a compiler directive or not. >2. Are the dimension statements REAL*8, etc., part of Fortran 77, 90 >or whatever, or are they just a VS extension? > REAL*8 is part of the Fortran 77 definition (its the same as DOUBLE PRECISION), not sure about the Fortran 90 standard. > Thanks for any discussion on these things. --Phil -- Jerry Heyman AWD Austin AIX Development VNET: HEYMAN at AUSVMQ IBM T-R: jerry@heyman.austin.ibm.com T/L: 793-3962