FIX: Errors F1002, F1901, R6000 Using Large Namelists (65047)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q65047

SYMPTOMS

In the code sample below, errors are produced when a READ operation is performed on a namelist that contains more than 99 variables.
With FORTRAN version 5.0,

If the namelist contains         the following errors are produced

   100 - 106 variables           F10002: out of heap space
                                 R6000 - stack overflow

   107 - 117 variables           machine hangs in DOS during compile
                                 or protection violation under OS/2.

   118 + variables               F1901: program too large for memory
				
If the READ in the code below is changed to a WRITE, the errors are the same, except when the namelist contains 104 - 106 variables under OS/2. In this case, the screen group running the compiler will hang.
With FORTRAN version 5.1

If the namelist contains         the following errors are produced

   108 - 115 variables           F1002: out of heap space
                                 R6000 - stack overflow

   116 - 118 variables           R6000 - stack overflow

   119 + variables               F1901: program too large for memory
				

RESOLUTION

The workaround to this problem is to reduce the size of the namelist. This can be accomplished by either splitting the namelist into multiple smaller namelists or by grouping variables of similar type together using arrays.

STATUS

Microsoft has confirmed this to be a problem in FORTRAN versions 5.0 and 5.1. This problem was corrected in FORTRAN PowerStation.

MORE INFORMATION

The following code will produce the errors:
        NAMELIST /test/ 
     * a001,a002,a003,a004,a005,a006,a007,a008,a009,a010
     *,a011,a012,a013,a014,a015,a016,a017,a018,a019,a020
     *,a021,a022,a023,a024,a025,a026,a027,a028,a029,a030
     *,a031,a032,a033,a034,a035,a036,a037,a038,a039,a040
     *,a041,a042,a043,a044,a045,a046,a047,a048,a049,a050
     *,a051,a052,a053,a054,a055,a056,a057,a058,a059,a060
     *,a061,a062,a063,a064,a065,a066,a067,a068,a069,a070
     *,a071,a072,a073,a074,a075,a076,a077,a078,a079,a080
     *,a081,a082,a083,a084,a085,a086,a087,a088,a089,a090
     *,a091,a092,a093,a094,a095,a096,a097,a098,a099,a100
     *,a101,a102,a103,a104,a105,a106,a107,a108,a109,a110
     *,a111,a112,a113,a114,a115,a116,a117,a118,a119,a120

      READ (*,test)
      END
				
The following code uses an array instead of individual variables:
      real a(120)
      namelist/test/ a

      read (*,test)
      end
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kbfix KB65047