This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi,
I am trying to define 5 arrays with "extern float" and access them with global variables. but i am unable to build the code due to error #10099-D as shown below
In above image, I assume the error occurred due to the "gamma_air[31]" & "v0[31]" arrays which are defined in "sinetab.c" file. But I am not sure why & how the memory allocation fail is happening here. and what can be done to avoid that. I have 3 more such variables which are declasred the same way and needs to be called in this program for calculations.
I am attaching a dummy code below for the understanding
#include "F28x_Project.h" // Device Headerfile and Examples Include File #include "math.h" extern float v0[31]; // wavenumber extern float ST0[31]; // line intensity //-------for Lorentzian lineshape--------// extern float gamma_air[31]; //Air broadening coeff extern float gamma_self[31]; //self broadening coeff extern float Ep[31]; // lower state energy float alpha_voigt[900] = {{0}}; float p = 1; float x_C2H2 = 1; float x_air; float T=27; float T0=296; double n = 0.75; float ST = 0; float gamma_airj=0; float gamma_selfj; double c1=0; double c2=0; //double c3=0; double c4=0; #define c3 0.966460375191359; #define z 1.4388 Uint16 j = 0; void main(void) { p = 1; //pressure in bar x_C2H2 = x_C2H2/100; x_air = 1 - x_C2H2; T = T + 273; // temperature in k c4 = pow(T0/T,(double)n); for(j=0;j<31;j++) { c1 = (1-exp(-1*(double)(z*v0[j]/T))); c2 = (1-exp(-1*(double)(z*v0[j]/T0))); gamma_airj = (float)((double)gamma_air[j]*c4); } }
I am also attaching the code for the "sinetab.c" file
/* sinetab.c */ // table section declaration // #pragma DATA_SECTION(QuadratureTable,"QuadratureTableSection") // quadrature look-up table: contains 5 quadrants of sinusoid data points // HITRAN for C2H2 // line center (wavenumber cm-1) const float v0[31] = { 6532.8262, 6533.2727, 6533.3195, 6533.3711, 6533.3724, 6533.3724, 6533.375, 6533.4872, 6533.5458, 6533.678, 6533.9707, 6534.0623, 6534.36345, 6534.3641, 6534.4024, 6534.4074, 6534.4342, 6534.4565, 6534.6889, 6534.7226, 6534.9115, 6534.9353, 6535.2999, 6535.3511, 6535.389, 6535.4305, 6535.4351, 6535.4751, 6535.4819, 6535.9152,6535.9549, }; // ST0 = line intensity*N, (N = 2.479E19) const float ST0[31] = { 1.46E-04, 1.25E-04, 1.33E-04, 2.07E-04, 3.99E-04, 4.89E-04, 6.91E-05, 5.37E-04, 2.46E-03, 4.96E-06, 1.79E-04, 7.85E-05, 3.00E-01, 6.18E-04, 5.21E-06, 2.18E-04, 3.76E-03, 1.25E-03, 9.85E-05, 3.92E-06, 2.33E-04, 4.39E-04, 3.55E-04, 3.71E-04, 1.24E-04, 1.64E-04, 1.49E-04, 7.00E-05, 2.10E-04, 1.93E-03, 4.91E-04 }; // Air broadening coeffcient const float gamma_air[31] = { 0.082, 0.0787, 0.0777, 0.082, 0.0777, 0.0768, 0.082, 0.0768, 0.094, 0.0541, 0.0768, 0.0616, 0.082, 0.0777, 0.0597, 0.0777, 0.1043, 0.1043, 0.0635, 0.0578, 0.0808, 0.0808, 0.0777, 0.0768, 0.0768, 0.0756, 0.0756, 0.0808, 0.0808, 0.0985, 0.0756 }; //self broadening coeff. const float gamma_self[31] = { 0.158, 0.147, 0.144, 0.158, 0.144, 0.141, 0.158, 0.141, 0.18, 0.101, 0.141, 0.113, 0.158, 0.144, 0.11, 0.144, 0.191, 0.191, 0.116, 0.107, 0.154, 0.154, 0.144, 0.141, 0.141, 0.138, 0.138, 0.154, 0.154, 0.185, 0.138 }; //lower state energy const float Ep[31] = { 1425.5081, 1483.8367, 1526.817, 1543.2997, 1526.858, 1445.4238, 1543.312, 1442.9182, 22.9686, 1564.9755,1443.2827, 1319.4218, 105.885, 944.0663, 1493.152, 943.2125, 614.0444, 614.0549, 1259.9725, 1557.4917, 1555.3862, 1446.7444, 1512.1445, 1557.4784, 1557.5341, 1475.7936, 1478.5311, 1564.5485, 1564.5677, 13.7813,1476.2665 };
Kindly Help me with a resolution to this memory allocation problem. Thanks for the help in advance