Index: pcp/src/output.c
===================================================================
--- pcp/src/output.c	(revision 4d4fc10e2f51b534762301d2bfad63419554abef)
+++ pcp/src/output.c	(revision 18d0651b3eacc9a085b3cf20e85ce1535b5fb9f3)
@@ -1301,9 +1301,11 @@
   int is,ia,i;
   FILE *SrcIonDoc, *SrcIonData;
+  char suffix[255];
 
   if (!(P->Par.me == 0)) return;
   
   // output of ion types and numbers per type
-  OpenFile(P, &SrcIonDoc, suffixsrciondoc, "w",P->Call.out[ReadOut]);
+  sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixsrciondoc);
+  OpenFile(P, &SrcIonDoc, suffix, "w",P->Call.out[ReadOut]);
   fprintf(SrcIonDoc,"%i\n", I->Max_Types);
   for (is=0; is < I->Max_Types; is++)
@@ -1311,5 +1313,6 @@
   fclose(SrcIonDoc);
 
-  OpenFile(P, &SrcIonData, suffixsrciondat, "wb",P->Call.out[ReadOut]);
+  sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixsrciondat);
+  OpenFile(P, &SrcIonData, suffix, "wb",P->Call.out[ReadOut]);
   (void)fwrite(P->Lat.RealBasis, sizeof(double), (size_t)(NDIM_NDIM), SrcIonData);
   for (is=0; is < I->Max_Types; is++) {
@@ -1346,36 +1349,54 @@
   double RealBasis[NDIM_NDIM];
   FILE *SrcIonDoc, *SrcIonData;
+  char *suffix;
   // read the doc file and check
-  if (OpenFile(P, &SrcIonDoc, suffixsrciondoc, "r",P->Call.out[ReadOut])) {
-    if (fscanf(SrcIonDoc,"%i", &Max_Types) != 1)
+  suffix = (char *)
+    Malloc(strlen(suffixsrciondoc) + 3 + 1,"ReadSrcIons: suffix");
+  sprintf(suffix, ".L%i%s", P->Lat.Lev[STANDARTLEVEL].LevelNo, suffixsrciondoc);
+  if (OpenFile(P, &SrcIonDoc, suffix, "r",P->Call.out[ReadOut])) {
+    if (fscanf(SrcIonDoc,"%i", &Max_Types) != 1) {
       //Error(SomeError, "ReadSrcIons: read error");
+      Free(suffix, "ReadSrcIons: suffix");
       return 0;
-    if (Max_Types != I->Max_Types)
+    }
+    if (Max_Types != I->Max_Types) {
       //Error(SomeError, "ReadSrcIons: srcion file does not fit to system, MaxTypes");
+      Free(suffix, "ReadSrcIons: suffix");
       return 0;
+    }
     Max_IonsOfType = (int *) Malloc(Max_Types*sizeof(int), "ReadSrcIons: Max_IonsOfType");
     for (is=0; is < Max_Types; is++) {
-      if (fscanf(SrcIonDoc,"%i", &Max_IonsOfType[is]) != 1)
+      if (fscanf(SrcIonDoc,"%i", &Max_IonsOfType[is]) != 1) {
         //Error(SomeError, "ReadSrcIons: read error");
-      return 0;
-      if (Max_IonsOfType[is] != I->I[is].Max_IonsOfType)
+        Free(suffix, "ReadSrcIons: suffix");
+    	  return 0;
+      }
+      if (Max_IonsOfType[is] != I->I[is].Max_IonsOfType) {
         //Error(SomeError, "ReadSrcIons: srcion file does not fit to system, Max_IonsOfType");
-      return 0;
+        Free(suffix, "ReadSrcIons: suffix");
+  	    return 0;
+	    }
     }
     fclose(SrcIonDoc);
     // read basis, then positions and speeds of ions
     if (OpenFile(P, &SrcIonData, suffixsrciondat, "rb",P->Call.out[ReadOut])) {
-      if (fread(RealBasis, sizeof(double), (size_t)(NDIM_NDIM), SrcIonData) != NDIM_NDIM)
+      if (fread(RealBasis, sizeof(double), (size_t)(NDIM_NDIM), SrcIonData) != NDIM_NDIM) {
         //Error(SomeError, "ReadSrcIons: read error");
+        Free(suffix, "ReadSrcIons: suffix");
         return 0;
+      }
       for (i=0; i < NDIM_NDIM; i++)
-        if (RealBasis[i] != P->Lat.RealBasis[i])
+        if (RealBasis[i] != P->Lat.RealBasis[i]) {
           //Error(SomeError, "ReadSrcIons: srcion file does not fit to system, RealBasis");
+	        Free(suffix, "ReadSrcIons: suffix");
           return 0;
+        }
       for (is=0; is < I->Max_Types; is++) {
         for (ia=0; ia < I->I[is].Max_IonsOfType; ia++) {
-          if (fread(&data, sizeof(double), (size_t)(2*NDIM), SrcIonData) != 2*NDIM)
+          if (fread(&data, sizeof(double), (size_t)(2*NDIM), SrcIonData) != 2*NDIM) {
           	//Error(SomeError, "ReadSrcIons: read error");
+		        Free(suffix, "ReadSrcIons: suffix");
             return 0;
+          }
           U = &I->I[is].U[NDIM*ia];
           pos = &I->I[is].R[NDIM*ia];
@@ -1390,4 +1411,5 @@
     if (Max_IonsOfType != NULL) Free(Max_IonsOfType, "Max_IonsOfType");
   }
+    Free(suffix, "ReadSrcIons: suffix");
   return 1;
 }
