NEC-LIST: Adjustable arrays in NEC-4 FORTRAN source

From: Chuck Counselman <ccc_at_email.domain.hidden>
Date: Sat, 06 Jun 1998 17:00:52 -0400

Please allow a FORTRAN novice to ask an ignorant question:

In the FORTRAN source code of NEC-4, so-called "adjustable" array
dimensioning is used to facilitate user adjustment of array sizes.
For example, in SUBROUTINE NEWINF you'll find

  .
  .
  .
C MAXSEG = MAXIMUM NUMBER OF SEGMENTS + PATCHES
  .
  .
  .
      PARAMETER (MAXSEG=2000,MAXMAT=2000)
  .
  .
  .
      COMMON/PATDAT/NPAT,XPAT(MAXSEG),YPAT(MAXSEG),ZPAT(MAXSEG),
     &PNX(MAXSEG),PNY(MAXSEG),PNZ(MAXSEG),APAT(MAXSEG),PCURXR(MAXSEG),
     &PCURXI(MAXSEG),PCURYR(MAXSEG),PCURYI(MAXSEG),PCURZR(MAXSEG),
     &PCURZI(MAXSEG)
....

When I tried to compile this code with Absoft's Fortran 77 compiler
for the PowerMac, v. 4.2 (which works fine for NEC-2, BTW), the
compiler complained about an adjustable array being used in this
subroutine. I RTFM and -- sure enough -- on page 11-18 it is stated,
"..."only _constant_ array declarators are allowed in
COMMON...statements. Adjustable and assumed size array declarators do
not supply sufficient information to map the static memory at compile
time."

This problem isn't a show-stopper; if all else fails I can edit the
source code to substitute a constant value for an adjustable
dimension, e.g., 2000 for MAXSEG. However, I wonder if maybe I should
update my Fortran compiler. Perhaps NEC-4 uses (say) FORTRAN 90
features and, if so, I'm in for one problem after another if I keep
trying to use an old FORTRAN 77 compiler.

Any advice? TIA. -Chuck.
Received on Sun Jun 07 1998 - 10:27:43 EDT

This archive was generated by hypermail 2.2.0 : Sat Oct 02 2010 - 00:10:38 EDT