Constant size exceeds variable size? 
Author Message
 Constant size exceeds variable size?

Can anyone help me out, I've been given a large program used to solve
coupled differential equations, and have only this error remaining. The
diagnostic is

%FORT-E-CONSIZEXC, Constant size exceeds variable size in data initialization
        [WMU] in module PRELIM at line 33

I don't understand.....

Here is the code for module PRELIM...

      SUBROUTINE PRELIM
      COMPLEX YF,YC
      COMMON /INOUT/ IR,IW
      COMMON /ABPAIR/ EA(10),EB(10),EC(10),KBLIM
      COMMON /RKCONS/ C(6),CDIF(6),KRK
      INTEGER ORDER
      COMMON/ARORD/MXI,MXJ,MXIJ,MXMU,MUVAL(6),ID,ORDER(150)
      INTEGER   IAG,JAG,AGDIM,NAG,NAGDIM,NB,NBDIM
      COMMON/CAG/AG(1000),AGDIM,NAGDIM,NAG(11),NB(11),IAG(300),JAG(300)
      EQUIVALENCE (NAGDIM,NBDIM)
      COMMON/STY/ YF(100),YC(100)  ,MAXY,MAXBNC
      COMMON /COMFAC/ NLOOP,NPTS,NMIN
      REAL WMU
      DIMENSION WMU(6),JORD(20),AGWR(10)
      DATA WMU/8H(00,00) ,8H(11,00) ,8H(10,00) ,8H(11,11) ,8H(10,10) ,
     1  8H(10,11) /
      DATA MORD/150/,MY/100/,MA/400/,MYP/30/,MB /20/,MBNC/200/
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       this is line 33 [i removed all the comments]

      [....program continues with lots of format statements etc]

anyone any idea what is wrong?, or indeed if they think the problem could
be elsewhere, what could be causing it?

Thanks for any help...

Clive McCaig
Dept. Applied Mathematics
Queens University Belfast.



Sat, 15 Mar 1997 21:40:54 GMT  
 Constant size exceeds variable size?

|>
|> Can anyone help me out, I've been given a large program used to solve
|> coupled differential equations, and have only this error remaining. The
|> diagnostic is
|>
|> %FORT-E-CONSIZEXC, Constant size exceeds variable size in data initialization
|>         [WMU] in module PRELIM at line 33
|>
|> I don't understand.....
|>
|> Here is the code for module PRELIM...
|>
|>       SUBROUTINE PRELIM
|>       COMPLEX YF,YC
|>       COMMON /INOUT/ IR,IW
|>       COMMON /ABPAIR/ EA(10),EB(10),EC(10),KBLIM
|>       COMMON /RKCONS/ C(6),CDIF(6),KRK
|>       INTEGER ORDER
|>       COMMON/ARORD/MXI,MXJ,MXIJ,MXMU,MUVAL(6),ID,ORDER(150)
|>       INTEGER   IAG,JAG,AGDIM,NAG,NAGDIM,NB,NBDIM
|>       COMMON/CAG/AG(1000),AGDIM,NAGDIM,NAG(11),NB(11),IAG(300),JAG(300)
|>       EQUIVALENCE (NAGDIM,NBDIM)
|>       COMMON/STY/ YF(100),YC(100)  ,MAXY,MAXBNC
|>       COMMON /COMFAC/ NLOOP,NPTS,NMIN
|>       REAL WMU
|>       DIMENSION WMU(6),JORD(20),AGWR(10)
|>       DATA WMU/8H(00,00) ,8H(11,00) ,8H(10,00) ,8H(11,11) ,8H(10,10) ,
|>      1  8H(10,11) /
|>       DATA MORD/150/,MY/100/,MA/400/,MYP/30/,MB /20/,MBNC/200/
|>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|>        this is line 33 [i removed all the comments]
|>      
|>       [....program continues with lots of format statements etc]
|>
|> anyone any idea what is wrong?, or indeed if they think the problem could
|> be elsewhere, what could be causing it?
|>
|> Thanks for any help...
|>
|> Clive McCaig

