- Timestamp:
- Apr 21, 2008, 9:43:30 PM (17 years ago)
- Children:
- cc46b0
- Parents:
- f50ab8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/output.c
rf50ab8 r57a69b2 816 816 MaxPoints = (N[0]+1)*(N[1]+1)*(N[2]+1); 817 817 posname = (char*) 818 Malloc(strlen(P->Files.mainname) + strlen(suffixdenspos) + 1,"OpenFile");819 sprintf(posname, "%s %s", P->Files.mainname, suffixdenspos);818 Malloc(strlen(P->Files.mainname) + strlen(suffixdenspos) + 3 + 1,"CreateDensityOutputGeneral: posname"); 819 sprintf(posname, "%s.L%i%s", P->Files.mainname, Lev->LevelNo, suffixdenspos); 820 820 datname = (char*) 821 Malloc(strlen(P->Files.mainname) + strlen(suffixdensdat) + 1,"OpenFile");822 sprintf(datname, "%s %s", P->Files.mainname, suffixdensdat);821 Malloc(strlen(P->Files.mainname) + strlen(suffixdensdat) + 3 + 1,"CreateDensityOutputGeneral: datname"); 822 sprintf(datname, "%s.L%i%s", P->Files.mainname, Lev->LevelNo, suffixdensdat); 823 823 // write doc file 824 824 suffix = (char *) … … 1048 1048 switch (Lat->RT.ActualUse) { 1049 1049 case active: 1050 sprintf(suffix, " %s", suffixdenspos);1050 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixdenspos); 1051 1051 OpenFileNo(P, &DensityPos, suffix, (int)step, "wb",P->Call.out[ReadOut]); 1052 1052 case inactive: 1053 1053 case standby: 1054 sprintf(suffix, " %s", suffixdensdat);1054 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixdensdat); 1055 1055 OpenFileNo(P, &DensityData, suffix, (int)step, "wb",P->Call.out[ReadOut]); 1056 1056 break; … … 1470 1470 struct Ions *I = &P->Ion; 1471 1471 struct FileData *F = &P->Files; 1472 struct LatticeLevel *Lev = &P->Lat.Lev[STANDARTLEVEL]; 1472 1473 int i,is,ia; 1473 1474 double *fion, *pos; … … 1480 1481 datnamef = (char*) 1481 1482 malloc(strlen(P->Files.mainname)+strlen(suffixionfor) + 1); 1482 sprintf(datnamef, "%s %s", P->Files.mainname, suffixionfor);1483 sprintf(datnamef, "%s.L%i%s", P->Files.mainname, P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixionfor); 1483 1484 datnameZ = (char*) 1484 1485 malloc(strlen(P->Files.mainname)+strlen(suffixionZ) + 1); 1485 sprintf(datnameZ, "%s %s", P->Files.mainname, suffixionZ);1486 sprintf(datnameZ, "%s.L%i%s", P->Files.mainname, P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixionZ); 1486 1487 posname = (char*) 1487 1488 malloc(strlen(P->Files.mainname)+strlen(suffixionpos) + 1); 1488 sprintf(posname, "%s %s", P->Files.mainname, suffixionpos);1489 sprintf(posname, "%s.L%i%s", P->Files.mainname, P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixionpos); 1489 1490 // open, fill and close doc file 1490 sprintf(suffix, " %s", suffixiondoc);1491 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixiondoc); 1491 1492 if (OpenFile(P, &IonsDoc, suffix, "w",P->Call.out[ReadOut])) { 1492 1493 fprintf(IonsDoc,"IonsPos file = %s.####\n", posname); … … 1501 1502 } 1502 1503 // open dx file and fill it with each output step, close it 1503 sprintf(suffix, " %s", suffixiondx);1504 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixiondx); 1504 1505 if (OpenFile(P, &IonsDx, suffix, "w",P->Call.out[ReadOut])) { 1505 1506 for (i=0; i < F->OutVisStep+1; i++) { … … 1541 1542 Free(posname, "OutVisIons: posname"); 1542 1543 // open IonForces, IonZ and IonPosition file, write forces respectively positions for each ion of each type, close them 1543 sprintf(suffix, " %s", suffixionfor);1544 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixionfor); 1544 1545 if (OpenFileNo(P, &IonsDataF, suffix, F->OutVisStep, "wb",P->Call.out[ReadOut])) { 1545 1546 if (F->OutVisStep == 0) { 1546 sprintf(suffix, " %s", suffixionZ);1547 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixionZ); 1547 1548 OpenFile(P, &IonsDataZ, suffix, "wb",P->Call.out[ReadOut]); 1548 1549 } 1549 sprintf(suffix, " %s", suffixionpos);1550 sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixionpos); 1550 1551 if (OpenFileNo(P, &IonsPos, suffix, F->OutVisStep, "wb",P->Call.out[ReadOut])) { 1551 1552 for (is=0; is < I->Max_Types; is++) {
Note:
See TracChangeset
for help on using the changeset viewer.