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

From: Michael S Kluskens <kluskens_at_email.domain.hidden>
Date: Mon, 08 Jun 1998 09:28:13 -0400

At 5:00 PM -0400 6/6/98, Chuck Counselman wrote:
>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
>
> 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."

I can't find NEWINF or PATDAT in my copy of NEC-4. Perhaps you have a
modified version.

In any case, the problem you encountered is not specific to the
particular compiler you used. Apparently someone took advantage of a
feature of a specific compiler which has not been copied by others
resulting in nonportable code.

Michael S. Kluskens, Electromagnetics Section, Code 5316
kluskens_at_crystal.nrl.navy.mil, 202/404-1818, FAX 202/767-6276
Received on Wed Jun 10 1998 - 09:26:14 EDT

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