The error message comes from the line above, i.e. "DATA WMU/8H(00,00)
,...." The problem is that this is an old-fashioned program, which uses
real-variables to store character strings.  "WMU" is declared as a
real, which is 4 bytes on most computers, and you need 8 bytes.......

The way to solve it is change "REAL WMU" to "REAL*8 WMU", or to
"CHARACTER*8 WMU", which should be the best way to do it.

+---------------------------------------------------------------------+
| Jan Arne Fagertun, Research Engineer, SINTEF Division Thermodynamics|

| Phone : +47 73 59 68 90                      Fax  : +47 73 59 35 80 |
| Mail  : SINTEF/Varmeteknikk, 7034 Trondheim, Norway                 |
+---------------------------------------------------------------------+



Sat, 15 Mar 1997 22:40:49 GMT  
 Constant size exceeds variable size?
|> Can anyone help me out, I've been given a large program used to solve
|> coupled differential equations, and have only this error remaining. The
|> diagnostic is
|>
|> %FORT-E-CONSIZEXC, Constant size exceeds variable size in data initialization
|>         [WMU] in module PRELIM at line 33
|>
|> I don't understand.....
|>
|> Here is the code for module PRELIM...
|>
|>       SUBROUTINE PRELIM
|>       COMPLEX YF,YC
|>       COMMON /INOUT/ IR,IW
|>       COMMON /ABPAIR/ EA(10),EB(10),EC(10),KBLIM
|>       COMMON /RKCONS/ C(6),CDIF(6),KRK
|>       INTEGER ORDER
|>       COMMON/ARORD/MXI,MXJ,MXIJ,MXMU,MUVAL(6),ID,ORDER(150)
|>       INTEGER   IAG,JAG,AGDIM,NAG,NAGDIM,NB,NBDIM
|>       COMMON/CAG/AG(1000),AGDIM,NAGDIM,NAG(11),NB(11),IAG(300),JAG(300)
|>       EQUIVALENCE (NAGDIM,NBDIM)
|>       COMMON/STY/ YF(100),YC(100)  ,MAXY,MAXBNC
|>       COMMON /COMFAC/ NLOOP,NPTS,NMIN
|>       REAL WMU
|>       DIMENSION WMU(6),JORD(20),AGWR(10)
|>       DATA WMU/8H(00,00) ,8H(11,00) ,8H(10,00) ,8H(11,11) ,8H(10,10) ,
|>      1  8H(10,11) /
|>       DATA MORD/150/,MY/100/,MA/400/,MYP/30/,MB /20/,MBNC/200/
|>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|>        this is line 33 [i removed all the comments]
|>      
|>       [....program continues with lots of format statements etc]
|>
|> anyone any idea what is wrong?, or indeed if they think the problem could
|> be elsewhere, what could be causing it?
|>
|> Thanks for any help...
|>
|> Clive McCaig
|> Dept. Applied Mathematics
|> Queens University Belfast.
|>
|>

You appear to be trying to intialize WMU with a character string. I suggest
that you declare WMU as character*8 and replace the 8H with quotes. You
currently have WMU declared as a real. The bit pattern represented by
the character string 8H(00,00) may translate into a real value that is
larger than can be represented by reals on your system.

regards,
  Jim Tuccillo



Sat, 15 Mar 1997 18:33:27 GMT  
 Constant size exceeds variable size?

Quote:

>Can anyone help me out? The diagnostic is:
>%FORT-E-CONSIZEXC, Constant size exceeds variable size in data initialization
>        [WMU] in module PRELIM at line 33
>Here is the code for module PRELIM...
>      SUBROUTINE PRELIM
>      REAL      WMU
>      DIMENSION WMU(6)
>      DATA WMU/8H(00,00) ,8H(11,00) ,8H(10,00) ,8H(11,11) ,8H(10,10) ,
>     1  8H(10,11) /
>      END
>anyone any idea what is wrong?

One vendor-specific extension in the fortran 66 language, i.e., back when
FORTRAN didn't support 'CHARACTER' variables, was in the DATA statement, e.g.,

        REAL FMT1(5),FMT2(5)
        DATA FMT1 /20H(1X,I2,3X,I4)                        /
        DATA FMT2 / 4H(1X,, 4HI2,3, 4HX,I4, 4H)   , 4H     /
        END

