RMcGee 0 Newbie Poster

A collegue of mine has a program to calculate viscous and non-viscous liguid flows. The program was written back in GB days so even has line numbers. Recently he wanted to run it under QB45 installed on a pentium III laptop running Windows 98SE. The original program ran fine and provided flow plots as expected. He wanted to increase the number of points considered in the Array matrices to improve the resolution of the results. The program now will not run indicating "not enough memory". He asked me if I could see what was wrong as he felt that the 128 mb memory that his laptop had should be many time greater than required. He was using the /ah option when invoking QB45. The following code snippet shows the part where arrays are dimensioned.

[1070 'N2
1080 DEFINT I-N
1090 DIM X(2000), Y(2000): ' X and Y coordinates
1100 DIM IBC(300), VIBC(300): ' stream function boundary
1110 DIM WBA(300): ' boundary of vorticity=0
1120 DIM ITC(100), BT(100): ' temp. condition
1130 DIM IES(50): ' thermal flux
1140 DIM IW(300, 2), IMO(300): ' boundary of vorticity
1150 DIM I(2000, 3): ' 3 element nodes
1159 ' $DYNAMIC
1160 DIM AA(2000, 30): ' band matrix (working area)
1170 DIM A(2000, 30): ' band matrix (saving area)
1180 DIM S(3, 3): ' element matrix
1190 DIM B(2000): ' right hand vector
1200 DIM DEL(2000): ' area of triangle
1210 DIM W(2000): ' vorticity (working area)
1220 DIM WW(2000): ' vorticity (saving area)
1230 DIM BB(2000): ' stream function
1240 DIM BS(3): ' element vector
1250 DIM V(2, 2000): ' velocity at center of triangle
1260 DIM C(300) ' working area
1270 ']

As you can see, his arrays were set as static arrays.

The following code snippet is his enhanced program increasing the size of the arrays.

[1070 'N20
1080 DEFINT I-N
1090 DIM X(2000), Y(2000): ' X and Y coordinates
1100 DIM IBC(300), VIBC(300): ' stream function boundary
1110 DIM WBA(300): ' boundary of vorticity=0
1120 DIM ITC(100), BT(100): ' temp. condition
1130 DIM IES(50): ' thermal flux
1140 DIM IW(300, 2), IMO(300): ' boundary of vorticity
1150 DIM I(2000, 3): ' 3 element nodes
1151 ' $DYNAMIC
1152 COMMON SHARED Big1, Big2 ' dynamic array sizes
1253 INPUT "input Big1 = 2000", Big1
1254 INPUT "input Big2 = 30", Big2


1160 DIM SHARED AA(1 TO Big1, 1 TO Big2): ' band matrix (working area)
1170 DIM SHARED A(1 TO Big1, 1 TO Big2): ' band matrix (saving area)
1180 DIM S(3, 3): ' element matrix
1190 DIM B(2000): ' right hand vector
1200 DIM DEL(2000): ' area of triangle
1210 DIM W(2000): ' vorticity (working area)
1220 DIM WW(2000): ' vorticity (saving area)
1230 DIM BB(2000): ' stream function
1240 DIM BS(3): ' element vector
1250 DIM V(2, 2000): ' velocity at center of triangle
1260 DIM C(300) ' working area
1270 ']

Notice that I attempted to set up the largest arrays as dynamic. However the program still tells us that we have insufficient memory at line 1170.

Is there an old (or young for that matter) codger out there who can suggest how we can get this to get past the array dimensioning?

Many thanks in advance

Roland

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.