@@ -1293,47 +1293,23 @@ INITIALIZE
12931293 "invalid monochromator radius=%g. Maybe you wanted to turn the component around instead?\n", NAME_CURRENT_COMP, radius_x));
12941294
12951295 if (!x_pos){
1296- double pos[n_crystals];
1297- for (int i=0;i<n_crystals;i++){
1298- pos[i] = 0;
1299- }
1300- x_pos = pos;
1296+ x_pos=calloc(n_crystals, sizeof(double));
13011297 }
13021298 if (!y_pos){
1303- double pos[n_crystals];
1304- for (int i=0;i<n_crystals;i++){
1305- pos[i] = 0;
1306- }
1307- y_pos = pos;
1299+ y_pos=calloc(n_crystals, sizeof(double));
13081300 }
13091301 if (!z_pos){
1310- double pos[n_crystals];
1311- for (int i=0;i<n_crystals;i++){
1312- pos[i] = 0;
1313- }
1314- z_pos = pos;
1302+ z_pos=calloc(n_crystals, sizeof(double));
13151303 }
13161304 if (!x_rot){
1317- double pos[n_crystals];
1318- for (int i=0;i<n_crystals;i++){
1319- pos[i] = 0;
1320- }
1321- x_rot = pos;
1322- }
1305+ x_rot=calloc(n_crystals, sizeof(double));
1306+ }
13231307 if (!y_rot){
1324- double pos[n_crystals];
1325- for (int i=0;i<n_crystals;i++){
1326- pos[i] = 0;
1327- }
1328- y_rot = pos;
1329- }
1330- if (!z_rot){
1331- double pos[n_crystals];
1332- for (int i=0;i<n_crystals;i++){
1333- pos[i] = 0;
1334- }
1335- z_rot = pos;
1308+ y_rot=calloc(n_crystals, sizeof(double));
13361309 }
1310+ if (!z_rot){
1311+ z_rot=calloc(n_crystals, sizeof(double));
1312+ }
13371313 if (verbose){
13381314 printf("Monochromator_Bent output: "
13391315 "Component name is %s:\n", NAME_CURRENT_COMP);
0 commit comments