Notice that the 20-byte string will be stored, byte-for-byte,
spilling into consecutive elements of the 'FMT1' array,
while the hard-to-read text is individually-loaded into the 'FMT2' array.

So, your compiler is confused whether to allow, or dis-allow, "spill".



Mon, 17 Mar 1997 05:16:15 GMT  
 Constant size exceeds variable size?

Quote:


>>Can anyone help me out? The diagnostic is:
>>%FORT-E-CONSIZEXC, Constant size exceeds variable size in data initialization
>>        [WMU] in module PRELIM at line 33
>>Here is the code for module PRELIM...
>>      SUBROUTINE PRELIM
>>      REAL      WMU
>>      DIMENSION WMU(6)
>>      DATA WMU/8H(00,00) ,8H(11,00) ,8H(10,00) ,8H(11,11) ,8H(10,10) ,
>>     1  8H(10,11) /

Clearly this assumes that each REAL value can hold at least 8
characters. True on a Cray, on a CDC {*filter*}, on many other machines
nowadays if you use the right compiler options, but default on VMS
(the error message has a very VMSish feel to it) is for a REAL value
to occupy only 4 bytes. Either dimension WMU(12) or declare REAL*8 WMU
or (even better) go for CHARACTER*8 WMU(6) and DATA WMU/'(00,00) ', etc.

Quote:
>        REAL FMT1(5),FMT2(5)
>        DATA FMT1 /20H(1X,I2,3X,I4)                        /
>        DATA FMT2 / 4H(1X,, 4HI2,3, 4HX,I4, 4H)   , 4H     /
>Notice that the 20-byte string will be stored, byte-for-byte,
>spilling into consecutive elements of the 'FMT1' array,
>while the hard-to-read text is individually-loaded into the 'FMT2' array.
>So, your compiler is confused whether to allow, or dis-allow, "spill".

Not in this case. Even allowing spill, the DATA statement specifies a
48-byte sequence, and WMU had only 24 bytes on the system where the
error occurred.

--



Mon, 17 Mar 1997 07:13:12 GMT  
 Constant size exceeds variable size?

Quote:
(Melvin Klassen) writes:
>One vendor-specific extension in the FORTRAN 66 language, i.e., back when
>FORTRAN didn't support 'CHARACTER' variables, was in the DATA statement, e.g.,

>        REAL FMT1(5),FMT2(5)
>        DATA FMT1 /20H(1X,I2,3X,I4)                        /
>        DATA FMT2 / 4H(1X,, 4HI2,3, 4HX,I4, 4H)   , 4H     /
>        END

>Notice that the 20-byte string will be stored, byte-for-byte,
>spilling into consecutive elements of the 'FMT1' array,
>while the hard-to-read text is individually-loaded into the 'FMT2' array.

>So, your compiler is confused whether to allow, or dis-allow, "spill".

No, it's not confused.  It doesn't allow it, which is why it's complaining.

It may be that the program (which attempts to store six eight-byte
strings into a six-element REAL array) was originally written for a CRAY
system where REALs are 8-bytes long.  Even supposing a compiler which
allowed "spill" (I'm not familiar with any), this program would still
be in error because 48 into 24 doesn't go.

Declaring the array to be REAL*8 is most likely the appropriate modification.
(The compiler in question, DEC Fortran for OpenVMS VAX, does not support an
"autodouble" feature. DEC Fortran on other platforms does support this feature.)


DEC Fortran Development           WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation    
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"




Mon, 17 Mar 1997 09:05:56 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Exceeding the text size in the embed editor

2. CVF warning LNK4084: total image size 355000320 exceeds max (268435456)

3. File size limit exceeded error

4. stack size limit exceed :-(

5. Segment Size Exceeds 64K

6. Stack and data size exceeds 64K

7. MS FORTRAN 5.1 seg. size exceeds 64K

8. stack size exceeded maxssiz

9. image size exceeds max

10. Constants on diagram not sized to text in Labview 5.1.1 under Windows 2000

11. constant sizing

12. IEEE draft standard P1364 verilog: sized constants

 

 
Powered by phpBB® Forum Software